From: Marc Zyngier <maz@kernel.org>
To: "Liao, Chang" <liaochang1@huawei.com>
Cc: <corbet@lwn.net>, <catalin.marinas@arm.com>, <will@kernel.org>,
<akpm@linux-foundation.org>, <paulmck@kernel.org>,
<pawan.kumar.gupta@linux.intel.com>, <mingo@kernel.org>,
<bp@alien8.de>, <kees@kernel.org>, <arnd@arndb.de>,
<fvdl@google.com>, <broonie@kernel.org>, <oliver.upton@linux.dev>,
<yeoreum.yun@arm.com>, <james.morse@arm.com>, <ardb@kernel.org>,
<hardevsinh.palaniya@siliconsignals.io>,
<linux-doc@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] arm64: Add kernel parameter to disable trap EL0 accesses to IMPDEF regs
Date: Wed, 22 Oct 2025 09:05:59 +0100 [thread overview]
Message-ID: <867bwnwec8.wl-maz@kernel.org> (raw)
In-Reply-To: <a3663aaf-14c9-4601-90e2-49650af90d7a@huawei.com>
On Wed, 22 Oct 2025 02:35:02 +0100,
"Liao, Chang" <liaochang1@huawei.com> wrote:
>
> 在 2025/10/21 20:25, Marc Zyngier 写道:
> > On Tue, 21 Oct 2025 12:54:28 +0100,
> > Liao Chang <liaochang1@huawei.com> wrote:
> >>
> >> Add kernel parameter to allow system-wide EL0 access to IMPDEF system
> >> regregisters and instructions without trapping to EL1/EL2. Since trap
> >> overhead will compromises benefits, and it's even worse in
> >> virtualization on CPU where certain IMPDEF registers and instructions
> >> are designed for EL0 performance use.
> >
> > Since you mention virtualisation, I want to be clear: there is no way
> > I will consider anything like this for KVM. KVM will always trap and
> > UNDEF such register accesses, no matter where they come from (EL0 or
> > EL1).
> >
> > Allowing such registers to be accessed from within a guest would make
> > it impossible to context-switch or save/restore the guest correctly.
>
> You've got that right, it seems like both the guest and the host would
> need to save and restore those IMDDEF registers with the VM or task
> context.The only exception would be if the registers aren't for saving
> state or configuration, but instead just act as an interface to trigger
> a special CPU function, such as ICC_IAR1.
Funny that you mention the IAR register. Because contrary to what you
seem to indicate, IAR does impact state outside of simply acknowledging
an interrupt. What do you think happens to PMR, APRs, and so on?
M.
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2025-10-22 8:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-21 11:54 [PATCH] arm64: Add kernel parameter to disable trap EL0 accesses to IMPDEF regs Liao Chang
2025-10-21 12:25 ` Marc Zyngier
2025-10-22 1:35 ` Liao, Chang
2025-10-22 8:05 ` Marc Zyngier [this message]
2025-10-22 8:35 ` Liao, Chang
2025-10-22 2:37 ` Liao, Chang
2025-10-22 8:44 ` Marc Zyngier
2025-10-22 5:26 ` Yicong Yang
2025-10-22 9:25 ` Liao, Chang
2025-10-22 10:15 ` Yicong Yang
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=867bwnwec8.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=ardb@kernel.org \
--cc=arnd@arndb.de \
--cc=bp@alien8.de \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=corbet@lwn.net \
--cc=fvdl@google.com \
--cc=hardevsinh.palaniya@siliconsignals.io \
--cc=james.morse@arm.com \
--cc=kees@kernel.org \
--cc=liaochang1@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=paulmck@kernel.org \
--cc=pawan.kumar.gupta@linux.intel.com \
--cc=will@kernel.org \
--cc=yeoreum.yun@arm.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;
as well as URLs for NNTP newsgroup(s).