Message ID | 20220414185853.342787-1-jmattson@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [kvm-unit-tests] x86: VMX: Require 16-byte alignment for struct vmx_msr_entry | expand |
On Thu, Apr 14, 2022 at 6:59 PM Jim Mattson <jmattson@google.com> wrote: > > 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") > Signed-off-by: Jim Mattson <jmattson@google.com> > --- > x86/vmx_tests.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c > index df931985ec46..4d98b7cb08dd 100644 > --- a/x86/vmx_tests.c > +++ b/x86/vmx_tests.c > @@ -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; > -- > 2.36.0.rc0.470.gd361397f0d-goog > Reviewed-by: Aaron Lewis <aaronlewis@google.com>
diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c index df931985ec46..4d98b7cb08dd 100644 --- a/x86/vmx_tests.c +++ b/x86/vmx_tests.c @@ -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;
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") Signed-off-by: Jim Mattson <jmattson@google.com> --- x86/vmx_tests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)