From: Paolo Bonzini <pbonzini@redhat.com>
To: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: Ben Gardon <bgardon@google.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Junaid Shahid <junaids@google.com>
Subject: Re: [PATCH v2 1/3] KVM: x86: assign two bits to track SPTE kinds
Date: Thu, 12 Dec 2019 01:33:45 +0100 [thread overview]
Message-ID: <5c39ee9b-3b58-f1c9-889d-6e012bbbac6c@redhat.com> (raw)
In-Reply-To: <20191212002902.GM5044@linux.intel.com>
On 12/12/19 01:29, Sean Christopherson wrote:
>> */
>> -#define MMIO_SPTE_GEN_MASK GENMASK_ULL(18, 0)
>> +#define MMIO_SPTE_GEN_MASK GENMASK_ULL(17, 0)
>>
>> #define MMIO_SPTE_GEN_LOW_START 3
>> #define MMIO_SPTE_GEN_LOW_END 11
>> #define MMIO_SPTE_GEN_LOW_MASK GENMASK_ULL(MMIO_SPTE_GEN_LOW_END, \
>> MMIO_SPTE_GEN_LOW_START)
>>
>> -#define MMIO_SPTE_GEN_HIGH_START 52
>> -#define MMIO_SPTE_GEN_HIGH_END 61
>> +/* Leave room for SPTE_SPECIAL_MASK. */
>> +#define MMIO_SPTE_GEN_HIGH_START PT64_SECOND_AVAIL_BITS_SHIFT
> I'd rather have GEN_HIGH_START be an explicit bit number and then add
> a BUILD_BUG_ON(GEN_HIGH_START < PT64_SECOND_AVAIL_BITS_SHIFT) to ensure
> the MMIO gen doesn't overlap other stuff. That way we get a build error
> if someone changes PT64_SECOND_AVAIL_BITS_SHIFT, otherwise the MMIO gen
> will end up who knows where and probably overwrite NX or EPT.SUPPRESS_VE.
>
Fair enough. While at it I'll also add MMIO_SPTE_GEN_BITS (
MMIO_SPTE_GEN_LOW_END - MMIO_SPTE_GEN_LOW_START + 1
+ MMIO_SPTE_GEN_HIGH_END - MMIO_SPTE_GEN_HIGH_START + 1) and use it in
MMIO_SPTE_GEN_MASK.
Paolo
next prev parent reply other threads:[~2019-12-12 0:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-27 11:15 [PATCH v2 0/3] KVM: MMU: fix nested guest live migration with PML Paolo Bonzini
2019-09-27 11:15 ` [PATCH v2 1/3] KVM: x86: assign two bits to track SPTE kinds Paolo Bonzini
2019-12-11 18:39 ` Ben Gardon
2019-12-11 19:13 ` Sean Christopherson
2019-12-11 23:28 ` Paolo Bonzini
2019-12-12 0:29 ` Sean Christopherson
2019-12-12 0:33 ` Paolo Bonzini [this message]
2019-09-27 11:15 ` [PATCH v2 2/3] KVM: x86: fix nested guest live migration with PML Paolo Bonzini
2019-09-27 20:24 ` Junaid Shahid
2019-09-27 11:15 ` [PATCH v2 3/3] selftests: kvm: add test for dirty logging inside nested guests 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=5c39ee9b-3b58-f1c9-889d-6e012bbbac6c@redhat.com \
--to=pbonzini@redhat.com \
--cc=bgardon@google.com \
--cc=junaids@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sean.j.christopherson@intel.com \
--cc=vkuznets@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.