From: Marc Zyngier <maz@kernel.org>
To: Miguel Luis <miguel.luis@oracle.com>
Cc: Eric Auger <eric.auger@redhat.com>,
"eric.auger.pro@gmail.com" <eric.auger.pro@gmail.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"qemu-arm@nongnu.org" <qemu-arm@nongnu.org>,
"peter.maydell@linaro.org" <peter.maydell@linaro.org>,
"richard.henderson@linaro.org" <richard.henderson@linaro.org>,
"gkulkarni@amperecomputing.com" <gkulkarni@amperecomputing.com>,
"gankulkarni@os.amperecomputing.com"
<gankulkarni@os.amperecomputing.com>
Subject: Re: [PATCH v5 0/5] ARM Nested Virt Support
Date: Tue, 27 May 2025 17:52:41 +0100 [thread overview]
Message-ID: <86frgqdmhy.wl-maz@kernel.org> (raw)
In-Reply-To: <A3872288-67B7-4C99-84F0-19812758FCF0@oracle.com>
On Tue, 27 May 2025 16:55:32 +0100,
Miguel Luis <miguel.luis@oracle.com> wrote:
>
> Hi Marc,
>
> > On 27 May 2025, at 13:46, Marc Zyngier <maz@kernel.org> wrote:
> >
> > On Tue, 27 May 2025 14:24:31 +0100,
> > Miguel Luis <miguel.luis@oracle.com> wrote:
> >>
> >>
> >>
> >>> On 27 May 2025, at 12:02, Marc Zyngier <maz@kernel.org> wrote:
> >>>
> >>> On Tue, 27 May 2025 12:40:35 +0100,
> >>> Miguel Luis <miguel.luis@oracle.com> wrote:
> >>>>
> >>>> Hi Marc,
> >>>>
> >>>>> On 27 May 2025, at 07:39, Marc Zyngier <maz@kernel.org> wrote:
> >>>>>
> >>>>> Hi Eric,
> >>>>>
> >>>>> On Tue, 27 May 2025 07:24:32 +0100,
> >>>>> Eric Auger <eric.auger@redhat.com> wrote:
> >>>>>>
> >>>>>> Now that ARM nested virt has landed in kvm/next, let's turn the series
> >>>>>> into a PATCH series. The linux header update was made against kvm/next.
> >>>>>>
> >>>>>> For gaining virt functionality in KVM accelerated L1, The host needs to
> >>>>>> be booted with "kvm-arm.mode=nested" option and qemu needs to be invoked
> >>>>>> with: -machine virt,virtualization=on.
> >>>>>
> >>>>> Thanks for respinning this series.
> >>>>>
> >>>>> Do you have any plan to support the non-VHE version of the NV support
> >>>>> (as advertised by KVM_CAP_ARM_EL2_E2H0)? It would allow running lesser
> >>>>> hypervisors (such as *cough* Xen *cough*), which completely rely on
> >>>>> HCR_EL2.E2H being 0?
> >>>>>
> >>>>
> >>>> Something that pops up is early_kvm_mode_cfg trying to handle nested mode
> >>>> while KVM_ARM_VCPU_HAS_EL2_E2H0 is set.
> >>>
> >>> Care to elaborate?
> >>>
> >>
> >> Say host is booted in nested mode (kvm-arm.mode=nested) and host's KVM supports
> >> both KVM_CAP_ARM_EL2 and KVM_CAP_ARM_E2H0.
> >>
> >> A L1 guest boots setting both KVM_ARM_VCPU_HAS_EL2 and
> >> KVM_ARM_VCPU_HAS_EL2_E2H0 and guest kernel's command line state
> >> kvm-arm.mode=nested.
> >>
> >> This splats the kernel from early_kvm_mode_cfg along a malformed early option
> >> message.
> >
> > BEBKAC. You are asking for nested on a (virtual) machine that doesn't
> > support it, and the kernel tells you so with a warning. Try the same
> > thing on a physical machine that doesn't have NV, and observe the
> > result.
> >
>
> Ack.
>
> I find trying them a great way to improve resilience.
> I’ve tried the scenarios below which have similar results on the guest:
>
> 1.
> Host: kvm-arm.mode=nested
>
> L1 Guest: kvm-arm.mode=nvhe setting both
> KVM_ARM_VCPU_HAS_EL2 and KVM_ARM_VCPU_HAS_EL2_E2H0
>
> Result on the guest: No early_kvm_mode_cfg splat, boot proceeds, ends up in a hard lockup splat.
Setting kvm-arm.mode=nvhe when KVM_ARM_VCPU_HAS_EL2_E2H0 is set is a
tautology. The very definition of nVHE is that HCR_EL2.E2H=0.
>
> 2.
> Host: kvm-arm.mode=nested
>
> L1 Guest: kvm-arm.mode=nested setting both
> KVM_ARM_VCPU_HAS_EL2 and KVM_ARM_VCPU_HAS_EL2_E2H0
>
> Result on the guest: Splat at early_kvm_mode_cfg, boot proceeds, ends up in hard lockup splat.
I don't see any of these lockups with kvmtool. See this:
https://pastebin.com/uyYzsBHc
for an example of a boot with both capabilities set and the nonsense
"nested" on the command-line (your #2).
> Does this means there’s a default fallback mode in which nv gets on when
> kvm-arm.mode fed to the guest kernel cmdline differs from the expected?
I don't understand your question. We have two modes of operation:
- HAS_EL2 enables NV on the host, and additionally enables recursive
NV. As a consequence, HCR_EL2.E2H is RES1. This is how NV will be
supported long term.
- HAS_EL2_E2H0 restricts the above by not exposing NV to the guest,
and enforcing HCR_EL2.E2H to be RES0. I expect this to gradually be
removed from implementations, and eventually disappear.
As you can see, there is no "fallback mode". You pick the mode you
want based on the guest you want to run and the capabilities of the
hardware.
M.
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2025-05-27 16:53 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-27 6:24 [PATCH v5 0/5] ARM Nested Virt Support Eric Auger
2025-05-27 6:24 ` [PATCH v5 1/5] linux-headers: Update against kvm/next Eric Auger
2025-05-27 6:24 ` [PATCH v5 2/5] hw/arm: Allow setting KVM vGIC maintenance IRQ Eric Auger
2025-05-27 6:24 ` [PATCH v5 3/5] target/arm/kvm: Add helper to detect EL2 when using KVM Eric Auger
2025-05-27 6:24 ` [PATCH v5 4/5] target/arm: Enable feature ARM_FEATURE_EL2 if EL2 is supported Eric Auger
2025-05-27 6:24 ` [PATCH v5 5/5] hw/arm/virt: Allow virt extensions with KVM Eric Auger
2025-06-17 14:17 ` Alyssa Ross
2025-06-17 14:52 ` Eric Auger
2025-06-17 15:10 ` Eric Auger
2025-06-17 15:23 ` Miguel Luis
2025-06-17 15:41 ` Eric Auger
2025-06-17 15:50 ` Miguel Luis
2025-06-19 9:40 ` Eric Auger
2025-06-19 13:29 ` Eric Auger
2025-06-19 16:04 ` Alyssa Ross
2025-06-20 16:20 ` Miguel Luis
2025-05-27 7:39 ` [PATCH v5 0/5] ARM Nested Virt Support Marc Zyngier
2025-05-27 9:05 ` Eric Auger
2025-05-27 11:40 ` Miguel Luis
2025-05-27 12:02 ` Marc Zyngier
2025-05-27 13:24 ` Miguel Luis
2025-05-27 13:46 ` Marc Zyngier
2025-05-27 15:55 ` Miguel Luis
2025-05-27 16:52 ` Marc Zyngier [this message]
2025-05-27 23:52 ` Miguel Luis
2025-05-28 8:07 ` Marc Zyngier
2025-06-19 8:19 ` Eric Auger
2025-06-19 8:33 ` Miguel Luis
2025-05-27 11:33 ` Miguel Luis
2025-05-27 12:01 ` Marc Zyngier
2025-05-27 12:54 ` Miguel Luis
2025-05-27 13:11 ` Eric Auger
2025-05-27 14:15 ` 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=86frgqdmhy.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=eric.auger.pro@gmail.com \
--cc=eric.auger@redhat.com \
--cc=gankulkarni@os.amperecomputing.com \
--cc=gkulkarni@amperecomputing.com \
--cc=miguel.luis@oracle.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.