From: Heiko Carstens <hca@linux.ibm.com>
To: Alexander Gordeev <agordeev@linux.ibm.com>,
Sven Schnelle <svens@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org
Subject: [PATCH 2/3] s390/probes: Add missing fixup for bctgr and bic
Date: Mon, 12 Oct 2026 10:36:28 +0200 [thread overview]
Message-ID: <20261012083629.2109206-3-hca@linux.ibm.com> (raw)
In-Reply-To: <20261012083629.2109206-1-hca@linux.ibm.com>
For the bctgr and bic instructions the probes fixup is missing.
For both instructions the instruction address must only be fixed up
if the branch is not taken. If the branch is taken the instruction
address is already correct.
Return FIXUP_BRANCH_NOT_TAKEN instead of the default FIXUP_PSW_NORMAL
to reflect that.
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
---
arch/s390/lib/probes.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/arch/s390/lib/probes.c b/arch/s390/lib/probes.c
index 049300b68ddd..3e7654223b05 100644
--- a/arch/s390/lib/probes.c
+++ b/arch/s390/lib/probes.c
@@ -77,6 +77,10 @@ int probe_get_fixup_type(u16 *insn)
if ((insn[0] & 0xff) == 0xb2)
fixup = FIXUP_NOT_REQUIRED;
break;
+ case 0xb9: /* bctgr */
+ if ((insn[0] & 0xff) == 0x46)
+ fixup = FIXUP_BRANCH_NOT_TAKEN;
+ break;
case 0xa7: /* bras */
if ((insn[0] & 0x0f) == 0x05)
fixup |= FIXUP_RETURN_REGISTER;
@@ -85,6 +89,14 @@ int probe_get_fixup_type(u16 *insn)
if ((insn[0] & 0x0f) == 0x05) /* brasl */
fixup |= FIXUP_RETURN_REGISTER;
break;
+ case 0xe3:
+ switch (insn[2] & 0xff) {
+ case 0x46: /* bctg */
+ case 0x47: /* bic */
+ fixup = FIXUP_BRANCH_NOT_TAKEN;
+ break;
+ }
+ break;
case 0xeb:
switch (insn[2] & 0xff) {
case 0x44: /* bxhg */
@@ -93,10 +105,6 @@ int probe_get_fixup_type(u16 *insn)
break;
}
break;
- case 0xe3: /* bctg */
- if ((insn[2] & 0xff) == 0x46)
- fixup = FIXUP_BRANCH_NOT_TAKEN;
- break;
case 0xec:
switch (insn[2] & 0xff) {
case 0xe4: /* cgrb */
--
2.53.0
next prev parent reply other threads:[~2026-10-12 8:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 8:36 [PATCH 0/3] s390/probes: Various fixes Heiko Carstens
2026-10-12 8:36 ` [PATCH 1/3] s390/probes: Fix wrong opcode for cgrb fixup Heiko Carstens
2026-10-12 8:36 ` Heiko Carstens [this message]
2026-10-12 8:36 ` [PATCH 3/3] s390/probes: Fix wrong mnemonic comment for clgib Heiko Carstens
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=20261012083629.2109206-3-hca@linux.ibm.com \
--to=hca@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=svens@linux.ibm.com \
/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
all inboxes | Powered by JetHome®