Article View: mailing.freebsd.svn-src-stable-9
Article #1svn commit: r303777 - stable/9/sys/x86/x86
From: John Baldwin
Date: Fri, 05 Aug 2016 17:14
Date: Fri, 05 Aug 2016 17:14
67 lines
3265 bytes
3265 bytes
Author: jhb
Date: Fri Aug 5 17:14:45 2016
New Revision: 303777
URL: https://svnweb.freebsd.org/changeset/base/303777
Log:
MFC 302181: Add a tunable to disable migration of MSI-X interrupts.
The new 'machdep.disable_msix_migration' tunable can be set to 1 to
disable migration of MSI-X interrupts.
Xen versions prior to 4.6.0 do not properly handle updates to MSI-X
table entries after the initial write. In particular, the operation
to unmask a table entry after updating it during migration is not
propagated to the "real" table for passthrough devices causing the
interrupt to remain masked. At least some systems in EC2 are
affected by this bug when using SRIOV. The tunable can be set in
loader.conf as a workaround.
Modified:
stable/9/sys/x86/x86/msi.c
Directory Properties:
stable/9/sys/ (props changed)
Modified: stable/9/sys/x86/x86/msi.c
==============================================================================
--- stable/9/sys/x86/x86/msi.c Fri Aug 5 17:13:25 2016 (r303776)
+++ stable/9/sys/x86/x86/msi.c Fri Aug 5 17:14:45 2016 (r303777)
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/sx.h>
+#include <sys/sysctl.h>
#include <sys/systm.h>
#include <x86/apicreg.h>
#include <machine/cputypes.h>
@@ -134,6 +135,16 @@ struct pic msi_pic = { msi_enable_source
msi_source_pending, NULL, NULL, msi_config_intr,
msi_assign_cpu };
+/*
+ * Xen hypervisors prior to 4.6.0 do not properly handle updates to
+ * enabled MSI-X table entries. Allow migration of MSI-X interrupts
+ * to be disabled via a tunable.
+ */
+static int msix_disable_migration = 0;
+SYSCTL_INT(_machdep, OID_AUTO, disable_msix_migration, CTLFLAG_RDTUN,
+ &msix_disable_migration, 0,
+ "Disable migration of MSI-X interrupts between CPUs");
+
static int msi_enabled;
static int msi_last_irq;
static struct mtx msi_lock;
@@ -212,6 +223,9 @@ msi_assign_cpu(struct intsrc *isrc, u_in
if (msi->msi_first != msi)
return (EINVAL);
+ if (msix_disable_migration && msi->msi_msix)
+ return (EINVAL);
+
/* Store information to free existing irq. */
old_vector = msi->msi_vector;
old_id = msi->msi_cpu;
_______________________________________________
svn-src-stable-9@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "svn-src-stable-9-unsubscribe@freebsd.org"
Technical Details
Message-ID:
<mailpost.1470417292.8104645.88001.mailing.freebsd.svn-src-stable-9@FreeBSD.cs.nctu.edu.tw>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!archive!apf9.newsdeef.eu!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <mailpost.1470417292.8104645.88001.mailing.freebsd.svn-src-stable-9@FreeBSD.cs.nctu.edu.tw> Subject: svn commit: r303777 - stable/9/sys/x86/x86 Date: Fri, 05 Aug 2016 17:14:46 +0000 From: jhb@FreeBSD.org (John Baldwin) Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!archive!apf9.newsdeef.eu!not-for-mail Newsgroups: mailing.freebsd.svn-src-stable-9 Organization: NCTU CS FreeBSD Server X-Received-Bytes: 3324 Lines: 68 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Received-Body-Crc: 1673500816 Sender: news@FreeBSD.cs.nctu.edu.tw Content-Type: text/plain; charset="us-ascii"