mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
passthrough/stubdom: clean up hypercall privilege checking
This patch adds securty checks for pci passthrough related hypercalls to enforce that the current domain owns the resources that it is about to remap. It also adds a call to xc_assign_device to xend and removes the PRIVILEGED_STUBDOMS flags. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
This commit is contained in:
1 parent
5dc1050805
commit
545a227dfc
8 files changed
+40
-21
No files matched your search
@@ -444,7 +444,15 @@ class PciController(DevController):
|
||||
# For hvm guest, (from c/s 19679 on) assigning device statically and
|
||||
# dynamically both go through reconfigureDevice(), so HERE the
|
||||
# setupOneDevice() is not necessary.
|
||||
if not self.vm.info.is_hvm():
|
||||
if self.vm.info.is_hvm():
|
||||
for pci_dev in pci_dev_list:
|
||||
# Setup IOMMU device assignment
|
||||
bdf = xc.assign_device(self.getDomid(), pci_dict_to_xc_str(pci_dev))
|
||||
pci_str = pci_dict_to_bdf_str(pci_dev)
|
||||
if bdf > 0:
|
||||
raise VmError("Failed to assign device to IOMMU (%s)" % pci_str)
|
||||
log.debug("pci: assign device %s" % pci_str)
|
||||
else :
|
||||
for d in pci_dev_list:
|
||||
self.setupOneDevice(d)
|
||||
wPath = '/local/domain/0/backend/pci/%u/0/aerState' % (self.getDomid())
|
||||
|
||||