Skip to content

Commit

Permalink
OS-6548 want interface for getting cached ipi vector
Browse files Browse the repository at this point in the history
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Mike Gerdts <mike.gerdts@joyent.com>
Reviewed by: Hans Rosenfeld <hans.rosenfeld@joyent.com>
Approved by: Hans Rosenfeld <hans.rosenfeld@joyent.com>
  • Loading branch information
pfmooney committed Feb 15, 2018
1 parent de818a9 commit 65327dd
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 11 deletions.
6 changes: 3 additions & 3 deletions usr/src/uts/i86pc/io/apix/apix.c
Expand Up @@ -25,9 +25,7 @@
/*
* Copyright (c) 2010, Intel Corporation.
* All rights reserved.
*/
/*
* Copyright (c) 2017, Joyent, Inc. All rights reserved.
* Copyright 2018 Joyent, Inc.
*/

/*
Expand Down Expand Up @@ -167,6 +165,8 @@ static struct psm_ops apix_ops = {
apix_intr_ops, /* Advanced DDI Interrupt framework */
apic_state, /* save, restore apic state for S3 */
apic_cpu_ops, /* CPU control interface. */

apic_cached_ipivect,
};

struct psm_ops *psmops = &apix_ops;
Expand Down
6 changes: 3 additions & 3 deletions usr/src/uts/i86pc/io/pcplusmp/apic.c
Expand Up @@ -25,9 +25,7 @@
/*
* Copyright (c) 2010, Intel Corporation.
* All rights reserved.
*/
/*
* Copyright (c) 2017, Joyent, Inc. All rights reserved.
* Copyright 2018 Joyent, Inc.
*/

/*
Expand Down Expand Up @@ -202,6 +200,8 @@ static struct psm_ops apic_ops = {
apic_intr_ops, /* Advanced DDI Interrupt framework */
apic_state, /* save, restore apic state for S3 */
apic_cpu_ops, /* CPU control interface. */

apic_cached_ipivect,
};

struct psm_ops *psmops = &apic_ops;
Expand Down
13 changes: 12 additions & 1 deletion usr/src/uts/i86pc/io/pcplusmp/apic_common.c
Expand Up @@ -23,7 +23,7 @@
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Copyright (c) 2017, Joyent, Inc. All rights reserved.
* Copyright 2018 Joyent, Inc.
* Copyright (c) 2016 by Delphix. All rights reserved.
*/

Expand Down Expand Up @@ -1707,3 +1707,14 @@ apic_get_ioapicid(uchar_t ioapicindex)

return (apic_io_id[ioapicindex]);
}

int
apic_cached_ipivect(int ipl, int type)
{
uchar_t vector = 0;

if (type != -1 && ipl >= 0 && ipl <= MAXIPL) {
vector = apic_resv_vector[ipl];
}
return ((vector != 0) ? vector : -1);
}
5 changes: 4 additions & 1 deletion usr/src/uts/i86pc/io/psm/uppc.c
Expand Up @@ -21,6 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
* Copyright 2018 Joyent, Inc.
*/

#define PSMI_1_7
Expand Down Expand Up @@ -174,7 +175,9 @@ static struct psm_ops uppc_ops = {
psm_intr_op_t, int *))NULL, /* psm_intr_ops */

uppc_state, /* psm_state */
(int (*)(psm_cpu_request_t *))NULL /* psm_cpu_ops */
(int (*)(psm_cpu_request_t *))NULL, /* psm_cpu_ops */

(int (*)(int, int))NULL, /* psm_cached_ipivect */
};


Expand Down
3 changes: 3 additions & 0 deletions usr/src/uts/i86pc/os/mp_machdep.c
Expand Up @@ -25,6 +25,7 @@
/*
* Copyright (c) 2009-2010, Intel Corporation.
* All rights reserved.
* Copyright 2018 Joyent, Inc.
*/

#define PSMI_1_7
Expand Down Expand Up @@ -145,6 +146,7 @@ void (*gethrestimef)(timestruc_t *) = pc_gethrestime;
void (*psm_notify_error)(int, char *) = (void (*)(int, char *))NULL;
int (*psm_get_clockirq)(int) = NULL;
int (*psm_get_ipivect)(int, int) = NULL;
int (*psm_cached_ipivect)(int, int) = NULL;
uchar_t (*psm_get_ioapicid)(uchar_t) = NULL;
uint32_t (*psm_get_localapicid)(uint32_t) = NULL;
uchar_t (*psm_xlate_vector_by_irq)(uchar_t) = NULL;
Expand Down Expand Up @@ -1153,6 +1155,7 @@ mach_smpinit(void)
}

