From nobody Thu Jan 30 21:44:09 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=pass(p=reject dis=none) header.from=seabios.org ARC-Seal: i=1; a=rsa-sha256; t=1735212190; cv=none; d=zohomail.com; s=zohoarc; b=n+rBDyT3eMpl0dgAy/hM+7RYnHPSqEc2Gx8W1WSTPwcTkd74dtD8tXo8yTCOWtOqNyQ+wrynrX5a4P+Sh1FIH/1kFTcsogShi1s2g6x8ZeRGM3x+te5UAMW0nO3+pwZx6Irb4tIbwOKJNK8objOJVntPJ6oIncQt49r3TMhqejk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1735212190; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=LaCER0KrFEa/BNw/fEKnjJBXV5Jm1cOuNPlzFXASawo=; b=cX28t9JTahbjn4DTjBnhAxaK05/hevmMFh3ihqHiln+gofrkAULz8rE7YwYCeqZDLgocXFJkQrZuRuZWr/7YZUMobjpR8veWsSIFlUEWNq9NpNRsvut1bnolSHZB/8bagbZOIK8OuOIAEjUqQsTwzncUVOYtTeK6t5L/J5WzWHA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from coreboot.org (78.46.105.101 [78.46.105.101]) by mx.zohomail.com with SMTPS id 1735212189993582.1535010955539; Thu, 26 Dec 2024 03:23:09 -0800 (PST) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id EAEC62202F; Thu, 26 Dec 2024 11:23:04 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id 39FE4211AE for ; Thu, 26 Dec 2024 11:22:49 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id A4EFB336F6; Thu, 26 Dec 2024 11:22:48 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 665C313999; Thu, 26 Dec 2024 11:22:48 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by imap1.dmz-prg2.suse.org with ESMTPSA id DCMwFYg8bWf+IAAAD6G6ig (envelope-from ); Thu, 26 Dec 2024 11:22:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seabios.org; s=dkim; t=1735212186; h=from:from:sender:reply-to: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:list-id:list-owner: list-unsubscribe:list-subscribe:list-post; bh=LaCER0KrFEa/BNw/fEKnjJBXV5Jm1cOuNPlzFXASawo=; b=HemmT3KIPG3MTKbdgGLGrSffUG1o1I4HMjpjaGVk1/WHTtEjDdxG/+WQoPJitZ5EnnrjkV I0pUz5JASGznWUT1YIelAoJXBZHjOE/4HcaRM5EuL8/lswsyziPTTTzzVgvqbVFiNOkzz3 lNJkl2Q34DVH7MaDL6soMZsFpnb8G2w= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1735212168; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=L5WzEINk0gqRgvqHVOIQ4ipiy2Qab/h0Y8TXzqkHkTA=; b=nN88O5gBJh9rghoa4G536lQKSxSdC75TdB6WKIPk3aSn55t6qea7KGTRbClEDrjxgaw/+a KVuRfQDXCwcSau31DieXbcAq2VZSIscPP+19rhlcD02M1Kn2Ebi70fez1QcsHtzh+NZnFE Tr3XAwBgCQsJj8MHe44ugWqR3srzsjk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1735212168; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=L5WzEINk0gqRgvqHVOIQ4ipiy2Qab/h0Y8TXzqkHkTA=; b=nN88O5gBJh9rghoa4G536lQKSxSdC75TdB6WKIPk3aSn55t6qea7KGTRbClEDrjxgaw/+a KVuRfQDXCwcSau31DieXbcAq2VZSIscPP+19rhlcD02M1Kn2Ebi70fez1QcsHtzh+NZnFE Tr3XAwBgCQsJj8MHe44ugWqR3srzsjk= Date: Thu, 26 Dec 2024 12:22:43 +0100 To: Kevin O'Connor Message-ID: References: <20241211103642.133358-1-ailiop@suse.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Score: -3.79 X-Spamd-Result: default: False [-3.79 / 50.00]; BAYES_HAM(-2.99)[99.96%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; RCVD_VIA_SMTP_AUTH(0.00)[]; MISSING_XM_UA(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email] X-Spam-Flag: NO X-Spam-Level: Message-ID-Hash: F7WBLZ2B5V3UOA2AIOSYWTRIXWPYL3P7 X-Message-ID-Hash: F7WBLZ2B5V3UOA2AIOSYWTRIXWPYL3P7 X-MailFrom: ailiop@suse.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-seabios.seabios.org-0; header-match-seabios.seabios.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: seabios@seabios.org X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [SeaBIOS] Re: [PATCH] fw/mptable: fix smp core initialization per cpu package List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Anthony Iliopoulos via SeaBIOS Reply-To: Anthony Iliopoulos Content-Transfer-Encoding: quoted-printable Authentication-Results: coreboot.org; auth=pass smtp.auth=mailman@coreboot.org smtp.mailfrom=seabios-bounces@seabios.org X-Spamd-Bar: / X-ZohoMail-DKIM: pass (identity @seabios.org) X-ZM-MESSAGEID: 1735212191348116600 Content-Type: text/plain; charset="utf-8" On Tue, Dec 24, 2024 at 06:55:19PM -0500, Kevin O'Connor wrote: > On Wed, Dec 11, 2024 at 11:36:42AM +0100, Anthony Iliopoulos via SeaBIOS = wrote: > > Currently the mptable setup code only considers one core per cpu package > > for populating the cpu tables. The detection logic goes back to machines > > where the cpuid would signify the presence of multiple logical cores > > (HT) and presumably this change was made to prevent creating vcpus for > > each hyperthread. > >=20 > > In practice this restriction is not required any longer especially since > > current processors feature many physical cores per socket, and it is > > preventing QEMU guests that don't enable ACPI from seeing more than one > > cores, unless those cores are explicitly placed across multiple sockets > > (one core per socket, specifically). > >=20 > > During v6.2 QEMU changed the default cpu topology arrangement preference > > from arranging multiple cores spreaded across multiple sockets to > > placing them within the same socket [1]. In practice this means that > > without specifing explicitly the cpu topology and assuming QEMU > > defaults, a guest without ACPI will not be able to instantiate more than > > one core. > >=20 > > Fix this by lifting the restriction of only populating the mptable with > > the first logical processor per package. > >=20 > > [1] commit 4a0af2930a4e ("machine: Prefer cores over sockets in smp > > parsing since 6.2") > >=20 > > Fixes: c0ad0e8febe5 ("Only add the first logical CPU in each physical > > CPU to the MPS tables.") > >=20 > > Signed-off-by: Anthony Iliopoulos >=20 > Alas, we found that we can't maintain these files - anytime we make > any change (for better or worse) it causes backwards compatibility > problems with clients. If you look at the top of mptable.c you'll > find: What are those other clients, out of curiosity? AFAICT other than qemu it is only bochs that may be leveraging it (although not by default). > // DO NOT ADD NEW FEATURES HERE. (See paravirt.c / biostables.c instead.) >=20 > So, if a change is needed to the mptable then code will be needed to > generate the desired table in qemu and pass it through to SeaBIOS. I assume you mean via the fw_cfg interface entries, but in paravirt.c there's the other comment: // List of QEMU fw_cfg entries. DO NOT ADD MORE. (All new content // should be passed via the fw_cfg "file" interface.) Also since qemu is already passing all the necessary info (CFG_MAX_CPUS), t= here shouldn't be any need to construct and pass any new entries, what about something simpler along the lines of the following diff: diff --git a/src/fw/mptable.c b/src/fw/mptable.c index 47385cc5d32d..76d2213d4b30 100644 --- a/src/fw/mptable.c +++ b/src/fw/mptable.c @@ -12,6 +12,7 @@ #include "hw/pci_regs.h" // PCI_INTERRUPT_PIN #include "malloc.h" // free #include "output.h" // dprintf +#include "paravirt.h" // runningOnQEMU #include "romfile.h" // romfile_loadint #include "std/mptable.h" // MPTABLE_SIGNATURE #include "string.h" // memset @@ -48,7 +49,7 @@ mptable_setup(void) cpuid_features =3D 0x201; } int pkgcpus =3D 1; - if (cpuid_features & (1 << 28)) { + if (cpuid_features & (1 << 28) && !runningOnQEMU()) { /* Only populate the MPS tables with the first logical CPU in each package */ pkgcpus =3D (ebx >> 16) & 0xff; Regards, Anthony _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org