mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Mark Brown <broonie@kernel.org>
Cc: Oliver Upton <oupton@kernel.org>,
	Fuad Tabba <fuad.tabba@linux.dev>,
	Joey Gouly <joey.gouly@arm.com>,
	Steffen Eiden <seiden@linux.ibm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] KVM: arm64: Enable S1PIE for hVHE
Date: Wed, 09 Sep 2026 15:29:29 +0100	[thread overview]
Message-ID: <86zexq7b1y.wl-maz@kernel.org> (raw)
In-Reply-To: <e3c716c2-66ef-4dd0-bcae-6df4ff814e48@sirena.org.uk>

On Wed, 09 Sep 2026 13:17:33 +0100,
Mark Brown <broonie@kernel.org> wrote:
> 
> > > +alternative_if ARM64_HAS_TCR2
> > > +	ldr	x1, [x0, #NVHE_INIT_TCR2_EL2]
> > > +	msr	REG_TCR2_EL2, x1
> > > +alternative_else_nop_endif
> 
> > S1PIE implies TCR2. Why the additional alternatives?
> 
> That is true but TCR2 does not imply S1PIE, I wrote things this way so
> that TCR2 is initialised even if we end up on a system where that is
> present but S1PIE is not (or S1PIE is present but has been disabled by a
> command line override).  This is during startup so it seemed reasonable
> to write things in a straightforward and easy to read fashion.

Fair enough.

> > TBH, I think this is completely going the wrong way. Why can't we
> > write this as a discrete enumeration of the permission combination we
> > support (all 3 of them), and map that to the correct index?
> 
> I was deliberately following a similar pattern to that used for the host
> kernel, intended to minimise code changes.  I will rework so we have an
> alternative path for S1PIE rather than trying to share.

I think it is fine to keep the same indices as the kernel for
permissions that map to something that can be expressed with direct
permissions.

But indirect permissions are not additive, and therefore shouldn't be
constructed as such. They are also more expressive, and there will
be a point where we will want to have other permissions that cannot be
expressed by "emulating" direct permissions (Execute-Only springs to
mind).

At this stage, this is not churn. This is an investment.

	M.

-- 
Without deviation from the norm, progress is not possible.

      reply	other threads:[~2026-09-09 14:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 19:40 Mark Brown
2026-09-09  9:44 ` Marc Zyngier
2026-09-09 12:17   ` Mark Brown
2026-09-09 14:29     ` 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=86zexq7b1y.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=fuad.tabba@linux.dev \
    --cc=joey.gouly@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=oupton@kernel.org \
    --cc=seiden@linux.ibm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    --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

all inboxes | Powered by JetHome®