lkml.org 
[lkml]   [2021]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 25/54] KVM: x86/mmu: Add helpers to query mmu_role bits
From
Date
On 22/06/21 19:57, Sean Christopherson wrote:
> +static inline bool is_##reg##_##name(struct kvm_mmu *mmu) \

What do you think about calling these is_mmu_##name? The point of
having these helpers is that the register doesn't count, and they return
the effective value (e.g. false in most EPT cases).

Paolo

> +{ \
> + return !!(mmu->mmu_role. base_or_ext . reg##_##name); \
> +}
> +BUILD_MMU_ROLE_ACCESSOR(ext, cr0, pg);
> +BUILD_MMU_ROLE_ACCESSOR(base, cr0, wp);
> +BUILD_MMU_ROLE_ACCESSOR(ext, cr4, pse);
> +BUILD_MMU_ROLE_ACCESSOR(ext, cr4, pae);
> +BUILD_MMU_ROLE_ACCESSOR(ext, cr4, smep);
> +BUILD_MMU_ROLE_ACCESSOR(ext, cr4, smap);
> +BUILD_MMU_ROLE_ACCESSOR(ext, cr4, pke);
> +BUILD_MMU_ROLE_ACCESSOR(ext, cr4, la57);
> +BUILD_MMU_ROLE_ACCESSOR(base, efer, nx);
> +
> struct kvm_mmu_role_regs vcpu_to_role_regs(struct kvm_vcpu *vcpu)

\
 
 \ /
  Last update: 2021-06-23 22:02    [W:1.939 / U:0.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site