From nobody Sun Dec 22 02:42:33 2024 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=1733913971; cv=none; d=zohomail.com; s=zohoarc; b=nZcKRZTWYfh6YdVKRRN2TWwTb/PlFHHkUC1uRLZzdIwJ5B9DKdCanjX5tnmulgRursRPhNf66fqKXRydJp1lllBJwex26QyxNuJCDE7Jp8IPnCCnnA8y8TwdAW1ANI4U1p1FlcFmTAH9jA35eNhERLYEGQRB3Rb1VMUhls84JyM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733913971; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Subject:Subject:To:To:Message-Id:Cc; bh=KOy1ObSW8e1/CVS4NAlabHq/mo90UwfCgCiHl6e+wmk=; b=FTc32ogtFnuEdU1Jjr/bF7+Q31F5qDaeC3mo60NUpowjtFlIlD9NShIZ7QV8hCCfOcGYNNSXLMw23BzodO38RWOwNx23fqiBYkDOGoJaPxiL3Uw0WT8PPuUSVK5pNGJE0CMBxcm2abv2Cb85Q4vmrLRMYJTGNaCDkx4YPD6iGVs= 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 1733913971870245.54158339794833; Wed, 11 Dec 2024 02:46:11 -0800 (PST) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id D409E274CA; Wed, 11 Dec 2024 10:46:06 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id 70ED020483 for ; Wed, 11 Dec 2024 10:45:52 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by smtp-out2.suse.de (Postfix) with ESMTP id 050CF1F38C for ; Wed, 11 Dec 2024 10:45:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seabios.org; s=dkim; t=1733913968; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:list-id:list-owner:list-unsubscribe:list-subscribe:list-post; bh=KOy1ObSW8e1/CVS4NAlabHq/mo90UwfCgCiHl6e+wmk=; b=5kNVuuaNMD58H0LFxBc/eISCg+XRTcQnjCogov7no45E5oAgVTKvUdzWrXs/KL0YDzW5+i Gq4cF+RnBgafgfnMEDlfECDYbjoDzwQQmp5fPH+H82v9sIFtBz7XVbVhAEXFESsF2XCVCJ HL3BB3htBEKHY7JWcAQLhOEfLJg3N60= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1733913952; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=5Paww2Ec+CploCrSYwZIr67uuy1/9AUspATFDcx3gS0=; b=SdkcO/U9qj1qfXeihPAEH/Ajjd7SS2zjT+hy/xLDBy/c4HFKBNtEA9xW6kAZpeYTad5CGH Tvhy91OxrmiJxsC9AM6UKMjC9JmD8U7qtVKE45vqnsQg6UHuSCQXzQ5jled1lbm+H17/hE cQM+B48Ae2w/YfV0E6bBstr3Z6kMTIk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1733913952; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=5Paww2Ec+CploCrSYwZIr67uuy1/9AUspATFDcx3gS0=; b=SdkcO/U9qj1qfXeihPAEH/Ajjd7SS2zjT+hy/xLDBy/c4HFKBNtEA9xW6kAZpeYTad5CGH Tvhy91OxrmiJxsC9AM6UKMjC9JmD8U7qtVKE45vqnsQg6UHuSCQXzQ5jled1lbm+H17/hE cQM+B48Ae2w/YfV0E6bBstr3Z6kMTIk= To: seabios@seabios.org Date: Wed, 11 Dec 2024 11:36:42 +0100 Message-ID: <20241211103642.133358-1-ailiop@suse.com> MIME-Version: 1.0 X-Spam-Score: -2.52 X-Spamd-Result: default: False [-2.52 / 50.00]; BAYES_HAM(-2.86)[99.39%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_SHORT(-0.06)[-0.289]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_ZERO(0.00)[0]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; FUZZY_BLOCKED(0.00)[rspamd.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_NONE(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:mid,suse.com:email] X-Spam-Flag: NO X-Spam-Level: * Message-ID-Hash: QI6V7KZ5JQW7ZY4RNC7X3VVHKD7GTP3G X-Message-ID-Hash: QI6V7KZ5JQW7ZY4RNC7X3VVHKD7GTP3G 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 X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [SeaBIOS] [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: 1733913973924116600 Content-Type: text/plain; charset="utf-8" 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. 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). 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. Fix this by lifting the restriction of only populating the mptable with the first logical processor per package. [1] commit 4a0af2930a4e ("machine: Prefer cores over sockets in smp parsing since 6.2") Fixes: c0ad0e8febe5 ("Only add the first logical CPU in each physical CPU to the MPS tables.") Signed-off-by: Anthony Iliopoulos --- src/fw/mptable.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/fw/mptable.c b/src/fw/mptable.c index 47385cc5d32d..a939743691c9 100644 --- a/src/fw/mptable.c +++ b/src/fw/mptable.c @@ -47,19 +47,13 @@ mptable_setup(void) cpuid_signature =3D 0x600; cpuid_features =3D 0x201; } - int pkgcpus =3D 1; - if (cpuid_features & (1 << 28)) { - /* Only populate the MPS tables with the first logical CPU in - each package */ - pkgcpus =3D (ebx >> 16) & 0xff; - pkgcpus =3D 1 << (__fls(pkgcpus - 1) + 1); /* round up to power of= 2 */ - } + u8 apic_version =3D readl((u8*)BUILD_APIC_ADDR + 0x30) & 0xff; =20 // CPU definitions. struct mpt_cpu *cpus =3D (void*)&config[1], *cpu =3D cpus; int i; - for (i =3D 0; i < MaxCountCPUs; i+=3Dpkgcpus) { + for (i =3D 0; i < MaxCountCPUs; i++) { memset(cpu, 0, sizeof(*cpu)); cpu->type =3D MPT_TYPE_CPU; cpu->apicid =3D i; --=20 2.47.0 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org