From nobody Sun Sep 14 03:55:57 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1732565081; cv=none; d=zohomail.com; s=zohoarc; b=GGR6qgC0heWjvewfOx7MOyiJWGANjBvMOjl+Rsce5/3SGauP9xMx/TRMhL8aVhEosR5Do1tAoRZhioMBmj3Hk3OUuA1S3JYl90AkiD9Dxfhy9XGl9lpJWptnyJIQQMO6TESTKuo58ANAN+iYXkrOnCqH1uMv2Z1IXMbyupz0EKI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732565081; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DywAE1h0x8RJnjNb6ZyyKOUQTV8+QaXBhNrpy+I4lm8=; b=mb3p1I9o4ZRxJf5vjKmvIPiuSORC44KPqRpBt8qZzqJl4ChIB5bn0TY9pz5JcFkpltwGX6M0HQ5YQbopevdn9+eFsNW0LE9FCFYyih5uUEjTuboIxCvFHr3BeQI+hsZkmMAOflT54CFeAxCR0182QIfBbpHd6kIgJTEIwaTpAe8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732565081495432.730321455118; Mon, 25 Nov 2024 12:04:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFfFQ-0005NH-3P; Mon, 25 Nov 2024 14:59:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tFfFH-0005Ab-Iz for qemu-devel@nongnu.org; Mon, 25 Nov 2024 14:59:43 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFfFA-0004qv-SE for qemu-devel@nongnu.org; Mon, 25 Nov 2024 14:59:43 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3824446d2bcso4300996f8f.2 for ; Mon, 25 Nov 2024 11:59:36 -0800 (PST) Received: from localhost.localdomain ([2.221.137.100]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3825fd0fbdcsm11237971f8f.109.2024.11.25.11.59.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2024 11:59:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732564775; x=1733169575; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DywAE1h0x8RJnjNb6ZyyKOUQTV8+QaXBhNrpy+I4lm8=; b=MuE9dgHEm5E3cWeO0m6XMqf+KqbUiGtMZMzxlQC/sVjcuQ1yNWkATGtqHgN+4alyr/ hGRZCOzS17yR/dJzeHsCiCoMp9VObClkT821EIrpVPpa06LyzylG1FI+MwbebG9ldsix HmQ3wNggxZt35C8jJf+zCM1Pcovvz3u1/LPEmneNKPOzkhwvi3F7MgoftwdwD5ICJPxm R9IUUxmQAmoiFSEVryNxJqEZ9HURud4AR5valJcAu0TLI9Sh40tb/0ZVsISPwVbsuAyL 49wpJCJTAQCYrTkzlBTIBppptRZdWpQblOEstNkzZRS8nSdR7k9Jyw7lO9RV6FYr+jy8 tKgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732564775; x=1733169575; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DywAE1h0x8RJnjNb6ZyyKOUQTV8+QaXBhNrpy+I4lm8=; b=FuaI6WflAXUjf9Rhv9CN13GRRg3kAoJa5+LOGlELlF/RaK7KJ4BhcqChtTsjewfYmD oNeQDaZKMx2c5axHhMauFO2LyC1A5RBdF+lcSrTblyLWIRN5z8D6c+N4X+rhU/B4Waux Hd503gqHmJOGR9TxA/TlZS/HusmwEkyt6KMWHMh/7PIVnYZbKU2vMSTi9Y7HLk8V22gS kuKiMK0aWp9Z85fL/VEPMfo+87FqdQA+SXUG1PO/pU/KPnyQW422rrgCuhEtu7OsTGjF cE/0RpatuOet/QOk8uINeBHNbZhuqlLdoaGXbohaGhx+aRpNM1btv25pEaAacuLijWou xaPg== X-Forwarded-Encrypted: i=1; AJvYcCWj7tXVNawtuAb7NHWWUbpTUJz14QEJjaKCEX5PdFUoOLy8DoeNUyHHYHllgS15i51pZbNI5mvZGag9@nongnu.org X-Gm-Message-State: AOJu0YwXUnJjcSl/IOhTjZWe0asN8gR5/swBmOWy0tpjDwfWL5BJn/S7 Fy7KyIMbuO8pdXbbgVxbCkzGVZbcBtr3QJ7vJlZJ0ZX7UQ4bCSCkOdDbAb3eXMM= X-Gm-Gg: ASbGnctzS6hkZJAYlTo45qcb2RJtjjMiHoQLTiB837YSjtyr1hkiqGpM8VPxUM5o4ck 37Agkrz4fDKLJSHO/6KsIL8rTAqwvBmUUYN9FkfPAO3Q+Az4P4vq1xmn6U21LMVNYGRQXHnrKrk UttI0rnyZavFeyw6Yi5yREiX2qpFxJ3+8+KwtsARIl7f6GscmqKSIv2hI+Utw9x7OXymsnYio73 VGPFWNyIFspptbJBjDJktDHhWknF84XrG8/j5mlo/l2YzaGzUaMwqEw66Fm2NFmVcfW X-Google-Smtp-Source: AGHT+IFcITnBM6NuekDsP94qupu4u1K65i9I9qgzFbjGkHe4n3FTfQzWMtxpGxczoDQxw6ewpdqeIQ== X-Received: by 2002:a05:6000:1788:b0:382:51d7:a2e0 with SMTP id ffacd0b85a97d-38260b61f45mr13353893f8f.27.1732564775393; Mon, 25 Nov 2024 11:59:35 -0800 (PST) From: Jean-Philippe Brucker To: peter.maydell@linaro.org Cc: richard.henderson@linaro.org, philmd@linaro.org, qemu-arm@nongnu.org, qemu-devel@nongnu.org, alex.bennee@linaro.org, Jean-Philippe Brucker Subject: [PATCH v3 19/26] hw/arm/virt: Move virt_flash_create() to machvirt_init() Date: Mon, 25 Nov 2024 19:56:18 +0000 Message-ID: <20241125195626.856992-21-jean-philippe@linaro.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241125195626.856992-2-jean-philippe@linaro.org> References: <20241125195626.856992-2-jean-philippe@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=jean-philippe@linaro.org; helo=mail-wr1-x431.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1732565081914019100 Content-Type: text/plain; charset="utf-8" For confidential VMs we'll want to skip flash device creation. Unfortunately, in virt_instance_init() the machine->cgs member has not yet been initialized, so we cannot check whether confidential guest is enabled. Move virt_flash_create() to machvirt_init(), where we can access the machine->cgs member. Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index eb94997914..c4cf69ea33 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2124,6 +2124,8 @@ static void machvirt_init(MachineState *machine) unsigned int smp_cpus =3D machine->smp.cpus; unsigned int max_cpus =3D machine->smp.max_cpus; =20 + virt_flash_create(vms); + possible_cpus =3D mc->possible_cpu_arch_ids(machine); =20 /* @@ -3359,8 +3361,6 @@ static void virt_instance_init(Object *obj) =20 vms->irqmap =3D a15irqmap; =20 - virt_flash_create(vms); - vms->oem_id =3D g_strndup(ACPI_BUILD_APPNAME6, 6); vms->oem_table_id =3D g_strndup(ACPI_BUILD_APPNAME8, 8); } --=20 2.47.0