From nobody Tue Feb 10 15:46:15 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; 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=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1682257145; cv=none; d=zohomail.com; s=zohoarc; b=ICbt4yXTZsEIy3Jii5Z4qICXFMhbjF4lkrKEF3cv1j6WqRCiL9s4QU60OAZjZIITLudbuO/AEsY4BG3PG/9U7wUwi6dRS5uwZvSzW7DFYoCY6fvNPdlcfJ8WpAt22DuHPJVwVXdRpRvc6hNcMU+l9jS8pKGiRjdbbyRKYNZQaHg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682257145; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=h3tb8JRjP14UCjGDsCmXQ1C/pI/Y64T1M6APvyDhQEA=; b=XI+oEQAE2WOWl7Rnhpznxb+8fIXub90KPx9rg7UQ44c2ZCqw7dvXY+40jJVglCeqWRxFxzgtquNkvn4n5zcHDDWSI+T6bbYgwADDqw4k7EyRDby+/KDEP0Fdd4vbqcXGou9lz98WG84gqYDEo79tnayZxdh/HahavFWU+jy0hNI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; 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 1682257145386253.9446416513282; Sun, 23 Apr 2023 06:39:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pqZuy-0001fU-EE; Sun, 23 Apr 2023 09:38:16 -0400 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 1pqWVY-0001RH-Rh for qemu-devel@nongnu.org; Sun, 23 Apr 2023 05:59:48 -0400 Received: from mga05.intel.com ([192.55.52.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pqWVW-0008LD-3J for qemu-devel@nongnu.org; Sun, 23 Apr 2023 05:59:48 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2023 02:59:42 -0700 Received: from intel-optiplex-7090.sh.intel.com ([10.67.104.162]) by orsmga003.jf.intel.com with ESMTP; 23 Apr 2023 02:59:41 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682243986; x=1713779986; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Dxp49splJXZs6OXaQAJeS2e5dUjiddxJp6EqfgMNFvo=; b=kHqFUvcU2hmyRo/d3JeQ44qBfNAhpUuhHs/o9wxlfQ0A7oCzgOoTGlJ8 q9aRaMHHoD6jvuvuQ9IsmG8iOaN2kV3bkwMNs+Si4BVmKKE2TRRAO52rF 0PTyrXMt2FqFnUSQR2PDF4rCLSC5sxdmjE9hZvCLYC1ILIxj1naXhz6y5 IOu2YV2bJG3+XltJq8cgmz/T4BztyIKOjXvWEkND4O16iPaRZOUJeqVce tD7zvhl0BLromC1BZW82inv9fpW1SuROXeVcPcO0i+dxrF3tY5p1lAUc6 +Q+drU5t5aeQW2KsivjE00iH91V3ecmjY56MIADHpZ/9m1PQiW3mEk2JU w==; X-IronPort-AV: E=McAfee;i="6600,9927,10688"; a="432542849" X-IronPort-AV: E=Sophos;i="5.99,220,1677571200"; d="scan'208";a="432542849" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10688"; a="643004682" X-IronPort-AV: E=Sophos;i="5.99,220,1677571200"; d="scan'208";a="643004682" From: Yong Li To: qemu-devel@nongnu.org Cc: Yong Li , "Zhiwei Liu" Subject: [PATCH] hw/riscv/virt: Fix the boot logic if pflash0 is specified Date: Sun, 23 Apr 2023 17:59:38 +0800 Message-Id: <20230423095938.3232631-1-yong.li@intel.com> X-Mailer: git-send-email 2.25.1 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=192.55.52.43; envelope-from=yong.li@intel.com; helo=mga05.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 23 Apr 2023 09:38:11 -0400 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 @intel.com) X-ZM-MESSAGEID: 1682257146472100001 Content-Type: text/plain; charset="utf-8" The firmware may be specified with -bios and the plfash0 device with option -drive if=3Dpflash. If both options are applied, it is intented that the pflash0 will store the secure variable and the firmware be the one specified by -bios. Explicitly specify "-bios none" if choose to boot from pflash0 Signed-off-by: Yong Li Cc: "Zhiwei Liu" --- hw/riscv/virt.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 4e3efbee16..b38b41e685 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -1296,10 +1296,12 @@ static void virt_machine_done(Notifier *notifier, v= oid *data) kernel_entry =3D 0; } =20 - if (drive_get(IF_PFLASH, 0, 0)) { + if (drive_get(IF_PFLASH, 0, 0) && + !strcmp(machine->firmware, "none")) { /* - * Pflash was supplied, let's overwrite the address we jump to aft= er - * reset to the base of the flash. + * If pflash (unit 0) was supplied and at the same time the -bois + * is not specified, then let's overwrite the address we jump to + * after reset to the base of the flash. */ start_addr =3D virt_memmap[VIRT_FLASH].base; } --=20 2.25.1