svn commit: r304637 - in head/sys: amd64/include i386/include x86/x86 x86/xen
John Baldwin
jhb at FreeBSD.org
Mon Aug 22 21:23:19 UTC 2016
Author: jhb
Date: Mon Aug 22 21:23:17 2016
New Revision: 304637
URL: https://svnweb.freebsd.org/changeset/base/304637
Log:
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
Reported by: Glyn Grinstead <glyn at grinstead.org>
MFC after: 3 days
Modified:
head/sys/amd64/include/intr_machdep.h
head/sys/i386/include/intr_machdep.h
head/sys/x86/x86/msi.c
head/sys/x86/xen/hvm.c
Modified: head/sys/amd64/include/intr_machdep.h
==============================================================================
--- head/sys/amd64/include/intr_machdep.h Mon Aug 22 20:59:34 2016 (r304636)
+++ head/sys/amd64/include/intr_machdep.h Mon Aug 22 21:23:17 2016 (r304637)
@@ -148,8 +148,9 @@ extern cpuset_t intr_cpus;
#endif
extern struct mtx icu_lock;
extern int elcr_found;
-
+#ifdef SMP
extern int msix_disable_migration;
+#endif
#ifndef DEV_ATPIC
void atpic_reset(void);
Modified: head/sys/i386/include/intr_machdep.h
==============================================================================
--- head/sys/i386/include/intr_machdep.h Mon Aug 22 20:59:34 2016 (r304636)
+++ head/sys/i386/include/intr_machdep.h Mon Aug 22 21:23:17 2016 (r304637)
@@ -139,8 +139,9 @@ extern cpuset_t intr_cpus;
#endif
extern struct mtx icu_lock;
extern int elcr_found;
-
+#ifdef SMP
extern int msix_disable_migration;
+#endif
#ifndef DEV_ATPIC
void atpic_reset(void);
Modified: head/sys/x86/x86/msi.c
==============================================================================
--- head/sys/x86/x86/msi.c Mon Aug 22 20:59:34 2016 (r304636)
+++ head/sys/x86/x86/msi.c Mon Aug 22 21:23:17 2016 (r304637)
@@ -149,6 +149,7 @@ struct pic msi_pic = {
.pic_reprogram_pin = NULL,
};
+#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
@@ -162,6 +163,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;
@@ -241,8 +243,10 @@ msi_assign_cpu(struct intsrc *isrc, u_in
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;
@@ -316,10 +320,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);
Modified: head/sys/x86/xen/hvm.c
==============================================================================
--- head/sys/x86/xen/hvm.c Mon Aug 22 20:59:34 2016 (r304636)
+++ head/sys/x86/xen/hvm.c Mon Aug 22 21:23:17 2016 (r304637)
@@ -143,6 +143,7 @@ xen_hvm_init_hypercall_stubs(enum xen_hv
printf("XEN: Hypervisor version %d.%d detected.\n", major,
minor);
+#ifdef SMP
if (((major < 4) || (major == 4 && minor <= 5)) &&
msix_disable_migration == -1) {
/*
@@ -157,6 +158,7 @@ xen_hvm_init_hypercall_stubs(enum xen_hv
"Set machdep.msix_disable_migration=0 to forcefully enable it.\n");
msix_disable_migration = 1;
}
+#endif
}
/*
More information about the svn-src-head
mailing list