From: Jim Mattson <jmattson@google.com>
To: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Cc: Nadav Amit <namit@vmware.com>,
Paolo Bonzini <pbonzini@redhat.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [kvm-unit-tests PATCH] x86: svm: low CR3 bits are not MBZ
Date: Wed, 15 Jul 2020 16:12:51 -0700 [thread overview]
Message-ID: <CALMp9eSoRSKBvNwjm5fpPG2XDJnnC1b-tm68P-K_Jnyab4aPMg@mail.gmail.com> (raw)
In-Reply-To: <ab9f1669-a295-1022-a62a-8b64c90f6dcb@oracle.com>
On Wed, Jul 15, 2020 at 3:40 PM Krish Sadhukhan
<krish.sadhukhan@oracle.com> wrote:
>
>
> On 7/15/20 3:27 PM, Nadav Amit wrote:
> >> On Jul 15, 2020, at 3:21 PM, Krish Sadhukhan <krish.sadhukhan@oracle.com> wrote:
> >>
> >>
> >> On 7/13/20 4:30 PM, Nadav Amit wrote:
> >>>> On Jul 13, 2020, at 4:17 PM, Krish Sadhukhan <krish.sadhukhan@oracle.com> wrote:
> >>>>
> >>>>
> > [snip]
> >
> >>>> I am just saying that the APM language "should be cleared to 0" is misleading if the processor doesn't enforce it.
> >>> Just to ensure I am clear - I am not blaming you in any way. I also found
> >>> the phrasing confusing.
> >>>
> >>> Having said that, if you (or anyone else) reintroduces “positive” tests, in
> >>> which the VM CR3 is modified to ensure VM-entry succeeds when the reserved
> >>> non-MBZ bits are set, please ensure the tests fails gracefully. The
> >>> non-long-mode CR3 tests crashed since the VM page-tables were incompatible
> >>> with the paging mode.
> >>>
> >>> In other words, instead of setting a VMMCALL instruction in the VM to trap
> >>> immediately after entry, consider clearing the present-bits in the high
> >>> levels of the NPT; or injecting some exception that would trigger exit
> >>> during vectoring or something like that.
> >>>
> >>> P.S.: If it wasn’t clear, I am not going to fix KVM itself for some obvious
> >>> reasons.
> >> I think since the APM is not clear, re-adding any test that tests those bits, is like adding a test with "undefined behavior" to me.
> >>
> >>
> >> Paolo, Should I send a KVM patch to remove checks for those non-MBZ reserved bits ?
> > Which non-MBZ reserved bits (other than those that I addressed) do you refer
> > to?
> >
> I am referring to,
>
> "[PATCH 2/3 v4] KVM: nSVM: Check that MBZ bits in CR3 and CR4 are
> not set on vmrun of nested guests"
>
> in which I added the following:
>
>
> +#define MSR_CR3_LEGACY_RESERVED_MASK 0xfe7U
> +#define MSR_CR3_LEGACY_PAE_RESERVED_MASK 0x7U
> +#define MSR_CR3_LONG_RESERVED_MASK 0xfff0000000000fe7U
In my experience, the APM generally distinguishes between "reserved"
and "reserved, MBZ." The low bits you have indicated for CR3 are
marked only as "reserved" in Figures 3-4, 3-5, and 3-6 of the APM,
volume 2. Only bits 63:52 are marked as "reserved, MBZ." (In fact,
Figure 3-6 of the May 2020 version of the APM, revision 3.35, also
calls out bits 11:0 as the PCID when CR4.PCIDE is set.)
Of course, you could always test the behavior. :-)
next prev parent reply other threads:[~2020-07-15 23:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-13 4:39 [kvm-unit-tests PATCH] x86: svm: low CR3 bits are not MBZ Nadav Amit
2020-07-13 23:06 ` Krish Sadhukhan
2020-07-13 23:11 ` Nadav Amit
2020-07-13 23:17 ` Krish Sadhukhan
2020-07-13 23:30 ` Nadav Amit
2020-07-15 22:21 ` Krish Sadhukhan
2020-07-15 22:27 ` Nadav Amit
2020-07-15 22:39 ` Krish Sadhukhan
2020-07-15 22:51 ` Nadav Amit
2020-07-15 23:12 ` Jim Mattson [this message]
2020-08-04 23:13 ` Krish Sadhukhan
2020-08-18 6:38 ` Paolo Bonzini
2020-08-18 18:25 ` Krish Sadhukhan
2020-08-29 1:39 ` Krish Sadhukhan
2020-07-28 21:27 ` Paolo Bonzini
2020-07-28 21:27 ` 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=CALMp9eSoRSKBvNwjm5fpPG2XDJnnC1b-tm68P-K_Jnyab4aPMg@mail.gmail.com \
--to=jmattson@google.com \
--cc=krish.sadhukhan@oracle.com \
--cc=kvm@vger.kernel.org \
--cc=namit@vmware.com \
--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.