Skip to contentSkip to conversation

powerpc: Fix MMCRA_BHRB_DISABLE define to work with binutils version < 2.28

PATCH Applied Athira Rajeev 3 participants 3 messages Jul 29, 2020 – Jul 30, 2020 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: Fix MMCRA_BHRB_DISABLE define to work with binutils version < 2.28

commit 9908c826d5ed ("powerpc/perf: Add Power10 PMU feature to DT CPU features") defines MMCRA_BHRB_DISABLE as 0x2000000000UL. Binutils version less than 2.28 doesn't support UL suffix.

linux-ppc/arch/powerpc/kernel/cpu_setup_power.S: Assembler messages:
linux-ppc/arch/powerpc/kernel/cpu_setup_power.S:250: Error: found 'L', expected: ')' linux-ppc/arch/powerpc/kernel/cpu_setup_power.S:250: Error: junk at end of line, first unrecognized character is `L' linux-ppc/arch/powerpc/kernel/cpu_setup_power.S:250: Error: found 'L', expected: ')' linux-ppc/arch/powerpc/kernel/cpu_setup_power.S:250: Error: found 'L', expected: ')' linux-ppc/arch/powerpc/kernel/cpu_setup_power.S:250: Error: junk at end of line, first unrecognized character is `L' linux-ppc/arch/powerpc/kernel/cpu_setup_power.S:250: Error: found 'L', expected: ')' linux-ppc/arch/powerpc/kernel/cpu_setup_power.S:250: Error: found 'L', expected: ')' linux-ppc/arch/powerpc/kernel/cpu_setup_power.S:250: Error: operand out of range (0x0000002000000000 is not between 0xffffffffffff8000 and 0x000000000000ffff)

Fix this by wrapping it around _UL macro.

Fixes 9908c826d5ed ("Add Power10 PMU feature to DT CPU features")
---
 arch/powerpc/include/asm/reg.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/include/asm/reg.h +2 -1
index ae71027..41419f1 100644
@@ -12,6 +12,7 @@
 #ifdef __KERNEL__
 
 #include <linux/stringify.h>
+#include <linux/const.h>
 #include <asm/cputable.h>
 #include <asm/asm-const.h>
 #include <asm/feature-fixups.h>
@@ -888,7 +889,7 @@
 #define   MMCRA_SLOT	0x07000000UL /* SLOT bits (37-39) */
 #define   MMCRA_SLOT_SHIFT	24
 #define   MMCRA_SAMPLE_ENABLE 0x00000001UL /* enable sampling */
-#define   MMCRA_BHRB_DISABLE  0x2000000000UL // BHRB disable bit for ISA v3.1
+#define   MMCRA_BHRB_DISABLE  _UL(0x2000000000) // BHRB disable bit for ISA v3.1
 #define   POWER6_MMCRA_SDSYNC 0x0000080000000000ULL	/* SDAR/SIAR synced */
 #define   POWER6_MMCRA_SIHV   0x0000040000000000ULL
 #define   POWER6_MMCRA_SIPR   0x0000020000000000ULL
Signature · 1 line
1.8.3.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · Athira Rajeev

commit 9908c826d5ed ("powerpc/perf: Add Power10 PMU feature to DT CPU features") defines MMCRA_BHRB_DISABLE as 0x2000000000UL. Binutils version less than 2.28 doesn't support UL suffix.

linux-ppc/arch/powerpc/kernel/cpu_setup_power.S: Assembler messages:
linux-ppc/arch/powerpc/kernel/cpu_setup_power.S:250: Error: found 'L', expected: ')' linux-ppc/arch/powerpc/kernel/cpu_setup_power.S:250: Error: junk at end of line, first unrecognized character is `L' linux-ppc/arch/powerpc/kernel/cpu_setup_power.S:250: Error: found 'L', expected: ')' linux-ppc/arch/powerpc/kernel/cpu_setup_power.S:250: Error: found 'L', expected: ')' linux-ppc/arch/powerpc/kernel/cpu_setup_power.S:250: Error: junk at end of line, first unrecognized character is `L' linux-ppc/arch/powerpc/kernel/cpu_setup_power.S:250: Error: found 'L', expected: ')' linux-ppc/arch/powerpc/kernel/cpu_setup_power.S:250: Error: found 'L', expected: ')' linux-ppc/arch/powerpc/kernel/cpu_setup_power.S:250: Error: operand out of range (0x0000002000000000 is not between 0xffffffffffff8000 and 0x000000000000ffff)

Quoted 1 line

Fix this by wrapping it around _UL macro.

Looks fine to me.

Quoted 29 lines
Fixes 9908c826d5ed ("Add Power10 PMU feature to DT CPU features")
---
  arch/powerpc/include/asm/reg.h | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/include/asm/reg.h +2 -1
index ae71027..41419f1 100644
@@ -12,6 +12,7 @@
  #ifdef __KERNEL__
 
  #include <linux/stringify.h>
+#include <linux/const.h>
  #include <asm/cputable.h>
  #include <asm/asm-const.h>
  #include <asm/feature-fixups.h>
@@ -888,7 +889,7 @@
  #define   MMCRA_SLOT	0x07000000UL /* SLOT bits (37-39) */
  #define   MMCRA_SLOT_SHIFT	24
  #define   MMCRA_SAMPLE_ENABLE 0x00000001UL /* enable sampling */
-#define   MMCRA_BHRB_DISABLE  0x2000000000UL // BHRB disable bit for ISA v3.1
+#define   MMCRA_BHRB_DISABLE  _UL(0x2000000000) // BHRB disable bit for ISA v3.1
  #define   POWER6_MMCRA_SDSYNC 0x0000080000000000ULL	/* SDAR/SIAR synced */
  #define   POWER6_MMCRA_SIHV   0x0000040000000000ULL
  #define   POWER6_MMCRA_SIPR   0x0000020000000000ULL
#2 lore raw
In reply to Athira Rajeev
Quoted 14 lines · Athira Rajeev

commit 9908c826d5ed ("powerpc/perf: Add Power10 PMU feature to DT CPU features") defines MMCRA_BHRB_DISABLE as 0x2000000000UL. Binutils version less than 2.28 doesn't support UL suffix.

linux-ppc/arch/powerpc/kernel/cpu_setup_power.S: Assembler messages:
linux-ppc/arch/powerpc/kernel/cpu_setup_power.S:250: Error: found 'L', expected: ')' linux-ppc/arch/powerpc/kernel/cpu_setup_power.S:250: Error: junk at end of line, first unrecognized character is `L' linux-ppc/arch/powerpc/kernel/cpu_setup_power.S:250: Error: found 'L', expected: ')' linux-ppc/arch/powerpc/kernel/cpu_setup_power.S:250: Error: found 'L', expected: ')' linux-ppc/arch/powerpc/kernel/cpu_setup_power.S:250: Error: junk at end of line, first unrecognized character is `L' linux-ppc/arch/powerpc/kernel/cpu_setup_power.S:250: Error: found 'L', expected: ')' linux-ppc/arch/powerpc/kernel/cpu_setup_power.S:250: Error: found 'L', expected: ')' linux-ppc/arch/powerpc/kernel/cpu_setup_power.S:250: Error: operand out of range (0x0000002000000000 is not between 0xffffffffffff8000 and 0x000000000000ffff)

Quoted 1 line

[...]

Applied to powerpc/next.

[1/1] powerpc/perf: Fix MMCRA_BHRB_DISABLE define for binutils < 2.28

      https://git.kernel.org/powerpc/c/443359aebce0e17148251c0e316801fe69aa7d33

cheers