* [PATCH] KVM: SVM: use kvm_pat_valid instead of kvm_mtrr_valid
@ 2023-03-29 8:18 Ke Guo
0 siblings, 0 replies; only message in thread
From: Ke Guo @ 2023-03-29 8:18 UTC (permalink / raw)
To: seanjc, pbonzini, tglx, mingo, bp, dave.hansen
Cc: x86, hpa, kvm, linux-kernel, guoke
Using kvm_pat_valid instead of kvm_mtrr_valid here is more appropriate. It
does the same thing as calling kvm_mtrr_valid here without two useless
check. MSR_IA32_CR_PAT is only related to PAT register but not the other
MTRR related registers.
Signed-off-by: Ke Guo <guoke@uniontech.com>
---
arch/x86/kvm/svm/svm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 252e7f37e4e2..834bf9e6c158 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -2906,7 +2906,7 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr)
break;
case MSR_IA32_CR_PAT:
- if (!kvm_mtrr_valid(vcpu, MSR_IA32_CR_PAT, data))
+ if (!kvm_pat_valid(data))
return 1;
vcpu->arch.pat = data;
svm->vmcb01.ptr->save.g_pat = data;
--
2.25.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-29 8:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-29 8:18 [PATCH] KVM: SVM: use kvm_pat_valid instead of kvm_mtrr_valid Ke Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®