[powerpc:next] BUILD SUCCESS 4cfa6ff24a9744ba484521c38bea613134fbfcb3

2022-08-03 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git 
next
branch HEAD: 4cfa6ff24a9744ba484521c38bea613134fbfcb3  powerpc/64e: Fix kexec 
build error

elapsed time: 714m

configs tested: 92
configs skipped: 4

The following configs have been built successfully.
More configs may be tested in the coming days.

gcc tested configs:
um   x86_64_defconfig
um i386_defconfig
x86_64   rhel-8.3-kvm
x86_64rhel-8.3-kselftests
x86_64  rhel-8.3-func
x86_64 rhel-8.3-kunit
x86_64   rhel-8.3-syz
powerpc   allnoconfig
mips allyesconfig
i386defconfig
powerpc  allmodconfig
m68k allmodconfig
x86_64randconfig-a015
i386  randconfig-a016
i386 allyesconfig
i386  randconfig-a014
x86_64  defconfig
i386  randconfig-a012
ia64 allmodconfig
x86_64randconfig-a013
x86_64randconfig-a011
x86_64randconfig-a006
x86_64randconfig-a002
i386  randconfig-a001
arc  allyesconfig
arm defconfig
i386  randconfig-a005
alphaallyesconfig
x86_64randconfig-a004
i386  randconfig-a003
m68k allyesconfig
arc  randconfig-r043-20220803
sh   allmodconfig
x86_64   rhel-8.3
riscvrandconfig-r042-20220803
x86_64   allyesconfig
s390 randconfig-r044-20220803
arm  allyesconfig
arm64allyesconfig
sh   secureedge5410_defconfig
arm  footbridge_defconfig
sh  landisk_defconfig
i386  randconfig-c001
csky  allnoconfig
alpha allnoconfig
arc   allnoconfig
riscv allnoconfig
powerpc  ep88xc_defconfig
sparc   sparc32_defconfig
sh magicpanelr2_defconfig
sparc64  alldefconfig
loongarch   defconfig
loongarch allnoconfig
sparc   defconfig
sh   se7780_defconfig
mips loongson1b_defconfig
powerpc  makalu_defconfig
sh  sdk7780_defconfig
armqcom_defconfig
m68k   m5208evb_defconfig
sh  polaris_defconfig
arc defconfig
riscv  rv32_defconfig
riscvnommu_k210_defconfig
i386   debian-10.3-kselftests
i386  debian-10.3
m68k amcore_defconfig
powerpc linkstation_defconfig
xtensa virt_defconfig
armmulti_v7_defconfig
sh  rsk7264_defconfig

clang tested configs:
x86_64randconfig-a014
i386  randconfig-a013
i386  randconfig-a015
i386  randconfig-a011
x86_64randconfig-a005
x86_64randconfig-a016
x86_64randconfig-a012
x86_64randconfig-a001
x86_64randconfig-a003
i386  randconfig-a004
i386  randconfig-a002
hexagon  randconfig-r041-20220803
i386  randconfig-a006
hexagon  randconfig-r045-20220803
x86_64randconfig-k001
arm hackkit_defconfig
powerpcfsp2_defconfig
mips  maltaaprp_defconfig
arm   mainstone_defconfig
arm   spear13xx_defconfig
mips   ip22_defconfig

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp


[PATCH] powerpc/microwatt: Add LiteX MMC driver

2022-08-03 Thread Joel Stanley
Enable the LiteX MMC device and it's dependency the common clock
framework.

Signed-off-by: Joel Stanley 
---
 arch/powerpc/configs/microwatt_defconfig | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/powerpc/configs/microwatt_defconfig 
b/arch/powerpc/configs/microwatt_defconfig
index eff933ebbb9e..ea2dbd778aad 100644
--- a/arch/powerpc/configs/microwatt_defconfig
+++ b/arch/powerpc/configs/microwatt_defconfig
@@ -75,7 +75,12 @@ CONFIG_SPI_BITBANG=y
 CONFIG_SPI_SPIDEV=y
 # CONFIG_HWMON is not set
 # CONFIG_USB_SUPPORT is not set
