Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1350223
| From | Radim Krčmář <rkrcmar@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] KVM: x86: disable PEBS before a guest entry |
| Date | 2016-03-04 14:30 +0100 |
| Message-ID | <r8XXQ-7oV-5@gated-at.bofh.it> (permalink) |
| References | <r8GDE-2P0-21@gated-at.bofh.it> <r8J8u-4LK-19@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
2016-03-03 13:32-0800, David Matlack: > On Thu, Mar 3, 2016 at 10:53 AM, Radim Krčmář <rkrcmar@redhat.com> wrote: >> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c >> @@ -1767,6 +1767,13 @@ static void clear_atomic_switch_msr(struct vcpu_vmx *vmx, unsigned msr) >> return; >> } >> break; >> + case MSR_IA32_PEBS_ENABLE: >> + /* PEBS needs a quiescent period after being disabled (to write >> + * a record). Disabling PEBS through VMX MSR swapping doesn't >> + * provide that period, so a CPU could write host's record into >> + * guest's memory. >> + */ >> + wrmsrl(MSR_IA32_PEBS_ENABLE, 0); > > Should this go in add_atomic_switch_msr instead of clear_atomic_switch_msr? Yes, it could be cleared in both (in case guest PEBS can be non-zero), but I wanted to have it only in add_atomic_switch_msr(). Thank you! v2 underway. (In case it makes you wonder how it was tested: I have a bad habit of trying whether a patch can be improved before posting and this one went awry, because I already returned the machine with reproducer and the change seemed simple enough.)
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] KVM: x86: disable PEBS before a guest entry Radim Krčmář <rkrcmar@redhat.com> - 2016-03-03 20:00 +0100
Re: [PATCH] KVM: x86: disable PEBS before a guest entry David Matlack <dmatlack@google.com> - 2016-03-03 22:40 +0100
Re: [PATCH] KVM: x86: disable PEBS before a guest entry Radim Krčmář <rkrcmar@redhat.com> - 2016-03-04 14:30 +0100
csiph-web