mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Jim Mattson <jmattson@google.com>, Wanpeng Li <kernellwp@gmail.com>
Cc: 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: Tue, 17 Oct 2017 19:48:09 +0200	[thread overview]
Message-ID: <52b28aa7-d69a-53d9-4eb6-3c18ceddccc1@redhat.com> (raw)
In-Reply-To: <CALMp9eTBs+aif_PF+W38rjGw-aTqNz5TXOEyXrMLmywXbwDPRg@mail.gmail.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?

Paolo

  reply	other threads:[~2017-10-17 17:48 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 [this message]
2017-10-18  0:51       ` Wanpeng Li
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=52b28aa7-d69a-53d9-4eb6-3c18ceddccc1@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=jmattson@google.com \
    --cc=kernellwp@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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®