Re: [edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

2023-01-18 Thread Laszlo Ersek
On 1/18/23 14:10, Gerd Hoffmann wrote: > Hi, > >> ... you could introduce a new fw_cfg boolean switch (and explain it in >> the hang message) that meant: "I know what this QEMU bug is, I >> understand its consequences are obscure, risky, and far-reaching in >> OVMF, I've been warned, I know what

Re: [edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

2023-01-18 Thread Laszlo Ersek
On 1/18/23 14:10, Ard Biesheuvel wrote: > On Wed, 18 Jan 2023 at 12:50, Laszlo Ersek wrote: >> >> On 1/18/23 08:25, Gerd Hoffmann wrote: >>> On Tue, Jan 17, 2023 at 05:43:53PM +0100, Ard Biesheuvel wrote: On Tue, 17 Jan 2023 at 13:37, Gerd Hoffmann wrote: > > Hi, > In

Re: [edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

2023-01-18 Thread Ard Biesheuvel
On Wed, 18 Jan 2023 at 12:50, Laszlo Ersek wrote: > > On 1/18/23 08:25, Gerd Hoffmann wrote: > > On Tue, Jan 17, 2023 at 05:43:53PM +0100, Ard Biesheuvel wrote: > >> On Tue, 17 Jan 2023 at 13:37, Gerd Hoffmann wrote: > >>> > >>> Hi, > >>> > >> In particular the firmware makes no further dec

Re: [edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

2023-01-18 Thread Gerd Hoffmann
Hi, > ... you could introduce a new fw_cfg boolean switch (and explain it in > the hang message) that meant: "I know what this QEMU bug is, I > understand its consequences are obscure, risky, and far-reaching in > OVMF, I've been warned, I know what I'm doing". That's a relatively > small additi

Re: [edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

2023-01-18 Thread Laszlo Ersek
On 1/18/23 08:25, Gerd Hoffmann wrote: > On Tue, Jan 17, 2023 at 05:43:53PM +0100, Ard Biesheuvel wrote: >> On Tue, 17 Jan 2023 at 13:37, Gerd Hoffmann wrote: >>> >>> Hi, >>> >> In particular the firmware makes no further decisions based on >> whether QEMU advertized some of these featur

Re: [edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

2023-01-17 Thread Gerd Hoffmann
On Tue, Jan 17, 2023 at 05:43:53PM +0100, Ard Biesheuvel wrote: > On Tue, 17 Jan 2023 at 13:37, Gerd Hoffmann wrote: > > > > Hi, > > > > > >> In particular the firmware makes no further decisions based on > > > >> whether QEMU advertized some of these features. > > > > > > > > I was thinking the

Re: [edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

2023-01-17 Thread Ard Biesheuvel
On Tue, 17 Jan 2023 at 13:37, Gerd Hoffmann wrote: > > Hi, > > > >> In particular the firmware makes no further decisions based on > > >> whether QEMU advertized some of these features. > > > > > > I was thinking the other way around: When cpu hotplug is disabled in > > > qemu it should be safe

Re: [edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

2023-01-17 Thread Gerd Hoffmann
Hi, > >> In particular the firmware makes no further decisions based on > >> whether QEMU advertized some of these features. > > > > I was thinking the other way around: When cpu hotplug is disabled in > > qemu it should be safe to skip the whole cpu hotplug checking dance. > > See test patch b

Re: [edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

2023-01-16 Thread Laszlo Ersek
On 1/13/23 13:22, Gerd Hoffmann wrote: > On Fri, Jan 13, 2023 at 11:10:54AM +0100, Laszlo Ersek wrote: >> On 1/13/23 10:32, Gerd Hoffmann wrote: >>> On Fri, Jan 13, 2023 at 07:03:54AM +0100, Gerd Hoffmann wrote: Hi, > - QEMU can be configured with other compat properties on the

Re: [edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

2023-01-16 Thread Ard Biesheuvel
On Fri, 13 Jan 2023 at 13:22, Gerd Hoffmann wrote: > > On Fri, Jan 13, 2023 at 11:10:54AM +0100, Laszlo Ersek wrote: > > On 1/13/23 10:32, Gerd Hoffmann wrote: > > > On Fri, Jan 13, 2023 at 07:03:54AM +0100, Gerd Hoffmann wrote: > > >> Hi, > > >> > > >>> - QEMU can be configured with other compa

Re: [edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

2023-01-13 Thread Gerd Hoffmann
On Fri, Jan 13, 2023 at 11:10:54AM +0100, Laszlo Ersek wrote: > On 1/13/23 10:32, Gerd Hoffmann wrote: > > On Fri, Jan 13, 2023 at 07:03:54AM +0100, Gerd Hoffmann wrote: > >> Hi, > >> > >>> - QEMU can be configured with other compat properties on the command > >>> line so that "CPU hotplug with S

Re: [edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

2023-01-13 Thread Laszlo Ersek
On 1/13/23 10:32, Gerd Hoffmann wrote: > On Fri, Jan 13, 2023 at 07:03:54AM +0100, Gerd Hoffmann wrote: >> Hi, >> >>> - QEMU can be configured with other compat properties on the command >>> line so that "CPU hotplug with SMI" and "CPU hot-unplug with SMI" *not* >>> be offered to the firmware. Th

Re: [edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

2023-01-13 Thread Gerd Hoffmann
On Fri, Jan 13, 2023 at 07:03:54AM +0100, Gerd Hoffmann wrote: > Hi, > > > - QEMU can be configured with other compat properties on the command > > line so that "CPU hotplug with SMI" and "CPU hot-unplug with SMI" *not* > > be offered to the firmware. Then QEMU will reject hotplug attempts, and

Re: [edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

2023-01-12 Thread Gerd Hoffmann
Hi, > - QEMU can be configured with other compat properties on the command > line so that "CPU hotplug with SMI" and "CPU hot-unplug with SMI" *not* > be offered to the firmware. Then QEMU will reject hotplug attempts, and > the SMM hotplug code in edk2 will not be triggered by the (virtual) > h

Re: [edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

2023-01-12 Thread Michael Brown
On 12/01/2023 17:58, Laszlo Ersek wrote: The case is that both QEMU and edk2 check for each other's supported features. It's a complex interwoven feature set with security impact, which is exactly why we added feature negotiation at every step -- effectively mutual negotiation wherever necessary

Re: [edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

2023-01-12 Thread Laszlo Ersek
On 1/12/23 09:28, Laszlo Ersek wrote: > In QEMU v5.1.0, the CPU hotplug register block misbehaves: the negotiation > protocol is (effectively) broken such that it suggests that switching from > the legacy interface to the modern interface works, but in reality the > switch never happens. The sympto

Re: [edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

2023-01-12 Thread Laszlo Ersek
On 1/12/23 18:58, Laszlo Ersek wrote: > Your proposal is entirely justified, from a practical / user > perspective, but I'm not the right person for it. This should do what you propose (untested), but I hate the code myself. diff --git a/OvmfPkg/Library/PlatformInitLib/Platform.c b/OvmfPkg/Libr

Re: [edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

2023-01-12 Thread Laszlo Ersek
On 1/12/23 17:08, Michael Brown wrote: > On 12/01/2023 13:22, Laszlo Ersek wrote: Detect the issue in PlatformMaxCpuCountInitialization(), and print an error message and *hang* if the issue is present. >>> >>> Would this mean that OVMF would refuse to start with all current >>> distro ver

Re: [edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

2023-01-12 Thread Michael Brown
On 12/01/2023 13:22, Laszlo Ersek wrote: Detect the issue in PlatformMaxCpuCountInitialization(), and print an error message and *hang* if the issue is present. Would this mean that OVMF would refuse to start with all current distro versions of qemu (when not using KVM), or am I misunderstandin

Re: [edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

2023-01-12 Thread Laszlo Ersek
On 1/12/23 11:09, Ard Biesheuvel wrote: > On Thu, 12 Jan 2023 at 10:56, Michael Brown wrote: >> >> On 12/01/2023 08:28, Laszlo Ersek wrote: >>> In QEMU v5.1.0, the CPU hotplug register block misbehaves: the negotiation >>> protocol is (effectively) broken such that it suggests that switching from

Re: [edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

2023-01-12 Thread Laszlo Ersek
On 1/12/23 10:55, Michael Brown wrote: > On 12/01/2023 08:28, Laszlo Ersek wrote: >> In QEMU v5.1.0, the CPU hotplug register block misbehaves: the >> negotiation >> protocol is (effectively) broken such that it suggests that switching >> from >> the legacy interface to the modern interface works,

Re: [edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

2023-01-12 Thread Ard Biesheuvel
On Thu, 12 Jan 2023 at 10:56, Michael Brown wrote: > > On 12/01/2023 08:28, Laszlo Ersek wrote: > > In QEMU v5.1.0, the CPU hotplug register block misbehaves: the negotiation > > protocol is (effectively) broken such that it suggests that switching from > > the legacy interface to the modern inter

Re: [edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

2023-01-12 Thread Michael Brown
On 12/01/2023 08:28, Laszlo Ersek wrote: In QEMU v5.1.0, the CPU hotplug register block misbehaves: the negotiation protocol is (effectively) broken such that it suggests that switching from the legacy interface to the modern interface works, but in reality the switch never happens. The symptom h

[edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression

2023-01-12 Thread Laszlo Ersek
In QEMU v5.1.0, the CPU hotplug register block misbehaves: the negotiation protocol is (effectively) broken such that it suggests that switching from the legacy interface to the modern interface works, but in reality the switch never happens. The symptom has been witnessed when using TCG accelerati