All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ladi Prosek <lprosek@redhat.com>
To: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: Jan Dakinevich <jan.dakinevich@gmail.com>,
	KVM list <kvm@vger.kernel.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	kernellwp@gmail.com
Subject: Re: [PATCH 2/2] KVM: nVMX: invvpid handling improvements
Date: Tue, 25 Oct 2016 15:57:39 +0200	[thread overview]
Message-ID: <CABdb734gE8FHqnj8VEUgL=RmO9BwqH1rvkWuwKE72KD1DTLzNg@mail.gmail.com> (raw)
In-Reply-To: <20161025134007.GA7686@potion>

On Tue, Oct 25, 2016 at 3:40 PM, Radim Krčmář <rkrcmar@redhat.com> wrote:
> 2016-10-25 10:08+0200, Ladi Prosek:
>> On Fri, Oct 21, 2016 at 10:02 PM, Radim Krčmář <rkrcmar@redhat.com> wrote:
>>> 2016-10-19 01:45+0300, Jan Dakinevich:
>>>>  - Expose all invalidation types to the L1
>>>>
>>>>  - Reject invvpid instruction, if L1 passed zero vpid value to single
>>>>    context invalidations
>>>>
>>>> Signed-off-by: Jan Dakinevich <jan.dakinevich@gmail.com>
>>>> ---
>>>> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
>>>> @@ -132,6 +132,11 @@
>>>>
>>>>  #define VMX_MISC_EMULATED_PREEMPTION_TIMER_RATE 5
>>>>
>>>> +#define VMX_VPID_EXTENT_ALL_MASK (VMX_VPID_EXTENT_INDIVIDUAL_ADDR_BIT |      \
>>>
>>> SUPPORTED instead of ALL would be a better name.
>>>
>>>> +     VMX_VPID_EXTENT_SINGLE_CONTEXT_BIT |                            \
>>>> +     VMX_VPID_EXTENT_GLOBAL_CONTEXT_BIT |                            \
>>>> +     VMX_VPID_EXTENT_SINGLE_CONTEXT_RETAINING_GLOBALS_BIT)
>>>> +
>>>>  /*
>>>>   * These 2 parameters are used to config the controls for Pause-Loop Exiting:
>>>>   * ple_gap:    upper bound on the amount of time between two successive
>>>> @@ -2838,8 +2843,7 @@ static void nested_vmx_setup_ctls_msrs(struct vcpu_vmx *vmx)
>>>>        */
>>>>       if (enable_vpid)
>>>>               vmx->nested.nested_vmx_vpid_caps = VMX_VPID_INVVPID_BIT |
>>>> -                             VMX_VPID_EXTENT_SINGLE_CONTEXT_BIT |
>>>> -                             VMX_VPID_EXTENT_GLOBAL_CONTEXT_BIT;
>>>> +                     VMX_VPID_EXTENT_ALL_MASK;
>>>
>>> I'd still support only type 2, because it is the only one we implement,
>>> and type 1, because of buggy KVMs.
>>>
>>> Are there some OSes that can't use single or all context invalidation,
>>> so supporting more might benefit something?
>>
>> Windows Server 2016 with Hyper-V enabled requires all four
>> invalidation types. The log message is not super clear, just
>> s/allowed/required/ and s/required/available/
>
> Yep, I would have understood it the other way around ...
>
>> "
>> Hypervisor launch failed;
>> Processor does not support the minimum features required to run the hypervisor
>> (MSR index 0x48C, allowed bits 0xF0106104040, required bits 0x60106114041).
>> "
>>
>> I have verified that adding VMX_VPID_EXTENT_INDIVIDUAL_ADDR and
>> VMX_VPID_EXTENT_SINGLE_CONTEXT_RETAINING_GLOBALS solves this,
>
> Great info.  Jan, I take back the conservativeness in review -- we'll
> want to support the currently existing modes.  (Invalidating unnecessary
> entries is sad, but not that bad ... nested is already slow.)
>
>>                                                               although
>> it's not the only issue preventing Hyper-V from running on KVM at the
>> moment.
>
> You mentioned another "allowed" bit that KVM lacks, which one was it?

MSR 48B 'Secondary Processor-Based VM-Execution Controls'
bit 2 'Descriptor-table exiting'

> Thanks.

  reply	other threads:[~2016-10-25 13:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-18 22:45 [PATCH 1/2] KVM: VMX: clean up declaration of VPID/EPT invalidation types Jan Dakinevich
2016-10-18 22:45 ` [PATCH 2/2] KVM: nVMX: invvpid handling improvements Jan Dakinevich
2016-10-21 20:02   ` Radim Krčmář
2016-10-25  8:08     ` Ladi Prosek
2016-10-25 13:40       ` Radim Krčmář
2016-10-25 13:57         ` Ladi Prosek [this message]
2016-10-25 13:58           ` Paolo Bonzini
2016-10-25 13:36     ` Paolo Bonzini
2016-10-21 19:40 ` [PATCH 1/2] KVM: VMX: clean up declaration of VPID/EPT invalidation types Radim Krčmář

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='CABdb734gE8FHqnj8VEUgL=RmO9BwqH1rvkWuwKE72KD1DTLzNg@mail.gmail.com' \
    --to=lprosek@redhat.com \
    --cc=jan.dakinevich@gmail.com \
    --cc=kernellwp@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.