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

[PATCH v1 24/28] x86/hvm: avic: ensure SVM AVIC is disabled with nested guest


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: dmukhin@xxxxxxxx
  • Date: Wed, 4 Nov 2026 17:33:41 -0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ford.com; dkim=pass (signature was verified) header.d=saarlouis.ford.com; dkim=pass (signature was verified) header.d=ford.com; arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=TID9m9slSC/X7gfNkK51xRN4bPBb6TjSoHkpoAhZQu4=; b=UodO4KEmW1migpj2cLMemhgUUaBBG9TuRJQ6vXL2h1Y0fPF4YMCBH7sh0gVvpTDTr2527LUAd+LnTkEE9CAHoOhD0nV9SgJ8hf0vlnv3qNZoLYrgaL1GUGCVtoyQe4E8k2tVjIOQrW+MQv63sZu4j6IIEIpRUM+WEl62sWmMtme/erX5a1nKYoxl5T56RYzCOUZB3uNgZw5kqzIMxkr+/NIaP4Q/CzYrXmBli1W0hvXTBSEbX1S4kpXiXwbfWEq8uLuACFfTviBNA5Uzlj49iKZbq9ohoggNJMEvP10y/Su6hUiIPFJc7eZOgfk1yK/VSkgtU6NWgK0qQta2mCOmTQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hfXGVsK0QK+zOj0eM5gYb/djcrEZcvk7IqunWupE3D7aRhL1Rb23vcORo2fm2PIFVnPPqRR+Ma93BRdUrNvESHNJjcKmFblsTCkuAH5o5cZCznJw9KBWiBOmjabkzct0H4rzupePvIkVZS5XdcRvw1ejM45bV1J+DKBqxmusm3+oYPpDLLD2VSlOr1KapjcrJuPm0zvhEwRaSF8fa3YPQMITFTUIbp8WxWStJ2V0HF4x1ZIfI6pEZSC4/xRKI6jiTbWmBe6fh004IM4wHWgJpSCEdjAKFKlgSR8rlrRhmha0396Ox318IayICZusMoMr6oZ3jkH00XNfV6EV4BjVUw==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
  • Cc: andrew.cooper3@xxxxxxxxxx, jason.andryuk@xxxxxxx, jbeulich@xxxxxxxx, roger@xxxxxxxxxxxxxx, teddy.astie@xxxxxxxxxx, dmukhin@xxxxxxx, Denis Mukhin <dmukhin@xxxxxxxx>
  • Delivery-date: Thu, 05 Nov 2026 01:35:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Pser-m365-app: SER-APP

From: Denis Mukhin <dmukhin@xxxxxxxx>

AVIC in nested virtualization environment is not supported as of yet.

Ensure there will be no problems in any production environments if AVIC
got enabled in nested guest by short-circuiting logic in
svm_avic_create_vmcb().

Signed-off-by: Denis Mukhin <dmukhin@xxxxxxxx>
---
 xen/arch/x86/hvm/svm/avic.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/xen/arch/x86/hvm/svm/avic.c b/xen/arch/x86/hvm/svm/avic.c
index 37a857f28d14..e19489bd485c 100644
--- a/xen/arch/x86/hvm/svm/avic.c
+++ b/xen/arch/x86/hvm/svm/avic.c
@@ -4,6 +4,7 @@
  */
 
 #include <asm/hvm/emulate.h>
+#include <asm/hvm/nestedhvm.h>
 #include <asm/msr.h>
 #include <asm/p2m.h>
 #include <xen/param.h>
@@ -170,6 +171,14 @@ static bool avic_vcpu_supported(struct vcpu *v)
         return false;
     }
 
+    if ( nestedhvm_enabled(d) && nestedhvm_vcpu_in_guestmode(v) )
+    {
+        gprintk(XENLOG_WARNING,
+                "%pv: AVIC: nested guest is not supported\n",
+                v);
+        return false;
+    }
+
     id = GET_xAPIC_ID(vlapic_reg_read(v, APIC_ID));
     if ( id > AVIC_MAX_PHYSICAL_ID )
     {
-- 
2.55.0




 


Rackspace

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