Received: by 2002:ab2:2997:0:b0:1ec:cbc4:63fb with SMTP id n23csp533260lqb; Thu, 29 Feb 2024 07:54:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVCug5Wdnii3Tvi/TsQYZw6RrE8d5xhMtb3dF1LfM/HVUKqJQzsssOueWZIzgmRbId5Y/DItWZMei3Haxtxf0coUwTFVTdFEtgBsRG64w== X-Google-Smtp-Source: AGHT+IFis2mvKlp9NNpax1i+Ic6atYrwCARWlZnK+Vz1VWqHbNHVjEc6X2PVJAWwEBuTDm7CwoTk X-Received: by 2002:a05:6a21:1014:b0:1a1:2f15:a307 with SMTP id nk20-20020a056a21101400b001a12f15a307mr1050504pzb.15.1709222048516; Thu, 29 Feb 2024 07:54:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709222048; cv=pass; d=google.com; s=arc-20160816; b=gFfqWJtqt3DpZlN9zXGcv819InSI1QM5EqovId42GI/mYZb3CJrVND9Nf4tlMLVAw0 dMqWiiZ22kNX4V1kAsfuu+WSJVA+be9Vuut99PaSRibRfSVf8Oi/j0pBQ0Y/qdvvqwwR iqFXK7J5LPY619sLBwPjmbBQTclur6dF/nK1gQKiXuqaCwdqR0D2PEY+RGyllUTsuh4w wq1y+E6OcLaQY3t+JCszXElKTZLWtEGmLApgEAMTi1qR2qNuTEWVe9SJdvslBegufXkU YmqATvh9XRbUcvfnbOINV1GmUtwVDt/i9qye1b8H2aEQ0/45HlvI2USCqHEzw2J5cmYa 2Xkg== 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=c1Mlq/Xn0LGxpmKk6jf+ICB6z+/boxkLQnhkhuFmkQg=; b=yr7NG70IHdLUJq8Ykg7kamvit+elrf/O47f1M0/MubwEZSnlm6a0S16ZJ98T/GXw5r TcfD/VrgpoDMiFPtxEUpeEo+dqJZGhfzwb4nRZS8Pg2AJv+nm2i/6Ys6+Hiu6edlFeD1 qEii0ePyMtMbtoLkMkkByg+L3QbxJYwUa/fuCGFXXKq8AlDup8mVU8Ojc0ScdwjA5++X 4Z0RLdfwvLrDOxKhT4zwjppwUteYRup2QkZbwtb8VELu0lLC/9Cjm5ipNR2GTTLC29Ng BKZgV2bJUM1MZ4CQJGoLdx9hnfeEH3WehMk3fZ7FplMs0CEDpCfLuAu+5PoF31XFocp1 sTvg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iKrP2moq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-86967-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86967-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 cb4-20020a056a02070400b005dc071d13c7si1722088pgb.273.2024.02.29.07.54.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 07:54:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-86967-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=iKrP2moq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-86967-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86967-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 3365D284330 for ; Thu, 29 Feb 2024 15:54:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4689815E5D7; Thu, 29 Feb 2024 15:49:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iKrP2moq" 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 6569915E5B2; Thu, 29 Feb 2024 15:49:27 +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=1709221767; cv=none; b=cz/WFO3mdQbDXq4uu0A2Px8GXBz6SayYzoOmOajUWfXoPwhRTOG1qRK9tEnetU3A689BsjDeroxHTYLaTah+SBMGNGWimvEh2Qr3qTr9wI1l+cLTdaujyQt0b2Gmb/Xj3fGpCFfo4jK9J91mju+q6dOUKzF6+JTSI+/AIK1kxko= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709221767; c=relaxed/simple; bh=YPRtis0IXaoNDc9pCeoWs6Weo9a+oWw+h2fuU+s0gXI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mD3x4pBdpZwSbpCblgaY6dYEb0zIFN1OtCCV7B2NjGpnaP6jexqlLsFhYblxLvQfc6XGRcv9otxvoS8fihFA/eAF1HOgwYlj5uF8/8FUBDxmLgwNWR+brBGp/vGhA/ICZp7YkCqzw3xs3iiSfjgWQiOt04X1kZAHPg41drutMq0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iKrP2moq; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 166AAC433B2; Thu, 29 Feb 2024 15:49:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709221767; bh=YPRtis0IXaoNDc9pCeoWs6Weo9a+oWw+h2fuU+s0gXI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iKrP2moqEyQQ0TfsR7hP8kkGKj1D5msl3YGz3CuYX3Ehd1HQTkR+/GQLkuME22aUv 1feskNvAOBckhjvl1/sQ/ggZlERntLwQW0GD7xmPTt6BPo0ziulkD4rZSRkajslJIz wRcoP9cTyZbhg03DZlp006rLMxFdpNUwDRRn50tO3r7g9extVdtFj6WGQWW34QLpaU Kd84D0ivi1P4+GZ+VlidkAjbSBljdj6d1W4UPrvkwgX7EfAbEsy5iHLq96gORFfxNA yYlEDnpbwQU9DDNUsEEKo8WBlg/33iaqEPGBuElAWmtF7swoyUmMGDfVQMODTEHm+K rx5K/2L2hYE7w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jiaxun Yang , Thomas Bogendoerfer , Sasha Levin , oleg@redhat.com, linux-mips@vger.kernel.org Subject: [PATCH AUTOSEL 6.7 19/26] MIPS: Clear Cause.BD in instruction_pointer_set Date: Thu, 29 Feb 2024 10:48:38 -0500 Message-ID: <20240229154851.2849367-19-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240229154851.2849367-1-sashal@kernel.org> References: <20240229154851.2849367-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 X-stable-base: Linux 6.7.6 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