Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2551733lqp; Mon, 25 Mar 2024 02:16:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU9khPbBHRpTnnQZtmnkkW09JrEJ5yWlqLHQscfmjji2mVZrlAb+k8f0NOv2is/fMY3Z84U7O4hMBi+UyUkQUuxYxa8tAEieNZjMnA0MA== X-Google-Smtp-Source: AGHT+IFZQkmgqZhiHvcACJWJ4/zWD6LHi7OtT5pM79LNPrie9SxKPLB0P1twr27ybnBS9Lv7yaL6 X-Received: by 2002:a05:622a:152:b0:431:39b0:e29f with SMTP id v18-20020a05622a015200b0043139b0e29fmr10199444qtw.32.1711358171943; Mon, 25 Mar 2024 02:16:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711358171; cv=pass; d=google.com; s=arc-20160816; b=Is93N61aH4OSMIx+C5dUKizPv5ZFfJHdW5hIlDdVZOG1LToeTNvMQI1cUaAmH2EmKP ghA5NzXPHe/yH9vT5P+9i5a3MFsi/cet4769gTfr6k3TvuxFXB0IS4OPoPJOAdu2fRr1 FcWCVhFaBhYVnXaOV8yboVQYuiPNe+uB8GxQlMo7FV+tswjXI/TOx4TOsZ8OPmcpP7x+ b2liVz3tO1nE8rJv9CM8UVnjRzUa4TbOS9wGyw/t6bz2AabIZQtQNdtS8yqMjBKYAK7p TEBeQPi8Gn2N1wGjT+G5Bu4q9f5XzsPJSULYiidFqh5pN6FQEJWxqbnuZzpIF8s8j0Kl chjg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Q6MPJBtYcOVwEJRic9Qmp2SQxEwnLljGwyR0cotn35U=; fh=A/zIe+kUygMWh1LL3xD57fzwY++WNUQqb1m7HTTIlJE=; b=VtpAfTGpSLfk4YkzIqL87Yg1yZ9RuJHgi2og5cU6b0gDZg3JKV5wevSI4vUdFFujGN XuWOUV8t0Dd9DeSdn/29I2ZCeqSdUXAElVV6QRHp5l+7m1Bl6AFWNHt0Zl1Ngr2ye/S0 niRO4BL+HP6tNd0AQlSNNIW6mu4sBROUkChLflOV3cnngHAe/MEA+KAvRkT0jGWQiC6C wkRCOKbga8OqFj5N5/v28oZgOyFwRvXW4yqn2Pfxf6z0Th1QyjXri2RAdeR0h9CtbtqC EwXevPwcylodGkg5GiFri9YEcBMrpQc7H08u3mFmLi4HiYPMcF3+E14I89HksPaLD2iE 0wnw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=C8mWsz5a; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115755-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115755-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v15-20020a05622a014f00b0043160b9b981si410926qtw.665.2024.03.25.02.16.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 02:16:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115755-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=C8mWsz5a; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115755-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115755-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id AAB761C30D2F for ; Mon, 25 Mar 2024 09:16:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C2CEB2613C5; Mon, 25 Mar 2024 03:00:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="C8mWsz5a" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B3B0B1448D1; Sun, 24 Mar 2024 23:12:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711321953; cv=none; b=gZf9hia9vr0PJJo1KWylbt4nWN5HRq7Wo9r/AiPvwOGBAr6/CGOOKsJWco/bAK0uDmLhGTIkhwizFG9UkYg2b18ggKoJ+eAKmMTAZTYYuMaa1LxYIptA28mND3CMI1T7OZFGPYAisfi4XU5XW3nSHwDQ4Rub0yyhiBOsBn1I+tM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711321953; c=relaxed/simple; bh=YPRtis0IXaoNDc9pCeoWs6Weo9a+oWw+h2fuU+s0gXI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S6Jv/2fWKEXzin07cl7DK/cq4npvm/sIqyYO52TEaMGiWBuMkuYJLGR4mOjX9Prn8PUx+9j/pKch3mwqlZGO8y2oUOnOzOFNj+n3Q14mjBWyc/rXv80f3sTmphCrYAV6i+vAwI780mUICJhm39/1b6I2/d06ETFJ6eSLZ2VRjw4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=C8mWsz5a; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE9B8C433F1; Sun, 24 Mar 2024 23:12:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711321953; bh=YPRtis0IXaoNDc9pCeoWs6Weo9a+oWw+h2fuU+s0gXI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C8mWsz5aKd3xKGkewsn6OOz4RIFLkV8gSOntopDqq8Yv3iSDLou5rU14lhseAoCda 9kLb/0jkdQJhoKpfBu8+qA8tv7gF7Cb151NWFf47aEZ/zJ9OYhziBT3aeX6Ms8JLTG pPITfrbeY6Y+1mwVBb1RUIIFvuqWK/50A0t3bvzKbCAPc1ysE1FkOOAi1sXlCGIYA/ 9Li4H1/e82V5DnOhcJVbyJ/aiFn+hRAXEnAE7ErrVE4Yvw+ucoIWbYkYN6mjp3U8q7 kwH1iFf0R0R/qtgGtusMoxW9EGvKIXKBasjz3t2EUmzZH7lGhaETRg5w9tU/Cxbbbd /Gr/T4TbClzcA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jiaxun Yang , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 6.1 025/451] MIPS: Clear Cause.BD in instruction_pointer_set Date: Sun, 24 Mar 2024 19:05:01 -0400 Message-ID: <20240324231207.1351418-26-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Jiaxun Yang [ Upstream commit 9d6e21ddf20293b3880ae55b9d14de91c5891c59 ] Clear Cause.BD after we use instruction_pointer_set to override EPC. This can prevent exception_epc check against instruction code at new return address. It won't be considered as "in delay slot" after epc being overridden anyway. Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- arch/mips/include/asm/ptrace.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/mips/include/asm/ptrace.h b/arch/mips/include/asm/ptrace.h index daf3cf244ea97..b3e4dd6be7e20 100644 --- a/arch/mips/include/asm/ptrace.h +++ b/arch/mips/include/asm/ptrace.h @@ -60,6 +60,7 @@ static inline void instruction_pointer_set(struct pt_regs *regs, unsigned long val) { regs->cp0_epc = val; + regs->cp0_cause &= ~CAUSEF_BD; } /* Query offset/name of register from its name/offset */ -- 2.43.0