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 <[email protected]>
> ---
> CC: Jan Beulich <[email protected]>
> CC: Roger Pau MonnĂ© <[email protected]>
> ---
>  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 <[email protected]>

Cheers,
Alejandro

Reply via email to