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

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


  • To: "dmukhin@xxxxxxxx" <dmukhin@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
  • Date: Thu, 5 Nov 2026 10:33:50 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • 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=WKX+41IYFCzMQGH9G/FCabIrzjJVwXwjzMApee5D0gs=; b=UMI0sbFXk0csHqGkYFGdt4PGOqeZqJ7pmN5YW25ceJ+ViymaELfylBonBLenhoI0NtEY2p9OeoyhyOKSuira63puulBM3x7StqxytbeG8Tnv9SERZVDgTL8lHm4xTPHxWM9ToEQcErxfO4XAc1ltX89pIPO1jH5zCubcMtgjaI5S6ZJQ1aKILdOWijw85UYWUhcvE5tmnYyQDRGDHabOMt1XIhZQrT51XcC3mFx5OtI0H2Jm4wHp31t+OBCg2qGIeWLNy3Iyv2GyFCwiYtgDI5BCSIfLcF+9P//+U+aEqBoD/WXeKAU7yOG7zzzg+asTBNSsxtFBRhI2PHo+k+EIWQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Iz3RgHB4FGxx7ELBiqjb81sZFZTJQvNmwuj+GYB4eKqrbTMnwHNpgLRc369punfNF5uGV7KQz2Bp9axcdIRQyzALh3qIH8cmh6Mzf37zYzqRmoF0JSHnBGWCncJU3/241TvFGvO8d2Rgmba1Zn4esWw2RzVqv9dLcNPNqha3DekESSXP7tAsDUg12W9RAZdiaQ9vVFQJtIdX/vi7WnYowjOK+zXNNnF4lRLd8ynE3h5HnvMCvCDwPQntBvAgFo2jR+zrExOxrZ9JO+6drGlMydPrTpkEbNxqBpRDH/bQqzdZRm9tfJZsQEuM+pkD05Zbs97nvJ1eS59+RP0DrVKBNA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
  • Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, "jason.andryuk@xxxxxxx" <jason.andryuk@xxxxxxx>, "jbeulich@xxxxxxxx" <jbeulich@xxxxxxxx>, "roger@xxxxxxxxxxxxxx" <roger@xxxxxxxxxxxxxx>, "teddy.astie@xxxxxxxxxx" <teddy.astie@xxxxxxxxxx>, "dmukhin@xxxxxxx" <dmukhin@xxxxxxx>
  • Delivery-date: Thu, 05 Nov 2026 10:34:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels:
  • Thread-index: AQHdbMXxDi7qjLhoDUuiCr7Mk5ZX/7cfRdBN
  • Thread-topic: [PATCH v1 24/28] x86/hvm: avic: ensure SVM AVIC is disabled with nested guest

> From: Xen-devel <xen-devel-bounces@xxxxxxxxxxxxxxxxxxxx> on behalf of 
> dmukhin@xxxxxxxx <dmukhin@xxxxxxxx>
> Sent: Thursday, November 05, 2026 01:33
> To: xen-devel@xxxxxxxxxxxxxxxxxxxx <xen-devel@xxxxxxxxxxxxxxxxxxxx>
> Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>; jason.andryuk@xxxxxxx 
> <jason.andryuk@xxxxxxx>; jbeulich@xxxxxxxx <jbeulich@xxxxxxxx>; 
> roger@xxxxxxxxxxxxxx <roger@xxxxxxxxxxxxxx>; teddy.astie@xxxxxxxxxx 
> <teddy.astie@xxxxxxxxxx>; dmukhin@xxxxxxx <dmukhin@xxxxxxx>; Denis Mukhin 
> <dmukhin@xxxxxxxx>
> Subject: [PATCH v1 24/28] x86/hvm: avic: ensure SVM AVIC is disabled with 
> nested guest
>
>
> 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 )
>      {

Does this actually work? This function is mostly called from
svm_vcpu_initialise() and the vCPU is never in guest mode there (i.e. L2).

You could probably just drop the second part of the if condition.

Ross


 


Rackspace

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