Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2535703lqp; Mon, 25 Mar 2024 01:33:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW2DRdJRxeV/Qtwg47fz6p87dgzVrPWLu/0t+eg/LTm1tKVSxa+4+ZtYwuD2VVVh4jwEZ9uS2s4kBuSfaM4K1iEbKDQF+MS0Ufn2xIRRg== X-Google-Smtp-Source: AGHT+IEJXIa8qDS8oRA+SYrHaMZfXMMaPRPB81PEvk1LM8c+Udq0xSSZcmShaTY0mBET/utrjeCD X-Received: by 2002:a17:90b:1296:b0:29c:f407:9d9c with SMTP id fw22-20020a17090b129600b0029cf4079d9cmr4078121pjb.22.1711355603899; Mon, 25 Mar 2024 01:33:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711355603; cv=pass; d=google.com; s=arc-20160816; b=kM5BM/f6r0TKU/kgQtLr/A9TBabGuKBLt8uBKGWt4W4amQhmES2gSjHq+IpaV/uRiR T8Ec6PIXt/yX0OBpjxTnt3HVEvUhcaxd7x7xdVHgosU8rF13DkIVMVZaQivOFwJkWI5K vH7074fTNplXrBbZ9FQwNsbmodgvLoERg/3UQ4BYgK5NSDgy8lhhKX44vWqEMPGJRyY9 SqfLqhQR3Be3MrsnySzfpQdmW7js+F57bdAeU0nBaq6hSzlR6k8gcds40Wa9hSxLqjkY nDVRwGDIxei6OoK8PJKZSUOp1OL2F11l4BhtMm2h1VP0JXGiRZucCqXRbvkcm/UNfEB2 X10Q== 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=ylv8IumRHNlOJdPgED4hxNBhofW5euw9Q0OHZWLf790=; fh=A/zIe+kUygMWh1LL3xD57fzwY++WNUQqb1m7HTTIlJE=; b=rv8quGQ4j2oJjYjdpi/7e0dclFlyEH6D8IpJG5y6OwPkilw2eFCXc6KoHLkWeoBt30 avwkfzej7HnQjVazU/UtKeDL5jWo5OsmOnfknLhe9GpckfItPufVS3ovdlmSulpSUmn9 xa2+CfwKkusUfUMUkWctr7osOjlnkIGEREwHNCA/ESuDGKfsiVRfPGpMKLA8WU6GdX4G QujoAAGtZjKn8pTLsL5mQjDjKOAs8U1NdxwTViB9CEonUgaunN3Nni8+s37HT4LxsaR7 uvbu2eW0gcdoRST8rrhxNvnYkvxaEWee6r19NbX1nLFTH0DpNRoT7e6nNHCUWFRMGW9+ NbFA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HZi5Z2zx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116115-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116115-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d5-20020a17090ab30500b002a05923da79si3631711pjr.56.2024.03.25.01.33.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 01:33:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116115-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HZi5Z2zx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116115-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116115-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 01D5B297F6D for ; Mon, 25 Mar 2024 08:33:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5DF713AB7CC; Mon, 25 Mar 2024 03:31:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HZi5Z2zx" 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 3130B280211; Sun, 24 Mar 2024 23:40:38 +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=1711323638; cv=none; b=JJI4MApbO9oG+radqntd9HQJK9br5Cman+0qzBBhLywwefyioqV4HME8wENe5uMo0/8R3mxHx0nr/oOHUHoWvML8cD3Va7emUBUkyQOphIy9HJx9dDkFJdCtrqOX1yUAILG6+1Qv+YPr1sw4s7IjNfgJSBFt71fIjNyuqacZzdI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711323638; c=relaxed/simple; bh=tfnOGd7pf3A5f59RWHth3GLkpWlXj5gee4oTcfvY3k4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sCU91bD19uTTdVpXibJrPCVANAsd5n9mkwkTH79PpyhsKnykYeB3XwrfyIy8sKi0RNHiZxwBIFzZWPBH4QNtJsQqK1vNuwlCM8B0QLHrTib6iHCWhS34XRMJrScAg1l02gBtYZZcYxLydW64kvFWpDn2zTbOupsnsIAzSF8jKSA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HZi5Z2zx; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E621C43390; Sun, 24 Mar 2024 23:40:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711323638; bh=tfnOGd7pf3A5f59RWHth3GLkpWlXj5gee4oTcfvY3k4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HZi5Z2zxzeRE3/FNc6bW1kRMmeK4NCHqvIgDUb1Enm3ZDml8+fwMH+GmCatTcaZ5m OUEhGKYDFRyPq8lvWjZ1+r78RyRnMJXwMCF+draHTfjuiE2xjABF3TIujOCXGEItNQ NXjvrokhN9h0R2U1wU3dCUxQwEeFRTa3EcA0+lwHzZP/zaw8Bj1NV7JJ2cPDwftZWu rqRtsNiIwbcI5CFrFsQx2dDrnVxeEnFA8gK3pnJJ1FxCQCAP2tsPjhMO6NBw0LnyOm Ra+QYWGtDduxWdFLY4WVpld9rVcdIxHYZXdiyZXkNIWFuX/3NtiEv6Z2tLNJ+35uYo fmipVoDKlCRMA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jiaxun Yang , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 5.10 009/238] MIPS: Clear Cause.BD in instruction_pointer_set Date: Sun, 24 Mar 2024 19:36:37 -0400 Message-ID: <20240324234027.1354210-10-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324234027.1354210-1-sashal@kernel.org> References: <20240324234027.1354210-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 1e76774b36ddf..2849a9b65a055 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