From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by mx.groups.io with SMTP id smtpd.web11.45469.1674135792722654352 for ; Thu, 19 Jan 2023 05:43:13 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f174eR+6; spf=pass (domain: kernel.org, ip: 145.40.68.75, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BCFAAB823C4; Thu, 19 Jan 2023 13:43:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43187C433D2; Thu, 19 Jan 2023 13:43:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674135788; bh=4sS8DLlA+oj5EGxe7Jxcd9n4WMfSys1oCebWhobaZJI=; h=From:To:Cc:Subject:Date:From; b=f174eR+68IcxcwuSWYwuqJqc/7YwjqR3TmonpCLvd7p2za+ZzozYey/NgksQ3n10D 9MHG3J5jCMF5zTmwZfsve7c/fqxLLd34/GX6DtpvK5kr2KZ/gL6onUwzh5oNDRYneb kV4nxet/Xr9nfDA22XFObn6pTCcjUJ71vEvfRjhRt/aEt33yYJTBA4QGljN+LV3EnP RgZuVqA7DWMawiuL43oTZrBign+TcYlwBJUDeYQ+08l3bYTqD7NaMIG1/Qo7rpHdl8 FWCzgaun+B5We8nFsxZ5vGVi7RCZBZhsT+ckUzDYBgoUKMEbmEJU4LKzQB+JiVooR+ NYwzL0CiZLAHw== From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Laszlo Ersek , Gerd Hoffmann , Jiewen Yao , Michael Brown , Oliver Steffen , Michael Kubacki Subject: [RFC PATCH] OvmfPkg/PlatformCI VS2019: Enable temporary workaround for cpuhp bugfix Date: Thu, 19 Jan 2023 14:43:02 +0100 Message-Id: <20230119134302.1524569-1-ardb@kernel.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable QEMU for x86 has a nasty CPU hotplug bug of which the ramifications are=0D difficult to oversee, even though KVM acceleration seems to be=0D unaffected. This has been addressed in QEMU mainline, and will percolate=0D through the ecosystem at its usual pace. In the mean time, due to the=0D potential impact on production workloads, we will be updating OVMF to=0D abort the boot when it detects a QEMU build that is affected.=0D =0D Tiancore's platform CI uses QEMU in TCG mode, and is therefore impacted=0D by this mitigation, unless its QEMU builds are updated. This has been=0D done for Ubuntu-GCC5, but Windows-VS2019 still uses a QEMU build that is=0D affected.=0D =0D Aborting the boot upon detecting the QEMU issue will render all boot=0D tests carried out on Windows-VS2019 broken unless we implement the=0D 'escape hatch' that enables proceed-at-your-own-risk mode, and permits=0D the boot to proceed even if the QEMU issue is detected.=0D =0D So let's enable this for Windows-VS2019, and remove it again once it is=0D no longer needed.=0D =0D Cc: Laszlo Ersek =0D Cc: Gerd Hoffmann =0D Cc: Jiewen Yao =0D Cc: Michael Brown =0D Cc: Oliver Steffen =0D Cc: Michael Kubacki =0D =0D Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4250=0D Signed-off-by: Ard Biesheuvel =0D ---=0D OvmfPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml | 2 +-=0D OvmfPkg/PlatformCI/PlatformBuildLib.py | 12 ++++++++++++=0D 2 files changed, 13 insertions(+), 1 deletion(-)=0D =0D diff --git a/OvmfPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml b/OvmfPk= g/PlatformCI/.azurepipelines/Windows-VS2019.yml=0D index 7e63f419b26b..b3b91aa84ea0 100644=0D --- a/OvmfPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml=0D +++ b/OvmfPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml=0D @@ -24,7 +24,7 @@ jobs:=0D package: 'OvmfPkg'=0D vm_image: 'windows-2019'=0D should_run: true=0D - run_flags: "MAKE_STARTUP_NSH=3DTRUE QEMU_HEADLESS=3DTRUE"=0D + run_flags: "MAKE_STARTUP_NSH=3DTRUE QEMU_HEADLESS=3DTRUE QEMU_CPUHP_= QUIRK=3DTRUE"=0D =0D #Use matrix to speed up the build process=0D strategy:=0D diff --git a/OvmfPkg/PlatformCI/PlatformBuildLib.py b/OvmfPkg/PlatformCI/Pl= atformBuildLib.py=0D index bfef9849c749..58dc1189a2cc 100644=0D --- a/OvmfPkg/PlatformCI/PlatformBuildLib.py=0D +++ b/OvmfPkg/PlatformCI/PlatformBuildLib.py=0D @@ -170,6 +170,7 @@ class PlatformBuilder( UefiBuilder, BuildSettingsManage= r):=0D self.env.SetValue("PRODUCT_NAME", "OVMF", "Platform Hardcoded")=0D self.env.SetValue("MAKE_STARTUP_NSH", "FALSE", "Default to false")= =0D self.env.SetValue("QEMU_HEADLESS", "FALSE", "Default to false")=0D + self.env.SetValue("QEMU_CPUHP_QUIRK", "FALSE", "Default to false")= =0D return 0=0D =0D def PlatformPreBuild(self):=0D @@ -211,6 +212,17 @@ class PlatformBuilder( UefiBuilder, BuildSettingsManag= er):=0D args +=3D " -pflash " + os.path.join(OutputPath_FV, "OVMF.fd")= # path to firmware=0D =0D =0D + ###=0D + ### NOTE This is a temporary workaround to allow platform CI to co= pe with=0D + ### a QEMU bug in the CPU hotplug code. Once the CI environme= nt has=0D + ### been updated to carry a fixed version of QEMU, this can b= e=0D + ### removed again=0D + ###=0D + ### Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=3D425= 0=0D + ###=0D + if (self.env.GetValue("QEMU_CPUHP_QUIRK").upper() =3D=3D "TRUE"):= =0D + args +=3D " -fw_cfg name=3Dopt/org.tianocore/X-Cpuhp-Bugcheck= -Override,string=3Dyes"=0D +=0D if (self.env.GetValue("MAKE_STARTUP_NSH").upper() =3D=3D "TRUE"):= =0D f =3D open(os.path.join(VirtualDrive, "startup.nsh"), "w")=0D f.write("BOOT SUCCESS !!! \n")=0D -- =0D 2.39.0=0D =0D