[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <67feoyvmmf2sl34kikk3btrfcedafax2pazht5tplxyeb5rtv7@eakih2vxt2xc>
Date: Thu, 11 Sep 2025 22:35:32 +0000
From: Yosry Ahmed <yosry.ahmed@...ux.dev>
To: Vineeth Pillai <viremana@...ux.microsoft.com>
Cc: Lan Tianyu <Tianyu.Lan@...rosoft.com>,
Michael Kelley <mikelley@...rosoft.com>, Paolo Bonzini <pbonzini@...hat.com>,
Sean Christopherson <seanjc@...gle.com>, Vitaly Kuznetsov <vkuznets@...hat.com>,
Tom Lendacky <thomas.lendacky@....com>, Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>, Joerg Roedel <joro@...tes.org>, Wei Liu <wei.liu@...nel.org>,
Stephen Hemminger <sthemmin@...rosoft.com>, Haiyang Zhang <haiyangz@...rosoft.com>,
"H. Peter Anvin" <hpa@...or.com>, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"K. Y. Srinivasan" <kys@...rosoft.com>, x86@...nel.org, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-hyperv@...r.kernel.org,
Venkatesh Srinivas <venkateshs@...gle.com>, .@google.com
Subject: Re: [PATCH v5 4/7] KVM: SVM: Software reserved fields
On Thu, Jun 03, 2021 at 03:14:37PM +0000, Vineeth Pillai wrote:
> SVM added support for certain reserved fields to be used by
> software or hypervisor. Add the following reserved fields:
> - VMCB offset 0x3e0 - 0x3ff
> - Clean bit 31
> - SVM intercept exit code 0xf0000000
>
> Later patches will make use of this for supporting Hyper-V
> nested virtualization enhancements.
>
> Signed-off-by: Vineeth Pillai <viremana@...ux.microsoft.com>
> ---
> arch/x86/include/asm/svm.h | 9 +++++++--
> arch/x86/include/uapi/asm/svm.h | 3 +++
> arch/x86/kvm/svm/svm.h | 17 +++++++++++++++--
> 3 files changed, 25 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h
> index 772e60efe243..e322676039f4 100644
> --- a/arch/x86/include/asm/svm.h
> +++ b/arch/x86/include/asm/svm.h
> @@ -156,6 +156,12 @@ struct __attribute__ ((__packed__)) vmcb_control_area {
> u64 avic_physical_id; /* Offset 0xf8 */
> u8 reserved_7[8];
> u64 vmsa_pa; /* Used for an SEV-ES guest */
> + u8 reserved_8[720];
> + /*
> + * Offset 0x3e0, 32 bytes reserved
> + * for use by hypervisor/software.
> + */
> + u8 reserved_sw[32];
> };
>
>
> @@ -314,7 +320,7 @@ struct ghcb {
>
>
> #define EXPECTED_VMCB_SAVE_AREA_SIZE 1032
> -#define EXPECTED_VMCB_CONTROL_AREA_SIZE 272
> +#define EXPECTED_VMCB_CONTROL_AREA_SIZE 1024
> #define EXPECTED_GHCB_SIZE PAGE_SIZE
>
> static inline void __unused_size_checks(void)
> @@ -326,7 +332,6 @@ static inline void __unused_size_checks(void)
>
> struct vmcb {
> struct vmcb_control_area control;
> - u8 reserved_control[1024 - sizeof(struct vmcb_control_area)];
> struct vmcb_save_area save;
> } __packed;
>
> diff --git a/arch/x86/include/uapi/asm/svm.h b/arch/x86/include/uapi/asm/svm.h
> index 554f75fe013c..efa969325ede 100644
> --- a/arch/x86/include/uapi/asm/svm.h
> +++ b/arch/x86/include/uapi/asm/svm.h
> @@ -110,6 +110,9 @@
> #define SVM_VMGEXIT_GET_AP_JUMP_TABLE 1
> #define SVM_VMGEXIT_UNSUPPORTED_EVENT 0x8000ffff
>
> +/* Exit code reserved for hypervisor/software use */
> +#define SVM_EXIT_SW 0xf0000000
Apologies for reviving this 2021 thread, but it seems like the APM says
in Table C-1. SVM Intercept Codes that the host reserved value is
F000_000h.
APM typo or wrong KVM definition?
Powered by blists - more mailing lists