Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1711011
| From | Yu Zhang <yu.c.zhang@linux.intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v1 3/4] KVM: MMU: Add 5 level EPT & Shadow page table support. |
| Date | 2017-08-14 17:20 +0200 |
| Message-ID | <uepjP-5KP-3@gated-at.bofh.it> (permalink) |
| References | (2 earlier) <uei8G-1hl-17@gated-at.bofh.it> <uemci-3H5-5@gated-at.bofh.it> <ueonN-5bN-39@gated-at.bofh.it> <uep0u-5p7-3@gated-at.bofh.it> <uepaa-5HJ-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 8/14/2017 11:02 PM, Paolo Bonzini wrote:
> On 14/08/2017 16:32, Yu Zhang wrote:
>>
>> On 8/14/2017 10:13 PM, Paolo Bonzini wrote:
>>> On 14/08/2017 13:37, Yu Zhang wrote:
>>>> Thanks a lot for your comments, Paolo. :-)
>>>>
>>>>
>>>> On 8/14/2017 3:31 PM, Paolo Bonzini wrote:
>>>>> On 12/08/2017 15:35, Yu Zhang wrote:
>>>>>> struct rsvd_bits_validate {
>>>>>> - u64 rsvd_bits_mask[2][4];
>>>>>> + u64 rsvd_bits_mask[2][5];
>>>>>> u64 bad_mt_xwr;
>>>>>> };
>>>>> Can you change this 4 to PT64_ROOT_MAX_LEVEL in patch 2?
>>>> Well, I had tried, but failed to find a neat approach to do so. The
>>>> difficulty I have met is that PT64_ROOT_MAX_LEVEL is defined together
>>>> with PT64_ROOT_4LEVEL/PT32E_ROOT_LEVEL/PT32_ROOT_LEVEL in mmu.h, yet
>>>> the rsvd_bits_validate structure is defined in kvm_host.h, which are
>>>> included in quite a lot .c files that do not include mmu.h or include
>>>> the mmu.h after kvm_host.h.
>>>>
>>>> I guess that's the reason why the magic number 4 instead of
>>>> PT64_ROOT_4LEVEL is used in current definition of
>>>> rsvd_bits_vadlidate. :-)
>>> Yes, you're right. I think the solution is to define
>>> PT64_ROOT_MAX_LEVEL in kvm_host.h.
>> Thanks, Paolo. How about we also move the definition of PT64_ROOT_4LEVEL/
>> PT32E_ROOT_LEVEL/PT32_ROOT_LEVEL from mmu.h to kvm_host.h? Then we
>> can define PT64_ROOT_MAX_LEVEL as PT64_ROOT_4LEVEL instead of 4 in
>> kvm_host.h.
> No, I think those are best left in mmu.h. They are only used in mmu
> files, except for two occurrences in svm.c.
>
> kvm_host.h would have PT64_ROOT_MAX_LEVEL just because it is slightly
> better than "4" or "5".
OK. I can define PT64_ROOT_MAX_LEVEL in kvm_host.h as 4 in patch 2, and
change
it to 5 in patch 3. :- )
Thanks
Yu
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v1 3/4] KVM: MMU: Add 5 level EPT & Shadow page table support. Yu Zhang <yu.c.zhang@linux.intel.com> - 2017-08-12 16:00 +0200
Re: [PATCH v1 3/4] KVM: MMU: Add 5 level EPT & Shadow page table support. Paolo Bonzini <pbonzini@redhat.com> - 2017-08-14 09:40 +0200
Re: [PATCH v1 3/4] KVM: MMU: Add 5 level EPT & Shadow page table support. Yu Zhang <yu.c.zhang@linux.intel.com> - 2017-08-14 14:00 +0200
Re: [PATCH v1 3/4] KVM: MMU: Add 5 level EPT & Shadow page table support. Paolo Bonzini <pbonzini@redhat.com> - 2017-08-14 16:20 +0200
Re: [PATCH v1 3/4] KVM: MMU: Add 5 level EPT & Shadow page table support. Yu Zhang <yu.c.zhang@linux.intel.com> - 2017-08-14 17:00 +0200
Re: [PATCH v1 3/4] KVM: MMU: Add 5 level EPT & Shadow page table support. Paolo Bonzini <pbonzini@redhat.com> - 2017-08-14 17:10 +0200
Re: [PATCH v1 3/4] KVM: MMU: Add 5 level EPT & Shadow page table support. Yu Zhang <yu.c.zhang@linux.intel.com> - 2017-08-14 17:20 +0200
csiph-web