[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] xen/x2apic: enable x2apic mode when supported


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx
  • From: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
  • Date: Thu, 20 Jan 2022 20:01:57 -0500
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HZjjEopL7LMZvyWoW3TyPmDK/SZ5ppLw/WPOKrvLsq0=; b=PIHUg+1G0pSP1nk8RJw0oJAqhS+X3Uk4zCGGVjC8lzmfKT4boRFlgPq8o2TIqLKiyADR7uCFG6sLo/twL3NkM5mS7kh2YwD3kmNRpeynyqoc6x8Ek3f7uKaBeUKz4VISR71iPEdAQRlTRgsOHF37nNNmL0mxMyRSevyOydbPFG71H/zoARkDqPODaJfXYOi+8yXwQ7WWPMxZaEvaukCyE9F1V9pumRYSVlowrPQu5ucxQO5abukwautVLQQvxz36gPEwLfBzcbnRs7JIdy0IY0nco7c2lWtgHjVpfms0kn0o8D0TaZGy0ZUzFYRAMMVYZGGurd+PYx2IA2W9JiV53w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aHIyXUpVl1uwGMwronkJBYdt5P6eUTR2dP3LnUwL+aQ9s/0YcNN/xCqztY92Ub3o8Ef1jn1DHNErkk7JqwsrS31P7iDRUuiNul1SrCv3CV+GBVf9q2S3ShGVm/Xy4I63OSesN50YBEcaL/hI26JEUZqirmIlnpaKcqLvRdjW9FMy6MVJ7Pzhc5ZuJuOBQk4Pl9q2BK4Aay5v6QFBTlZZYVXtzsYNdjSTtdcsxlR2/GpYH4XU1ROJymaUt55p8mayCvZLhlUpsyhAEcqne5jQfSuMPsK2ywIWQxgzhnFbxfxkokq2I7EVh6kTC+iB1q86fj0tlw0cjFoA0xQ7E3wZew==
  • Cc: Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, x86@xxxxxxxxxx, "H. Peter Anvin" <hpa@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 21 Jan 2022 01:02:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>



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@xxxxxxxxxx>
---
Cc: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
Cc: Juergen Gross <jgross@xxxxxxxx>
Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Borislav Petkov <bp@xxxxxxxxx>
Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
Cc: x86@xxxxxxxxxx
Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
---
  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



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.