From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 13BE1C61DC6 for ; Thu, 27 Aug 2026 12:56:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wzZeP-0003V4-0f; Thu, 27 Aug 2026 08:56:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wzZeM-0003U8-R5 for qemu-arm@nongnu.org; Thu, 27 Aug 2026 08:56:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wzZeK-0001c8-OX for qemu-arm@nongnu.org; Thu, 27 Aug 2026 08:56:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787835368; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=54KayOJzLDH0Va2lz6kNgaPxDQZ+bDW52CI0gZFnU7c=; b=PYQg0Ir+G/eb0/tjeZQJ8MaF4+DHxI5GYAqWCUrVkLUNli0isoAoB6vhwvebowBmGcwrP+ fu14U8XwH9CcVNP7YQ+OqfZACCqmrtC4VBHFFF9Vp1Tl8rwIiJJ58vtYWOLWkhd4IVFPLT B5/Q6+DibukhyZFgkDebH9Y3s70z+R8= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-673-agKZOUFPPv6q_Vq8uTpk-w-1; Thu, 27 Aug 2026 08:56:04 -0400 X-MC-Unique: agKZOUFPPv6q_Vq8uTpk-w-1 X-Mimecast-MFC-AGG-ID: agKZOUFPPv6q_Vq8uTpk-w_1787835363 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E56CF180AEDF; Thu, 27 Aug 2026 12:56:02 +0000 (UTC) Received: from redhat.com (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 669ED434; Thu, 27 Aug 2026 12:55:59 +0000 (UTC) Date: Thu, 27 Aug 2026 13:55:56 +0100 From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= To: Mathieu Poirier 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 Message-ID: References: <20260728192630.240375-1-mathieu.poirier@linaro.org> <20260728192630.240375-19-mathieu.poirier@linaro.org> MIME-Version: 1.0 In-Reply-To: <20260728192630.240375-19-mathieu.poirier@linaro.org> User-Agent: Mutt/2.4.0 (2026-06-19) X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 X-Mimecast-MFC-PROC-ID: KEa0sXUrOe6V2hjOwjNCq0UhdT24NGVz5_M7iT4DVyw_1787835363 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Errors-To: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org Sender: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org On Tue, Jul 28, 2026 at 01:26:24PM -0600, Mathieu Poirier wrote: > From: Jean-Philippe Brucker > > 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 > Signed-off-by: Mathieu Poirier > --- > 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 :|