From nobody Thu Dec 22 10:23:49 2022 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 4Nd5xx5n8pz1GxC0; Thu, 22 Dec 2022 10:23: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 4Nd5xx5CZ2z4D1Q; Thu, 22 Dec 2022 10:23:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671704629; 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=ak2EnPw/0oxcY9wpHqUyjarJ0QNW1Lnu4zgwC/cTsrk=; b=yI8IxgTDmHxMmTqiY6tC3t1mAb7/QYJc7MtKd7xxX/bYrXQtheVWBaOuunUSoh1DTUwzGo TK7eXL9r2hXG0Ag8DhEbEeWBiBYr16rdQPmFgfPPCM+6BPcUprRyOlXBMbIBD4BEyU7Ceq tNoQaEXKB93XPxn9gKoZ8EjrcnXDfJbtogfAAuc0mw4K1Oi28DGOErXM/i+G0BVePe7i7L OHBf/J5ua9V97dWaSgoaPbai8KLKyxfUvBk9hZOvAM8rm4my3OO+E3QCt2IXlJWQG9wdrH jJruLajrddUMEPlpBTPcsZP1sXZXHrC1rKTc+YKp8JbeG7MytpHVR6Wz2u2ing== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671704629; 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=ak2EnPw/0oxcY9wpHqUyjarJ0QNW1Lnu4zgwC/cTsrk=; b=epu5eSvppehoSBCjFvFeKy4YM48kU37WsCtx35qr9d/VQF5OD8oRxfKSREKtiy2TIQTbIZ K/fDTtKsFV7MXQ5PtRjj5QD5ggfSR8DEXXn8/BqyWIrPQsDd0P32mGQUdCjTQ2t9XX0hZJ p9BFtVgeO6NqkufOwBP+Ds49j2C9XYKWDs64qK9TUT4mmqvRp1Tq6RbbZHBbHjeXwB/L80 6L3SxWhbV2QXHMBr0TSf4ETBub+aordc1zQjpBJhzrtGTc6XjrNNJTtYyHyu2HC19S09MN 0wRuIJPRHq6hUWWvxrPMd9zwfw0PglCpWc/EL0hv53LpWP6RkLxwAQEmmUQRuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1671704629; a=rsa-sha256; cv=none; b=fDklq9CkwjDHmrotyz0OenZYYlkhSMtKHdBO8AgpBF74AUr1mEfkDK1gIKmY1C6uUKMcP9 TAavdHdELTlEWdbg0OseBEJmFx5Rt0pGGXXRPmiUNwDBq2ClkhGE/YMtZfX5NHTTZ5317g dctprccrAFzznY92ysJxmBKQ+dXpwxU4J9Zo/VQd8A5fFUA01vAdx/wEwqPYLqBLeBRneW jVe43rlTZdC2P/vWNUVNjwjpVDzGr/3ZpyLF5dgnaroVGJNnf6OtRnShA03eZoubell7yL zIbeZpHTfL3mUyRQNd2162sQDLlUBVGXiGTa4e9Y2TX57Y9SQzcPZpyokRkkJg== 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 4Nd5xx4GKpzqy6; Thu, 22 Dec 2022 10:23:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2BMANnBX024555; Thu, 22 Dec 2022 10:23:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BMANntF024554; Thu, 22 Dec 2022 10:23:49 GMT (envelope-from git) Date: Thu, 22 Dec 2022 10:23:49 GMT Message-Id: <202212221023.2BMANntF024554@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: c1a2798faa3d - main - arm64: Don't include td_inhibitors when checking td_ast in do_ast 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: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c1a2798faa3d8a76a7b9023d859629b5c0532d9b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=c1a2798faa3d8a76a7b9023d859629b5c0532d9b commit c1a2798faa3d8a76a7b9023d859629b5c0532d9b Author: Jessica Clarke AuthorDate: 2022-12-22 10:23:10 +0000 Commit: Jessica Clarke CommitDate: 2022-12-22 10:23:10 +0000 arm64: Don't include td_inhibitors when checking td_ast in do_ast The td_ast member is an int so only 4 bytes, yet we were using an 8 byte load and thus also got td_inhibitors in the upper bits. The code prior to the commit that introduced td_ast did also do a bogus 8 byte load of td_flags but masked the flags so arguably was correct, if dodgy. Now that we're using the right width for the load we can also fold the immediate offset back into the load; because td_ast is at an odd multiple of 4 bytes from the start of struct thread the normal scaled load couldn't be used with such an immediate offset when doing an 8 byte load due to its limited immediate range, but we can use a scaled load once more now that the offset is a multiple of the load width. Reviewed by: andrew, kib Fixes: c6d31b8306eb ("AST: rework") Differential Revision: https://reviews.freebsd.org/D37751 --- sys/arm64/arm64/exception.S | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/arm64/arm64/exception.S b/sys/arm64/arm64/exception.S index e875b75e41c4..4a74358afeb9 100644 --- a/sys/arm64/arm64/exception.S +++ b/sys/arm64/arm64/exception.S @@ -177,11 +177,10 @@ __FBSDID("$FreeBSD$"); /* Read the current thread AST mask */ ldr x1, [x18, #PC_CURTHREAD] /* Load curthread */ - add x1, x1, #(TD_AST) - ldr x1, [x1] + ldr w1, [x1, #(TD_AST)] /* Check if we have a non-zero AST mask */ - cbz x1, 2f + cbz w1, 2f /* Restore interrupts */ msr daif, x19