summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2016-09-09 19:57:32 +0000
committerjhb <jhb@FreeBSD.org>2016-09-09 19:57:32 +0000
commita40f879158e4188a2bf5392aa234da1bb3cb0354 (patch)
tree74f3cd6192890f54d68ffffa602953dbd3498b54
parent9182c7d232efa0b771a91ea759b0f662e2b210ae (diff)
downloadFreeBSD-src-a40f879158e4188a2bf5392aa234da1bb3cb0354.zip
FreeBSD-src-a40f879158e4188a2bf5392aa234da1bb3cb0354.tar.gz
MFC 304637: Fix build for !SMP kernels after the Xen MSIX workaround.
Move msix_disable_migration under #ifdef SMP since it doesn't make sense for !SMP kernels. PR: 212014
-rw-r--r--sys/amd64/include/intr_machdep.h3
-rw-r--r--sys/i386/include/intr_machdep.h3
-rw-r--r--sys/x86/x86/msi.c6
-rw-r--r--sys/x86/xen/hvm.c2
4 files changed, 12 insertions, 2 deletions
diff --git a/sys/amd64/include/intr_machdep.h b/sys/amd64/include/intr_machdep.h
index 7626c81..bd59fac 100644
--- a/sys/amd64/include/intr_machdep.h
+++ b/sys/amd64/include/intr_machdep.h
@@ -143,8 +143,9 @@ struct nmi_pcpu {
extern struct mtx icu_lock;
extern int elcr_found;
-
+#ifdef SMP
extern int msix_disable_migration;
+#endif
#ifndef DEV_ATPIC
void atpic_reset(void);
diff --git a/sys/i386/include/intr_machdep.h b/sys/i386/include/intr_machdep.h
index b71bbb6..5af8cce 100644
--- a/sys/i386/include/intr_machdep.h
+++ b/sys/i386/include/intr_machdep.h
@@ -140,8 +140,9 @@ struct trapframe;
extern struct mtx icu_lock;
extern int elcr_found;
-
+#ifdef SMP
extern int msix_disable_migration;
+#endif
#ifndef DEV_ATPIC
void atpic_reset(void);
diff --git a/sys/x86/x86/msi.c b/sys/x86/x86/msi.c
index 37f0e16..18b46df 100644
--- a/sys/x86/x86/msi.c
+++ b/sys/x86/x86/msi.c
@@ -135,6 +135,7 @@ struct pic msi_pic = { msi_enable_source, msi_disable_source, msi_eoi_source,
msi_source_pending, NULL, NULL, msi_config_intr,
msi_assign_cpu };
+#ifdef SMP
/**
* Xen hypervisors prior to 4.6.0 do not properly handle updates to
* enabled MSI-X table entries. Allow migration of MSI-X interrupts
@@ -148,6 +149,7 @@ int msix_disable_migration = -1;
SYSCTL_INT(_machdep, OID_AUTO, disable_msix_migration, CTLFLAG_RDTUN,
&msix_disable_migration, 0,
"Disable migration of MSI-X interrupts between CPUs");
+#endif
static int msi_enabled;
static int msi_last_irq;
@@ -227,8 +229,10 @@ msi_assign_cpu(struct intsrc *isrc, u_int apic_id)
if (msi->msi_first != msi)
return (EINVAL);
+#ifdef SMP
if (msix_disable_migration && msi->msi_msix)
return (EINVAL);
+#endif
/* Store information to free existing irq. */
old_vector = msi->msi_vector;
@@ -302,10 +306,12 @@ msi_init(void)
return;
}
+#ifdef SMP
if (msix_disable_migration == -1) {
/* The default is to allow migration of MSI-X interrupts. */
msix_disable_migration = 0;
}
+#endif
msi_enabled = 1;
intr_register_pic(&msi_pic);
diff --git a/sys/x86/xen/hvm.c b/sys/x86/xen/hvm.c
index 68f7fde..8372c0d 100644
--- a/sys/x86/xen/hvm.c
+++ b/sys/x86/xen/hvm.c
@@ -394,6 +394,7 @@ xen_hvm_init_hypercall_stubs(void)
printf("XEN: Hypervisor version %d.%d detected.\n", major,
minor);
+#ifdef SMP
if (((major < 4) || (major == 4 && minor <= 5)) &&
msix_disable_migration == -1) {
/*
@@ -408,6 +409,7 @@ xen_hvm_init_hypercall_stubs(void)
"Set machdep.msix_disable_migration=0 to forcefully enable it.\n");
msix_disable_migration = 1;
}
+#endif
}
/*
OpenPOWER on IntegriCloud