KVM: SVM: Name and check reserved fields with structs offset
authorCarlos Bilbao <carlos.bilbao@amd.com>
Mon, 24 Oct 2022 16:44:48 +0000 (11:44 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 9 Nov 2022 17:31:16 +0000 (12:31 -0500)
commitd08b48585309247d4d28051dd7a315eef5d1db26
tree5dab8d6b5edf4166a086c18a12ef8aa95381728e
parent07a368b3f55a79d33cad113d506b279e04fd2a00
KVM: SVM: Name and check reserved fields with structs offset

Rename reserved fields on all structs in arch/x86/include/asm/svm.h
following their offset within the structs. Include compile time checks for
this in the same place where other BUILD_BUG_ON for the structs are.

This also solves that fields of struct sev_es_save_area are named by their
order of appearance, but right now they jump from reserved_5 to reserved_7.

Link: https://lkml.org/lkml/2022/10/22/376
Signed-off-by: Carlos Bilbao <carlos.bilbao@amd.com>
Message-Id: <20221024164448.203351-1-carlos.bilbao@amd.com>
[Use ASSERT_STRUCT_OFFSET + fix a couple wrong offsets. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/svm.h
arch/x86/kvm/svm/sev.c