From nobody Tue Apr 16 21:42:44 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 4VJyFJ65Pyz5H7rb; Tue, 16 Apr 2024 21:42:44 +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 4VJyFJ5M18z4YNx; Tue, 16 Apr 2024 21:42:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713303764; 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=ksp2tOHJzZSg9VAvCwU3/Y8lClKPrxAqzTmThxtIxs4=; b=m4mlitHj63sQWD8LH3pOGcL6y7sIgb0m2EL9M9b4iYbf1CUzlSAzIVoOfeOsx9+ctEXD17 6UflFg+lFsAyXRX+TYr8wFpQt6Sr2EX/qeQjdib5h9ySDyrZhCRGv+5pPSrEq2KcfckVOs 5BnRc2uFdzJ8i6kNdEZUPkOZri2Nf44GleNQzr3HtBvI+/bwnCjMo5w+sgdz8coPJr4jdj TXR6EKEeJiMngrRBE93/h04u/rvJWQ5cUHWBplOgh2O9rf4j1jnPCIg0y26+U1nRXZAWcF zgtO6sIUoZ7cY6WWvYqSD5+oDqYBTHA3WgBAPZLfmE/+UJ9NAEQHWJN9XGZNSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713303764; a=rsa-sha256; cv=none; b=VeC5WHQoH1zcENnu+tLZzWT/O6iwN9E8USKoe+2Qzwtqp6I5ZcG6LfA3fmlBeeKqM5EKbi R8HDhv/uUDK6mRj+seNgPeZ/o8gyrLJJ2pLNL6wjSZIvZNnHBk4N8RScXB3qK7zhbhM/eM mXgWgg/nGhEbFjAzBFpsQiy7i7WOKCr6tD1qXWRDdTFJxfEFQJpEpZB7NGfKjhdjCv9uxj xugcVkYVfqlr0FIBDIoNiA93NqIUqcmocLsij+0ysUO/2y0pUDbi1YgG+dOv9AITbiiB3F pB1HwSBiffhXtlr68OzE6HpDKgh2boj1Q9vMD9QU3akcfy5DB/DMNESN8yMuGQ== 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=1713303764; 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=ksp2tOHJzZSg9VAvCwU3/Y8lClKPrxAqzTmThxtIxs4=; b=HS3Wogpk1pakkNWuMxagoHA75XZHzFKwEYJL3T9dp83Z8gTqeFxPvAEXU2wwX7XSoq9z9n BWO33vA4dVasSda1He3SxYhi04geCimWVg9XpKBhT3Ws6LICnROKNthPqxSNRRjNtQlk8j xg5CmOfsZkZlq17jplONFIk2D4MSPrS0x82r67519YFPr88glQwC3sbvhKIxZlxYq3NSTE ar3n/2Hceml0FeU3ucmbiQt8CSAhp50hmj3Wf2tHR3w/af7HTP6kZrtw9A+DbLqNk2POSy SlEZHV490NhNkoZonmJVDkGyV04YHXAAuRKkxs/y4SnKLy3fl2cnJRfeUcaHsQ== 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 4VJyFJ4ySXz10cX; Tue, 16 Apr 2024 21:42:44 +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 43GLgiff094425; Tue, 16 Apr 2024 21:42:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43GLgiTw094422; Tue, 16 Apr 2024 21:42:44 GMT (envelope-from git) Date: Tue, 16 Apr 2024 21:42:44 GMT Message-Id: <202404162142.43GLgiTw094422@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 02eaed648f40 - stable/14 - gicv3: Change how we initialize its children. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 02eaed648f401f2aceaa1cea3fb2ca2e949b47e4 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=02eaed648f401f2aceaa1cea3fb2ca2e949b47e4 commit 02eaed648f401f2aceaa1cea3fb2ca2e949b47e4 Author: Warner Losh AuthorDate: 2024-02-28 14:08:15 +0000 Commit: Warner Losh CommitDate: 2024-04-16 21:27:35 +0000 gicv3: Change how we initialize its children. The current code is written such that all the attach routines can do so in parallel. However, newbus serializes children today, and is likely to do so in the future. Only allocate memory for the first time. Add an assertion that this memory is allocated for larger units. Sponsored by: Netflix Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D44032 (cherry picked from commit 15c8a610a80dfe1980e043174d0fcc8034868676) --- sys/arm64/arm64/gicv3_its.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/sys/arm64/arm64/gicv3_its.c b/sys/arm64/arm64/gicv3_its.c index 777e20649f33..16ea48f49b7f 100644 --- a/sys/arm64/arm64/gicv3_its.c +++ b/sys/arm64/arm64/gicv3_its.c @@ -292,8 +292,6 @@ struct gicv3_its_softc { vm_page_t ma; /* fake msi page */ }; -static void *conf_base; - typedef void (its_quirk_func_t)(device_t); static its_quirk_func_t its_quirk_cavium_22375; @@ -681,20 +679,26 @@ gicv3_its_table_init(device_t dev, struct gicv3_its_softc *sc) static void gicv3_its_conftable_init(struct gicv3_its_softc *sc) { - void *conf_table; - - conf_table = atomic_load_ptr(&conf_base); - if (conf_table == NULL) { - conf_table = contigmalloc(LPI_CONFTAB_SIZE, - M_GICV3_ITS, M_WAITOK, 0, LPI_CONFTAB_MAX_ADDR, - LPI_CONFTAB_ALIGN, 0); + /* note: we assume the ITS children are serialized by the parent */ + static void *conf_table; - if (atomic_cmpset_ptr((uintptr_t *)&conf_base, - (uintptr_t)NULL, (uintptr_t)conf_table) == 0) { - contigfree(conf_table, LPI_CONFTAB_SIZE, M_GICV3_ITS); - conf_table = atomic_load_ptr(&conf_base); - } + /* + * The PROPBASER is a singleton in our parent. We only set it up the + * first time through. conf_table is effectively global to all the units + * and we rely on subr_bus to serialize probe/attach. + */ + if (conf_table != NULL) { + sc->sc_conf_base = conf_table; + return; } + + /* + * Just allocate contiguous pages. We'll configure the PROPBASER + * register later in its_init_cpu_lpi(). + */ + conf_table = contigmalloc(LPI_CONFTAB_SIZE, + M_GICV3_ITS, M_WAITOK, 0, LPI_CONFTAB_MAX_ADDR, + LPI_CONFTAB_ALIGN, 0); sc->sc_conf_base = conf_table; /* Set the default configuration */