Minor cleanups when parsing the "iommu" option
cover Minor cleanups when parsing the "iommu" option
Small cleanup changes. The first removes the helper function by directly checking the property and the second adds a error message if user tries to use "-machine iommu=on" with i440fx.
Bandan Das (2):
q35: Check propery to determine if iommu is set
i440fx: print a error message if user enable iommu
hw/core/machine.c | 7 ------- hw/pci-host/piix.c | 4 ++++ hw/pci-host/q35.c | 2 +- include/hw/boards.h | 1 - 4 files changed, 5 insertions(+), 9 deletions(-)
Signature · 1 line
2.6.1
PATCH 1/2 q35: Check propery to determine if iommu is set
The helper function machine_iommu() isn't necesary. We can directly check for the property.
--- hw/core/machine.c | 5 ----- hw/pci-host/q35.c | 2 +- include/hw/boards.h | 1 - 3 files changed, 1 insertion(+), 7 deletions(-)
hw/core/machine.c +0 -5
@@ -462,11 +462,6 @@ bool machine_usb(MachineState *machine)return machine->usb; } -bool machine_iommu (MachineState *machine) -{ -return machine->iommu; -} -bool machine_kernel_irqchip_allowed (MachineState *machine) {return machine->kernel_irqchip_allowed;
hw/pci-host/q35.c +1 -1
@@ -506,7 +506,7 @@ static void mch_realize(PCIDevice *d, Error **errp) PAM_EXPAN_BASE + i * PAM_EXPAN_SIZE, PAM_EXPAN_SIZE); }/* Intel IOMMU (VT-d) */ -if (machine_iommu (current_machine)) { +if (object_property_get_bool (qdev_get_machine (),"iommu" ,NULL )) {mch_init_dmar (mch); } }
include/hw/boards.h +0 -1
@@ -33,7 +33,6 @@ MachineClass *find_default_machine(void);extern MachineState *current_machine;bool machine_usb (MachineState *machine); -bool machine_iommu (MachineState *machine);bool machine_kernel_irqchip_allowed (MachineState *machine);bool machine_kernel_irqchip_required (MachineState *machine);int machine_kvm_shadow_mem (MachineState *machine);
Signature · 1 line
2.6.1
PATCH 2/2 i440fx: print an error message if user tries to enable iommu
In reply to Bandan DasThere's no indication of any sort that i440fx doesn't support "iommu=on""
--- hw/pci-host/piix.c | 4 ++++ 1 file changed, 4 insertions(+)
hw/pci-host/piix.c +4 -0
@@ -301,6 +301,10 @@ static void i440fx_pcihost_realize(DeviceState *dev, Error **errp)static void i440fx_realize (PCIDevice *dev,Error **errp) { dev->config[I440FX_SMRAM ] =0x02 ; + +if (object_property_get_bool (qdev_get_machine (),"iommu" ,NULL )) { +fprintf (stderr,"i440fx doesn't support emulated iommu\n" ); + } } PCIBus *i440fx_init(const char *host_type, const char *pci_type,
Signature · 1 line
2.6.1
Re: [Qemu-devel] [PATCH 2/2] i440fx: print an error message if user tries to enable iommu
Quoted 13 lines · Bandan Das
There's no indication of any sort that i440fx doesn't support "iommu=on""
Signed-off-by Bandan Das <[email protected]>--- hw/pci-host/piix.c | 4 ++++ 1 file changed, 4 insertions(+)hw/pci-host/piix.c +0
-0
hw/pci-host/piix.c static void i440fx_pcihost_realize(DeviceState *dev, Error **errp) · line 310
Quoted 10 lines
hw/pci-host/piix.c +4
-0@@ -301,6 +301,10 @@ static void i440fx_pcihost_realize(DeviceState *dev, Error **errp)static void i440fx_realize (PCIDevice *dev,Error **errp) { dev->config[I440FX_SMRAM ] =0x02 ; + +if (object_property_get_bool (qdev_get_machine (),"iommu" ,NULL )) { +fprintf (stderr,"i440fx doesn't support emulated iommu\n" ); + } } PCIBus *i440fx_init(const char *host_type, const char *pci_type,
error_report(), please.
If this is just a warning, please prefix the message with "warning: ".
If it isn't, exit(1).
Re: [Qemu-devel] [PATCH 2/2] i440fx: print an error message if user tries to enable iommu
Quoted 24 lines · Markus Armbruster
Quoted 22 lines · Bandan Das
There's no indication of any sort that i440fx doesn't support "iommu=on""
Signed-off-by Bandan Das <[email protected]>--- hw/pci-host/piix.c | 4 ++++ 1 file changed, 4 insertions(+)hw/pci-host/piix.c +4
-0@@ -301,6 +301,10 @@ static void i440fx_pcihost_realize(DeviceState *dev, Error **errp)static void i440fx_realize (PCIDevice *dev,Error **errp) { dev->config[I440FX_SMRAM ] =0x02 ; + +if (object_property_get_bool (qdev_get_machine (),"iommu" ,NULL )) { +fprintf (stderr,"i440fx doesn't support emulated iommu\n" ); + } }
Quoted 5 lines
hw/pci-host/piix.c static void i440fx_pcihost_realize(DeviceState *dev, Error **errp) · line 310
Quoted 1 line
hw/pci-host/piix.c +0
-0PCIBus *i440fx_init(const char *host_type, const char *pci_type,
error_report(), please.If this is just a warning, please prefix the message with "warning: ".
Sure will do. Yeah, it seems good enough just to print a message without exiting.
Quoted 1 line
If it isn't, exit(1).