From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.70542.1674206699835552578 for ; Fri, 20 Jan 2023 01:25:00 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SnVs/O4I; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674206698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KcllZUSaHB0lySA6WiiquZ019H6jqykEeFWAYE/8wj0=; b=SnVs/O4I90i/6fk0iiXqGPdgAB6Xd9wo16SBc619IbPQA6m3wnhXUMh5K1tnkfFmjqBckX 3Qa1puHlL3XQWOhi8JyyWmX10n54n0hNdrJpbNKQr1DGmrYRC4h1CbadYrDwQyln4bT57h wuEd4b1TomxEAOGfN4ugLUx6oLWYiZE= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-101-qxZ44dCpNxuMdEy3qAyELw-1; Fri, 20 Jan 2023 04:24:55 -0500 X-MC-Unique: qxZ44dCpNxuMdEy3qAyELw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1326D3815F7C; Fri, 20 Jan 2023 09:24:55 +0000 (UTC) Received: from [10.39.192.173] (unknown [10.39.192.173]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9F2AF140EBF6; Fri, 20 Jan 2023 09:24:53 +0000 (UTC) Message-ID: Date: Fri, 20 Jan 2023 10:24:52 +0100 MIME-Version: 1.0 Subject: Re: [RFC PATCH] OvmfPkg/PlatformCI VS2019: Enable temporary workaround for cpuhp bugfix To: Ard Biesheuvel , devel@edk2.groups.io, Oliver Steffen Cc: Gerd Hoffmann , Jiewen Yao , Michael Brown , Michael Kubacki References: <20230119134302.1524569-1-ardb@kernel.org> From: "Laszlo Ersek" In-Reply-To: <20230119134302.1524569-1-ardb@kernel.org> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 1/19/23 14:43, Ard Biesheuvel wrote: > QEMU for x86 has a nasty CPU hotplug bug of which the ramifications are > difficult to oversee, even though KVM acceleration seems to be > unaffected. This has been addressed in QEMU mainline, and will percolate > through the ecosystem at its usual pace. In the mean time, due to the > potential impact on production workloads, we will be updating OVMF to > abort the boot when it detects a QEMU build that is affected. > > Tiancore's platform CI uses QEMU in TCG mode, and is therefore impacted > by this mitigation, unless its QEMU builds are updated. This has been > done for Ubuntu-GCC5, but Windows-VS2019 still uses a QEMU build that is > affected. > > Aborting the boot upon detecting the QEMU issue will render all boot > tests carried out on Windows-VS2019 broken unless we implement the > 'escape hatch' that enables proceed-at-your-own-risk mode, and permits > the boot to proceed even if the QEMU issue is detected. > > So let's enable this for Windows-VS2019, and remove it again once it is > no longer needed. > > Cc: Laszlo Ersek > Cc: Gerd Hoffmann > Cc: Jiewen Yao > Cc: Michael Brown > Cc: Oliver Steffen > Cc: Michael Kubacki > > Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=4250 > Signed-off-by: Ard Biesheuvel > --- > OvmfPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml | 2 +- > OvmfPkg/PlatformCI/PlatformBuildLib.py | 12 ++++++++++++ > 2 files changed, 13 insertions(+), 1 deletion(-) > > diff --git a/OvmfPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml b/OvmfPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml > index 7e63f419b26b..b3b91aa84ea0 100644 > --- a/OvmfPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml > +++ b/OvmfPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml > @@ -24,7 +24,7 @@ jobs: > package: 'OvmfPkg' > vm_image: 'windows-2019' > should_run: true > - run_flags: "MAKE_STARTUP_NSH=TRUE QEMU_HEADLESS=TRUE" > + run_flags: "MAKE_STARTUP_NSH=TRUE QEMU_HEADLESS=TRUE QEMU_CPUHP_QUIRK=TRUE" > > #Use matrix to speed up the build process > strategy: > diff --git a/OvmfPkg/PlatformCI/PlatformBuildLib.py b/OvmfPkg/PlatformCI/PlatformBuildLib.py > index bfef9849c749..58dc1189a2cc 100644 > --- a/OvmfPkg/PlatformCI/PlatformBuildLib.py > +++ b/OvmfPkg/PlatformCI/PlatformBuildLib.py > @@ -170,6 +170,7 @@ class PlatformBuilder( UefiBuilder, BuildSettingsManager): > self.env.SetValue("PRODUCT_NAME", "OVMF", "Platform Hardcoded") > self.env.SetValue("MAKE_STARTUP_NSH", "FALSE", "Default to false") > self.env.SetValue("QEMU_HEADLESS", "FALSE", "Default to false") > + self.env.SetValue("QEMU_CPUHP_QUIRK", "FALSE", "Default to false") > return 0 > > def PlatformPreBuild(self): > @@ -211,6 +212,17 @@ class PlatformBuilder( UefiBuilder, BuildSettingsManager): > args += " -pflash " + os.path.join(OutputPath_FV, "OVMF.fd") # path to firmware > > > + ### > + ### NOTE This is a temporary workaround to allow platform CI to cope with > + ### a QEMU bug in the CPU hotplug code. Once the CI environment has > + ### been updated to carry a fixed version of QEMU, this can be > + ### removed again > + ### > + ### Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=4250 > + ### > + if (self.env.GetValue("QEMU_CPUHP_QUIRK").upper() == "TRUE"): > + args += " -fw_cfg name=opt/org.tianocore/X-Cpuhp-Bugcheck-Override,string=yes" > + > if (self.env.GetValue("MAKE_STARTUP_NSH").upper() == "TRUE"): > f = open(os.path.join(VirtualDrive, "startup.nsh"), "w") > f.write("BOOT SUCCESS !!! \n") Reviewed-by: Laszlo Ersek Technically speaking, can I merge this *prepended* to my v3 patch set ([PATCH v3 0/2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression), in the *same* PR? Because then I'll do that, saving us a bit of duplicated work. I'll then also file the BZ for reverting this (once I know the commit hash), for when a new QEMU is out for Windows -- whom should I assign that BZ? Oliver or Ard? Thanks! Laszlo