From: Paolo Bonzini <pbonzini@redhat.com>
To: Maxim Levitsky <mlevitsk@redhat.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: MMU: update comment on the number of page role combinations
Date: Tue, 16 Nov 2021 13:28:17 +0100 [thread overview]
Message-ID: <42866023-7380-823d-c4c1-2fbf7b5d9527@redhat.com> (raw)
In-Reply-To: <85599dcde5c8c6b74437fac28ebb62c38dafc6a8.camel@redhat.com>
On 11/16/21 12:07, Maxim Levitsky wrote:
>> - * But, even though there are 18 bits in the mask below, not all
>> combinations
>> + * But, even though there are 20 bits in the mask
>> below, not all combinations
> I to be honest counted 19 bits there (which includes the 'smm' bit),
> but I might have made a mistake. I do wonder maybe it is better to
> just remove that comment with explicit number?
Yes, they are 19. But the explicit number is there to guide in
understanding how 19 goes down to 14 combinations.
Here is a better writeup:
* - invalid shadow pages are not accounted, so the bits are effectively 18
* - quadrant will only be used if gpte_is_8_bytes is zero (non-PAE paging);
* execonly and ad_disabled are only used for nested EPT which has
* gpte_is_8_bytes=1. Therefore, 2 bits are always unused.
* - the 4 bits of level are effectively limited to the values 2/3/4/5,
* as 4k SPs are not tracked (allowed to go unsync). In addition non-PAE
* paging has exactly one upper level, making level effectively redundant
* when gpte_is_8_bytes=0.
* - on top of this, smep_andnot_wp and smap_andnot_wp are only set if cr0_wp=0,
* therefore these three bits only give rise to 5 possibilities.
FWIW, the full count becomes 6400 unless I screwed up the math.
Paolo
next prev parent reply other threads:[~2021-11-16 12:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-16 10:11 Paolo Bonzini
2021-11-16 11:07 ` Maxim Levitsky
2021-11-16 12:28 ` Paolo Bonzini [this message]
2021-11-17 22:25 ` Sean Christopherson
2021-11-18 7:08 ` 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=42866023-7380-823d-c4c1-2fbf7b5d9527@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mlevitsk@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 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®