From: David Hildenbrand <david@redhat.com>
To: Wanpeng Li <kernellwp@gmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
kvm <kvm@vger.kernel.org>, "Paolo Bonzini" <pbonzini@redhat.com>,
"Radim Krčmář" <rkrcmar@redhat.com>,
"Wanpeng Li" <wanpeng.li@hotmail.com>
Subject: Re: [PATCH v2 2/3] KVM: VMX: Fix enable VPID even if INVVPID is not exposed in vmx capability
Date: Tue, 21 Mar 2017 10:15:23 +0100 [thread overview]
Message-ID: <d8618b80-aa7d-f501-5402-abd2dc74da8d@redhat.com> (raw)
In-Reply-To: <CANRm+CxJuYvMbrx72qCGKAdURZ+M=hm+oKXEF7K-g=u-mmTURw@mail.gmail.com>
>>> Cc: Paolo Bonzini <pbonzini@redhat.com>
>>> Cc: Radim Krčmář <rkrcmar@redhat.com>
>>> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
>>> ---
>>> arch/x86/kvm/vmx.c | 9 ++++++++-
>>> 1 file changed, 8 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
>>> index 06d8080..b310214 100644
>>> --- a/arch/x86/kvm/vmx.c
>>> +++ b/arch/x86/kvm/vmx.c
>>> @@ -1239,6 +1239,11 @@ static inline bool cpu_has_vmx_invvpid_global(void)
>>> return vmx_capability.vpid & VMX_VPID_EXTENT_GLOBAL_CONTEXT_BIT;
>>> }
>>>
>>> +static inline bool cpu_has_vmx_invvpid(void)
>>> +{
>>> + return vmx_capability.vpid & VMX_VPID_INVVPID_BIT;
>>> +}
>>> +
>>> static inline bool cpu_has_vmx_ept(void)
>>> {
>>> return vmcs_config.cpu_based_2nd_exec_ctrl &
>>> @@ -6519,8 +6524,10 @@ static __init int hardware_setup(void)
>>> if (boot_cpu_has(X86_FEATURE_NX))
>>> kvm_enable_efer_bits(EFER_NX);
>>>
>>> - if (!cpu_has_vmx_vpid())
>>> + if (!cpu_has_vmx_vpid() ||
>>> + !(cpu_has_vmx_invvpid()))
>>
>> This indentation looks weird. Can't this be fit into one line?
>
> The same as cpu_has_vmx_ept_4levels().
I only know the general rules:
1. make things fit into one line unless it really harms readability
2. when splitting conditions over multiple lines, make them start at the
same level.
And I said, this indentation looks weird, because 1 and 2 are not met.
Anyhow, the general patch is fine in my opinion.
--
Thanks,
David
next prev parent reply other threads:[~2017-03-21 9:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-21 4:18 [PATCH v2 1/3] KVM: nVMX: Fix nested VPID vmx exec control Wanpeng Li
2017-03-21 4:18 ` [PATCH v2 2/3] KVM: VMX: Fix enable VPID even if INVVPID is not exposed in vmx capability Wanpeng Li
2017-03-21 8:50 ` David Hildenbrand
2017-03-21 8:58 ` Wanpeng Li
2017-03-21 9:01 ` David Hildenbrand
2017-03-21 9:05 ` Wanpeng Li
2017-03-21 9:15 ` David Hildenbrand [this message]
2017-03-21 16:19 ` Paolo Bonzini
2017-03-21 4:18 ` [PATCH v2 3/3] KVM: x86: correct async page present tracepoint Wanpeng Li
2017-03-21 8:57 ` David Hildenbrand
2017-03-21 16:19 ` [PATCH v2 1/3] KVM: nVMX: Fix nested VPID vmx exec control 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=d8618b80-aa7d-f501-5402-abd2dc74da8d@redhat.com \
--to=david@redhat.com \
--cc=kernellwp@gmail.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®