[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e549d4c4-ca56-da1d-cc50-1a73621ba487@redhat.com>
Date: Wed, 13 Apr 2022 18:03:51 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Lai Jiangshan <jiangshanlai@...il.com>,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
Lai Jiangshan <jiangshan.ljs@...group.com>,
Jonathan Corbet <corbet@....net>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>, linux-doc@...r.kernel.org
Subject: Re: [RFC PATCH V3 2/4] KVM: X86: Introduce role.glevel for level
expanded pagetable
On 4/13/22 17:32, Sean Christopherson wrote:
>>> Are we planning on removing direct?
>>
>> I think so, it's redundant and the code almost always checks
>> direct||passthrough (which would be passthrough_delta > 0 with your scheme).
>
> I'm ok dropping direct and rolling it into target_level, just so long as we add
> helpers, e.g. IIUC they would be
>
> static inline bool is_sp_direct(...)
> {
> return !sp->role.target_level;
> }
>
> static inline bool is_sp_direct_or_passthrough(...)
> {
> return sp->role.target_level != sp->role.level;
> }
Yes of course. Or respectively:
return sp->role.passthrough_levels == s->role.level;
return sp->role.passthrough_levels > 0;
I'm not sure about a more concise name for the latter. Maybe
sp_has_gpt(...) but I haven't thought it through very much.
>>> Hmm, it's not a raw level though.
>>
>> Hence the plural. :)
>
> LOL, I honestly thought that was a typo. Making it plural sounds like it's passing
> through to multiple levels.
I meant it as number of levels being passed through. I'll leave that to
Jiangshan, either target_level or passthrough_levels will do for me.
Paolo
Powered by blists - more mailing lists