From nobody Fri Feb 02 14:31:49 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 4TRJBF44G9z58rnT; Fri, 2 Feb 2024 14:31:49 +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 4TRJBF3bT0z4FlB; Fri, 2 Feb 2024 14:31:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706884309; 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=0ObAFCB1zFsbCnDGggwxXRneIPWrRYp5NcbhijgzHsk=; b=qyxcudluhBGa61G1LtU7aB2JbAz1tEd5oQzXAc3U4pC3Pw31SAGL6B/5PUb4wvNZVJhIet Rge0zJ7WDY2uqf4qYkYu1VNMlB6ryk89fl4phz8nQvCmYDwp159EzdkInrhpaSyrMpLbqJ eMzgp5cHW4RaVwoFTKXfWpqoghYKiMbTIzmptmmYYNfwzuQDrBT98KvAw33RbyfXx9x6IQ B0pksEgyFaIS3yDyOSvX4QdQw+/MUkv9T9up5vYv3gskaMAlS5U8z6k/LHKih5gEDs+xpQ 7DD4U8fn7UscRz+SX2gMvBYR9UmS4+FM1vwaK1+MjygWvoW17qUQN0XWgDwYsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706884309; 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=0ObAFCB1zFsbCnDGggwxXRneIPWrRYp5NcbhijgzHsk=; b=XlybGtJAXv1F9Gf5L6sskmrsuHcjYAa2ajaT/Gxv5qP0VuSpTuGcgVzavqUNeZT0PsrbIC 1/0xTQOLzq5mLGT1A0fIxhahx57gLy63l0xlV1x2t0fF8k/bk5jmosotAiZTCAXJbidqC4 mJb37y8uNcDS8jaL/bR8CdDV4pnitRLJrGlmfJwdcC415LyKiLAb0J0EBA9FrPfj0LEcov UQ53JRutbbKcd5oxcz9Fu2aqY0gd4CWkfOO4fg7rsq299Vqoh7duicygpDrErEadAbJSVo ELlHPNZkU767my9t5o9as5eOXjpyfRSI74fYKOwWPW3zdkCnvfuqLwab5Wo8ew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706884309; a=rsa-sha256; cv=none; b=kVcKPwB0f7Td3Y5kaJdjpCtQcKxZhzSIlWmxqZmhnyptDRXYQet1RfLGx0E9AguJTOEYkJ GVy+fOxPGXbWe1BzpvixAGsSoOnhTuX4K+f1xxBzL3UuCy9Awox+wNPlPLDg3kHNqEDq8B Elbv823nsGU8oBcCmdlTXwAPEZ5eSpYuzFg6mrzwyqWcPI273UuwqBPCVmkLEj0nd+PxG3 JCRBlRPEjzbhPZOMKnRVTGkKnAJMi8NsNodgVbeI6HKK4x4PhVmH0cjzuPeg4eXUXBdLmW KFAvk9ya+4knbHBrFEjR27GQ/4dOT5RmfZxxt9+dchrlMQFQEja6y0S2C3O9YA== 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 4TRJBF2j9YzYbp; Fri, 2 Feb 2024 14:31:49 +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 412EVnhW098323; Fri, 2 Feb 2024 14:31:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 412EVnwR098320; Fri, 2 Feb 2024 14:31:49 GMT (envelope-from git) Date: Fri, 2 Feb 2024 14:31:49 GMT Message-Id: <202402021431.412EVnwR098320@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 40adc2787879 - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 40adc2787879f9b0cd5e61e3042e96b0ee30f95a Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=40adc2787879f9b0cd5e61e3042e96b0ee30f95a commit 40adc2787879f9b0cd5e61e3042e96b0ee30f95a Author: Mark Johnston AuthorDate: 2024-01-26 15:35:40 +0000 Commit: Mark Johnston CommitDate: 2024-02-02 14:31:08 +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 (cherry picked from commit 90372a9e3cda838914bc8518dbc4340906351e98) --- 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 09bfc7aa5685..bf531ab6ae56 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -498,7 +498,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 0da7eea8d982..ac925f13f069 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 @@ -151,7 +156,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 @@ -886,7 +893,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 320223c43345..9849a58dd070 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -7834,12 +7834,6 @@ pmap_is_valid_memattr(pmap_t pmap __unused, vm_memattr_t mode) #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 1789588210c3..bb226df2099c 100644 --- a/sys/arm64/include/pmap.h +++ b/sys/arm64/include/pmap.h @@ -194,7 +194,6 @@ struct arm64_bootparams; void pmap_bootstrap_san(vm_paddr_t); void pmap_san_enter(vm_offset_t); -void pmap_san_bootstrap(struct arm64_bootparams *); #endif #endif /* _KERNEL */