]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: VMX: Move architectural "vmcs" and "vmcs_hdr" structures to public vmx.h
authorSean Christopherson <seanjc@google.com>
Sat, 14 Feb 2026 01:26:48 +0000 (17:26 -0800)
committerSean Christopherson <seanjc@google.com>
Wed, 4 Mar 2026 16:52:26 +0000 (08:52 -0800)
Move "struct vmcs" and "struct vmcs_hdr" to asm/vmx.h in anticipation of
moving VMXON/VMXOFF to the core kernel (VMXON requires a "root" VMCS with
the appropriate revision ID in its header).

No functional change intended.

Tested-by: Chao Gao <chao.gao@intel.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Tested-by: Sagi Shahar <sagis@google.com>
Link: https://patch.msgid.link/20260214012702.2368778-3-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/include/asm/vmx.h
arch/x86/kvm/vmx/vmcs.h

index b92ff87e35605d62b252aa84ccbd34f8be78731a..37080382df54865d352415266e8c5a8330236c3c 100644 (file)
 #include <asm/trapnr.h>
 #include <asm/vmxfeatures.h>
 
+struct vmcs_hdr {
+       u32 revision_id:31;
+       u32 shadow_vmcs:1;
+};
+
+struct vmcs {
+       struct vmcs_hdr hdr;
+       u32 abort;
+       char data[];
+};
+
 #define VMCS_CONTROL_BIT(x)    BIT(VMX_FEATURE_##x & 0x1f)
 
 /*
index 66d747e265b1274a27e0a3c73236eca81b214d0d..1f16ddeae9cb1a2cfc573fb49ea7e3726e51b918 100644 (file)
 #define VMCS12_IDX_TO_ENC(idx) ROL16(idx, 10)
 #define ENC_TO_VMCS12_IDX(enc) ROL16(enc, 6)
 
-struct vmcs_hdr {
-       u32 revision_id:31;
-       u32 shadow_vmcs:1;
-};
-
-struct vmcs {
-       struct vmcs_hdr hdr;
-       u32 abort;
-       char data[];
-};
-
 DECLARE_PER_CPU(struct vmcs *, current_vmcs);
 
 /*