From nobody Tue Feb 13 11:51:47 2024 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 4TZ06X0X0mz5B7F6; Tue, 13 Feb 2024 11:51:48 +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 4TZ06W6zFXz44VY; Tue, 13 Feb 2024 11:51:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707825108; 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=1eyl+0TqIHNIYEiesJz8fh/H3FDsdmPB+o/VafX5Src=; b=pAA7wIBl2tneDT0AA5y2PnMrY8dM06hDzpw37Kaf51n9qQDGIJN9E2QwmFlRWIPbL/1uWl HpkndQqoWIuY1GMljXJ3DPDvySVsqHZlqcFkSX9h8WQPufYQD9ZlMpbVfUP23BeVTAdCiz 5pWY8Cu7ox+953r+CIH+D5cje23QeGtHcV69TSgnQWLp1gFql6CU4k2w5YmYw+Q9mG9rTy TMAjmR3FGULdHo6cGdgjfv5ODyKd5HA/Ad8mJDNBq4etVrjUHCRkACIvy9ZDEOj6XF3sGl QM0iHYM4A0m0UuA8zepoUh74V5XtDkQ8j7YsjuR2QYFodpzmKq+Q2EF74vdz3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707825108; a=rsa-sha256; cv=none; b=lOM38W/s1H9AfYZMuZlKBkefmizFVfj6ugnwx6MdwgRFgICVaBW7UZp5r7KLzUSrQDmhwd Lgz1x9dzDuCP2aEu+QPKJkoLRbVZuHDoRXofwMBqSRmQl0O6L0JRbYQS6b/d353yINeHkJ +cj8GDWzzqE9KZmGOnhLjfoQJvJvRCxLCFNAFNu1gaMQaeYIzTKc6x0XbraX/AD4LiQcVJ C4Psh1nwKAaAbKY3h7MdBKwBf/jjQxX7Ev+QRYzzoAafDZRgBIaoPRfcmvzN8NkxWdNfkJ /AaJj6c3ipd9gVlR5v5x63/wyBqNlW/MY3FRf26jV1qtfI21aCBM//yR9yLQTA== 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=1707825108; 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=1eyl+0TqIHNIYEiesJz8fh/H3FDsdmPB+o/VafX5Src=; b=QGNWPf4J4ytRKJ2tW5DjttuaZNzKZ1sktX42Qi920OJflo6G2b06VhPHDR8EA0hD9wLOUJ Yoy7cUnzKWMMHC4oIh27RbdQlZ5+i48T4zg+BVMnbGE+inXDoLrPJ+ZKet11//XrJHUPzW hYpr9l5sCmHDxdoPasFOq2+QqoLhYlPd3f+i/hjqIOXhhaahqrko3mVPzJr/SYQwQVQ8a0 PVJPgvRWcXA1WUgJjR6L4yXK5TVthijk19BRQUtOIh6XqeBcc/cosIOXofm+o835tTdSRU 3veoCo1MsAvVEODmf3+uq30NbZYfSUCyVSrSLSZmoWMGXdLXJt3Yhc80fmM6IQ== 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 4TZ06W62D7z1Chj; Tue, 13 Feb 2024 11:51:47 +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 41DBplAS045757; Tue, 13 Feb 2024 11:51:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41DBplR0045754; Tue, 13 Feb 2024 11:51:47 GMT (envelope-from git) Date: Tue, 13 Feb 2024 11:51:47 GMT Message-Id: <202402131151.41DBplR0045754@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 639a626b4050 - main - arm: Clean up socdev_va 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: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 639a626b40503f81a184ccd93fb9bc023f86a3fd Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=639a626b40503f81a184ccd93fb9bc023f86a3fd commit 639a626b40503f81a184ccd93fb9bc023f86a3fd Author: Andrew Turner AuthorDate: 2024-01-08 14:43:32 +0000 Commit: Andrew Turner CommitDate: 2024-02-13 11:48:52 +0000 arm: Clean up socdev_va Support socdev_va on arm and ensure the variable is available on arm64. Reviewed by: imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D43359 --- sys/arm/arm/machdep.c | 8 ++++++++ sys/arm/include/machdep.h | 7 +++++++ sys/arm64/arm64/machdep.c | 9 +++++++++ 3 files changed, 24 insertions(+) diff --git a/sys/arm/arm/machdep.c b/sys/arm/arm/machdep.c index 999e47fd381a..c36953c513be 100644 --- a/sys/arm/arm/machdep.c +++ b/sys/arm/arm/machdep.c @@ -134,6 +134,14 @@ static delay_func *delay_impl; static void *delay_arg; #endif +#if defined(SOCDEV_PA) +#if !defined(SOCDEV_VA) +#error SOCDEV_PA defined, but not SOCDEV_VA +#endif +uintptr_t socdev_va = SOCDEV_VA; +#endif + + struct kva_md_info kmi; /* * arm32_vector_init: diff --git a/sys/arm/include/machdep.h b/sys/arm/include/machdep.h index f999cce12b47..45e44a65368b 100644 --- a/sys/arm/include/machdep.h +++ b/sys/arm/include/machdep.h @@ -51,6 +51,13 @@ void arm_add_efi_map_entries(struct efi_map_header *efihdr, struct mem_region *mr, int *mrcnt); #endif +#ifdef SOCDEV_PA +/* + * The virtual address SOCDEV_PA is mapped at. + */ +extern uintptr_t socdev_va; +#endif + /* * Symbols created by ldscript.arm which are accessible in the kernel as global * symbols. They have uint8 type because they mark the byte location where the diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index 92f9e5692be4..9ce1c40b674c 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -138,6 +138,15 @@ struct kva_md_info kmi; int64_t dczva_line_size; /* The size of cache line the dc zva zeroes */ int has_pan; +#if defined(SOCDEV_PA) +/* + * This is the virtual address used to access SOCDEV_PA. As it's set before + * .bss is cleared we need to ensure it's preserved. To do this use + * __read_mostly as it's only ever set once but read in the putc functions. + */ +uintptr_t socdev_va __read_mostly; +#endif + /* * Physical address of the EFI System Table. Stashed from the metadata hints * passed into the kernel and used by the EFI code to call runtime services.