From: Wanpeng Li <kernellwp@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Jim Mattson" <jmattson@google.com>,
LKML <linux-kernel@vger.kernel.org>,
"kvm list" <kvm@vger.kernel.org>,
"Radim Krčmář" <rkrcmar@redhat.com>,
"Wanpeng Li" <wanpeng.li@hotmail.com>
Subject: Re: [PATCH v2 2/2] KVM: VMX: Fix VPID capability detection
Date: Wed, 18 Oct 2017 08:51:51 +0800 [thread overview]
Message-ID: <CANRm+CwTYhbEXeHbjbN2Bi483JHTc7bBbWsN8BXw++mF6rZhtg@mail.gmail.com> (raw)
In-Reply-To: <52b28aa7-d69a-53d9-4eb6-3c18ceddccc1@redhat.com>
2017-10-18 1:48 GMT+08:00 Paolo Bonzini <pbonzini@redhat.com>:
> On 17/10/2017 19:43, Jim Mattson wrote:
>>> + &vmx_capability.ept, &vmx_capability.vpid);
>>> +
>>> if (_cpu_based_2nd_exec_control & SECONDARY_EXEC_ENABLE_EPT) {
>>> /* CR3 accesses and invlpg don't need to cause VM Exits when EPT
>>> enabled */
>>> _cpu_based_exec_control &= ~(CPU_BASED_CR3_LOAD_EXITING |
>>> CPU_BASED_CR3_STORE_EXITING |
>>> CPU_BASED_INVLPG_EXITING);
>>> - rdmsr(MSR_IA32_VMX_EPT_VPID_CAP,
>>> - vmx_capability.ept, vmx_capability.vpid);
>>> - }
>>> + } else
>>> + vmx_capability.ept = 0;
>> I would expect vmx_capability.ept to already be 0 here. Otherwise, L0
>> is reporting inconsistent VMX capabilities.
>>
>>> + if (!(_cpu_based_2nd_exec_control & SECONDARY_EXEC_ENABLE_VPID))
>>> + vmx_capability.vpid = 0;
>> I would expect vmx_capability.vpid to already be 0 here. Otherwise, L0
>> is reporting inconsistent VMX capabilities.
>>
>
> That's true, but I think it's better to be safe. Maybe add a pr_warn if
> it is not zero?
Will do in v3.
Regards,
Wanpeng Li
next prev parent reply other threads:[~2017-10-18 0:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-17 4:03 [PATCH v2 1/2] KVM: VMX: Don't advertise EPT switching if EPT itself is not exposed Wanpeng Li
2017-10-17 4:03 ` [PATCH v2 2/2] KVM: VMX: Fix VPID capability detection Wanpeng Li
2017-10-17 17:43 ` Jim Mattson
2017-10-17 17:48 ` Paolo Bonzini
2017-10-18 0:51 ` Wanpeng Li [this message]
2017-10-17 17:29 ` [PATCH v2 1/2] KVM: VMX: Don't advertise EPT switching if EPT itself is not exposed Jim Mattson
2017-10-17 17:35 ` Paolo Bonzini
2017-10-17 18:30 ` Jim Mattson
2017-10-18 1:05 ` Wanpeng Li
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=CANRm+CwTYhbEXeHbjbN2Bi483JHTc7bBbWsN8BXw++mF6rZhtg@mail.gmail.com \
--to=kernellwp@gmail.com \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=wanpeng.li@hotmail.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®