public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Sasha Levin <sashal@kernel.org>,
	oleg@redhat.com, linux-mips@vger.kernel.org
Subject: [PATCH AUTOSEL 5.10 5/7] MIPS: Clear Cause.BD in instruction_pointer_set
Date: Thu, 29 Feb 2024 10:51:09 -0500	[thread overview]
Message-ID: <20240229155112.2851155-5-sashal@kernel.org> (raw)
In-Reply-To: <20240229155112.2851155-1-sashal@kernel.org>

From: Jiaxun Yang <jiaxun.yang@flygoat.com>

[ 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 <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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


  parent reply	other threads:[~2024-02-29 15:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29 15:51 [PATCH AUTOSEL 5.10 1/7] btrfs: add and use helper to check if block group is used Sasha Levin
2024-02-29 15:51 ` [PATCH AUTOSEL 5.10 2/7] selftests: tls: use exact comparison in recv_partial Sasha Levin
2024-02-29 15:51 ` [PATCH AUTOSEL 5.10 3/7] ASoC: rt5645: Make LattePanda board DMI match more precise Sasha Levin
2024-02-29 15:51 ` [PATCH AUTOSEL 5.10 4/7] x86/xen: Add some null pointer checking to smp.c Sasha Levin
2024-02-29 15:51 ` Sasha Levin [this message]
2024-02-29 15:51 ` [PATCH AUTOSEL 5.10 6/7] HID: multitouch: Add required quirk for Synaptics 0xcddc device Sasha Levin
2024-02-29 15:51 ` [PATCH AUTOSEL 5.10 7/7] gen_compile_commands: fix invalid escape sequence warning Sasha Levin
2024-03-11 21:00 ` [PATCH AUTOSEL 5.10 1/7] btrfs: add and use helper to check if block group is used Pavel Machek
2024-03-11 21:05   ` David Sterba
2024-03-18 14:18     ` Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240229155112.2851155-5-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox