Skip to contentSkip to conversation

x86: VMX: Require 16-byte alignment for struct vmx_msr_entry

PATCH In review Jim Mattson 2 participants 2 messages Apr 14, 2022 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: VMX: Require 16-byte alignment for struct vmx_msr_entry

The MSR-store area and the MSR-load areas must be 16-byte aligned, per the hardware specification.

Fixes bd1bf2d6af77a ("VMX: Test MSR load/store feature")
---
 x86/vmx_tests.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
x86/vmx_tests.c +1 -1
index df931985ec46..4d98b7cb08dd 100644
@@ -1959,7 +1959,7 @@ struct vmx_msr_entry {
 	u32 index;
 	u32 reserved;
 	u64 value;
-} __attribute__((packed));
+} __attribute__((packed, aligned(16)));
 
 #define MSR_MAGIC 0x31415926
 struct vmx_msr_entry *exit_msr_store, *entry_msr_load, *exit_msr_load;
Signature · 1 line
2.36.0.rc0.470.gd361397f0d-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 24 lines · Jim Mattson

The MSR-store area and the MSR-load areas must be 16-byte aligned, per the hardware specification.

Fixes bd1bf2d6af77a ("VMX: Test MSR load/store feature")
---
 x86/vmx_tests.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
x86/vmx_tests.c +1 -2
index df931985ec46..4d98b7cb08dd 100644
@@ -1959,7 +1959,7 @@ struct vmx_msr_entry {
        u32 index;
        u32 reserved;
        u64 value;
-} __attribute__((packed));
+} __attribute__((packed, aligned(16)));
 
 #define MSR_MAGIC 0x31415926
 struct vmx_msr_entry *exit_msr_store, *entry_msr_load, *exit_msr_load;
--
Quoted 2 lines

2.36.0.rc0.470.gd361397f0d-goog