Linux KVM/arm64 development list
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Wei-Lin Chang <r09922117@csie.ntu.edu.tw>
Cc: Andre Przywara <andre.przywara@arm.com>,
	Will Deacon <will@kernel.org>,
	Julien Thierry <julien.thierry.kdev@gmail.com>,
	kvm@vger.kernel.org, kvmarm@lists.linux.dev,
	Alexandru Elisei <alexandru.elisei@arm.com>
Subject: Re: [PATCH kvmtool v2 5/6] arm64: add FEAT_E2H0 support (TBC)
Date: Sat, 26 Jul 2025 10:19:11 +0100	[thread overview]
Message-ID: <87jz3vtils.wl-maz@kernel.org> (raw)
In-Reply-To: <zbgu6irpeytcpymaxpg55tvijeppfpdpwcju275g3h6bx4u5qn@35vb5ymt55hx>

On Sat, 26 Jul 2025 10:01:25 +0100,
Wei-Lin Chang <r09922117@csie.ntu.edu.tw> wrote:
> 
> Hi all,
> 
> On Fri, Jul 25, 2025 at 05:37:12PM +0100, Marc Zyngier wrote:
> > Hi Andre,
> > 
> > Thanks for picking this. A few nits below.
> > 
> > On Fri, 25 Jul 2025 15:40:59 +0100,
> > Andre Przywara <andre.przywara@arm.com> wrote:
> > > 
> > > From: Marc Zyngier <maz@kernel.org>
> > > 
> > > To reduce code complexity, KVM only supports nested virtualisation in
> > > VHE mode. So to allow recursive nested virtualisation, and be able to
> > > expose FEAT_NV2 to a guest, we must prevent a guest from turning off
> > > HCR_EL2.E2H, which is covered by not advertising the FEAT_E2H0 architecture
> > > feature.
> > > 
> > > To allow people to run a guest in non-VHE mode, KVM introduced the
> > > KVM_ARM_VCPU_HAS_EL2_E2H0 feature flag, which will allow control over
> > > HCR_EL2.E2H, but at the cost of turning off FEAT_NV2.
> > 
> > All of that has been captured at length in the kernel code, and I
> > think this is "too much information" for userspace. I'd rather we
> > stick to a pure description of what the various options mean to the
> > user.
> > 
> > > Add a kvmtool command line option "--e2h0" to set that feature bit when
> > > creating a guest, to gain non-VHE, but lose recursive nested virt.
> > 
> > How about:
> > 
> > "The --nested option allows a guest to boot at EL2 without FEAT_E2H0
> >  (i.e. mandating VHE support). While this is great for "modern"
> >  operating systems and hypervisors, a few legacy guests are stuck in a
> >  distant past.
> > 
> >  To support those, the --e2h0 option exposes FEAT_E2H0 to the guest,
> >  at the expense of a number of other features, such as FEAT_NV2. This
> 
> Just a very small thing:
> 
> Will only mentioning FEAT_NV2 here lead people to think that FEAT_NV is
> still available with --e2h0?
> Maybe s/FEAT_NV2/FEAT_NV/ makes it clearer?

Maybe. On the other hand, we never advertise the old FEAT_NV as such,
irrespective of the state of E2H. This is indicated by
ID_AA64MMFR4_EL1.NV_frac==0b0001 when NV is advertised. So I'm not
sure this changes anything, really.

Thanks,

	M.


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

  reply	other threads:[~2025-07-26  9:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-25 14:40 [PATCH kvmtool v2 0/6] arm64: Nested virtualization support Andre Przywara
2025-07-25 14:40 ` [PATCH kvmtool v2 1/6] Sync kernel UAPI headers with v6.16-rc1 Andre Przywara
2025-07-25 14:40 ` [PATCH kvmtool v2 2/6] arm64: Initial nested virt support Andre Przywara
2025-07-25 14:40 ` [PATCH kvmtool v2 3/6] arm64: nested: add support for setting maintenance IRQ Andre Przywara
2025-07-25 14:40 ` [PATCH kvmtool v2 4/6] arm64: Add counter offset control Andre Przywara
2025-07-26  9:25   ` Marc Zyngier
2025-07-25 14:40 ` [PATCH kvmtool v2 5/6] arm64: add FEAT_E2H0 support (TBC) Andre Przywara
2025-07-25 16:37   ` Marc Zyngier
2025-07-26  9:01     ` Wei-Lin Chang
2025-07-26  9:19       ` Marc Zyngier [this message]
2025-07-26 10:11         ` Wei-Lin Chang
2025-07-26 10:34           ` Marc Zyngier
2025-07-25 14:41 ` [PATCH kvmtool v2 6/6] arm64: Generate HYP timer interrupt specifiers Andre Przywara

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=87jz3vtils.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=alexandru.elisei@arm.com \
    --cc=andre.przywara@arm.com \
    --cc=julien.thierry.kdev@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=r09922117@csie.ntu.edu.tw \
    --cc=will@kernel.org \
    /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