From nobody Fri Sep 01 10:07:14 2023 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 4RcYc230BQz4sKPq; Fri, 1 Sep 2023 10:07:14 +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 4RcYc226qxz3ZlX; Fri, 1 Sep 2023 10:07:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693562834; 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=hS2kWoOyFIcYhcga1IbfyMMax55TjKex3vjmd7hCopw=; b=YXUa3hMQ4PKNSW049Vj6C02pA8gOqjCYDF6eaBBNOr8XUtBnM9mviWUGWfb0gl6qGnzyDP aGBhnlBVjCVNf8Kzf3z4/NcRqZIQpMEVzNSX1L2REAohBUKrWP+5Avv3qm16RTOMU5bQVH 4ZTfafPWyk06fQysdZANRZDCqAWVXJtkZ5nSt+NTGePU22jUnP8lx1JjrVBUcS5ACk+jyY /N0ZBc9XwR7ADixaLdWloV44xspew1RnADEwNXFbIWSb3NuyBT0hhCaHM+z5m6e5ZAaj2d LA/kQqPvZsP5JM4zqvSHEMvesvrT+ehDeTGyFZh81wtVJhyTSh5SvaM1d5UeCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693562834; a=rsa-sha256; cv=none; b=pxDUHNiet/G+2wUOqeWcbhn/PiD8MVcByBTMR5+P7CWg2J0+mGHWFUr5AxExyFEJ3f7kKh x0t/RNRkztnIQ19z1iRdITNFyiYWGLgOSz16VPtHgXd1v3SwQ9/+7Cl7lKme7xp9zq2he7 Zn2gfeGQCHP1XSaAxJE+tph070p1bepxpMds1cYnq4axA7Kr8LSgQ7DSGc6QZgM5oGDvke lm3r1EAw+9KBj670bYT+7yatHa1/BbiwFG8DMy/O/zMnXTiKjHScijGezHFHV1rsijDlj9 aC4CI5NyXqGvM1VHJnI6MHo4wmgyWIYh8K3EKpoNMWIUfsY1I9SEkyaG820NuA== 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=1693562834; 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=hS2kWoOyFIcYhcga1IbfyMMax55TjKex3vjmd7hCopw=; b=w+8Hg3qIu/KfNWlYS/Ep1cKBCCpWVZCu1TYJaJlNN7JYnF4XIdLSvF+KzBxFg1ZaW7cPlX NbYNbB2+cCrAY+Z4sq4Vt5Meaq//u6dsrfEvgTtjTbIU1Hvc1M4jDORY4iPo3iBrslcGZf WDK5YidsFtTogpC6ckSLx1ZqTS1txGqwpGoR2VXh2dUZGoT3lv2OvnBPSttdAL1yqfUdI+ GljKvEnnv56LnDsn2Lp3hqHRcK9rg7gl/nQuDGD71u6JDYYLPC1/gb4qnl91qeqFyrcC3R vScg7ANRPNDvMump8ky3n6MZFztpWSQku4K6/5GzGoypFktQ1Azj81fUBY4d2g== 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 4RcYc21F30zwxs; Fri, 1 Sep 2023 10:07:14 +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 381A7EBX092404; Fri, 1 Sep 2023 10:07:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 381A7ELJ092401; Fri, 1 Sep 2023 10:07:14 GMT (envelope-from git) Date: Fri, 1 Sep 2023 10:07:14 GMT Message-Id: <202309011007.381A7ELJ092401@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: 5429e194212e - main - gicv3: Add logging for when its_device_alloc fails 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: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5429e194212e7d2fd7b4771bcf348f0917a0d505 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=5429e194212e7d2fd7b4771bcf348f0917a0d505 commit 5429e194212e7d2fd7b4771bcf348f0917a0d505 Author: Andrew Turner AuthorDate: 2023-08-23 17:44:38 +0000 Commit: Andrew Turner CommitDate: 2023-09-01 09:56:42 +0000 gicv3: Add logging for when its_device_alloc fails Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D41566 --- sys/arm64/arm64/gicv3_its.c | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/sys/arm64/arm64/gicv3_its.c b/sys/arm64/arm64/gicv3_its.c index a126a166c4c9..777e20649f33 100644 --- a/sys/arm64/arm64/gicv3_its.c +++ b/sys/arm64/arm64/gicv3_its.c @@ -1277,21 +1277,44 @@ its_device_alloc(struct gicv3_its_softc *sc, int devid) /* No device table */ if (sc->sc_dev_table_idx < 0) { - if (devid < (1 << sc->sc_devbits)) - return (true); - return (false); + if (devid >= (1 << sc->sc_devbits)) { + if (bootverbose) { + device_printf(sc->dev, + "%s: Device out of range for hardware " + "(%x >= %x)\n", __func__, devid, + 1 << sc->sc_devbits); + } + return (false); + } + return (true); } ptable = &sc->sc_its_ptab[sc->sc_dev_table_idx]; /* Check the devid is within the table limit */ if (!ptable->ptab_indirect) { - return (devid < ptable->ptab_l1_nidents); + if (devid >= ptable->ptab_l1_nidents) { + if (bootverbose) { + device_printf(sc->dev, + "%s: Device out of range for table " + "(%x >= %x)\n", __func__, devid, + ptable->ptab_l1_nidents); + } + return (false); + } + + return (true); } /* Check the devid is within the allocated range */ index = devid / ptable->ptab_l2_nidents; - if (index >= ptable->ptab_l1_nidents) + if (index >= ptable->ptab_l1_nidents) { + if (bootverbose) { + device_printf(sc->dev, + "%s: Index out of range for table (%x >= %x)\n", + __func__, index, ptable->ptab_l1_nidents); + } return (false); + } table = (uint64_t *)ptable->ptab_vaddr; /* We have an second level table */