+Peter, +Jason (intel-iommu maintainer/reviewer) On 15/07/2023 16:22, Bui Quang Minh wrote: > As userspace APIC now supports x2APIC, intel interrupt remapping > hardware can be set to EIM mode when userspace local APIC is used. > > Reviewed-by: Michael S. Tsirkin <m...@redhat.com> > Signed-off-by: Bui Quang Minh <minhquangbu...@gmail.com> > --- > hw/i386/intel_iommu.c | 11 ----------- > 1 file changed, 11 deletions(-) > > diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c > index dcc334060c..5e576f6059 100644 > --- a/hw/i386/intel_iommu.c > +++ b/hw/i386/intel_iommu.c > @@ -4043,17 +4043,6 @@ static bool vtd_decide_config(IntelIOMMUState *s, > Error **errp) > && x86_iommu_ir_supported(x86_iommu) ? > ON_OFF_AUTO_ON : > ON_OFF_AUTO_OFF; > } > - if (s->intr_eim == ON_OFF_AUTO_ON && !s->buggy_eim) { > - if (!kvm_irqchip_is_split()) { > - error_setg(errp, "eim=on requires > accel=kvm,kernel-irqchip=split"); > - return false; > - } > - if (!kvm_enable_x2apic()) { > - error_setg(errp, "eim=on requires support on the KVM side" > - "(X2APIC_API, first shipped in v4.7)"); > - return false; > - } > - } > Given commit 20ca47429e ('Revert "intel_iommu: Fix irqchip / X2APIC configuration checks"'), won't we regress behaviour again for the accel=kvm case by dropping the kvm_enable_x2apic() call here?
Perhaps if we support userspace APIC with TCG the check just needs to be redone to instead avoid always requiring kvm e.g.: if (kvm_irqchip_in_kernel()) { error_setg(errp, "eim=on requires accel=kvm,kernel-irqchip=split" "(X2APIC_API, first shipped in v4.7)"); } if (kvm_irqchip_is_split() && !kvm_enable_x2apic()) { error_setg(errp, "eim=on requires support on the KVM side" "(X2APIC_API, first shipped in v4.7)"); return false; }