diff options
| author | Yosry Ahmed <yosry@kernel.org> | 2026-03-03 03:34:16 +0300 |
|---|---|---|
| committer | Sean Christopherson <seanjc@google.com> | 2026-03-05 03:09:06 +0300 |
| commit | a2b858051cf03d4f0abca014cddd424675be5316 (patch) | |
| tree | 78442535889c3983ec5edc078eece6a03d32984e | |
| parent | b709087e9e544259d1d075ced91cc4ab769a8ae2 (diff) | |
| download | linux-a2b858051cf03d4f0abca014cddd424675be5316.tar.xz | |
KVM: nSVM: Use PAGE_MASK to drop lower bits of bitmap GPAs from vmcb12
Use PAGE_MASK to drop the lower bits from IOPM_BASE_PA and MSRPM_BASE_PA
while copying them instead of dropping the bits afterward with a
hardcoded mask.
No functional change intended.
Signed-off-by: Yosry Ahmed <yosry@kernel.org>
Link: https://patch.msgid.link/20260303003421.2185681-23-yosry@kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
| -rw-r--r-- | arch/x86/kvm/svm/nested.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c index c61b4923963e..fd7045904948 100644 --- a/arch/x86/kvm/svm/nested.c +++ b/arch/x86/kvm/svm/nested.c @@ -482,8 +482,8 @@ void __nested_copy_vmcb_control_to_cache(struct kvm_vcpu *vcpu, if (!guest_cpu_cap_has(vcpu, X86_FEATURE_NPT)) to->misc_ctl &= ~SVM_MISC_ENABLE_NP; - to->iopm_base_pa = from->iopm_base_pa; - to->msrpm_base_pa = from->msrpm_base_pa; + to->iopm_base_pa = from->iopm_base_pa & PAGE_MASK; + to->msrpm_base_pa = from->msrpm_base_pa & PAGE_MASK; to->tsc_offset = from->tsc_offset; to->tlb_ctl = from->tlb_ctl; to->erap_ctl = from->erap_ctl; @@ -505,8 +505,6 @@ void __nested_copy_vmcb_control_to_cache(struct kvm_vcpu *vcpu, /* Copy asid here because nested_vmcb_check_controls() will check it */ to->asid = from->asid; - to->msrpm_base_pa &= ~0x0fffULL; - to->iopm_base_pa &= ~0x0fffULL; to->clean = from->clean; #ifdef CONFIG_KVM_HYPERV |