+CONFIG_MMC=y
+# CONFIG_PWRSEQ_EMMC is not set
+# CONFIG_PWRSEQ_SIMPLE is not set
+CONFIG_MMC_LITEX=y
 # CONFIG_VIRTIO_MENU is not set
+CONFIG_COMMON_CLK=y
 # CONFIG_IOMMU_SUPPORT is not set
 # CONFIG_NVMEM is not set
 CONFIG_EXT4_FS=y
-- 
2.35.1



[PATCH] MAINTAINERS: Update ibmveth maintainer

2022-08-03 Thread Nick Child
Add Nick Child as the maintainer of the IBM Power Virtual Ethernet
Device Driver, replacing Cristobal Forno.

Signed-off-by: Nick Child 
---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 2cfda104ba4e..4686e505b8e0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9555,7 +9555,7 @@ F:arch/powerpc/platforms/powernv/copy-paste.h
 F: arch/powerpc/platforms/powernv/vas*
 
 IBM Power Virtual Ethernet Device Driver
-M: Cristobal Forno 
+M: Nick Child 
 L: net...@vger.kernel.org
 S: Supported
 F: drivers/net/ethernet/ibm/ibmveth.*
-- 
2.27.0



[PATCH] mm: check the return value of ioremap() in macio_init()

2022-08-03 Thread studentxswpy
From: Xie Shaowen 

The function ioremap() in macio_init() can fail, so
its return value should be checked.

Fixes: 36874579dbf4c ("[PATCH] powerpc: macio-adb build fix")
Reported-by: Hacash Robot 
Signed-off-by: Xie Shaowen 
---
 drivers/macintosh/macio-adb.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/macintosh/macio-adb.c b/drivers/macintosh/macio-adb.c
index 9b63bd2551c6..cd4e34d15c26 100644
--- a/drivers/macintosh/macio-adb.c
+++ b/drivers/macintosh/macio-adb.c
@@ -108,6 +108,10 @@ int macio_init(void)
return -ENXIO;
}
adb = ioremap(r.start, sizeof(struct adb_regs));
+   if (!adb) {
+   of_node_put(adbs);
+   return -ENOMEM;
+   }
 
out_8(>ctrl.r, 0);
out_8(>intr.r, 0);
-- 
2.25.1



Re: clang kernel PPC32 build failure, undefined reference to `__umoddi3'

2022-08-03 Thread Nick Desaulniers
Thanks for the report; tracking the issue here:
https://github.com/ClangBuiltLinux/linux/issues/1679

clang-15 got more aggressive about eliminating loops outright; some
cases can be replaced with division/remainder.  LLVM is missing
support for expanding 64b division by constant for 32b targets; WIP.

On Wed, Aug 3, 2022 at 11:54 AM Christophe Leroy
 wrote:
>
> Looks like since recently some clang builds fails for missing reference
> to `__umoddi3`.
>
> See exemple at:
> - https://github.com/ruscur/linux-ci/actions/runs/2789193140
> -
> https://patchwork.ozlabs.org/project/linuxppc-dev/patch/eca9251f1e1f82c4c46ec6380ddb28356ab3fdfe.1659527244.git.christophe.le...@csgroup.eu/
>
>  From fs/mpage.o:
>
> 0170 :
> ...
>   69c:  38 60 00 00 li  r3,0
>   6a0:  38 a0 00 00 li  r5,0
>   6a4:  38 c0 00 05 li  r6,5
>   6a8:  7d c4 73 78 mr  r4,r14
>   6ac:  92 e1 00 10 stw r23,16(r1)
>   6b0:  3a a0 00 00 li  r21,0
>   6b4:  93 81 00 18 stw r28,24(r1)
>   6b8:  3b 80 00 05 li  r28,5
>   6bc:  92 01 00 14 stw r16,20(r1)
>   6c0:  92 21 00 1c stw r17,28(r1)
>   6c4:  48 00 00 01 bl  6c4 
> 6c4: R_PPC_REL24__umoddi3
>
>
>
> I don't understand why calling __umoddi3 when the arguments are
> obviously 32 bits are r3 and r5 are zero.
>
> Christophe



-- 
Thanks,
~Nick Desaulniers


clang kernel PPC32 build failure, undefined reference to `__umoddi3'

