From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: kchamart@redhat.com, pierrick.bouvier@oss.qualcomm.com,
peter.maydell@linaro.org, mst@redhat.com, cohuck@redhat.com,
pbonzini@redhat.com, eblake@redhat.com, armbru@redhat.com,
lorenzo.pieralisi@linaro.org, gshan@redhat.com,
qemu-devel@nongnu.org, qemu-arm@nongnu.org, kvm@vger.kernel.org
Subject: Re: [RFC v2 18/24] hw/arm/virt: Disable DTB randomness for confidential VMs
Date: Thu, 27 Aug 2026 13:55:56 +0100 [thread overview]
Message-ID: <apAz3Ck1ybM9XntA@redhat.com> (raw)
In-Reply-To: <20260728192630.240375-19-mathieu.poirier@linaro.org>
On Tue, Jul 28, 2026 at 01:26:24PM -0600, Mathieu Poirier wrote:
> From: Jean-Philippe Brucker <jean-philippe@linaro.org>
>
> The dtb-randomness feature, which adds random seeds to the DTB, isn't
> really compatible with confidential VMs since it randomizes the Realm
> Initial Measurement. Enabling it is not an error, but it prevents
> attestation. It also isn't useful to a Realm, which doesn't trust host
> input.
>
> Currently the feature is automatically enabled, unless the user disables
> it on the command-line. Change it to OnOffAuto, and automatically
> disable it for confidential VMs, unless the user explicitly enables it.
>
> Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> ---
> docs/system/arm/virt.rst | 9 +++++----
> hw/arm/virt.c | 41 +++++++++++++++++++++++++---------------
> include/hw/arm/virt.h | 2 +-
> 3 files changed, 32 insertions(+), 20 deletions(-)
>
> diff --git a/docs/system/arm/virt.rst b/docs/system/arm/virt.rst
> index 5f6dd1797862..9882b842ddd5 100644
> --- a/docs/system/arm/virt.rst
> +++ b/docs/system/arm/virt.rst
> @@ -238,10 +238,11 @@ dtb-randomness
> rng-seed and kaslr-seed nodes (in both "/chosen" and
> "/secure-chosen") to use for features like the random number
> generator and address space randomisation. The default is
> - ``on``. You will want to disable it if your trusted boot chain
> - will verify the DTB it is passed, since this option causes the
> - DTB to be non-deterministic. It would be the responsibility of
> - the firmware to come up with a seed and pass it on if it wants to.
> + ``off`` for confidential VMs, and ``on`` otherwise. You will want
> + to disable it if your trusted boot chain will verify the DTB it is
> + passed, since this option causes the DTB to be non-deterministic.
> + It would be the responsibility of the firmware to come up with a
> + seed and pass it on if it wants to.
>
> dtb-kaslr-seed
> A deprecated synonym for dtb-randomness.
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index fa6cd62a335c..65ed8573f8b1 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -401,6 +401,7 @@ static int gic_fdt_irq_type_spi(const VirtMachineState *vms)
>
> static void create_fdt(VirtMachineState *vms)
> {
> + bool dtb_randomness = true;
> MachineState *ms = MACHINE(vms);
> int nb_numa_nodes = ms->numa_state->num_nodes;
> void *fdt = create_device_tree(&vms->fdt_size);
> @@ -410,6 +411,16 @@ static void create_fdt(VirtMachineState *vms)
> exit(1);
> }
>
> + /*
> + * Including random data in the DTB causes random intial measurement on CCA,
> + * so disable it for confidential VMs.
> + */
> + if (vms->dtb_randomness == ON_OFF_AUTO_OFF ||
> + (vms->dtb_randomness == ON_OFF_AUTO_AUTO &&
> + virt_machine_is_confidential(vms))) {
> + dtb_randomness = false;
> + }
Is there any valid use case for ON_OFF_AUTO_ON with RME ?
It feels like a miscnofiguration that ought to result in a fatal
error message, rather than booting with a VM config that cannot
be verified due to random measurement
With regards,
Daniel
--
|: https://berrange.com ~~ https://hachyderm.io/@berrange :|
|: https://libvirt.org ~~ https://entangle-photo.org :|
|: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
next prev parent reply other threads:[~2026-08-27 12:56 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-28 19:26 [RFC v2 00/24] Add Realm support to QEMU-VMM Mathieu Poirier
2026-07-28 19:26 ` [RFC v2 01/24] linux-headers: Add RME related definitions Mathieu Poirier
2026-07-30 5:41 ` Kohei Enju
2026-07-30 5:41 ` Kohei Enju via qemu development
2026-07-30 5:41 ` Kohei Enju via
2026-07-30 6:08 ` Gavin Shan
2026-07-30 6:13 ` Kohei Enju
2026-07-30 6:13 ` Kohei Enju via qemu development
2026-07-30 6:13 ` Kohei Enju via
2026-07-28 19:26 ` [RFC v2 02/24] target/arm/kvm: Return immediately on error in kvm_arch_init() Mathieu Poirier
2026-07-28 19:26 ` [RFC v2 03/24] target/arm: Add confidential guest support Mathieu Poirier
2026-07-28 19:26 ` [RFC v2 04/24] target/arm/kvm-rme: Add mechanic to initialize realms Mathieu Poirier
2026-07-28 19:26 ` [RFC v2 05/24] target/arm/kvm: Split kvm_arch_get/put_registers Mathieu Poirier
2026-07-28 19:26 ` [RFC v2 06/24] target/arm/kvm-rme: Initialize vCPU Mathieu Poirier
2026-07-28 19:26 ` [RFC v2 07/24] target/arm/kvm: Create scratch Realm VM when requested Mathieu Poirier
2026-07-28 19:26 ` [RFC v2 08/24] target/arm/kvm: Use kvm_vm_check_extension() where necessary Mathieu Poirier
2026-07-28 19:26 ` [RFC v2 09/24] hw/core/loader: Add a ROM loader notifier Mathieu Poirier
2026-07-28 19:26 ` [RFC v2 10/24] target/arm/kvm-rme: Keep track of images loaded in Realm memory Mathieu Poirier
2026-07-28 19:26 ` [RFC v2 11/24] target/arm/kvm-rme: Populate Realm with runtime images Mathieu Poirier
2026-07-28 19:26 ` [RFC v2 12/24] target/arm/cpu: Set number of breakpoints and watchpoints in KVM Mathieu Poirier
2026-07-28 19:26 ` [RFC v2 13/24] target/arm/cpu: Set number of PMU counters " Mathieu Poirier
2026-07-28 19:26 ` [RFC v2 14/24] target/arm/cpu: Don't read Realm registers Mathieu Poirier
2026-07-28 19:26 ` [RFC v2 15/24] hw/arm/virt: Set proper conduit method for Realms Mathieu Poirier
2026-07-28 19:26 ` [RFC v2 16/24] hw/arm/virt: Embed Realm VM type with IPA address space Mathieu Poirier
2026-07-28 19:26 ` [RFC v2 17/24] hw/arm/virt: Reserve one bit of guest physical address for RME Mathieu Poirier
2026-07-28 19:26 ` [RFC v2 18/24] hw/arm/virt: Disable DTB randomness for confidential VMs Mathieu Poirier
2026-08-27 12:55 ` Daniel P. Berrangé [this message]
2026-07-28 19:26 ` [RFC v2 19/24] hw/arm/virt: Move virt_flash_create() to machvirt_init() Mathieu Poirier
2026-07-28 19:26 ` [RFC v2 20/24] hw/arm/virt: Use RAM instead of flash for confidential guest firmware Mathieu Poirier
2026-07-28 19:26 ` [RFC v2 21/24] target/arm/kvm-rme: Add DMA remapping for the shared memory region Mathieu Poirier
2026-07-28 19:26 ` [RFC v2 22/24] docs/interop/firmware.json: Add arm-rme firmware feature Mathieu Poirier
2026-07-28 19:26 ` [RFC v2 23/24] hw/arm/boot: Load DTB as is for confidential VMs Mathieu Poirier
2026-07-28 19:26 ` [RFC v2 24/24] hw/arm/boot: Skip bootloader for confidential guests Mathieu Poirier
2026-07-30 5:11 ` [RFC v2 00/24] Add Realm support to QEMU-VMM Kohei Enju
2026-07-30 5:11 ` Kohei Enju via qemu development
2026-07-30 5:11 ` Kohei Enju via
2026-08-09 13:06 ` Mathieu Poirier
2026-08-25 21:09 ` Mathieu Poirier
2026-08-27 12:38 ` Kohei Enju
2026-08-27 12:38 ` Kohei Enju via qemu development
2026-08-27 12:38 ` Kohei Enju via
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=apAz3Ck1ybM9XntA@redhat.com \
--to=berrange@redhat.com \
--cc=armbru@redhat.com \
--cc=cohuck@redhat.com \
--cc=eblake@redhat.com \
--cc=gshan@redhat.com \
--cc=kchamart@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=lorenzo.pieralisi@linaro.org \
--cc=mathieu.poirier@linaro.org \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.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.