From: Paolo Bonzini <pbonzini@redhat.com>
To: "Radim Krčmář" <rkrcmar@redhat.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: Wanpeng Li <kernellwp@gmail.com>
Subject: Re: [PATCH v2 2/3] KVM: VMX: join functions that disable x2apic msr intercepts
Date: Fri, 30 Sep 2016 10:29:34 +0200 [thread overview]
Message-ID: <d5da97b7-ca0d-ab47-779c-effe464b40e3@redhat.com> (raw)
In-Reply-To: <20160929204133.1259-3-rkrcmar@redhat.com>
On 29/09/2016 22:41, Radim Krčmář wrote:
> for (msr = 0x800; msr <= 0x8ff; msr++) {
> if (msr == 0x839 /* TMCCT */)
> continue;
> - vmx_disable_intercept_msr_read_x2apic(msr, true);
> + vmx_disable_intercept_msr_x2apic(msr, MSR_TYPE_R, true);
> }
>
> /* TPR */
> - vmx_disable_intercept_msr_write_x2apic(0x808, true);
> + vmx_disable_intercept_msr_x2apic(0x808, MSR_TYPE_W, true);
> /* EOI */
> - vmx_disable_intercept_msr_write_x2apic(0x80b, true);
> + vmx_disable_intercept_msr_x2apic(0x80b, MSR_TYPE_W, true);
> /* SELF-IPI */
> - vmx_disable_intercept_msr_write_x2apic(0x83f, true);
> + vmx_disable_intercept_msr_x2apic(0x83f, MSR_TYPE_W, true);
>
> /*
> * (enable_apicv && !kvm_vcpu_apicv_active()) ||
> * !enable_apicv
> */
> /* TPR */
> - vmx_disable_intercept_msr_read_x2apic(0x808, false);
> - vmx_disable_intercept_msr_write_x2apic(0x808, false);
> + vmx_disable_intercept_msr_x2apic(0x808, MSR_TYPE_R | MSR_TYPE_W, false);
Alternatively you could place the two function calls for 0x808 together:
for (msr = 0x800; msr <= 0x8ff; msr++)
vmx_disable_intercept_msr_x2apic(msr, MSR_TYPE_R, true);
/*
* TPR reads and writes can be virtualized even if virtual interrupt delivery
* is not in use.
*/
vmx_disable_intercept_msr_x2apic(0x808, MSR_TYPE_R | MSR_TYPE_W, false);
vmx_disable_intercept_msr_x2apic(0x808, MSR_TYPE_W, true);
/* EOI */
vmx_disable_intercept_msr_x2apic(0x80b, MSR_TYPE_W, true);
/* SELF-IPI */
vmx_disable_intercept_msr_x2apic(0x83f, MSR_TYPE_W, true);
Paolo
next prev parent reply other threads:[~2016-09-30 8:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-29 20:41 [PATCH v2 0/3] KVM: VMX: refactor global page-sized bitmaps Radim Krčmář
2016-09-29 20:41 ` [PATCH v2 1/3] KVM: VMX: remove functions that enable msr intercepts Radim Krčmář
2016-09-29 20:41 ` [PATCH v2 2/3] KVM: VMX: join functions that disable x2apic " Radim Krčmář
2016-09-30 8:29 ` Paolo Bonzini [this message]
2016-10-07 12:30 ` Radim Krčmář
2016-10-07 23:43 ` Wanpeng Li
2016-09-29 20:41 ` [PATCH v2 3/3] KVM: VMX: refactor setup of global page-sized bitmaps Radim Krčmář
2016-09-30 8:32 ` 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=d5da97b7-ca0d-ab47-779c-effe464b40e3@redhat.com \
--to=pbonzini@redhat.com \
--cc=kernellwp@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rkrcmar@redhat.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