2022-08-03 Thread Christophe Leroy
Looks like since recently some clang builds fails for missing reference 
to `__umoddi3`.


See exemple at:
- https://github.com/ruscur/linux-ci/actions/runs/2789193140
- 
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/eca9251f1e1f82c4c46ec6380ddb28356ab3fdfe.1659527244.git.christophe.le...@csgroup.eu/


From fs/mpage.o:

0170 :
...
 69c:   38 60 00 00 li  r3,0
 6a0:   38 a0 00 00 li  r5,0
 6a4:   38 c0 00 05 li  r6,5
 6a8:   7d c4 73 78 mr  r4,r14
 6ac:   92 e1 00 10 stw r23,16(r1)
 6b0:   3a a0 00 00 li  r21,0
 6b4:   93 81 00 18 stw r28,24(r1)
 6b8:   3b 80 00 05 li  r28,5
 6bc:   92 01 00 14 stw r16,20(r1)
 6c0:   92 21 00 1c stw r17,28(r1)
 6c4:   48 00 00 01 bl  6c4 
6c4: R_PPC_REL24__umoddi3



I don't understand why calling __umoddi3 when the arguments are 
obviously 32 bits are r3 and r5 are zero.


Christophe


Re: [PATCH] powerpc/ppc-opcode: Fix PPC_RAW_TW()

2022-08-03 Thread Naveen N. Rao

Christophe Leroy wrote:

PPC_RAW_TW() is erroneously defined with base code 0x7f08
instead of 0x7c08.

That's invisible because its only user is PPC_RAW_TRAP() which is
0x7fe8, but fix it anyway to avoid any risk of future bug.

Reported-by: Naveen N. Rao 
Fixes: d00d762daf12 ("powerpc/ppc-opcode: Define and use PPC_RAW_TRAP() and 
PPC_RAW_TW()")
Signed-off-by: Christophe Leroy 
---
 arch/powerpc/include/asm/ppc-opcode.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Thanks.
Reviewed-by: Naveen N. Rao 



diff --git a/arch/powerpc/include/asm/ppc-opcode.h 
b/arch/powerpc/include/asm/ppc-opcode.h
index d9703c5fd713..c6d724104ed1 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -571,7 +571,7 @@
 
 #define PPC_RAW_BRANCH(offset)		(0x4800 | PPC_LI(offset))

 #define PPC_RAW_BL(offset) (0x4801 | PPC_LI(offset))
-#define PPC_RAW_TW(t0, a, b)   (0x7f08 | ___PPC_RS(t0) | 
___PPC_RA(a) | ___PPC_RB(b))
+#define PPC_RAW_TW(t0, a, b)   (0x7c08 | ___PPC_RS(t0) | 
___PPC_RA(a) | ___PPC_RB(b))
 #define PPC_RAW_TRAP() PPC_RAW_TW(31, 0, 0)
 #define PPC_RAW_SETB(t, bfa)   (0x7c000100 | ___PPC_RT(t) | ___PPC_RA((bfa) 
<< 2))
 
--

2.36.1




Re: [PATCH v2] random: handle archrandom in plural words

2022-08-03 Thread Holger Dengler
Hi Jason,

On 22/07/2022 13:22, Jason A. Donenfeld wrote:
> On Fri, Jul 22, 2022 at 10:08:05AM +0200, Holger Dengler wrote:
>> Why not changing the API to take bytes instead of words? Sure, at the
>> moment it looks like all platforms with TRNG support are able to
>> deliver at least one word, but bytes would be more flexible. 
> 
> The idea is to strike a sweet spot between capabilities. S390x is fine
> with byte-level granularity up to arbitrary lengths, while x86 is best
> with word-level granularity of length 1. The happy intersection between
> the two is just word-level granularity of arbitrary length. Yes we
> _could_ introduce a lot of code complexity by cascading the x86 case
> down into smaller and smaller registers, ignoring the fact that it's no
> longer efficient below 32- or 64-bit registers depending on vendor. But
> then we're relying on the inliner to remove all of that extra code,
> since all callers actually only ever want 32 or 64 bytes. Why bloat for
> nothing? The beauty of this approach is that it translates very
> naturally over all the various quirks of architectures without having to
> have a lot of coupling code.