psm_get_ipivect = pops->psm_get_ipivect;
psm_cached_ipivect = pops->psm_cached_ipivect;

(void) add_avintr((void *)NULL, XC_HI_PIL, xc_serv, "xc_intr",
(*pops->psm_get_ipivect)(XC_HI_PIL, PSM_INTR_IPI_HI),
Expand Down
3 changes: 2 additions & 1 deletion usr/src/uts/i86pc/sys/apic_common.h
Expand Up @@ -22,7 +22,7 @@
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
* Copyright 2018 Joyent, Inc.
*/

#ifndef _SYS_APIC_COMMON_H
Expand Down Expand Up @@ -182,6 +182,7 @@ extern void apic_shutdown(int cmd, int fcn);
extern void apic_preshutdown(int cmd, int fcn);
extern processorid_t apic_get_next_processorid(processorid_t cpun);
extern uint_t apic_calibrate(volatile uint32_t *, uint16_t *);
extern int apic_cached_ipivect(int, int);

extern int apic_error_intr();
extern void apic_cpcovf_mask_clear(void);
Expand Down
3 changes: 3 additions & 0 deletions usr/src/uts/i86pc/sys/psm_types.h
Expand Up @@ -26,6 +26,7 @@
/*
* Copyright (c) 2010, Intel Corporation.
* All rights reserved.
* Copyright 2018 Joyent, Inc.
*/

#ifndef _SYS_PSM_TYPES_H
Expand Down Expand Up @@ -190,6 +191,8 @@ struct psm_ops {
#endif
#if defined(PSMI_1_7)
int (*psm_cpu_ops)(psm_cpu_request_t *reqp);

int (*psm_cached_ipivect)(int ipl, int type);
#endif
};

Expand Down
2 changes: 2 additions & 0 deletions usr/src/uts/i86pc/sys/smp_impldefs.h
Expand Up @@ -21,6 +21,7 @@

/*
* Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2018 Joyent, Inc.
*/

#ifndef _SYS_SMP_IMPLDEFS_H
Expand Down Expand Up @@ -64,6 +65,7 @@ extern void (*psm_enable_intr)(processorid_t); /* enable intr to cpu */
extern int (*psm_get_clockirq)(int); /* get clock vector */
extern int (*psm_get_ipivect)(int, int); /* get interprocessor intr vec */
extern int (*psm_clkinit)(int); /* timer init entry point */
extern int (*psm_cached_ipivect)(int, int); /* get cached ipi vec */
extern void (*psm_timer_reprogram)(hrtime_t); /* timer reprogram */
extern void (*psm_timer_enable)(void); /* timer enable */
extern void (*psm_timer_disable)(void); /* timer disable */
Expand Down
5 changes: 4 additions & 1 deletion usr/src/uts/i86xpv/io/psm/xpv_psm.c
Expand Up @@ -22,6 +22,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
* Copyright 2018 Joyent, Inc.
*/

#define PSMI_1_7
Expand Down Expand Up @@ -1673,7 +1674,9 @@ static struct psm_ops xen_psm_ops = {
(void (*)(int, int))NULL, /* psm_preshutdown */
xen_intr_ops, /* Advanced DDI Interrupt framework */
(int (*)(psm_state_request_t *))NULL, /* psm_state */
(int (*)(psm_cpu_request_t *))NULL /* psm_cpu_ops */
(int (*)(psm_cpu_request_t *))NULL, /* psm_cpu_ops */

(int (*)(int, int))NULL, /* psm_cached_ipivect */
};

static struct psm_info xen_psm_info = {
Expand Down
5 changes: 4 additions & 1 deletion usr/src/uts/i86xpv/io/psm/xpv_uppc.c
Expand Up @@ -22,6 +22,7 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
* Copyright 2018 Joyent, Inc.
*/

#define PSMI_1_7
Expand Down Expand Up @@ -892,7 +893,9 @@ static struct psm_ops xen_uppc_ops = {
(int (*)(dev_info_t *, ddi_intr_handle_impl_t *,
psm_intr_op_t, int *))NULL, /* psm_intr_ops */
(int (*)(psm_state_request_t *))NULL, /* psm_state */
(int (*)(psm_cpu_request_t *))NULL /* psm_cpu_ops */
(int (*)(psm_cpu_request_t *))NULL, /* psm_cpu_ops */

(int (*)(int, int))NULL, /* psm_cached_ipivect */
};

static struct psm_info xen_uppc_info = {
Expand Down

0 comments on commit 65327dd

Please sign in to comment.