Messages in this thread | | | Date | Thu, 20 Jan 2022 20:01:57 -0500 | Subject | Re: [PATCH 1/2] xen/x2apic: enable x2apic mode when supported | From | Boris Ostrovsky <> |
| |
On 1/20/22 10:25 AM, Roger Pau Monne wrote: > There's no point in disabling x2APIC mode when running as a Xen HVM > guest, just enable it when available. > > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> > --- > Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com> > Cc: Juergen Gross <jgross@suse.com> > Cc: Stefano Stabellini <sstabellini@kernel.org> > Cc: Thomas Gleixner <tglx@linutronix.de> > Cc: Ingo Molnar <mingo@redhat.com> > Cc: Borislav Petkov <bp@alien8.de> > Cc: Dave Hansen <dave.hansen@linux.intel.com> > Cc: x86@kernel.org > Cc: "H. Peter Anvin" <hpa@zytor.com> > Cc: xen-devel@lists.xenproject.org > --- > arch/x86/xen/enlighten_hvm.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/xen/enlighten_hvm.c b/arch/x86/xen/enlighten_hvm.c > index 42300941ec29..ab8171cbee23 100644 > --- a/arch/x86/xen/enlighten_hvm.c > +++ b/arch/x86/xen/enlighten_hvm.c > @@ -9,6 +9,7 @@ > #include <xen/events.h> > #include <xen/interface/memory.h> > > +#include <asm/apic.h> > #include <asm/cpu.h> > #include <asm/smp.h> > #include <asm/io_apic.h> > @@ -248,7 +249,7 @@ bool __init xen_hvm_need_lapic(void) > return false; > if (!xen_hvm_domain()) > return false; > - if (xen_feature(XENFEAT_hvm_pirqs) && xen_have_vector_callback) > + if (!x2apic_supported()) > return false; > return true; > }
Then it seems this whole routine can be reduced to just
return x2apic_supported();
and then dropped altogether and x2apic_supported() moved to xen_x2apic_para_available(). Domain type checks here are not really needed since this can only be called on HVM guests.
-boris
| |