From: Alyssa Ross <hi@alyssa.is>
To: eric.auger@redhat.com, Miguel Luis <miguel.luis@oracle.com>
Cc: "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>,
"maz@kernel.org" <maz@kernel.org>,
"gkulkarni@amperecomputing.com" <gkulkarni@amperecomputing.com>,
"gankulkarni@os.amperecomputing.com"
<gankulkarni@os.amperecomputing.com>
Subject: Re: [PATCH v5 5/5] hw/arm/virt: Allow virt extensions with KVM
Date: Thu, 19 Jun 2025 18:04:11 +0200 [thread overview]
Message-ID: <8734bvyays.fsf@alyssa.is> (raw)
In-Reply-To: <01ab0b6e-ccd5-4465-98c0-70b8ec2ac87a@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2830 bytes --]
Eric Auger <eric.auger@redhat.com> writes:
> Hi,
>
> On 6/17/25 5:50 PM, Miguel Luis wrote:
>> Hi Eric,
>>
>>> On 17 Jun 2025, at 15:41, Eric Auger <eric.auger@redhat.com> wrote:
>>>
>>>
>>>
>>> On 6/17/25 5:23 PM, Miguel Luis wrote:
>>>> Hi Alyssa,
>>>>
>>>>> On 17 Jun 2025, at 14:17, Alyssa Ross <hi@alyssa.is> wrote:
>>>>>
>>>>> Eric Auger <eric.auger@redhat.com> writes:
>>>>>
>>>>>> From: Haibo Xu <haibo.xu@linaro.org>
>>>>>>
>>>>>> Up to now virt support on guest has been only supported with TCG.
>>>>>> Now it becomes feasible to use it with KVM acceleration.
>>>>>>
>>>>>> Also check only in-kernel GICv3 is used along with KVM EL2.
>>>>>>
>>>>>> Signed-off-by: Haibo Xu <haibo.xu@linaro.org>
>>>>>> Signed-off-by: Miguel Luis <miguel.luis@oracle.com>
>>>>>> Signed-off-by: Eric Auger <eric.auger@redhat.com>
>>>>>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>>>>> Hi! From what I can tell, this will produce an error on hosts that
>>>>> don't support nested virtualization when QEMU is invoked with -accel
>>>>> kvm:tcg
>>>> I didn’t know '-acell kvm:tcg’ could be used as a fallback mechanism between
>>>> acceleration modes. May I ask whether do you manage the ‘-cpu’ type for ‘-accel
>>>> kvm:tcg’ with cpu ‘max’ ?
>>> Does it exist?
>>> qemu-system-aarch64: -accel kvm:tcg: invalid accelerator kvm:tcg
>> Maybe Alyssa is referring to ‘-M virt,accel=kvm:tcg,virtualization=on,gic-version=3’ ?
>>
>> The above didn’t triggered any error. Anyhow if the above does what Alyssa’s saying
>> we would just be missing the check for || !tcg_enabled() in this patch, I believe.
>
> After discussion with Paolo, the lack of the CAP should be detected
> earlier in kvm_init/kvm_arch_init to allow the fallback to TCG.
> in target/arm/kvm.c kvm_arch_init() some generic caps are checked but
> none of them are related to machine settings and this code is virt arm
> machine agnostic.
>
> I checked and adding
>
> if (object_dynamic_cast(OBJECT(ms), TYPE_VIRT_MACHINE)) {
> VirtMachineState *vms = VIRT_MACHINE(ms);
>
> if (vms->virt && !kvm_arm_el2_supported()) {
> error_report("KVM does not support nested virtualization");
> ret = -EINVAL;
> }
> }
>
> at the end of the function would do the job. But as I said previously
> this is not done for other virt arm machine options that are accel
> specific or require special KVM caps (secure, mte for instance) so it
> would be a change in the approach.
Right — if it's not done for other options it doesn't need to be done
here either; I wasn't aware of that. It would be nice if QEMU worked
differently, but that's certainly not in scope of this series.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]
next prev parent reply other threads:[~2025-06-19 16:04 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 [this message]
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
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=8734bvyays.fsf@alyssa.is \
--to=hi@alyssa.is \
--cc=eric.auger.pro@gmail.com \
--cc=eric.auger@redhat.com \
--cc=gankulkarni@os.amperecomputing.com \
--cc=gkulkarni@amperecomputing.com \
--cc=maz@kernel.org \
--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.