aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2012-05-30 11:05:39 +0200
committerMarcelo Tosatti <mtosatti@redhat.com>2012-06-01 20:51:10 -0300
commit6e6536872e7ca85ba0e810b5f035bc055c583982 (patch)
treefbd8ba6df57bb93a267e0fc1acd9252dd9cdd449
parentpci-assign: Hide ioport regions on lacking sysfs support (diff)
downloadqemu-kvm-6e6536872e7ca85ba0e810b5f035bc055c583982.tar.gz
qemu-kvm-6e6536872e7ca85ba0e810b5f035bc055c583982.tar.bz2
qemu-kvm-6e6536872e7ca85ba0e810b5f035bc055c583982.zip
pci-assign: Drop iommu property
Disabling the IOMMU for an assigned device was never more than a highly experimental features and is no longer supported by host kernels >= 3.2. So drop this useless control from property list. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
-rw-r--r--hw/device-assignment.c22
-rw-r--r--hw/device-assignment.h6
2 files changed, 8 insertions, 20 deletions
diff --git a/hw/device-assignment.c b/hw/device-assignment.c
index 077d81e9a..b9b955b31 100644
--- a/hw/device-assignment.c
+++ b/hw/device-assignment.c
@@ -749,21 +749,13 @@ static int assign_device(AssignedDevice *dev)
assigned_dev_data.busnr = dev->h_busnr;
assigned_dev_data.devfn = dev->h_devfn;
- /* We always enable the IOMMU unless disabled on the command line */
- if (dev->features & ASSIGNED_DEVICE_USE_IOMMU_MASK) {
- if (!kvm_check_extension(kvm_state, KVM_CAP_IOMMU)) {
- fprintf(stderr, "No IOMMU found. Unable to assign device \"%s\"\n",
- dev->dev.qdev.id);
- return -ENODEV;
- }
- assigned_dev_data.flags |= KVM_DEV_ASSIGN_ENABLE_IOMMU;
- }
- if (!(dev->features & ASSIGNED_DEVICE_USE_IOMMU_MASK)) {
- fprintf(stderr,
- "WARNING: Assigning a device without IOMMU protection can "
- "cause host memory corruption if the device issues DMA write "
- "requests!\n");
+ assigned_dev_data.flags = KVM_DEV_ASSIGN_ENABLE_IOMMU;
+ if (!kvm_check_extension(kvm_state, KVM_CAP_IOMMU)) {
+ fprintf(stderr, "No IOMMU found. Unable to assign device \"%s\"\n",
+ dev->dev.qdev.id);
+ return -ENODEV;
}
+
if (dev->features & ASSIGNED_DEVICE_SHARE_INTX_MASK &&
kvm_has_intx_set_mask()) {
assigned_dev_data.flags |= KVM_DEV_ASSIGN_PCI_2_3;
@@ -1782,8 +1774,6 @@ PropertyInfo qdev_prop_hostaddr = {
static Property da_properties[] =
{
DEFINE_PROP("host", AssignedDevice, host, qdev_prop_hostaddr, PCIHostDevice),
- DEFINE_PROP_BIT("iommu", AssignedDevice, features,
- ASSIGNED_DEVICE_USE_IOMMU_BIT, true),
DEFINE_PROP_BIT("prefer_msi", AssignedDevice, features,
ASSIGNED_DEVICE_PREFER_MSI_BIT, false),
DEFINE_PROP_BIT("share_intx", AssignedDevice, features,
diff --git a/hw/device-assignment.h b/hw/device-assignment.h
index 5d271d5bf..1ef2dbe16 100644
--- a/hw/device-assignment.h
+++ b/hw/device-assignment.h
@@ -74,11 +74,9 @@ typedef struct {
PCIRegion *region;
} AssignedDevRegion;
-#define ASSIGNED_DEVICE_USE_IOMMU_BIT 0
-#define ASSIGNED_DEVICE_PREFER_MSI_BIT 1
-#define ASSIGNED_DEVICE_SHARE_INTX_BIT 2
+#define ASSIGNED_DEVICE_PREFER_MSI_BIT 0
+#define ASSIGNED_DEVICE_SHARE_INTX_BIT 1
-#define ASSIGNED_DEVICE_USE_IOMMU_MASK (1 << ASSIGNED_DEVICE_USE_IOMMU_BIT)
#define ASSIGNED_DEVICE_PREFER_MSI_MASK (1 << ASSIGNED_DEVICE_PREFER_MSI_BIT)
#define ASSIGNED_DEVICE_SHARE_INTX_MASK (1 << ASSIGNED_DEVICE_SHARE_INTX_BIT)