Linux KVM/arm64 development list
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Oliver Upton <oliver.upton@linux.dev>
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: Sun, 01 Jun 2025 07:54:40 +0100	[thread overview]
Message-ID: <87plfodk9b.wl-maz@kernel.org> (raw)
In-Reply-To: <aDtBx7BXLeCzofPf@linux.dev>

On Sat, 31 May 2025 18:52:07 +0100,
Oliver Upton <oliver.upton@linux.dev> wrote:
> 
> 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.

Of course!

	M.

-- 
Jazz isn't dead. It just smells funny.

      reply	other threads:[~2025-06-01  6:54 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
2025-06-01  6:54   ` Marc Zyngier [this message]

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=87plfodk9b.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=joey.gouly@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=oliver.upton@linux.dev \
    --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