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

Re: [PATCH 3/3] x86/svm: Drop svmdebug.h


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
  • Date: Mon, 1 Dec 2025 16:39:52 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=citrix.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=sar9cuNbW5/wix3CLG33GCKNcehMGre7ZojghHkxWpM=; b=TDuMDMO2fL1anc0gDf3cvQz8wq7iUkwhqZhKOcd+zH5OpPv4yvwFNk8Qbv0Q9sSJp4FdGlO0gEDjh5e1itbVALg6IUffgnbSxXZdyW18B4BqL38Ui0sbk5IvdaYEhCYXJvhyg3yGNqIbv4NMzdBQstlneb9h8DLi8sAWG2HD/1NbyTaNp4fycyj96bhDv63Qd/weOZbz8DqRjoNqWTSsXpHxR8g98mZnjlgPnWayIeFitZXYUQpud+V4l4tfxaj7wvtcjG1+tUMzQBw1I2IisnyhpjpkB8Zys/TqgPIEzIwdmlCF9Hu0ZxDcWkI/xtS8ty/l8m9xWeELm1+ob3oNbw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vtMoir4tKUxy90QJbmisxFRCUdr0nqcL+ShoiHcU8Zt28hPjYPXMBK6V2ixUEtlQFhxDhksSW6AKUs2oVip8Axg5W+F8Vq7jm7+GzLEDs32oI6pZZpGKQRH+Y1hXiIRkiTsBPS6ubdKRrdvw2t7zwPFyBnKNojrmz+shV9FW/lx2VcrNb3T1SSO0PEEbQ6icikgZfOgJfKONC37pvDQyXPBV2nJBBnlHpys/YK2JlX46xzGyUa2gaevYezRQ5F3fIyT1uO1J4Yn3SBqxJG/MMjUFPcieR48s9whUCGBqpwbqLG5kxc5XHbvAXPX8+C9vHawaSjTyWt5qbCpOxRdmTA==
  • Cc: Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Xen-devel <xen-devel-bounces@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 01 Dec 2025 15:40:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri Nov 28, 2025 at 9:19 PM CET, Andrew Cooper wrote:
> svmdebug.h now only contains the declaration for svm_sync_vmcb(), despite the
> function being implemented in svm.c.  Move the declaration into svm.h
>
> No functional change.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
> CC: Jan Beulich <JBeulich@xxxxxxxx>
> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> ---
>  xen/arch/x86/hvm/svm/svm.c                  |  1 -
>  xen/arch/x86/hvm/svm/svm.h                  | 17 +++++++++++++++++
>  xen/arch/x86/hvm/svm/vmcb.c                 |  2 +-
>  xen/arch/x86/include/asm/hvm/svm/svmdebug.h | 16 ----------------
>  xen/arch/x86/include/asm/hvm/svm/vmcb.h     | 15 ---------------
>  5 files changed, 18 insertions(+), 33 deletions(-)
>  delete mode 100644 xen/arch/x86/include/asm/hvm/svm/svmdebug.h
>
> diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
> index 14b3a427e642..15d45cbb57c5 100644
> --- a/xen/arch/x86/hvm/svm/svm.c
> +++ b/xen/arch/x86/hvm/svm/svm.c
> @@ -27,7 +27,6 @@
>  #include <asm/hvm/nestedhvm.h>
>  #include <asm/hvm/support.h>
>  #include <asm/hvm/svm/svm.h>
> -#include <asm/hvm/svm/svmdebug.h>
>  #include <asm/hvm/svm/vmcb.h>
>  #include <asm/i387.h>
>  #include <asm/idt.h>
> diff --git a/xen/arch/x86/hvm/svm/svm.h b/xen/arch/x86/hvm/svm/svm.h
> index f5b0312d2dcf..cfa411ad5ae1 100644
> --- a/xen/arch/x86/hvm/svm/svm.h
> +++ b/xen/arch/x86/hvm/svm/svm.h
> @@ -78,6 +78,23 @@ unsigned int svm_get_task_switch_insn_len(void);
>  #define _NPT_PFEC_in_gpt       33
>  #define NPT_PFEC_in_gpt        (1UL<<_NPT_PFEC_in_gpt)
>  
> +/*
> + * VMRUN doesn't switch fs/gs/tr/ldtr and SHADOWGS/SYSCALL/SYSENTER state.
> + * Therefore, guest state is in the hardware registers when servicing a
> + * VMExit.
> + *
> + * Immediately after a VMExit, the vmcb is stale, and needs to be brought
> + * into sync by VMSAVE.  If state in the vmcb is modified, a VMLOAD is
> + * needed before the following VMRUN.
> + */
> +enum vmcb_sync_state {
> +    vmcb_in_sync,
> +    vmcb_needs_vmsave,    /* VMCB out of sync (VMSAVE needed)? */
> +    vmcb_needs_vmload,    /* VMCB dirty (VMLOAD needed)? */

extra comma on move, but this is better, IMO.

  Reviewed-by: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>

Cheers,
Alejandro



 


Rackspace

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