From nobody Mon Nov 23 14:26:22 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jY7Xv0mkZz6w4jw for ; Mon, 23 Nov 2026 14:26:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4jY7Xv0Fgjz4gNp for ; Mon, 23 Nov 2026 14:26:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795443983; h=from:from: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; bh=hLkW7FELohkzzmwYW47R8eyOJt8E9p0Z/bBR87A2z9c=; b=dP9lCIJYvhLwnCWvA1njCPae5IvMXz7su1BMX296Bw82WAa0ut5HbuwqiPr7iIdHKvgdMm ktRP+L/hbEizCA2ur304m9Xiz+4eODWuqIlKszEi4ewoBCBiUz7N4CF9fZplzGT3iRwtHZ VFHqlaqRVWmL7m85wBw0wXzn4v5hcbhTtU7gPZgrmppcbzGq1iYeB+6AxzcjJmdC67q2Rk h+P1uyapYlptHYal6f/oBS48o48PyaO87l0olfme7QtWz8FSDY5eUyS3nfr4ehbegpAjah o/Cy8V483gFXgwfhwioe0RfpAMdy22X+6euMPSQipZ/b7J7tsum1Zya/Imf57w== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795443983; b=Dj1y6eUG6+9lyhnClIRPJM6sMejlgbZpCW8yhST43GPMDsA19KQUqhvXCLEl4YGzzE53PE n8gmHjD1foTHYxFeXy4mv/xrmSkT78RUmCqXMLj2mPgP+JaMlYMv0+W8WevlOOjAwovqKQ vFLlZ3At80oQutrQBE7LKArZgzsAHcdlwPWmyvJjw6ZjcoS4/CN5ffkjxwYztFL55kYwgm ztZ6nhVsXorm9cbusOzIhs385VzVPUMsNFn7E5YnfRnvfS2pJGjGe61GMrTU9PqhsWMvP1 SwLVmbiYQuZ1er7YhYLQA/D5AcZxum4uhrCJ7d8kRvOHGvUWjj11C4VgZf/oBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795443983; h=from:from: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; bh=hLkW7FELohkzzmwYW47R8eyOJt8E9p0Z/bBR87A2z9c=; b=GFjFBFuMOKMJvfeMib2SdYMVQAh8gDtHABWQg9C7mXcQ0HD9V7dzEOYXfpiSaBSI0d1Zx8 YYboXa/rb6GAmo82KhBY0RV272NwWEB506FUVnmi82vSErP2HN82F7kS46SgggcmOl0GEh puQPtDq+BRH9lLUj4XlyBDuGB4Iltsk7Yf/xjtEC+j2vc19k2pGfwAPDWn+RrPcCzjs1j4 lCWjv2rjv9ShXnWShBcVH/6KPI4oB7y374s8/ghG1fkKqKr88UEgfLgIojUiHdmTQdKGHT XNzR7nykjVdHFAdY20xWmFH6stlThZ9Pot3Cx+M4Ji2L7xDu5nSE81nbWUwBkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jY7Xt71x2zvPw for ; Mon, 23 Nov 2026 14:26:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e431 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 23 Nov 2026 14:26:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: R. Christian McDonald Subject: git: 36f7e87007da - main - amd64: Mark the BSP as a small core List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rcm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 36f7e87007da16b8f45b65b923b854eef50d9894 Auto-Submitted: auto-generated Date: Mon, 23 Nov 2026 14:26:22 +0000 Message-Id: <6b044d0e.e431.5fde208d@gitrepo.freebsd.org> The branch main has been updated by rcm: URL: https://cgit.FreeBSD.org/src/commit/?id=36f7e87007da16b8f45b65b923b854eef50d9894 commit 36f7e87007da16b8f45b65b923b854eef50d9894 Author: R. Christian McDonald AuthorDate: 2026-11-23 14:22:59 +0000 Commit: R. Christian McDonald CommitDate: 2026-11-23 14:22:59 +0000 amd64: Mark the BSP as a small core cpu_init_small_core() records in the pcpu area that a CPU is an Intel small (Atom) core, and that it needs the workaround for INVLPG not flushing global TLB entries when PCID is enabled. hammer_time() calls it for the BSP before the BSP has a pcpu area: the temporary one is zeroed and installed only later, and pmap_bootstrap() then replaces it with the final one, zeroed again. The BSP therefore never has pc_small_core or pc_pcid_invlpg_workaround set, while the APs, which call it from initializecpu(), do. On a hybrid machine the BSP is normally a large core and nothing is missing. On a machine with small cores only, such as an Atom C1110 or x7809C, the BSP is one of them, and its invalidations of kernel mappings in pmap_invlpg(), pmap_invalidate_range() and the shootdown handler go without the workaround. Do it in amd64_bsp_pcpu_init1() instead, which runs for both of the BSP's pcpu areas once %gs points at them. The PCID features and tunables it depends on are still evaluated first. Reviewed by: kib, markj Fixes: a2c08eba43a2 ("amd64: be more precise when...") MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D61804 --- sys/amd64/amd64/machdep.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 04204fa74c11..a9d4144ace48 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1247,6 +1247,7 @@ amd64_bsp_pcpu_init1(struct pcpu *pc) PCPU_SET(gs32p, &gdt[GUGS32_SEL]); PCPU_SET(ucr3_load_mask, PMAP_UCR3_NOMASK); PCPU_SET(smp_tlb_gen, 1); + cpu_init_small_core(); } void @@ -1399,13 +1400,8 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) pmap_pcid_enabled = 0; invpcid_works = (cpu_stdext_feature & CPUID_STDEXT_INVPCID) != 0; - /* - * Now we can do small core initialization, after the PCID - * CPU features and user knobs are evaluated. - */ TUNABLE_INT_FETCH("vm.pmap.pcid_invlpg_workaround", &pmap_pcid_invlpg_workaround_uena); - cpu_init_small_core(); if ((cpu_feature2 & CPUID2_XSAVE) != 0) { use_xsave = 1;