[PATCH 3/3] powerpc/ps3: Make real stack frames for LV1 hcalls

2023-12-26 Thread Nicholas Piggin
The PS3 hcall assembly code makes ad-hoc stack frames that don't have a back-chain pointer or meet other requirements like minimum frame size. This probably confuses stack unwinders. Give all hcalls a real stack frame. Signed-off-by: Nicholas Piggin --- arch/powerpc/platforms/ps3/hvcall.S | 152

[PATCH 2/3] powerpc/ps3: lv1 hcall code use symbolic constant for LR save offset

2023-12-26 Thread Nicholas Piggin
The LRSAVE constant is required for assembly compiled for both 32-bit and 64-bit, because the value differs there. PS3 is 64-bit only so this is a noop, but it is nice to abstract stack frame offsets. Signed-off-by: Nicholas Piggin --- arch/powerpc/platforms/ps3/hvcall.S | 128 ++

[PATCH 0/3] powerpc/ps3: Fixes for lv1 hcall assembly

2023-12-26 Thread Nicholas Piggin
This (hopefully) fixes the ELFv2 bug that Geoff reported, with patch 1. And a couple of other possible improvements I noticed. I don't have a PS3 setup[*] so I have only compile tested these, I'm sorry. [*] Is RPCS3 usable for this kind of thing? Thanks, Nick Nicholas Piggin (3): powerpc/ps3:

[PATCH 1/3] powerpc/ps3: Fix lv1 hcall assembly for ELFv2 calling convention

2023-12-26 Thread Nicholas Piggin
Stack-passed parameters begin at a different offset in the caller's stack in the ELFv2 ABI. Reported-by: Geoff Levand Fixes: 8c5fa3b5c4df ("powerpc/64: Make ELFv2 the default for big-endian builds") Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/ppc_asm.h | 6 -- arch/powerpc

[PATCHv10 3/3] powerpc/smp: Allow hole in paca_ptrs to accommodate boot_cpu

2023-12-26 Thread Pingfan Liu
From: Pingfan Liu This patch always forces the first core onlined due to some subsystem needs cpu0. After core0, a hole may follow, then comes the crashed core. Signed-off-by: Pingfan Liu Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Cc: Mahesh Salgaonkar Cc: Wen Xiong Cc:

[PATCHv10 2/3] powerpc/kernel: Extend arrays' size to make room for a hole in cpu_possible_mask

2023-12-26 Thread Pingfan Liu
From: Pingfan Liu This patch aims to mark all the arrays which size is decided by nr_cpu_ids or num_possible_cpus(). Later if a hole is allowed in cpu_possible_mask, the corresponding array should extend to hold the last bit number in cpu_possible_mask. Signed-off-by: Pingfan Liu Cc: Michael E

[PATCHv10 1/3] powerpc/kernel: Remove check on paca_ptrs_size

2023-12-26 Thread Pingfan Liu
From: Pingfan Liu Between early_setup()->allocate_paca_ptrs() and smp_setup_cpu_maps()->free_unused_pacas(), there is no call to set_nr_cpu_ids(), which means nr_cpu_ids is unchanged. Hence removing the check. Signed-off-by: Pingfan Liu Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe

[PATCHv10 0/3] enable nr_cpus for powerpc without re-ordering cpu number

2023-12-26 Thread Pingfan Liu
From: Pingfan Liu This series addresses the nr_cpus issue for PowerPC without re-ordering cpu number. To save the memory used by percpu area, it also limits the possible cpu numbers by allowing hole in cpu_possible_mask. Because the last cpu number will bigger than nr_cpu_ids in this way, some p

Re: [PATCH] powerpc/ps3_defconfig: Disable PPC64_BIG_ENDIAN_ELF_ABI_V2

2023-12-26 Thread Michael Ellerman
Geoff Levand writes: > Commit 8c5fa3b5c4df3d071dab42b04b971df370d99354 (powerpc/64: Make ELFv2 the > default for big-endian builds), merged in Linux-6.5-rc1 changes the calling > ABI > in a way that is incompatible with the current code for the PS3's LV1 > hypervisor > calls. I'll take this for

Re: [PATCH] arch: powerpc: kernel: fixed some typos

2023-12-26 Thread Michael Ellerman
Ghanshyam Agrawal writes: > On Thu, Dec 21, 2023 at 4:55 PM Michael Ellerman wrote: >> >> Ghanshyam Agrawal writes: >> > Fixed some typos >> > >> > Signed-off-by: Ghanshyam Agrawal >> > --- >> > arch/powerpc/kernel/eeh_pe.c | 6 +++--- >> > 1 file changed, 3 insertions(+), 3 deletions(-) >> >>

[PATCH 1/1] arch/mm/fault: fix major fault accounting when retrying under per-VMA lock

2023-12-26 Thread Suren Baghdasaryan
A test [1] in Android test suite started failing after [2] was merged. It turns out that after handling a major fault under per-VMA lock, the process major fault counter does not register that fault as major. Before [2] read faults would be done under mmap_lock, in which case FAULT_FLAG_TRIED flag