diff options
author | 2022-02-28 11:07:49 +0800 | |
---|---|---|
committer | 2022-04-13 13:37:18 -0400 | |
commit | 8176472563fb1a233f46f3f0441738c82afd88da (patch) | |
tree | 4fee74530b45dd14da38a724592cb80514513d3e | |
parent | selftests: kvm/x86/xen: Replace a comma in the xen_shinfo_test with semicolon (diff) | |
download | linux-dev-8176472563fb1a233f46f3f0441738c82afd88da.tar.xz linux-dev-8176472563fb1a233f46f3f0441738c82afd88da.zip |
kvm: x86: Adjust the location of pkru_mask of kvm_mmu to reduce memory
Adjust the field pkru_mask to the back of direct_map to make up 8-byte
alignment.This reduces the size of kvm_mmu by 8 bytes.
Signed-off-by: Peng Hao <flyingpeng@tencent.com>
Message-Id: <20220228030749.88353-1-flyingpeng@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | arch/x86/include/asm/kvm_host.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index f1dfa066068d..e9c9a23d6623 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -443,14 +443,6 @@ struct kvm_mmu { u8 shadow_root_level; u8 ept_ad; bool direct_map; - struct kvm_mmu_root_info prev_roots[KVM_MMU_NUM_PREV_ROOTS]; - - /* - * Bitmap; bit set = permission fault - * Byte index: page fault error code [4:1] - * Bit index: pte permissions in ACC_* format - */ - u8 permissions[16]; /* * The pkru_mask indicates if protection key checks are needed. It @@ -460,6 +452,15 @@ struct kvm_mmu { */ u32 pkru_mask; + struct kvm_mmu_root_info prev_roots[KVM_MMU_NUM_PREV_ROOTS]; + + /* + * Bitmap; bit set = permission fault + * Byte index: page fault error code [4:1] + * Bit index: pte permissions in ACC_* format + */ + u8 permissions[16]; + u64 *pae_root; u64 *pml4_root; u64 *pml5_root; |