From nobody Fri Jan 26 15:45:36 2024 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 4TM28c6cCFz58MW9; Fri, 26 Jan 2024 15:45:36 +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 4TM28c5drnz4WTt; Fri, 26 Jan 2024 15:45:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706283936; 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=7cv80T7BCn/3ckNonyavIel8kDNZkN/OiHZ2pLseGtk=; b=fBeU3xyZyUEPjK6Mm2IB+HKRdbjLvlt5FtPEa69QKnL8l44eGGeS6hH5cJLamgSeiBT/8+ 3XGMuWOemqOiHRk+0pBPqBE9tIX3EXLfQArljTdoLCAHr3GOPuKDiGc92qsifw1LmQ0Q7T 67d6tJemik2tOFj8pl0aVE91Xsfkev4L2dgsFm028a/OHECeTEW/M+xUFqhlH/3Kkdx4qP wiI1g6dsLxETm9AqNPKWxEYPmxL8yTrWbNvdlUcFPqPzi+7GRy7usK6sbp8VxvtHIQGD6Q pjEx/QTQfRuAiL54UajNGBlZ2uKHvZNdhNs3KlAJUMJQoEZAJqGHv05mKtu5LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706283936; 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=7cv80T7BCn/3ckNonyavIel8kDNZkN/OiHZ2pLseGtk=; b=Rscyt0oP5+xrLbq92Smzjq9qzSthrhwvM4D/uMPcZfYEfgUJU8JJ56tftxVZGgMIJ/8OtQ gAM7nfGYy2nUMW4gzA+7CsU+pqZ1JlGX3GM6GOVbkwpM1YrxyPBkH+MVVjE7lCtQpLDxLH u3KlfS1r7BGvqhpp7cxO39mm3tCNJMr1qNrQ3IWhdnAtkBT49ZrGvOr5nhXXKpGAYap7zg CIBDe37sR4qYGhRk35ff/FH8Vm8Nc9M9xrLFyUSzyt31hbSYnM6hMBEHQTj3m/NnM6EM3w CiiOjzCTOcdseLKo8z049rmtk8m8u2S3+fl0CgZWJ/aI/PjsnTPoFLZuv3K0OQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706283936; a=rsa-sha256; cv=none; b=mZdXldVKjAJcCQPerzrURcisB6qq7AVqI8NgZtDWH2hwO7fv2bylU/XHIUbKQzFH9GCqRL 4Z7c3m16hHIn+/Bkzw+kBarKFbXqjjxx51KgNnrCxl/sJcLNpkWM9y4B6r+iY6S1o8m++s qn6xG3zeqITuU+pt/1E463jb2e5+p6YFy02asT747VIeoqGAA7RjgcPmoZ8kwKUS0LF9VU Q/N/28QMb2ViX25pQqwApFVvl6TDrDQHLBv7+Dw6vkGIgaLMCUbPghg/VDJ38YTPx3NUay z25UFYvPdGJq5V9xuDKEGK6M6eMidJBRvhQmhQiWY9zTr4CmmfgcwpcblAsAyg== 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 4TM28c4hBKznZ6; Fri, 26 Jan 2024 15:45:36 +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 40QFjalg043216; Fri, 26 Jan 2024 15:45:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40QFjaMF043214; Fri, 26 Jan 2024 15:45:36 GMT (envelope-from git) Date: Fri, 26 Jan 2024 15:45:36 GMT Message-Id: <202401261545.40QFjaMF043214@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: 90372a9e3cda - main - arm64: Remove pmap_san_bootstrap() and call kasan_init_early() directly List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: 90372a9e3cda838914bc8518dbc4340906351e98 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=90372a9e3cda838914bc8518dbc4340906351e98 commit 90372a9e3cda838914bc8518dbc4340906351e98 Author: Mark Johnston AuthorDate: 2024-01-26 15:35:40 +0000 Commit: Mark Johnston CommitDate: 2024-01-26 15:42:34 +0000 arm64: Remove pmap_san_bootstrap() and call kasan_init_early() directly pmap_san_bootstrap() doesn't really do much, and it was hard-coding the the bootstrap stack size defined in locore.S. Moreover, the name is a bit confusing given the existence of pmap_bootstrap_san(). Just remove it and call kasan_init_early() directly like we do on amd64. It will not be used by KMSAN in a forthcoming patch series. No functional change intended. MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D43403 --- sys/amd64/include/pmap.h | 1 - sys/arm64/arm64/locore.S | 11 +++++++++-- sys/arm64/arm64/pmap.c | 6 ------ sys/arm64/include/pmap.h | 1 - 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 17df8d0b8fde..cb95b311a3b9 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -495,7 +495,6 @@ void pmap_page_array_startup(long count); vm_page_t pmap_page_alloc_below_4g(bool zeroed); #if defined(KASAN) || defined(KMSAN) -void pmap_san_bootstrap(void); void pmap_san_enter(vm_offset_t); #endif diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index 8b0564298296..b246ed3f2a41 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -45,6 +45,11 @@ #define L3_PAGE_COUNT 32 #endif +/* + * The size of our bootstrap stack. + */ +#define BOOT_STACK_SIZE (KSTACK_PAGES * PAGE_SIZE) + .globl kernbase .set kernbase, KERNBASE @@ -147,7 +152,9 @@ virtdone: mov x19, x0 /* Bootstrap an early shadow map for the boot stack. */ - bl pmap_san_bootstrap + ldr x0, [x0, #BP_KERN_STACK] + ldr x1, =BOOT_STACK_SIZE + bl kasan_init_early /* Restore bootparams */ mov x0, x19 @@ -880,7 +887,7 @@ END(abort) .bss .align PAGE_SHIFT initstack: - .space (PAGE_SIZE * KSTACK_PAGES) + .space BOOT_STACK_SIZE initstack_end: .section .init_pagetable, "aw", %nobits diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 134ad187130c..f44371080c91 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -7864,12 +7864,6 @@ pmap_pte_bti(pmap_t pmap, vm_offset_t va __diagused) #if defined(KASAN) static pd_entry_t *pmap_san_early_l2; -void __nosanitizeaddress -pmap_san_bootstrap(struct arm64_bootparams *abp) -{ - kasan_init_early(abp->kern_stack, KSTACK_PAGES * PAGE_SIZE); -} - #define SAN_BOOTSTRAP_L2_SIZE (1 * L2_SIZE) #define SAN_BOOTSTRAP_SIZE (2 * PAGE_SIZE) static vm_offset_t __nosanitizeaddress diff --git a/sys/arm64/include/pmap.h b/sys/arm64/include/pmap.h index efbf7eaaae91..4b4d47ccc7af 100644 --- a/sys/arm64/include/pmap.h +++ b/sys/arm64/include/pmap.h @@ -194,7 +194,6 @@ struct arm64_bootparams; void pmap_bootstrap_san(void); void pmap_san_enter(vm_offset_t); -void pmap_san_bootstrap(struct arm64_bootparams *); #endif #endif /* _KERNEL */