linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Link Mauve <linkmauve@linkmauve.fr>
To: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Cc: "Link Mauve" <linkmauve@linkmauve.fr>,
	"Madhavan Srinivasan" <maddy@linux.ibm.com>,
	techflashYT <officialTechflashYT@gmail.com>,
	"Ash Logan" <ash@heyquark.com>,
	"Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
	"Michael Ellerman" <mpe@ellerman.id.au>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Christophe Leroy (CS GROUP)" <chleroy@kernel.org>
Subject: [PATCH 1/2] powerpc/sstep: Consistently use one define to check arch bit width
Date: Wed, 29 Jul 2026 22:49:55 +0200	[thread overview]
Message-ID: <20260729204958.755143-2-linkmauve@linkmauve.fr> (raw)
In-Reply-To: <20260729204958.755143-1-linkmauve@linkmauve.fr>

Previously, both CONFIG_PPC64 and __powerpc64__ were being used to check
whether we were on 32-bit or on 64-bit PowerPC, sometimes in a single
function.

I picked __powerpc64__ since it was used six times as much as
CONFIG_PPC64 in this file, but could be convinced to use the other one
if there is any reason to prefer it.

Signed-off-by: Link Mauve <linkmauve@linkmauve.fr>
---
 arch/powerpc/lib/sstep.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index f0d6aa657c1a..597a0d841fe8 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -15,7 +15,7 @@
 #include <asm/cputable.h>
 #include <asm/disassemble.h>
 
-#ifdef CONFIG_PPC64
+#ifdef __powerpc64__
 /* Bits in SRR1 that are copied from MSR */
 #define MSR_MASK	0xffffffff87c0ffffUL
 #else
@@ -1256,7 +1256,7 @@ static nokprobe_inline void do_popcnt(const struct pt_regs *regs,
 	op->val = out;	/* popcntd */
 }
 
-#ifdef CONFIG_PPC64
+#ifdef __powerpc64__
 static nokprobe_inline void do_bpermd(const struct pt_regs *regs,
 				      struct instruction_op *op,
 				      unsigned long v1, unsigned long v2)
@@ -1273,7 +1273,7 @@ static nokprobe_inline void do_bpermd(const struct pt_regs *regs,
 	}
 	op->val = perm;
 }
-#endif /* CONFIG_PPC64 */
+#endif /* __powerpc64__ */
 /*
  * The size parameter adjusts the equivalent prty instruction.
  * prtyw = 32, prtyd = 64
@@ -1340,7 +1340,7 @@ static nokprobe_inline int trap_compare(long v1, long v2)
 int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
 		  ppc_inst_t instr)
 {
-#ifdef CONFIG_PPC64
+#ifdef __powerpc64__
 	unsigned int suffixopcode, prefixtype, prefix_r;
 #endif
 	unsigned int opcode, ra, rb, rc, rd, spr, u;
@@ -1739,7 +1739,7 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
 			op->reg = rd;
 			op->val = 0xffffffff & ~(MSR_ME | MSR_LE);
 			return 0;
-#ifdef CONFIG_PPC64
+#ifdef __powerpc64__
 		case 178:	/* mtmsrd */
 			if (user_mode(regs))
 				goto priv;
@@ -2054,7 +2054,7 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
 		case 186:	/* prtyd */
 			do_prty(regs, op, regs->gpr[rd], 64);
 			goto logical_done_nocc;
-#ifdef CONFIG_PPC64
+#ifdef __powerpc64__
 		case 252:	/* bpermd */
 			do_bpermd(regs, op, regs->gpr[rd], regs->gpr[rb]);
 			goto logical_done_nocc;
@@ -2082,7 +2082,7 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
 		case 476:	/* nand */
 			op->val = ~(regs->gpr[rd] & regs->gpr[rb]);
 			goto logical_done;
-#ifdef CONFIG_PPC64
+#ifdef __powerpc64__
 		case 506:	/* popcntd */
 			do_popcnt(regs, op, regs->gpr[rd], 64);
 			goto logical_done_nocc;
@@ -3247,7 +3247,7 @@ void emulate_update_regs(struct pt_regs *regs, struct instruction_op *op)
 		case BARRIER_EIEIO:
 			eieio();
 			break;
-#ifdef CONFIG_PPC64
+#ifdef __powerpc64__
 		case BARRIER_LWSYNC:
 			asm volatile("lwsync" : : : "memory");
 			break;
-- 
2.55.0



  reply	other threads:[~2026-07-29 20:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-29 20:49 [PATCH 0/2] powerpc/sstep: Fix compilation on 32-bit PowerPC Link Mauve
2026-07-29 20:49 ` Link Mauve [this message]
2026-07-30  6:02   ` [PATCH 1/2] powerpc/sstep: Consistently use one define to check arch bit width LEROY Christophe
2026-07-29 20:49 ` [PATCH 2/2] powerpc/sstep: Don’t define variables we won’t be using Link Mauve
2026-07-30  6:24   ` Christophe Leroy (CS GROUP)
2026-07-30  6:39     ` Link Mauve
2026-07-30  5:51 ` [PATCH 0/2] powerpc/sstep: Fix compilation on 32-bit PowerPC Christophe Leroy (CS GROUP)
2026-07-30  6:04   ` Link Mauve

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=20260729204958.755143-2-linkmauve@linkmauve.fr \
    --to=linkmauve@linkmauve.fr \
    --cc=ash@heyquark.com \
    --cc=chleroy@kernel.org \
    --cc=j.neuschaefer@gmx.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=officialTechflashYT@gmail.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;
as well as URLs for NNTP newsgroup(s).