Linux KVM/arm64 development list
 help / color / mirror / Atom feed
From: Oliver Upton <oliver.upton@linux.dev>
To: Marc Zyngier <maz@kernel.org>
Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	Joey Gouly <joey.gouly@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>
Subject: Re: [PATCH] KVM: arm64: Add helper to identify a nested context
Date: Sat, 31 May 2025 10:52:07 -0700	[thread overview]
Message-ID: <aDtBx7BXLeCzofPf@linux.dev> (raw)
In-Reply-To: <20250531164901.1166892-1-maz@kernel.org>

On Sat, May 31, 2025 at 05:49:01PM +0100, Marc Zyngier wrote:
> 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>

Thanks! I'll probably pick this up as a prefix on my abort routing
series if that's OK with you.

Best,
Oliver

  reply	other threads:[~2025-05-31 17:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-31 16:49 [PATCH] KVM: arm64: Add helper to identify a nested context Marc Zyngier
2025-05-31 17:52 ` Oliver Upton [this message]
2025-06-01  6:54   ` Marc Zyngier

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=aDtBx7BXLeCzofPf@linux.dev \
    --to=oliver.upton@linux.dev \
    --cc=joey.gouly@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=yuzenghui@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox