From nobody Tue Oct 17 13:37:06 2023 X-Original-To: dev-commits-src-main@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 4S8w4y286Hz4xWNZ; Tue, 17 Oct 2023 13:37:06 +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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S8w4y1h6Pz3FmM; Tue, 17 Oct 2023 13:37:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697549826; 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=9oOjgKnE3+I/Q9Zy3ViLHo5gNHJ4ZLG0FJoljmFxwgE=; b=N4Va8yKaicDvB1swl864xR+smv4fgOhzvc5HgDEqJmM+Qm0lXmhLTj7UAXYt3NSwoUWig5 WM4RIXqCyM5uqTid1GrE0TUiEjXNPLX26RaHZCykphuLUxgvjDD7R7IY6KUJrKn+d+yVPi EgiuZ/W9pkuxLKsa3ZIcOs0cQzSFoPAxxIttoW4v9o3R9+eDIourOwQP+W6/yBosjbu0I5 UiRcF/VP4XOmNWnJJRPnCSYTpy75CZC6JrrFm33fqSSqh1BZFnF8nG5bl1nUFtVc31HSv5 UcvEw1xMZoh/WrCEV7hAMwX8UJxYUVtaKzgRrNtBYwaXqyPb+lThLYaBcSjLCw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697549826; a=rsa-sha256; cv=none; b=xs/8adL7L3lNp3Qba2jBjVIo9i+evh2vmJ+7BC6J0zXNAuUNfoLUOBySvKGskTJDQ424P2 cPT9hLo5TAEeqCTqvdPA9iqFvcqbORNl+26qhlTX/F5SRBdycnXEpXeYcK7YSXRwFGH6Zg k9Wbi22SHgJMGD+6kkIhmF+XdnbVaEP3F3W/MqCukGr/6jfZOdyvMiI5UOX/N9pslCqeOP mX0FodgDZ4ulydCutUXjq4QKIj5/2MNI8oGx3ZyaVFMgXDC5R1BkZKjCKRAdmPlf/whe9N giSYIbaqukA1egqNfWYLw/DwkH/Jd1+9PjKPGzuRAo1C8N/dUtD552qtUBoZQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697549826; 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=9oOjgKnE3+I/Q9Zy3ViLHo5gNHJ4ZLG0FJoljmFxwgE=; b=CypOVB66wj5OHlwmBKIFVDsYzpqpjsPNHQ11o2rj2H4x7FP23D+ijf/X339401BXxJ/wKK 91/yqDEKK5RRziptdmCT/eX2NQ1suqBnRekRwOu5lmk/ZfW1KPq4PAywZvIl4+nMTtQ+vF OAk9DS1Szgf0clXFors9TxNSWvUc5IHEJWLTL3tEyUbR0+GcVBISjrQS7n4thM/o13SYDY YJXJSvxJ3ZsE5Bcqg60IGQ82OVZLsf0YHMgaSRtCIY1t0BIsWO6RABhKRShrLQmbLfT41r T4GDAD5nn7tknBInasPBRu0aNeypHd00WBNT+B3lb0RUs/FINUOSUVwrt8eojA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4S8w4y0kFVz9Q5; Tue, 17 Oct 2023 13:37:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 39HDb6Fx095731; Tue, 17 Oct 2023 13:37:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39HDb67k095728; Tue, 17 Oct 2023 13:37:06 GMT (envelope-from git) Date: Tue, 17 Oct 2023 13:37:06 GMT Message-Id: <202310171337.39HDb67k095728@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: a37e484d0497 - main - amd64: Zero-fill AP PCPU pages List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a37e484d049758c70f2d61be0d28a115b6f2f01e Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a37e484d049758c70f2d61be0d28a115b6f2f01e commit a37e484d049758c70f2d61be0d28a115b6f2f01e Author: Mark Johnston AuthorDate: 2023-10-16 22:40:21 +0000 Commit: Mark Johnston CommitDate: 2023-10-17 13:12:08 +0000 amd64: Zero-fill AP PCPU pages At least KMSAN relies on zero-initialization of AP PCPU regions, see commit 4b136ef259ce. Prior to commit af1c6d3f3013 these were allocated with allocpages() in the amd64 pmap, which always returns zero-initialized memory. Reviewed by: kib Fixes: af1c6d3f3013 ("amd64: do not leak pcpu pages") MFC after: 3 days Sponsored by: Klara, Inc. Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D42241 --- sys/amd64/amd64/mp_machdep.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index ec4501c3aeed..d506ffada4b9 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -300,11 +300,12 @@ amd64_mp_alloc_pcpu(void) m = NULL; if (vm_ndomains > 1) { m = vm_page_alloc_noobj_domain( - acpi_pxm_get_cpu_locality(cpu_apic_ids[cpu]), 0); + acpi_pxm_get_cpu_locality(cpu_apic_ids[cpu]), + VM_ALLOC_ZERO); } if (m == NULL) #endif - m = vm_page_alloc_noobj(0); + m = vm_page_alloc_noobj(VM_ALLOC_ZERO); if (m == NULL) panic("cannot alloc pcpu page for cpu %d", cpu); pmap_qenter((vm_offset_t)&__pcpu[cpu], &m, 1);