mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 18:21:39 +01:00
x86/MSI: fail if no hardware support
This is to guard against buggy callers (luckily Dom0 only) invoking
the respective hypercall for a device not being MSI-capable.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: c7d5d5d8ea
master date: 2015-09-16 11:20:27 +0200
This commit is contained in:
1 parent
33562a45c6
commit
bda02ca86f
1 file changed
+2
@@ -566,6 +566,8 @@ static int msi_capability_init(struct pci_dev *dev,
|
||||
|
||||
ASSERT(spin_is_locked(&pcidevs_lock));
|
||||
pos = pci_find_cap_offset(seg, bus, slot, func, PCI_CAP_ID_MSI);
|
||||
if ( !pos )
|
||||
return -ENODEV;
|
||||
control = pci_conf_read16(seg, bus, slot, func, msi_control_reg(pos));
|
||||
maxvec = multi_msi_capable(control);
|
||||
if ( nvec > maxvec )
|
||||
|
||||