You're absolutely right. Your solution addresses all needs of current 
architectures. My proposal was just meant as preparation for the case, that new 
(smaller) architectures may come up in the future with a TRNG support, but with 
other granularity. But anyhow: we can handle it as soon as it happens, fine 
with me.


-- 
Mit freundlichen Grüßen / Kind regards
Holger Dengler
--
IBM Systems, Linux on IBM Z Development
deng...@linux.ibm.com


[PATCH] powerpc/ppc-opcode: Fix PPC_RAW_TW()

2022-08-03 Thread Christophe Leroy
PPC_RAW_TW() is erroneously defined with base code 0x7f08
instead of 0x7c08.

That's invisible because its only user is PPC_RAW_TRAP() which is
0x7fe8, but fix it anyway to avoid any risk of future bug.

Reported-by: Naveen N. Rao 
Fixes: d00d762daf12 ("powerpc/ppc-opcode: Define and use PPC_RAW_TRAP() and 
PPC_RAW_TW()")
Signed-off-by: Christophe Leroy 
---
 arch/powerpc/include/asm/ppc-opcode.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/ppc-opcode.h 
b/arch/powerpc/include/asm/ppc-opcode.h
index d9703c5fd713..c6d724104ed1 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -571,7 +571,7 @@
 
 #define PPC_RAW_BRANCH(offset) (0x4800 | PPC_LI(offset))
 #define PPC_RAW_BL(offset) (0x4801 | PPC_LI(offset))
-#define PPC_RAW_TW(t0, a, b)   (0x7f08 | ___PPC_RS(t0) | 
___PPC_RA(a) | ___PPC_RB(b))
+#define PPC_RAW_TW(t0, a, b)   (0x7c08 | ___PPC_RS(t0) | 
___PPC_RA(a) | ___PPC_RB(b))
 #define PPC_RAW_TRAP() PPC_RAW_TW(31, 0, 0)
 #define PPC_RAW_SETB(t, bfa)   (0x7c000100 | ___PPC_RT(t) | 
___PPC_RA((bfa) << 2))
 
-- 
2.36.1



Re: [PATCH 2/3] powerpc/ppc-opcode: Define and use PPC_RAW_TRAP() and PPC_RAW_TW()

2022-08-03 Thread Michael Ellerman
"Naveen N. Rao"  writes:
> Christophe Leroy wrote:
>> Add and use PPC_RAW_TRAP() instead of opencoding.
>> 
>> Signed-off-by: Christophe Leroy 
>> ---
>>  arch/powerpc/include/asm/ppc-opcode.h | 2 ++
>>  arch/powerpc/include/asm/probes.h | 3 ++-
>>  arch/powerpc/xmon/xmon.c  | 2 +-
>>  3 files changed, 5 insertions(+), 2 deletions(-)
>> 
>> diff --git a/arch/powerpc/include/asm/ppc-opcode.h 
>> b/arch/powerpc/include/asm/ppc-opcode.h
>> index 89beabf5325c..5527a955fb4a 100644
>> --- a/arch/powerpc/include/asm/ppc-opcode.h
>> +++ b/arch/powerpc/include/asm/ppc-opcode.h
>> @@ -581,6 +581,8 @@
>>  
>>  #define PPC_RAW_BRANCH(offset)  (0x4800 | PPC_LI(offset))
>>  #define PPC_RAW_BL(offset)  (0x4801 | PPC_LI(offset))
>> +#define PPC_RAW_TW(t0, a, b)(0x7f08 | ___PPC_RS(t0) | 
>> ___PPC_RA(a) | ___PPC_RB(b))
>
> Shouldn't that be 0x7c08 ?

