On Mon, Jul 11, 2016 at 01:17:40PM +0300, David Kiarie wrote: > On Fri, Jun 24, 2016 at 10:10 AM, Peter Xu <pet...@redhat.com> wrote: > > When user specify "kernel-irqchip=on", throw error and then quit. > > > > Signed-off-by: Peter Xu <pet...@redhat.com> > > --- > > > > One more patch for this series. Without this one, guest kernel will > > possibly hang. This is not user friendly. > > > > hw/i386/intel_iommu.c | 9 +++++++++ > > 1 file changed, 9 insertions(+) > > > > diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c > > index 4ff9a24..618b0f9 100644 > > --- a/hw/i386/intel_iommu.c > > +++ b/hw/i386/intel_iommu.c > > @@ -20,6 +20,7 @@ > > */ > > > > #include "qemu/osdep.h" > > +#include "qemu/error-report.h" > > #include "hw/sysbus.h" > > #include "exec/address-spaces.h" > > #include "intel_iommu_internal.h" > > @@ -29,6 +30,7 @@ > > #include "hw/boards.h" > > #include "hw/i386/x86-iommu.h" > > #include "hw/pci-host/q35.h" > > +#include "sysemu/kvm.h" > > > > /*#define DEBUG_INTEL_IOMMU*/ > > #ifdef DEBUG_INTEL_IOMMU > > @@ -2458,6 +2460,13 @@ static void vtd_realize(DeviceState *dev, Error > > **errp) > > bus->iommu_opaque = dev; > > /* Pseudo address space under root PCI bus. */ > > pcms->ioapic_as = vtd_host_dma_iommu(bus, s, Q35_PSEUDO_DEVFN_IOAPIC); > > + > > + /* Currently Intel IOMMU IR only support "kernel-irqchip={off|split}" > > */ > > + if (kvm_irqchip_in_kernel() && !kvm_irqchip_is_split()) { > > + error_report("Intel Interrupt Remapping cannot work with " > > + "kernel-irqchip=on, please use 'split|off'."); > > + exit(1); > > + } > > } > > Shouldn't you be checking whether VT-d interrupt remapping is > enabled(I'm assuming it's off by default) before you ensure > kernel-irqchip=off|split ? Doesn't the above imply that one can't use > VT-d with kernel_irqchip=on (regardless of whether IR is enabled) ?
Yes we should allow ir=off and kernel-irqchip=on. Will fix in v12, thanks! -- peterx