From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: jordan.l.justen@intel.com) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by groups.io with SMTP; Wed, 24 Jul 2019 10:26:35 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jul 2019 10:26:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,303,1559545200"; d="scan'208";a="174952349" Received: from jpolitsc-mobl1.amr.corp.intel.com (HELO localhost) ([10.254.111.52]) by orsmga006.jf.intel.com with ESMTP; 24 Jul 2019 10:26:34 -0700 MIME-Version: 1.0 In-Reply-To: <8c04a9e0-ac53-0bef-41df-9508b06b09cc@redhat.com> References: <20190724015101.13044-1-rebecca@bsdio.com> <156393689849.9039.6940197421609488727@jljusten-skl> <8c04a9e0-ac53-0bef-41df-9508b06b09cc@redhat.com> Subject: Re: [edk2-devel] [PATCH 1/2] OvmfPkg/build.sh: use newer '-drive if=pflash' syntax when running qemu From: "Jordan Justen" To: Philippe Mathieu-Daudé , Ard Biesheuvel , Laszlo Ersek , devel@edk2.groups.io, rebecca@bsdio.com Message-ID: <156398919445.22585.9417541374118966045@jljusten-skl> User-Agent: alot/0.8 Date: Wed, 24 Jul 2019 10:26:34 -0700 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On 2019-07-24 05:27:28, Philippe Mathieu-Daud=C3=A9 wrote: > On 7/24/19 4:54 AM, Jordan Justen wrote: > > On 2019-07-23 18:51:00, wrote: > >> Specify the firmware to use via the newer '-drive if=3Dpflash' syntax > >> which allows specifying the raw format and readonly parameters. This > >> avoids warnings with newer version of QEMU. > >> > >> Signed-off-by: Rebecca Cran > >> --- > >> OvmfPkg/build.sh | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/OvmfPkg/build.sh b/OvmfPkg/build.sh > >> index a2c4eff2a5..e2890ff762 100755 > >> --- a/OvmfPkg/build.sh > >> +++ b/OvmfPkg/build.sh > >> @@ -268,7 +268,7 @@ if [[ "$RUN_QEMU" =3D=3D "yes" ]]; then > >> fi > >> ln -sf $FV_DIR/OVMF.fd $QEMU_FIRMWARE_DIR/bios.bin > >> if [[ "$ENABLE_FLASH" =3D=3D "yes" ]]; then > >> - QEMU_COMMAND=3D"$QEMU_COMMAND -pflash $QEMU_FIRMWARE_DIR/bios.bin" > >> + QEMU_COMMAND=3D"$QEMU_COMMAND -drive if=3Dpflash,format=3Draw,rea= donly,file=3D$QEMU_FIRMWARE_DIR/bios.bin" > >=20 > > It looks like we set ENABLE_FLASH for qemu 1.6 and newer. Does this > > work on 1.6? > >=20 > > Also, I don't think we want readonly. Read-write should allow > > non-volatile variables to persist across multiple boot. >=20 > This flash only contains the CODE, not the non-volatile VARS, using > readonly makes sense to me. That's not the case here. The build.sh support uses a combined code/vars binary. Originally the qemu pflash support only supported a single binary. At this point we can probably assume that a new enough version of qemu is available that supports multiple pflash devices, so build.sh could be upgraded to use the split binaries. Hmm, it looks like qemu 2.0 is when the multiple flash device support was added: https://wiki.qemu.org/ChangeLog/2.0 The build.sh script currently attempts to detect 1.6 and newer for flash support. pflash first appeared in 1.1, but kvm support was added in 1.6. I think it'd be reasonable to alter the script to not use flash for qemu < 2.0, to enable using separate code and vars binaries. -Jordan