diff options
author | Marc Zyngier <maz@kernel.org> | 2025-07-08 10:25:08 -0700 |
---|---|---|
committer | Oliver Upton <oliver.upton@linux.dev> | 2025-07-08 10:40:30 -0700 |
commit | 1d6fea7663b2d3fc8569cf14c91a49fb9b37067b (patch) | |
tree | bc1faa45e70d551bd34eb4c4515becdbace0890f /scripts/lib/kdoc/kdoc_re.py | |
parent | e3fd66620f10cddfcfe062404cf0ed170133bb43 (diff) |
KVM: arm64: Add helper to identify a nested context
A common idiom in the KVM code is to check if we are currently
dealing with a "nested" context, defined as having NV enabled,
but being in the EL1&0 translation regime.
This is usually expressed as:
if (vcpu_has_nv(vcpu) && !is_hyp_ctxt(vcpu) ... )
which is a mouthful and a bit hard to read, specially when followed
by additional conditions.
Introduce a new helper that encapsulate these two terms, allowing
the above to be written as
if (is_nested_context(vcpu) ... )
which is both shorter and easier to read, and makes more obvious
the potential for simplification on some code paths.
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20250708172532.1699409-4-oliver.upton@linux.dev
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Diffstat (limited to 'scripts/lib/kdoc/kdoc_re.py')
0 files changed, 0 insertions, 0 deletions