Yes, my script agrees.

https://github.com/mpe/misc-scripts/blob/master/ppc/ppc-instruction-encode

$ ./ppc-instruction-encode 0:31 6:t0 11:ra 16:rb 21:4 31:
.long 0x7c08
t0 << 21
ra << 16
rb << 11


I guess the only user is PPC_RAW_TRAP() which passes t0 = 31, so that's
why nothing has broken.

Send a fixup? :)

cheers


Re: [PATCH 1/2] powerpc/64s: POWER9 DD2.3 CPU feature flag fixes

2022-08-03 Thread Michael Ellerman
Nicholas Piggin  writes:
> DD2.3 missed out on getting its feature flag bits.
>
> This meant when booting with dt-cpu-ftrs, CPU_FTR_P9_TM_HV_ASSIST is
> missing (unless the firmware contains it, which mine does not seem to).
> And when booting without, CPU_FTR_P9_TM_XER_SO_BUG is set.
>
> In practice this doesn't make any difference to pseries guests, only
> powernv.
>
> Signed-off-by: Nicholas Piggin 
> ---
>  arch/powerpc/include/asm/cputable.h |  2 ++
>  arch/powerpc/kernel/cputable.c  | 22 --
>  arch/powerpc/kernel/dt_cpu_ftrs.c   | 14 +-
>  3 files changed, 27 insertions(+), 11 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/cputable.h 
> b/arch/powerpc/include/asm/cputable.h
> index e85c849214a2..46bae9624784 100644
> --- a/arch/powerpc/include/asm/cputable.h
> +++ b/arch/powerpc/include/asm/cputable.h
> @@ -440,6 +440,8 @@ static inline void cpu_feature_keys_init(void) { }
>  #define CPU_FTRS_POWER9_DD2_2 (CPU_FTRS_POWER9 | CPU_FTR_POWER9_DD2_1 | \
>  CPU_FTR_P9_TM_HV_ASSIST | \
>  CPU_FTR_P9_TM_XER_SO_BUG)
> +#define CPU_FTRS_POWER9_DD2_3 (CPU_FTRS_POWER9 | CPU_FTR_POWER9_DD2_1 | \
> +CPU_FTR_P9_TM_HV_ASSIST)
>  #define CPU_FTRS_POWER10 (CPU_FTR_LWSYNC | \
>   CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | CPU_FTR_ARCH_206 |\
>   CPU_FTR_MMCRA | CPU_FTR_SMT | \
> diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
> index ae0fdef0ac11..9ab97d1fd5a2 100644
> --- a/arch/powerpc/kernel/cputable.c
> +++ b/arch/powerpc/kernel/cputable.c
> @@ -487,11 +487,29 @@ static struct cpu_spec __initdata cpu_specs[] = {
>   .machine_check_early= __machine_check_early_realmode_p9,
>   .platform   = "power9",
>   },
> - {   /* Power9 DD2.2 or later */
> + {   /* Power9 DD 2.2 */
> + .pvr_mask   = 0xefff,
> + .pvr_value  = 0x004e0202,
> + .cpu_name   = "POWER9 (raw)",
> + .cpu_features   = CPU_FTRS_POWER9_DD2_2,
> + .cpu_user_features  = COMMON_USER_POWER9,
> + .cpu_user_features2 = COMMON_USER2_POWER9,
> + .mmu_features   = MMU_FTRS_POWER9,
> + .icache_bsize   = 128,
> + .dcache_bsize   = 128,
> + .num_pmcs   = 6,
> + .pmc_type   = PPC_PMC_IBM,
> + .oprofile_cpu_type  = "ppc64/power9",
> + .cpu_setup  = __setup_cpu_power9,
> + .cpu_restore= __restore_cpu_power9,
> + .machine_check_early= __machine_check_early_realmode_p9,
> + .platform   = "power9",
> + },
> + {   /* Power9 DD 2.3 or later */
>   .pvr_mask   = 0x,
>   .pvr_value  = 0x004e,
>   .cpu_name   = "POWER9 (raw)",
> - .cpu_features   = CPU_FTRS_POWER9_DD2_2,
> + .cpu_features   = CPU_FTRS_POWER9_DD2_3,
>   .cpu_user_features  = COMMON_USER_POWER9,
>   .cpu_user_features2 = COMMON_USER2_POWER9,
>   .mmu_features   = MMU_FTRS_POWER9,
> diff --git a/arch/powerpc/kernel/dt_cpu_ftrs.c 
> b/arch/powerpc/kernel/dt_cpu_ftrs.c
> index 358aee7c2d79..af95f337e54b 100644
> --- a/arch/powerpc/kernel/dt_cpu_ftrs.c
> +++ b/arch/powerpc/kernel/dt_cpu_ftrs.c
> @@ -764,18 +764,14 @@ static __init void cpufeatures_cpu_quirks(void)
>* Not all quirks can be derived from the cpufeatures device tree.
>*/
>   if ((version & 0xefff) == 0x004e0200) {
> - /* DD2.0 has no feature flag */
> - cur_cpu_spec->cpu_features |= CPU_FTR_P9_RADIX_PREFETCH_BUG;
> + cur_cpu_spec->cpu_features |= CPU_FTRS_POWER9_DD2_0;
>   } else if ((version & 0xefff) == 0x004e0201) {
> - cur_cpu_spec->cpu_features |= CPU_FTR_POWER9_DD2_1;
> - cur_cpu_spec->cpu_features |= CPU_FTR_P9_RADIX_PREFETCH_BUG;
> + cur_cpu_spec->cpu_features |= CPU_FTRS_POWER9_DD2_1;
>   } else if ((version & 0xefff) == 0x004e0202) {
> - cur_cpu_spec->cpu_features |= CPU_FTR_P9_TM_HV_ASSIST;
> - cur_cpu_spec->cpu_features |= CPU_FTR_P9_TM_XER_SO_BUG;
> - cur_cpu_spec->cpu_features |= CPU_FTR_POWER9_DD2_1;
> + cur_cpu_spec->cpu_features |= CPU_FTRS_POWER9_DD2_2;
>   } else if ((version & 0x) == 0x004e) {
> - /* DD2.1 and up have DD2_1 */
> - cur_cpu_spec->cpu_features |= CPU_FTR_POWER9_DD2_1;
> + /* DD2.3 and up */
> + cur_cpu_spec->cpu_features |= CPU_FTRS_POWER9_DD2_3;
>   }

As we discussed on slack, this part is wrong.

Or'ing in the full CPU_FTRS_POWER9_DDx mask sets bits 

Re: [PATCH 2/3] powerpc/ppc-opcode: Define and use PPC_RAW_TRAP() and PPC_RAW_TW()

2022-08-03 Thread Naveen N. Rao

Christophe Leroy wrote:

Add and use PPC_RAW_TRAP() instead of opencoding.

Signed-off-by: Christophe Leroy 
---
 arch/powerpc/include/asm/ppc-opcode.h | 2 ++
 arch/powerpc/include/asm/probes.h | 3 ++-
 arch/powerpc/xmon/xmon.c  | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/ppc-opcode.h 
b/arch/powerpc/include/asm/ppc-opcode.h
index 89beabf5325c..5527a955fb4a 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -581,6 +581,8 @@
 
 #define PPC_RAW_BRANCH(offset)		(0x4800 | PPC_LI(offset))

 #define PPC_RAW_BL(offset) (0x4801 | PPC_LI(offset))
+#define PPC_RAW_TW(t0, a, b)   (0x7f08 | ___PPC_RS(t0) | 
___PPC_RA(a) | ___PPC_RB(b))


Shouldn't that be 0x7c08 ?

- Naveen



+#define PPC_RAW_TRAP() PPC_RAW_TW(31, 0, 0)
 
 /* Deal with instructions that older assemblers aren't aware of */

 #definePPC_BCCTR_FLUSH stringify_in_c(.long 
PPC_INST_BCCTR_FLUSH)
diff --git a/arch/powerpc/include/asm/probes.h 
b/arch/powerpc/include/asm/probes.h
index 00634e3145e7..e77a2ed7d938 100644
--- a/arch/powerpc/include/asm/probes.h
+++ b/arch/powerpc/include/asm/probes.h
@@ -9,8 +9,9 @@
  */
 #include 
 #include 
+#include 
 
-#define BREAKPOINT_INSTRUCTION	0x7fe8	/* trap */

+#define BREAKPOINT_INSTRUCTION PPC_RAW_TRAP()  /* trap */
 
 /* Trap definitions per ISA */

 #define IS_TW(instr)   (((instr) & 0xfc0007fe) == 0x7c08)
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index f80c714f1d49..26ef3388c24c 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -116,7 +116,7 @@ struct bpt {
 static struct bpt bpts[NBPTS];
 static struct bpt dabr[HBP_NUM_MAX];
 static struct bpt *iabr;
-static unsigned bpinstr = 0x7fe8;  /* trap */
+static unsigned int bpinstr = PPC_RAW_TRAP();
 
 #define BP_NUM(bp)	((bp) - bpts + 1)
 
--

2.36.1





[PATCH] powerpc: Update ISA versions to mention e5500/e6500

2022-08-03 Thread Michael Ellerman
Add the NXP (nee Freescale) e5500 and e6500 to the ISA versions
documentation.

Signed-off-by: Michael Ellerman 
---
 Documentation/powerpc/isa-versions.rst | 8 
 1 file changed, 8 insertions(+)

diff --git a/Documentation/powerpc/isa-versions.rst 
b/Documentation/powerpc/isa-versions.rst
index dfcb1097dce4..5592b8899a48 100644
--- a/Documentation/powerpc/isa-versions.rst
+++ b/Documentation/powerpc/isa-versions.rst
@@ -10,6 +10,8 @@ CPU   Architecture version
 Power10   Power ISA v3.1
 Power9Power ISA v3.0B
 Power8Power ISA v2.07
+e6500 Power ISA v2.06 with some exceptions
+e5500 Power ISA v2.06 with some exceptions, no Altivec
 Power7Power ISA v2.06
 Power6Power ISA v2.05
 PA6T  Power ISA v2.04
@@ -36,6 +38,8 @@ CPUVMX (aka. Altivec)
 Power10Yes
 Power9 Yes
 Power8 Yes
+e6500  Yes
+e5500  No
 Power7 Yes
 Power6 Yes
 PA6T   Yes
@@ -52,6 +56,8 @@ CPUVSX
 Power10Yes
 Power9 Yes
 Power8 Yes
+e6500  No
+e5500  No
 Power7 Yes
 Power6 No
 PA6T   No
@@ -68,6 +74,8 @@ CPUTransactional Memory
 Power10No  (* see Power ISA v3.1, "Appendix A. Notes on the Removal of 
Transactional Memory from the Architecture")
 Power9 Yes (* see transactional_memory.txt)
 Power8 Yes
+e6500  No
+e5500  No
 Power7 No
 Power6 No
 PA6T   No
-- 
2.35.3



[PATCH] powerpc/64e: Fix kexec build error

2022-08-03 Thread Michael Ellerman
When building ppc64_book3e_allmodconfig the build fails with:

  arch/powerpc/kexec/file_load_64.c:1063:14: error: implicit declaration of 
function ‘firmware_has_feature’
   1063 | if (!firmware_has_feature(FW_FEATURE_LPAR))
|  ^~~~

Add a direct include of asm/firmware.h to fix the error.

Fixes: b1fc44eaa9ba ("pseries/iommu/ddw: Fix kdump to work in absence of 
ibm,dma-window")
Signed-off-by: Michael Ellerman 
---
 arch/powerpc/kexec/file_load_64.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/kexec/file_load_64.c 
b/arch/powerpc/kexec/file_load_64.c
index 5d2c22aa34fb..683462e4556b 100644
--- a/arch/powerpc/kexec/file_load_64.c
+++ b/arch/powerpc/kexec/file_load_64.c
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
-- 
2.35.3