]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xen/pciback: Don't allow MSI-X ops if PCI_COMMAND_MEMORY is not set.
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mon, 2 Nov 2015 23:13:27 +0000 (18:13 -0500)
committerJoao Martins <joao.m.martins@oracle.com>
Sun, 27 Mar 2016 01:01:41 +0000 (02:01 +0100)
commit0fe94acfdc97180f40eb013bf2e8362093eeed5e
tree55976404740060100e3d7580c5d6fda8f73d7af7
parent71750b28158b62f65d3f8c2334e3472b4fa02aca
xen/pciback: Don't allow MSI-X ops if PCI_COMMAND_MEMORY is not set.

commit f598282f51 ("PCI: Fix the NIU MSI-X problem in a better way")
teaches us that dealing with MSI-X can be troublesome.

Further checks in the MSI-X architecture shows that if the
PCI_COMMAND_MEMORY bit is turned of in the PCI_COMMAND we
may not be able to access the BAR (since they are memory regions).

Since the MSI-X tables are located in there.. that can lead
to us causing PCIe errors. Inhibit us performing any
operation on the MSI-X unless the MEMORY bit is set.

Note that Xen hypervisor with:
"x86/MSI-X: access MSI-X table only after having enabled MSI-X"
will return:
xen_pciback: 0000:0a:00.1: error -6 enabling MSI-X for guest 3!

When the generic MSI code tries to setup the PIRQ without
MEMORY bit set. Which means with later versions of Xen
(4.6) this patch is not neccessary.

This is part of XSA-157

CC: stable@vger.kernel.org
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
(cherry picked from commit 408fb0e5aa7fda0059db282ff58c3b2a4278baa0)
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
drivers/xen/xen-pciback/pciback_ops.c