svn commit: r277781 - in projects/powernv/powerpc: powerpc pseries
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Mon Jan 26 23:45:11 UTC 2015
Author: nwhitehorn
Date: Mon Jan 26 23:45:10 2015
New Revision: 277781
URL: https://svnweb.freebsd.org/changeset/base/277781
Log:
Unbreak XICP driver when running under a hypervisor. Now it works (tested)
both ways.
Modified:
projects/powernv/powerpc/powerpc/intr_machdep.c
projects/powernv/powerpc/pseries/xics.c
Modified: projects/powernv/powerpc/powerpc/intr_machdep.c
==============================================================================
--- projects/powernv/powerpc/powerpc/intr_machdep.c Mon Jan 26 22:27:17 2015 (r277780)
+++ projects/powernv/powerpc/powerpc/intr_machdep.c Mon Jan 26 23:45:10 2015 (r277781)
@@ -155,7 +155,7 @@ smp_intr_init(void *dummy __unused)
for (vector = 0; vector < nvectors; vector++) {
i = powerpc_intrs[vector];
- if (i != NULL && i->pic == root_pic)
+ if (i != NULL && i->event != NULL && i->pic == root_pic)
PIC_BIND(i->pic, i->intline, i->cpu);
}
}
Modified: projects/powernv/powerpc/pseries/xics.c
==============================================================================
--- projects/powernv/powerpc/pseries/xics.c Mon Jan 26 22:27:17 2015 (r277780)
+++ projects/powernv/powerpc/pseries/xics.c Mon Jan 26 23:45:10 2015 (r277781)
@@ -286,11 +286,11 @@ xicp_dispatch(device_t dev, struct trapf
uint64_t xirr, junk;
int i;
- if (sc->mem[0])
+ if (mfmsr() & PSL_HV) {
regs = xicp_mem_for_cpu(PCPU_GET(cpuid));
-
- KASSERT(sc->mem[0] == NULL || regs != NULL,
- ("Can't find regs for CPU %d", PCPU_GET(cpuid)));
+ KASSERT(regs != NULL,
+ ("Can't find regs for CPU %d", PCPU_GET(cpuid)));
+ }
sc = device_get_softc(dev);
for (;;) {
@@ -371,13 +371,12 @@ static void
xicp_eoi(device_t dev, u_int irq)
{
uint64_t xirr;
- struct xicp_softc *sc = device_get_softc(dev);
if (irq == MAX_XICP_IRQS) /* Remap IPI interrupt to internal value */
irq = XICP_IPI;
xirr = irq | (XICP_PRIORITY << 24);
- if (sc->mem[0])
+ if (mfmsr() & PSL_HV)
bus_write_4(xicp_mem_for_cpu(PCPU_GET(cpuid)), 4, xirr);
else
phyp_hcall(H_EOI, xirr);
@@ -386,9 +385,8 @@ xicp_eoi(device_t dev, u_int irq)
static void
xicp_ipi(device_t dev, u_int cpu)
{
- struct xicp_softc *sc = device_get_softc(dev);
- if (sc->mem[0])
+ if (mfmsr() & PSL_HV)
bus_write_1(xicp_mem_for_cpu(cpu), 12, XICP_PRIORITY);
else
phyp_hcall(H_IPI, (uint64_t)cpu, XICP_PRIORITY);
More information about the svn-src-projects
mailing list