Commit 81764725 authored by Peng Hao's avatar Peng Hao Committed by Paolo Bonzini

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: default avatarPeng Hao <flyingpeng@tencent.com>
Message-Id: <20220228030749.88353-1-flyingpeng@tencent.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 42c35fdc
...@@ -443,14 +443,6 @@ struct kvm_mmu { ...@@ -443,14 +443,6 @@ struct kvm_mmu {
u8 shadow_root_level; u8 shadow_root_level;
u8 ept_ad; u8 ept_ad;
bool direct_map; 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 * The pkru_mask indicates if protection key checks are needed. It
...@@ -460,6 +452,15 @@ struct kvm_mmu { ...@@ -460,6 +452,15 @@ struct kvm_mmu {
*/ */
u32 pkru_mask; 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 *pae_root;
u64 *pml4_root; u64 *pml4_root;
u64 *pml5_root; u64 *pml5_root;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment