From: Paolo Bonzini <pbonzini@redhat.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: guangrong.xiao@linux.intel.com, jroedel@suse.de,
alex.williamson@redhat.com, ogerlitz@mellanox.com,
amirv@mellanox.com, Jan Kiszka <jan.kiszka@siemens.com>
Subject: [PATCH 3/4] KVM: SVM: Sync g_pat with guest-written PAT value
Date: Wed, 8 Jul 2015 17:18:29 +0200 [thread overview]
Message-ID: <1436368710-5452-4-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1436368710-5452-1-git-send-email-pbonzini@redhat.com>
From: Jan Kiszka <jan.kiszka@siemens.com>
When hardware supports the g_pat VMCB field, we can use it for emulating
the PAT configuration that the guest configures by writing to the
corresponding MSR.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
arch/x86/kvm/svm.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 414ec25b673e..d36cfaf5a97a 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -3350,6 +3350,16 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr)
case MSR_VM_IGNNE:
vcpu_unimpl(vcpu, "unimplemented wrmsr: 0x%x data 0x%llx\n", ecx, data);
break;
+ case MSR_IA32_CR_PAT:
+ if (npt_enabled) {
+ if (!kvm_mtrr_valid(vcpu, MSR_IA32_CR_PAT, data))
+ return 1;
+ vcpu->arch.pat = data;
+ svm_set_guest_pat(svm, &svm->vmcb->save.g_pat);
+ mark_dirty(svm->vmcb, VMCB_NPT);
+ break;
+ }
+ /* fall through */
default:
return kvm_set_msr_common(vcpu, msr);
}
--
1.8.3.1
next prev parent reply other threads:[~2015-07-08 15:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-08 15:18 [RFC/RFT PATCH v3 0/4] KVM: x86: full virtualization of guest MTRR Paolo Bonzini
2015-07-08 15:18 ` [PATCH 1/4] KVM: count number of assigned devices Paolo Bonzini
2015-07-08 15:29 ` Alex Williamson
2015-07-08 15:18 ` [PATCH 2/4] KVM: SVM: use NPT page attributes Paolo Bonzini
2015-07-08 15:18 ` Paolo Bonzini [this message]
2015-07-08 15:18 ` [PATCH 4/4] KVM: x86: apply guest MTRR virtualization on host reserved pages Paolo Bonzini
2015-07-08 17:46 ` [RFC/RFT PATCH v3 0/4] KVM: x86: full virtualization of guest MTRR Joerg Roedel
2015-07-29 13:52 ` Or Gerlitz
-- strict thread matches above, loose matches on Subject: below --
2015-07-07 13:45 [RFC/RFT PATCH v2 " Paolo Bonzini
2015-07-07 13:45 ` [PATCH 3/4] KVM: SVM: Sync g_pat with guest-written PAT value Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1436368710-5452-4-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=amirv@mellanox.com \
--cc=guangrong.xiao@linux.intel.com \
--cc=jan.kiszka@siemens.com \
--cc=jroedel@suse.de \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®