From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from a7-20.smtp-out.eu-west-1.amazonses.com (a7-20.smtp-out.eu-west-1.amazonses.com [54.240.7.20]) by mx.groups.io with SMTP id smtpd.web10.51124.1673517361096600431 for ; Thu, 12 Jan 2023 01:56:01 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@ipxe.org header.s=cphpx6z2rfcgehlykjjh3gknqe3hsoe2 header.b=P7LHIuUE; spf=pass (domain: eu-west-1.amazonses.com, ip: 54.240.7.20, mailfrom: 01020185a568604c-e16d8581-963a-4ff3-8566-bf0640ad327d-000000@eu-west-1.amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=cphpx6z2rfcgehlykjjh3gknqe3hsoe2; d=ipxe.org; t=1673517359; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=AzlXpjGxQfT414mEMLllZwn5dN+zdiRMAdw0Aqy7zH8=; b=P7LHIuUEaoDUrGbPNzIFe4ZTDHcmoTyKC0Gx4ozFLA3YUPfWDoKoTZFzMXi6dHwy I8MNssgwUMxLWPz15SeAq9DdJ6zyymJMuI8Oo9d5rRArgLuWtNuqNT8pK4D1tQ2Qno8 A5P5mjfauzud3DIiqvuHqpqNRiRr8aHlBxWKNf9J3b87P5HWYnAVEcYMnTOjJbr4Jnw FPdjARRL89gGcoTIR3FVNZQn6PyGUQ0d1RmoYoFGhF3/zKQw29/+zGElCOJMvJOHBiZ PRiEKEtfZzLmzGSvSccj5kMgAFo70bCF3EXHOuvar5f5kWa17aMW9ivXvTgWzWHG48D VO5nIn0mdw== DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ihchhvubuqgjsxyuhssfvqohv7z3u4hn; d=amazonses.com; t=1673517359; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=AzlXpjGxQfT414mEMLllZwn5dN+zdiRMAdw0Aqy7zH8=; b=BbhN4/HzY61Cw/km58KxR/x7bIN28WnvKE1+/WePBTcXBEZPKj5+b2lntE8sRpgb YKN93cTXVL55c1UGRo3o0Qh/uUZRkX8b7OoMEJGaUr/PPIGUjRUvVAMjtvX+c0vGUVz E/cxlOtIr3iswMI0f2wF8rPPUwqLLKv7W4lt2kb8= Message-ID: <01020185a568604c-e16d8581-963a-4ff3-8566-bf0640ad327d-000000@eu-west-1.amazonses.com> Date: Thu, 12 Jan 2023 09:55:59 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [edk2-devel] [PATCH v2] OvmfPkg/PlatformInitLib: catch QEMU's CPU hotplug reg block regression To: devel@edk2.groups.io, lersek@redhat.com Cc: Ard Biesheuvel , Brijesh Singh , Erdem Aktas , Gerd Hoffmann , James Bottomley , Jiewen Yao , Jordan Justen , Min Xu , Oliver Steffen , Sebastien Boeuf , Tom Lendacky References: <20230112082845.128463-1-lersek@redhat.com> From: "Michael Brown" In-Reply-To: <20230112082845.128463-1-lersek@redhat.com> X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on blyat.fensystems.co.uk Feedback-ID: 1.eu-west-1.fspj4M/5bzJ9NLRzJP0PaxRwxrpZqiDQJ1IF94CF2TA=:AmazonSES X-SES-Outgoing: 2023.01.12-54.240.7.20 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 has been witnessed when using TCG > acceleration; KVM seems to mask the issue. The issue persists with the > following (latest) stable QEMU releases: v5.2.0, v6.2.0, v7.2.0. Currently > there is no stable release that addresses the problem. > > The QEMU bug confuses the Present and Possible counting in function > PlatformMaxCpuCountInitialization(), in > "OvmfPkg/Library/PlatformInitLib/Platform.c". OVMF ends up with Present=0 > Possible=1. This in turn further confuses MpInitLib in UefiCpuPkg (hence > firmware-time multiprocessing will be broken). Worse, CPU hot(un)plug with > SMI will be summarily broken in OvmfPkg/CpuHotplugSmm, which (considering > the privilege level of SMM) is not that great. > > 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 misunderstanding? Thanks, Michael