All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Bandan Das <bsd@redhat.com>
Cc: David Hildenbrand <david@redhat.com>,
	kvm@vger.kernel.org, pbonzini@redhat.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching for the L1 hypervisor
Date: Wed, 19 Jul 2017 11:30:37 +0200	[thread overview]
Message-ID: <20170719093036.GA13079@potion> (raw)
In-Reply-To: <jpgfudvgd3i.fsf@linux.bootlegged.copy>

2017-07-17 13:58-0400, Bandan Das:
> Radim Krčmář <rkrcmar@redhat.com> writes:
> ...
>>> > and no other mentions of a VM exit, so I think that the VM exit happens
>>> > only under these conditions:
>>> >
>>> >   — The EPT memory type (bits 2:0) must be a value supported by the
>>> >     processor as indicated in the IA32_VMX_EPT_VPID_CAP MSR (see
>>> >     Appendix A.10).
>>> >   — Bits 5:3 (1 less than the EPT page-walk length) must be 3, indicating
>>> >     an EPT page-walk length of 4; see Section 28.2.2.
>>> >   — Bit 6 (enable bit for accessed and dirty flags for EPT) must be 0 if
>>> >     bit 21 of the IA32_VMX_EPT_VPID_CAP MSR (see Appendix A.10) is read
>>> >     as 0, indicating that the processor does not support accessed and
>>> >     dirty flags for EPT.
>>> >   — Reserved bits 11:7 and 63:N (where N is the processor’s
>>> >     physical-address width) must all be 0.
>>> >
>>> > And it looks like we need parts of nested_ept_init_mmu_context() to
>>> > properly handle VMX_EPT_AD_ENABLE_BIT.
>>> 
>>> I completely ignored AD and the #VE sections. I will add a TODO item
>>> in the comment section.
>>
>> AFAIK, we don't support #VE, but AD would be nice to handle from the
>> beginning.  (I think that caling nested_ept_init_mmu_context() as-is
>> isn't that bad.)
> 
> I went back to the spec to take a look at the AD handling. It doesn't look
> like anything needs to be done since nested_ept_init_mmu_context() is already
> being called with the correct eptp in prepare_vmcs02 ? Anything else that
> needs to be done for AD handling in vmfunc context ?

AD is decided by EPTP bit 6, so it can be toggled by EPTP switching and
we don't call prepare_vmcs02() after emulating VMFUNC vm exit.
We want to forward the new AD configuration to KVM's MMU.

  reply	other threads:[~2017-07-19  9:30 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-10 20:49 [PATCH v4 0/3] Expose VMFUNC to the nested hypervisor Bandan Das
2017-07-10 20:49 ` [PATCH v4 1/3] KVM: vmx: Enable VMFUNCs Bandan Das
2017-07-10 20:49 ` [PATCH v4 2/3] KVM: nVMX: Enable VMFUNC for the L1 hypervisor Bandan Das
2017-07-10 20:49 ` [PATCH v4 3/3] KVM: nVMX: Emulate EPTP switching " Bandan Das
2017-07-11  7:51   ` David Hildenbrand
2017-07-11  8:39     ` Paolo Bonzini
2017-07-11 13:52     ` Radim Krčmář
2017-07-11 18:05       ` Bandan Das
2017-07-11 19:12         ` Radim Krčmář
2017-07-11 19:34           ` Bandan Das
2017-07-11 17:58     ` Bandan Das
2017-07-11 18:22       ` Jim Mattson
2017-07-11 18:35         ` Bandan Das
2017-07-11 19:13           ` Radim Krčmář
2017-07-11 19:38             ` Bandan Das
2017-07-11 20:22               ` Radim Krčmář
2017-07-11 20:45                 ` Bandan Das
2017-07-12 13:41                   ` Radim Krčmář
2017-07-12 18:04                     ` Bandan Das
2017-07-11 18:24       ` Bandan Das
2017-07-11 19:32         ` Radim Krčmář
2017-07-11 19:50           ` Bandan Das
2017-07-11 20:21             ` Radim Krčmář
2017-07-11 20:34               ` Bandan Das
2017-07-11 20:45                 ` Radim Krčmář
2017-07-11 21:08                   ` Bandan Das
2017-07-12 13:24                     ` Radim Krčmář
2017-07-12 18:11                       ` Bandan Das
2017-07-12 19:18                         ` Radim Krčmář
2017-07-17 17:58               ` Bandan Das
2017-07-19  9:30                 ` Radim Krčmář [this message]
2017-07-19 17:54                   ` Bandan Das
2017-07-13 15:39       ` David Hildenbrand
2017-07-13 17:08         ` Bandan Das

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=20170719093036.GA13079@potion \
    --to=rkrcmar@redhat.com \
    --cc=bsd@redhat.com \
    --cc=david@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@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.