Re: [PATCH] KVM: lapic: stop advertising DIRECTED_EOI when in-kernel IOAPIC is in use
From: Vitaly Kuznetsov
Date: Fri Feb 09 2018 - 11:33:11 EST
Nikita Leshenko <nikita.leshchenko@xxxxxxxxxx> writes:
> The patch looks correct, however Iâm confused about why you consider
> this to be a bug in the guest rather than a bug in KVM.
>
> The spec for x2APIC states:
> "The support for Directed EOI capability can be detected by means of
> bit 24 in the Local APIC Version Registerâ (Intelâs x2APIC spec, 2.5.1
> Directed EOI)
> It seems to me that Windows did the right thing by testing for the
> presence of directed EOI feature rather than implying it exists by
> testing a version number. KVM did the wrong thing by advertising a
> feature it doesnât support.
>
> Therefore I think that you should change the comment to something like
> âKVMâs in-kernel IOAPIC doesnât support Directed EOI register, so donât
> advertise this capability in the LAPIC Version Register.â instead of
> talking about buggy guests, as it may confuse future readers of this
> code.
>
Before disabling EOI broadcast guests should check if IOAPIC is of
proper version - the fact that you can disable EOI broadcast doesn't
automatically mean that you can later do EOI through IOAPIC...
Anyway, I got the impression that last time conversation ended up with
'this is a guest bug' conclusion
(https://www.spinics.net/lists/kvm/msg148187.html - see Radim's and
Ladi's comments) but I'm not insisting - if now we conclude this is not a
Windows issue let it be it. But let's just fix it once and for all :-)
--
Vitaly