Re: [PATCH v2 1/2] maple_tree: Disable mas_wr_append() when other readers are possible

2023-09-12 Thread Andreas Schwab
On Sep 12 2023, Liam R. Howlett wrote:

> * Andreas Schwab  [230912 14:15]:
>> Any news?  This is still broken.
>
> I have a proposed fix.  I seem to have caused a pre-existing problem to
> show up.  Please see if the attached works for you, and I'll send it
> to a lot of people.

Thanks, it fixes the issue for me (tested both 6.5 and 6.6-rc1).

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v2 1/2] maple_tree: Disable mas_wr_append() when other readers are possible

2023-09-12 Thread Andreas Schwab
Any news?  This is still broken.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v2 1/2] maple_tree: Disable mas_wr_append() when other readers are possible

2023-08-31 Thread Andreas Schwab
On Aug 31 2023, Michael Ellerman wrote:

> Andreas Schwab  writes:
>> This breaks booting on ppc32:
>
> Does enabling CONFIG_DEBUG_ATOMIC_SLEEP fix the crash?

Yes, it does.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v2 1/2] maple_tree: Disable mas_wr_append() when other readers are possible

2023-08-30 Thread Andreas Schwab
This breaks booting on ppc32:

Kernel attemptd to writ user page (1ff0) - exploit attempt? (uid: 0)
BUG: Unable to handle kernel data access on write at 0x1ff0
Faulting instruction address: 0xc0009554
Vector: 300 (Data Access) at [c0b09d10]
pc: c0009554: do_softirq_own_stack+0x18/0x30
lr: c004f480: __irq_exit_rcu+0x70/0xc0
sp: c0b09dd0
   msr: 1032
   dar: 1ff0
 dsisr: 4200
  current = 0xc0a08360
pid   = 0, comm = swapper
Linux version 6.5.0 ...
enter ? for help
[c0b09de0] c00ff480 __irq_exit_rcu+0x70/0xc0
[c0b09df0] c0005a98 Decrementer_virt+0x108/0x10c
--- Exception: 900 (Decrementer) at c06cfa0c __schedule+0x4fc/0x510
[c0b09ec0] c06cf75c __schedule+0x1cc/0x510 (unreliable)
[c0b09ef0] c06cfc90 __cond_resched+0x2c/0x54
[c0b09f00] c06d07f8 mutex_lock_killable+0x18/0x5c
[c0b09f10] c013c404 pcpu_alloc+0x110/0x4dc
[c0b09f70] c000cc34 alloc_descr.isra.18+0x48/0x144
[c0b09f90] c0988aa0 early_irq_init+0x64/0x8c
[c0b09fa0] c097a5a4 start_kernel+0x5b4/0x7b0
[c0b09ff0] 3dc0
mon>

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v4 2/5] fs: Add fchmodat2()

2023-07-27 Thread Andreas Schwab
On Jul 27 2023, David Laight wrote:

> From: Aleksa Sarai
>> Sent: 25 July 2023 17:36
> ...
>> We almost certainly want to support AT_EMPTY_PATH at the same time.
>> Otherwise userspace will still need to go through /proc when trying to
>> chmod a file handle they have.
>
> That can't be allowed.

IIUC, fchmodat2(fd, "", m, AT_EMPTY_PATH) is equivalent to fchmod(fd,
m).  With that, new architectures only need to implement the fchmodat2
syscall to cover all chmod variants.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v8 1/3] riscv: Introduce CONFIG_RELOCATABLE

2023-05-19 Thread Andreas Schwab
On Mai 19 2023, Alexandre Ghiti wrote:

> I have tested the following patch successfully, can you give it a try
> while I make sure this is the only place I forgot to add the -fno-pie
> flag?
>
> diff --git a/arch/riscv/kernel/Makefile b/arch/riscv/kernel/Makefile
> index fbdccc21418a..153864e4f399 100644
> --- a/arch/riscv/kernel/Makefile
> +++ b/arch/riscv/kernel/Makefile
> @@ -23,6 +23,10 @@ ifdef CONFIG_FTRACE
>  CFLAGS_REMOVE_alternative.o = $(CC_FLAGS_FTRACE)
>  CFLAGS_REMOVE_cpufeature.o = $(CC_FLAGS_FTRACE)
>  endif
> +ifdef CONFIG_RELOCATABLE
> +CFLAGS_alternative.o += -fno-pie
> +CFLAGS_cpufeature.o += -fno-pie
> +endif
>  ifdef CONFIG_KASAN
>  KASAN_SANITIZE_alternative.o := n
>  KASAN_SANITIZE_cpufeature.o := n

I can confirm that this fixes the crash.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v8 1/3] riscv: Introduce CONFIG_RELOCATABLE

2023-05-11 Thread Andreas Schwab
On Mai 09 2023, Alexandre Ghiti wrote:

> On 5/9/23 21:07, Andreas Schwab wrote:
>> That does not work with UEFI booting:
>>
>> Loading Linux 6.4.0-rc1-1.g668187d-default ...
>> Loading initial ramdisk ...
>> Unhandled exception: Instruction access fault
>> EPC: 80016d56 RA: 8020334e TVAL: 007f80016d56
>> EPC: 002d1d56 RA: 004be34e reloc adjusted
>> Unhandled exception: Load access fault
>> EPC: fff462d4 RA: fff462d0 TVAL: 80016d56
>> EPC: 802012d4 RA: 802012d0 reloc adjusted
>>
>> Code: c825 8e0d 05b3 40b4 d0ef 0636 7493 ffe4 (d783 0004)
>> UEFI image [0xfe65e000:0xfe6e3fff] 
>> '/efi\boot\bootriscv64.efi'
>> UEFI image [0xdaa82000:0xdcc2afff]
>>
>
> I need more details please, as I have a UEFI bootflow and it works great
> (KASLR is based on a relocatable kernel and works fine in UEFI too).

It also crashes without UEFI.  Disabling CONFIG_RELOCATABLE fixes that.
This was tested on the HiFive Unmatched board.
The kernel image I tested is available from
<https://download.opensuse.org/repositories/Kernel:/HEAD/RISCV/>.  The
same kernel with CONFIG_RELOCATABLE disabled is available from
<https://download.opensuse.org/repositories/home:/Andreas_Schwab:/riscv:/kernel/standard/>.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v8 1/3] riscv: Introduce CONFIG_RELOCATABLE

2023-05-09 Thread Andreas Schwab
That does not work with UEFI booting:

Loading Linux 6.4.0-rc1-1.g668187d-default ...
Loading initial ramdisk ...
Unhandled exception: Instruction access fault
EPC: 80016d56 RA: 8020334e TVAL: 007f80016d56
EPC: 002d1d56 RA: 004be34e reloc adjusted
Unhandled exception: Load access fault
EPC: fff462d4 RA: fff462d0 TVAL: 80016d56
EPC: 802012d4 RA: 802012d0 reloc adjusted

Code: c825 8e0d 05b3 40b4 d0ef 0636 7493 ffe4 (d783 0004)
UEFI image [0xfe65e000:0xfe6e3fff] '/efi\boot\bootriscv64.efi'
UEFI image [0xdaa82000:0xdcc2afff]

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 06/14] powerpc/vdso: Remove unused '-s' flag from ASFLAGS

2023-01-09 Thread Andreas Schwab
On Jan 09 2023, Segher Boessenkool wrote:

> It is required by POSIX (for the c99 command, anyway).  It *also* is
> required to be supported when producing object files (so when no linking
> is done).
>
> It is a GCC flag, and documented just fine:
> https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html#index-s

Most assembler flags are unrelated to the flags passed to the compiler
driver, and -s is no exception.  POSIX has nothing to say about the
sub-commands of the compiler anyway.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] powerpc: Fix a wrong version calculation issue in ld_version

2023-01-03 Thread Andreas Schwab
On Jan 03 2023, Ojaswin Mujoo wrote:

> If version is of the form x.y.z and length(z) == 8, then most probably
> it is a date [mmdd]. As an approximation, discard the dd and 
> parts and keep the mm part in the version.

I don't think any part of the date should be mixed into the computed
version.  It just means that it's a snapshot from after the 2.37
release, so it should be treated like 2.37 (no further releases has been
made from this branch).

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


[PATCH] powerpc/32: fix syscall wrappers with 64-bit arguments

2022-10-31 Thread Andreas Schwab
With the introducion of syscall wrappers all wrappers for syscalls with
64-bit arguments must be handled specially, not only those that have
unaligned 64-bit arguments.  This left out the fallocate and
sync_file_range2 syscalls.

Fixes: 7e92e01b7245 ("powerpc: Provide syscall wrapper")
Fixes: e23750623835 ("powerpc/32: fix syscall wrappers with 64-bit arguments of 
unaligned register-pairs")
Signed-off-by: Andreas Schwab 
---
 arch/powerpc/include/asm/syscalls.h  |  7 +++
 arch/powerpc/kernel/sys_ppc32.c  | 13 -
 arch/powerpc/kernel/syscalls/syscall.tbl |  7 +--
 3 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/include/asm/syscalls.h 
b/arch/powerpc/include/asm/syscalls.h
index a1142496cd58..6d51b007b59e 100644
--- a/arch/powerpc/include/asm/syscalls.h
+++ b/arch/powerpc/include/asm/syscalls.h
@@ -104,6 +104,13 @@ long sys_ppc_ftruncate64(unsigned int fd, u32 reg4,
 unsigned long len1, unsigned long len2);
 long sys_ppc32_fadvise64(int fd, u32 unused, u32 offset1, u32 offset2,
 size_t len, int advice);
+long sys_ppc_sync_file_range2(int fd, unsigned int flags,
+ unsigned int offset1,
+ unsigned int offset2,
+ unsigned int nbytes1,
+ unsigned int nbytes2);
+long sys_ppc_fallocate(int fd, int mode, u32 offset1, u32 offset2,
+  u32 len1, u32 len2);
 #endif
 #ifdef CONFIG_COMPAT
 long compat_sys_mmap2(unsigned long addr, size_t len,
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c
index 1ab4a4d95aba..d451a8229223 100644
--- a/arch/powerpc/kernel/sys_ppc32.c
+++ b/arch/powerpc/kernel/sys_ppc32.c
@@ -112,7 +112,7 @@ PPC32_SYSCALL_DEFINE6(ppc32_fadvise64,
 advice);
 }
 
-COMPAT_SYSCALL_DEFINE6(ppc_sync_file_range2,
+PPC32_SYSCALL_DEFINE6(ppc_sync_file_range2,
   int, fd, unsigned int, flags,
   unsigned int, offset1, unsigned int, offset2,
   unsigned int, nbytes1, unsigned int, nbytes2)
@@ -122,3 +122,14 @@ COMPAT_SYSCALL_DEFINE6(ppc_sync_file_range2,
 
return ksys_sync_file_range(fd, offset, nbytes, flags);
 }
+
+#ifdef CONFIG_PPC32
+SYSCALL_DEFINE6(ppc_fallocate,
+   int, fd, int, mode,
+   u32, offset1, u32, offset2, u32, len1, u32, len2)
+{
+   return ksys_fallocate(fd, mode,
+ merge_64(offset1, offset2),
+ merge_64(len1, len2));
+}
+#endif
diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl 
b/arch/powerpc/kernel/syscalls/syscall.tbl
index e9e0df4f9a61..a0be127475b1 100644
--- a/arch/powerpc/kernel/syscalls/syscall.tbl
+++ b/arch/powerpc/kernel/syscalls/syscall.tbl
@@ -394,8 +394,11 @@
 305common  signalfdsys_signalfd
compat_sys_signalfd
 306common  timerfd_create  sys_timerfd_create
 307common  eventfd sys_eventfd
-308common  sync_file_range2sys_sync_file_range2
compat_sys_ppc_sync_file_range2
-309nospu   fallocate   sys_fallocate   
compat_sys_fallocate
+30832  sync_file_range2sys_ppc_sync_file_range2
compat_sys_ppc_sync_file_range2
+30864  sync_file_range2sys_sync_file_range2
+308spu sync_file_range2sys_sync_file_range2
+30932  fallocate   sys_ppc_fallocate   
compat_sys_fallocate
+30964  fallocate   sys_fallocate
 310nospu   subpage_protsys_subpage_prot
 31132  timerfd_settime sys_timerfd_settime32
 31164  timerfd_settime sys_timerfd_settime
-- 
2.38.1

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


[PATCH] asm-generic: compat: fix compat_arg_u64 and compat_arg_u64_dual

2022-10-31 Thread Andreas Schwab
The macros are defined backwards.

Fixes: 43d5de2b67d7 ("asm-generic: compat: Support BE for long long args in 
32-bit ABIs")
Signed-off-by: Andreas Schwab 
---
 include/asm-generic/compat.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/asm-generic/compat.h b/include/asm-generic/compat.h
index aeb257ad3d1a..8392caea398f 100644
--- a/include/asm-generic/compat.h
+++ b/include/asm-generic/compat.h
@@ -15,7 +15,7 @@
 #endif
 
 #ifndef compat_arg_u64
-#ifdef CONFIG_CPU_BIG_ENDIAN
+#ifndef CONFIG_CPU_BIG_ENDIAN
 #define compat_arg_u64(name)   u32  name##_lo, u32  name##_hi
 #define compat_arg_u64_dual(name)  u32, name##_lo, u32, name##_hi
 #else
-- 
2.38.1



Re: [PATCH v6 21/25] powerpc: Provide syscall wrapper

2022-10-30 Thread Andreas Schwab
On Okt 30 2022, Arnd Bergmann wrote:

> On Sun, Oct 30, 2022, at 16:34, Andreas Schwab wrote:
>> This breaks powerpc32.  The fallocate syscall misinterprets its
>> arguments.
>
> It was fixed in

Nope.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 1/2] powerpc/32: fix syscall wrappers with 64-bit arguments of unaligned register-pairs

2022-10-30 Thread Andreas Schwab
On Okt 12 2022, Nicholas Piggin wrote:

> diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl 
> b/arch/powerpc/kernel/syscalls/syscall.tbl
> index 2bca64f96164..e9e0df4f9a61 100644
> --- a/arch/powerpc/kernel/syscalls/syscall.tbl
> +++ b/arch/powerpc/kernel/syscalls/syscall.tbl
> @@ -228,8 +228,10 @@
>  176  64  rt_sigtimedwait sys_rt_sigtimedwait
>  177  nospu   rt_sigqueueinfo sys_rt_sigqueueinfo 
> compat_sys_rt_sigqueueinfo
>  178  nospu   rt_sigsuspend   sys_rt_sigsuspend   
> compat_sys_rt_sigsuspend
> -179  common  pread64 sys_pread64 
> compat_sys_ppc_pread64
> -180  common  pwrite64sys_pwrite64
> compat_sys_ppc_pwrite64
> +179  32  pread64 sys_ppc_pread64 
> compat_sys_ppc_pread64
> +179  64  pread64 sys_pread64
> +180  32  pwrite64sys_ppc_pwrite64
> compat_sys_ppc_pwrite64
> +180  64  pwrite64sys_pwrite64

Doesn't that lack entries for SPU?  Likewise for all other former common
syscalls in this patch.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v6 21/25] powerpc: Provide syscall wrapper

2022-10-30 Thread Andreas Schwab
It probably breaks every syscall with a 64-bit argument.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v6 21/25] powerpc: Provide syscall wrapper

2022-10-30 Thread Andreas Schwab
This breaks powerpc32.  The fallocate syscall misinterprets its
arguments.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: Fwd: Fwd: X stopped working with 5.14 on iBook

2021-11-04 Thread Andreas Schwab
I don't use debian.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: Fwd: Fwd: X stopped working with 5.14 on iBook

2021-11-03 Thread Andreas Schwab
On Nov 04 2021, Finn Thain wrote:

> Does your Xorg installation use --enable-suid-wrapper, Andreas?

Doesn't look like.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: Fwd: Fwd: X stopped working with 5.14 on iBook

2021-11-03 Thread Andreas Schwab
On Nov 02 2021, Finn Thain wrote:

> After many builds and tests, Stan and I were able to determine that this 
> regression only affects builds with CONFIG_USER_NS=y. That is,
>
> d3ccc9781560  + CONFIG_USER_NS=y  -->  fail
> d3ccc9781560  + CONFIG_USER_NS=n  -->  okay
> d3ccc9781560~ + CONFIG_USER_NS=y  -->  okay
> d3ccc9781560~ + CONFIG_USER_NS=n  -->  okay

On my iBook G4, X is working alright with 5.15 and CONFIG_USER_NS=y.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] powerpc/syscalls: Remove __NR__exit

2021-08-23 Thread Andreas Schwab
On Aug 23 2021, Christophe Leroy wrote:

> __NR_exit is nowhere used. On most architectures it was removed by

ITYM __NR__exit, which is what you are removing.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: Possible regression by ab037dd87a2f (powerpc/vdso: Switch VDSO to generic C implementation.)

2021-07-29 Thread Andreas Schwab
On Jul 29 2021, Michael Ellerman wrote:

> I haven't been able to reproduce the crash by following the instructions
> in your bug report, I have go1.13.8, I guess the crash is only in newer
> versions?

Yes, only go1.14 and later are affected.

https://build.opensuse.org/package/live_build_log/openSUSE:Factory:PowerPC/go1.13/standard/ppc64
https://build.opensuse.org/package/live_build_log/openSUSE:Factory:PowerPC/go1.14/standard/ppc64

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 4/4] powerpc/32: Avoid #ifdef nested with FTR_SECTION on booke syscall entry

2021-06-04 Thread Andreas Schwab
On Jun 04 2021, Christophe Leroy wrote:

> On booke, SYSCALL_ENTRY macro nests an FTR_SECTION with a

That sentence lacks an

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v3] powerpc/64: Option to use ELFv2 ABI for big-endian kernels

2021-05-03 Thread Andreas Schwab
Should this add a tag to the module vermagic?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] powerpc/64s: power4 nap fixup in C

2021-04-05 Thread Andreas Schwab
On Apr 05 2021, Nicholas Piggin wrote:

> I worked it out. There was a window where it could take another 
> interrupt before the first one adjusts the nip.
>
> I managed to trigger it in qemu and this version fixed it.

Works for me as well.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] powerpc/64s: power4 nap fixup in C

2021-03-29 Thread Andreas Schwab
On Mär 29 2021, Andreas Schwab wrote:

> On Mär 29 2021, Christophe Leroy wrote:
>
>> Le 29/03/2021 à 10:33, Benjamin Herrenschmidt a écrit :
>>> On Fri, 2021-03-12 at 11:20 +1000, Nicholas Piggin wrote:
>>>>
>>>> +static inline void nap_adjust_return(struct pt_regs *regs)
>>>>
>>>> +{
>>>>
>>>> +#ifdef CONFIG_PPC_970_NAP
>>>>
>>>> +   if (unlikely(test_thread_local_flags(_TLF_NAPPING))) {
>>>> +   /* Can avoid a test-and-clear because NMIs do not call 
>>>> this */
>>>> +   clear_thread_local_flags(_TLF_NAPPING);
>>>> +   regs->nip = (unsigned long)power4_idle_nap_return;
>>>> +   }
>>> Is this a pointer to a function descriptor or the actual code ?
>>> 
>>
>> --- a/arch/powerpc/kernel/idle_book3s.S
>> +++ b/arch/powerpc/kernel/idle_book3s.S
>> @@ -209,4 +209,8 @@ _GLOBAL(power4_idle_nap)
>>  mtmsrd  r7
>>  isync
>>  b   1b
>> +
>> +.globl power4_idle_nap_return
>> +power4_idle_nap_return:
>> +blr
>>  #endif
>
> The problem is not the definition, it is the reference.  In C, a
> function symbol always resolves to the address of the descriptor.

Sorry, this is wrong, I have misremembered how function descriptors work
on ppc64.  The address is really pointing to the actual code.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] powerpc/64s: power4 nap fixup in C

2021-03-29 Thread Andreas Schwab
On Mär 29 2021, Andreas Schwab wrote:

> On Mär 29 2021, Michael Ellerman wrote:
>
>> Nicholas Piggin  writes:
>>> There is no need for this to be in asm, use the new intrrupt entry wrapper.
>>>
>>> Signed-off-by: Nicholas Piggin 
>>> ---
>>> Hopefully this works on a real G5 now, but I couldn't reproduce the
>>> problem with QEMU.
>>
>> It still prevents my G5 from booting.
>
> I see differing failures.  What's common is that there is a pause of
> about 60 seconds before the crash occurs.  It looks like the crash
> occurs in power4_idle_nap+0x30/0x34.  Unfortuately, the BootX console is
> too small to see enough.

I was now able to see the messages on the VGA console, and the problem
is actually that the cpus are starting to stall.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] powerpc/64s: power4 nap fixup in C

2021-03-29 Thread Andreas Schwab
On Mär 29 2021, Michael Ellerman wrote:

> Nicholas Piggin  writes:
>> There is no need for this to be in asm, use the new intrrupt entry wrapper.
>>
>> Signed-off-by: Nicholas Piggin 
>> ---
>> Hopefully this works on a real G5 now, but I couldn't reproduce the
>> problem with QEMU.
>
> It still prevents my G5 from booting.

I see differing failures.  What's common is that there is a pause of
about 60 seconds before the crash occurs.  It looks like the crash
occurs in power4_idle_nap+0x30/0x34.  Unfortuately, the BootX console is
too small to see enough.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] powerpc/64s: power4 nap fixup in C

2021-03-29 Thread Andreas Schwab
On Mär 29 2021, Christophe Leroy wrote:

> Le 29/03/2021 à 10:33, Benjamin Herrenschmidt a écrit :
>> On Fri, 2021-03-12 at 11:20 +1000, Nicholas Piggin wrote:
>>>
>>> +static inline void nap_adjust_return(struct pt_regs *regs)
>>>
>>> +{
>>>
>>> +#ifdef CONFIG_PPC_970_NAP
>>>
>>> +   if (unlikely(test_thread_local_flags(_TLF_NAPPING))) {
>>> +   /* Can avoid a test-and-clear because NMIs do not call this 
>>> */
>>> +   clear_thread_local_flags(_TLF_NAPPING);
>>> +   regs->nip = (unsigned long)power4_idle_nap_return;
>>> +   }
>> Is this a pointer to a function descriptor or the actual code ?
>> 
>
> --- a/arch/powerpc/kernel/idle_book3s.S
> +++ b/arch/powerpc/kernel/idle_book3s.S
> @@ -209,4 +209,8 @@ _GLOBAL(power4_idle_nap)
>   mtmsrd  r7
>   isync
>   b   1b
> +
> + .globl power4_idle_nap_return
> +power4_idle_nap_return:
> + blr
>  #endif

The problem is not the definition, it is the reference.  In C, a
function symbol always resolves to the address of the descriptor.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 2/4] exec: remove compat_do_execve

2021-03-26 Thread Andreas Schwab
On Mär 26 2021, Christoph Hellwig wrote:

> Just call compat_do_execve instead.

ITYM compat_do_execveat here.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v3 11/17] riscv: Convert to GENERIC_CMDLINE

2021-03-26 Thread Andreas Schwab
On Mär 26 2021, Christophe Leroy wrote:

> diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
> index f8f15332caa2..e7c91ee478d1 100644
> --- a/arch/riscv/kernel/setup.c
> +++ b/arch/riscv/kernel/setup.c
> @@ -20,6 +20,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #include 
>  #include 
> @@ -228,10 +229,8 @@ static void __init parse_dtb(void)
>   }
>  
>   pr_err("No DTB passed to the kernel\n");
> -#ifdef CONFIG_CMDLINE_FORCE
> - strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
> + cmdline_build(boot_command_line, NULL, COMMAND_LINE_SIZE);
>   pr_info("Forcing kernel command line to: %s\n", boot_command_line);

Shouldn't that message become conditional in some way?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [RFC PATCH v1] powerpc: Enable KFENCE for PPC32

2021-03-03 Thread Andreas Schwab
On Mär 03 2021, Marco Elver wrote:

> On Wed, 3 Mar 2021 at 11:32, Christophe Leroy
>  wrote:
>> ./include/linux/kern_levels.h:5:18: warning: format '%zd' expects argument 
>> of type 'signed size_t',
>> but argument 3 has type 'ptrdiff_t' {aka 'const long int'} [-Wformat=]
>>  5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
>>|  ^~
>> ./include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
>> 11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
>>|  ^~~~
>> ./include/linux/printk.h:343:9: note: in expansion of macro 'KERN_ERR'
>>343 |  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
>>| ^~~~
>> mm/kfence/report.c:233:3: note: in expansion of macro 'pr_err'
>>233 |   pr_err("Invalid free of 0x%p (in kfence-#%zd):\n", (void 
>> *)address,
>>|   ^~
>>
>> Christophe
>
> No this is not expected. Is 'signed size_t' != 'long int' on ppc32?

If you want to format a ptrdiff_t you should use %td.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


[PATCH] powerpc/vdso: fix clock_gettime_fallback for vdso32

2021-01-11 Thread Andreas Schwab
The second argument of __kernel_clock_gettime64 points to a struct
__kernel_timespec, with 64-bit time_t, so use the clock_gettime64 syscall
in the fallback function for the 32-bit vdso.  Similarily,
clock_getres_fallback should use the clock_getres_time64 syscall, though
it isn't yet called from the 32-bit vdso.

Signed-off-by: Andreas Schwab 
---
 arch/powerpc/include/asm/vdso/gettimeofday.h | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/powerpc/include/asm/vdso/gettimeofday.h 
b/arch/powerpc/include/asm/vdso/gettimeofday.h
index 81671aa365b3..a26c12df2c9a 100644
--- a/arch/powerpc/include/asm/vdso/gettimeofday.h
+++ b/arch/powerpc/include/asm/vdso/gettimeofday.h
@@ -106,13 +106,21 @@ int gettimeofday_fallback(struct __kernel_old_timeval 
*_tv, struct timezone *_tz
 static __always_inline
 int clock_gettime_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
 {
+#ifndef __powerpc64__
+   return do_syscall_2(__NR_clock_gettime64, _clkid, (unsigned long)_ts);
+#else
return do_syscall_2(__NR_clock_gettime, _clkid, (unsigned long)_ts);
+#endif
 }
 
 static __always_inline
 int clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
 {
+#ifndef __powerpc64__
+   return do_syscall_2(__NR_clock_getres_time64, _clkid, (unsigned 
long)_ts);
+#else
return do_syscall_2(__NR_clock_getres, _clkid, (unsigned long)_ts);
+#endif
 }
 
 #ifdef CONFIG_VDSO32
-- 
2.30.0


-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v14 6/9] powerpc/vdso: Prepare for switching VDSO to generic C implementation.

2020-12-26 Thread Andreas Schwab
On Nov 27 2020, Michael Ellerman wrote:

> diff --git a/arch/powerpc/include/asm/vdso/gettimeofday.h 
> b/arch/powerpc/include/asm/vdso/gettimeofday.h
> new file mode 100644
> index ..43dd1dc47c37
> --- /dev/null
> +++ b/arch/powerpc/include/asm/vdso/gettimeofday.h
> @@ -0,0 +1,187 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _ASM_POWERPC_VDSO_GETTIMEOFDAY_H
> +#define _ASM_POWERPC_VDSO_GETTIMEOFDAY_H
> +
> +#ifdef __ASSEMBLY__
> +
> +#include 
> +
> +/*
> + * The macros sets two stack frames, one for the caller and one for the 
> callee
> + * because there are no requirement for the caller to set a stack frame when
> + * calling VDSO so it may have omitted to set one, especially on PPC64
> + */
> +
> +.macro cvdso_call funct
> +  .cfi_startproc
> + PPC_STLUr1, -PPC_MIN_STKFRM(r1)
> + mflrr0
> +  .cfi_register lr, r0
> + PPC_STLUr1, -PPC_MIN_STKFRM(r1)
> + PPC_STL r0, PPC_MIN_STKFRM + PPC_LR_STKOFF(r1)
> + get_datapager5, r0
> + addir5, r5, VDSO_DATA_OFFSET
> + bl  DOTSYM(\funct)
> + PPC_LL  r0, PPC_MIN_STKFRM + PPC_LR_STKOFF(r1)
> + cmpwi   r3, 0
> + mtlrr0
> +  .cfi_restore lr
> + addir1, r1, 2 * PPC_MIN_STKFRM
> + crclr   so
> + beqlr+
> + crset   so
> + neg r3, r3
> + blr
> +  .cfi_endproc
> +.endm
> +
> +.macro cvdso_call_time funct
> +  .cfi_startproc
> + PPC_STLUr1, -PPC_MIN_STKFRM(r1)
> + mflrr0
> +  .cfi_register lr, r0
> + PPC_STLUr1, -PPC_MIN_STKFRM(r1)
> + PPC_STL r0, PPC_MIN_STKFRM + PPC_LR_STKOFF(r1)
> + get_datapager4, r0
> + addir4, r4, VDSO_DATA_OFFSET
> + bl  DOTSYM(\funct)
> + PPC_LL  r0, PPC_MIN_STKFRM + PPC_LR_STKOFF(r1)
> + crclr   so
> + mtlrr0
> +  .cfi_restore lr
> + addir1, r1, 2 * PPC_MIN_STKFRM
> + blr
> +  .cfi_endproc
> +.endm
> +
> +#else
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#define VDSO_HAS_CLOCK_GETRES1
> +
> +#define VDSO_HAS_TIME1
> +
> +static __always_inline int do_syscall_2(const unsigned long _r0, const 
> unsigned long _r3,
> + const unsigned long _r4)
> +{
> + register long r0 asm("r0") = _r0;
> + register unsigned long r3 asm("r3") = _r3;
> + register unsigned long r4 asm("r4") = _r4;
> + register int ret asm ("r3");
> +
> + asm volatile(
> + "   sc\n"
> + "   bns+1f\n"
> + "   neg %0, %0\n"
> + "1:\n"
> + : "=r" (ret), "+r" (r4), "+r" (r0)
> + : "r" (r3)
> + : "memory", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "cr0", 
> "ctr");
> +
> + return ret;
> +}
> +
> +static __always_inline
> +int gettimeofday_fallback(struct __kernel_old_timeval *_tv, struct timezone 
> *_tz)
> +{
> + return do_syscall_2(__NR_gettimeofday, (unsigned long)_tv, (unsigned 
> long)_tz);
> +}
> +
> +static __always_inline
> +int clock_gettime_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
> +{
> + return do_syscall_2(__NR_clock_gettime, _clkid, (unsigned long)_ts);

Doesn't that need to be __NR_clock_gettime64 for ppc32?

> +}
> +
> +static __always_inline
> +int clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
> +{
> + return do_syscall_2(__NR_clock_getres, _clkid, (unsigned long)_ts);

And here __NR_clock_getres_time64?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] powerpc/32s: Use relocation offset when setting early hash table

2020-11-07 Thread Andreas Schwab
On Nov 07 2020, Serge Belyshev wrote:

> Christophe Leroy  writes:
>
>> When calling early_hash_table(), the kernel hasn't been yet
>> relocated to its linking address, so data must be addressed
>> with relocation offset.
>>
>> Add relocation offset to write into Hash in early_hash_table().
>>
>> Reported-by: Erhard Furtner 
>> Reported-by: Andreas Schwab 
>> Fixes: 69a1593abdbc ("powerpc/32s: Setup the early hash table at all time.")
>> Signed-off-by: Christophe Leroy 
>
> Tested-by: Serge Belyshev 

Works here as well.

Thanks, Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] powerpc: Use asm_goto_volatile for put_user()

2020-11-04 Thread Andreas Schwab
With that patch the kernel is working again.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] powerpc/32s: Setup the early hash table at all time.

2020-11-03 Thread Andreas Schwab
On Nov 03 2020, Christophe Leroy wrote:

> Would you mind checking that with that patch reverted, you are able to
> boot a kernel built with CONFIG_KASAN ?

That doesn't exist.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] powerpc/32s: Setup the early hash table at all time.

2020-11-03 Thread Andreas Schwab
On Nov 03 2020, Christophe Leroy wrote:

> I tried again on QEMU with both pmac32_defconfig and your config, and it 
> boots.

Isn't it quite naïve to think that qemu provides an adequate test
environment for such lowlevel stuff?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] powerpc/32s: Setup the early hash table at all time.

2020-10-30 Thread Andreas Schwab
#
# Automatically generated file; DO NOT EDIT.
# Linux/powerpc 5.10.0-rc1 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc-4.9 (SUSE Linux) 4.9.3"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=40903
CONFIG_LD_VERSION=23501
CONFIG_CLANG_VERSION=0
CONFIG_CC_CAN_LINK=y
CONFIG_CC_CAN_LINK_STATIC=y
CONFIG_CC_HAS_ASM_GOTO=y
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_TABLE_SORT=y
CONFIG_THREAD_INFO_IN_TASK=y

#
# General setup
#
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=32
# CONFIG_COMPILE_TEST is not set
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_BUILD_SALT=""
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_KERNEL_GZIP=y
# CONFIG_KERNEL_XZ is not set
CONFIG_DEFAULT_INIT=""
CONFIG_DEFAULT_HOSTNAME="(none)"
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
CONFIG_WATCH_QUEUE=y
CONFIG_CROSS_MEMORY_ATTACH=y
CONFIG_USELIB=y
CONFIG_AUDIT=y
CONFIG_HAVE_ARCH_AUDITSYSCALL=y
CONFIG_AUDITSYSCALL=y

#
# IRQ subsystem
#
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
# CONFIG_GENERIC_IRQ_DEBUGFS is not set
# end of IRQ subsystem

CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CMOS_UPDATE=y

#
# Timers subsystem
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ_COMMON=y
# CONFIG_HZ_PERIODIC is not set
CONFIG_NO_HZ_IDLE=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
# end of Timers subsystem

# CONFIG_PREEMPT_NONE is not set
CONFIG_PREEMPT_VOLUNTARY=y
# CONFIG_PREEMPT is not set

#
# CPU/Task time and stats accounting
#
CONFIG_TICK_CPU_ACCOUNTING=y
# CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set
# CONFIG_IRQ_TIME_ACCOUNTING is not set
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_PSI=y
# CONFIG_PSI_DEFAULT_DISABLED is not set
# end of CPU/Task time and stats accounting

#
# RCU Subsystem
#
CONFIG_TINY_RCU=y
# CONFIG_RCU_EXPERT is not set
CONFIG_SRCU=y
CONFIG_TINY_SRCU=y
CONFIG_TASKS_RCU_GENERIC=y
CONFIG_TASKS_TRACE_RCU=y
# end of RCU Subsystem

CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
# CONFIG_IKHEADERS is not set
CONFIG_LOG_BUF_SHIFT=18
CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13

#
# Scheduler features
#
# end of Scheduler features

CONFIG_CGROUPS=y
CONFIG_PAGE_COUNTER=y
CONFIG_MEMCG=y
CONFIG_MEMCG_SWAP=y
CONFIG_MEMCG_KMEM=y
CONFIG_BLK_CGROUP=y
CONFIG_CGROUP_WRITEBACK=y
CONFIG_CGROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_CFS_BANDWIDTH=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_CGROUP_PIDS=y
# CONFIG_CGROUP_RDMA is not set
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
# CONFIG_CGROUP_BPF is not set
# CONFIG_CGROUP_DEBUG is not set
CONFIG_SOCK_CGROUP_DATA=y
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
CONFIG_IPC_NS=y
CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
# CONFIG_CHECKPOINT_RESTORE is not set
CONFIG_SCHED_AUTOGROUP=y
# CONFIG_SYSFS_DEPRECATED is not set
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_RD_XZ=y
CONFIG_RD_LZO=y
CONFIG_RD_LZ4=y
CONFIG_RD_ZSTD=y
CONFIG_BOOT_CONFIG=y
# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION=y
# CONFIG_LD_DEAD_CODE_DATA_ELIMINATION is not set
CONFIG_SYSCTL=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_BPF=y
CONFIG_EXPERT=y
CONFIG_MULTIUSER=y
CONFIG_SGETMASK_SYSCALL=y
CONFIG_SYSFS_SYSCALL=y
CONFIG_FHANDLE=y
CONFIG_POSIX_TIMERS=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_FUTEX_PI=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_AIO=y
CONFIG_IO_URING=y
CONFIG_ADVISE_SYSCALLS=y
CONFIG_MEMBARRIER=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_KALLSYMS_BASE_RELATIVE=y
CONFIG_BPF_SYSCALL=y
# CONFIG_BPF_PRELOAD is not set
CONFIG_USERFAULTFD=y
CONFIG_ARCH_HAS_MEMBARRIER_CALLBACKS=y
CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y
CONFIG_RSEQ=y
# CONFIG_DEBUG_RSEQ is not set
# CONFIG_EMBEDDED is not set
CONFIG_HAVE_PERF_EVENTS=y
# CONFIG_PC104 is not set

#
# Kernel Performance Events And Counters
#
# CONFIG_PERF_EVENTS is not set
# end of Kernel Performance Events And Counters

CONFIG_VM_EVENT_COUNTERS=y
CONFIG_SLUB_DEBUG=y
CONFIG_SLUB_MEMCG_SYSFS_ON=y
# CONFIG_COMPAT_BRK is not set
# CONFIG_SLAB is not set
CONFIG_SLUB=y
# CONFIG_SLOB is not set
CONFIG_SLAB_MERGE_DEFAULT=y
# CONFIG_SLAB_FREELIST_RANDOM is not set
# CONFIG_SLAB_FREELIST_HARDENED is not set
# CONFIG_SHUFFLE_PAGE_ALLOCATOR is not set
CONFIG_SYSTEM_DATA_VERIFICATION=y
# CONFIG_PROFILING is not set
# end of General setup

CONFIG_PPC32=y
# CONFIG_PPC64 is not set
CONFIG_PPC_BOOK3S_32=y

#
# Processor support
#
CONFIG_PPC_BOOK3S_6xx=y
# CONFIG_PPC_85xx is not set
# CONFIG_PPC_8xx is not set
# CONFIG_40x is not set
# CONFIG_44x is not set
# CONFIG_E200 is not set
# CONFIG_GENERIC_CPU is not set
# CONFIG_E300C2_CPU is not set
# 

Re: [PATCH] powerpc/32s: Setup the early hash table at all time.

2020-10-30 Thread Andreas Schwab
On Okt 30 2020, Michael Ellerman wrote:

> Andreas Schwab  writes:
>> On Okt 01 2020, Christophe Leroy wrote:
>>
>>> At the time being, an early hash table is set up when
>>> CONFIG_KASAN is selected.
>>>
>>> There is nothing wrong with setting such an early hash table
>>> all the time, even if it is not used. This is a statically
>>> allocated 256 kB table which lies in the init data section.
>>>
>>> This makes the code simpler and may in the future allow to
>>> setup early IO mappings with fixmap instead of hard coding BATs.
>>>
>>> Put create_hpte() and flush_hash_pages() in the .ref.text section
>>> in order to avoid warning for the reference to early_hash[]. This
>>> reference is removed by MMU_init_hw_patch() before init memory is
>>> freed.
>>
>> This breaks booting on the iBook G4.
>
> Do you get an oops or anything?

Nope, nothing at all.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] powerpc/32s: Setup the early hash table at all time.

2020-10-29 Thread Andreas Schwab
On Okt 01 2020, Christophe Leroy wrote:

> At the time being, an early hash table is set up when
> CONFIG_KASAN is selected.
>
> There is nothing wrong with setting such an early hash table
> all the time, even if it is not used. This is a statically
> allocated 256 kB table which lies in the init data section.
>
> This makes the code simpler and may in the future allow to
> setup early IO mappings with fixmap instead of hard coding BATs.
>
> Put create_hpte() and flush_hash_pages() in the .ref.text section
> in order to avoid warning for the reference to early_hash[]. This
> reference is removed by MMU_init_hw_patch() before init memory is
> freed.

This breaks booting on the iBook G4.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 1/3] powerpc/uaccess: Switch __put_user_size_allowed() to __put_user_asm_goto()

2020-10-29 Thread Andreas Schwab
#
# Automatically generated file; DO NOT EDIT.
# Linux/powerpc 5.10.0-rc1 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc-4.9 (SUSE Linux) 4.9.3"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=40903
CONFIG_LD_VERSION=23501
CONFIG_CLANG_VERSION=0
CONFIG_CC_CAN_LINK=y
CONFIG_CC_CAN_LINK_STATIC=y
CONFIG_CC_HAS_ASM_GOTO=y
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_TABLE_SORT=y
CONFIG_THREAD_INFO_IN_TASK=y

#
# General setup
#
CONFIG_INIT_ENV_ARG_LIMIT=32
# CONFIG_COMPILE_TEST is not set
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_BUILD_SALT=""
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_KERNEL_GZIP=y
# CONFIG_KERNEL_XZ is not set
CONFIG_DEFAULT_INIT=""
CONFIG_DEFAULT_HOSTNAME="(none)"
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
CONFIG_WATCH_QUEUE=y
CONFIG_CROSS_MEMORY_ATTACH=y
CONFIG_USELIB=y
CONFIG_AUDIT=y
CONFIG_HAVE_ARCH_AUDITSYSCALL=y
CONFIG_AUDITSYSCALL=y

#
# IRQ subsystem
#
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
CONFIG_GENERIC_IRQ_MIGRATION=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
# CONFIG_GENERIC_IRQ_DEBUGFS is not set
# end of IRQ subsystem

CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_ARCH_HAS_TICK_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_CMOS_UPDATE=y

#
# Timers subsystem
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ_COMMON=y
# CONFIG_HZ_PERIODIC is not set
CONFIG_NO_HZ_IDLE=y
# CONFIG_NO_HZ_FULL is not set
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
# end of Timers subsystem

# CONFIG_PREEMPT_NONE is not set
CONFIG_PREEMPT_VOLUNTARY=y
# CONFIG_PREEMPT is not set

#
# CPU/Task time and stats accounting
#
CONFIG_VIRT_CPU_ACCOUNTING=y
# CONFIG_TICK_CPU_ACCOUNTING is not set
CONFIG_VIRT_CPU_ACCOUNTING_NATIVE=y
# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_PSI=y
# CONFIG_PSI_DEFAULT_DISABLED is not set
# end of CPU/Task time and stats accounting

# CONFIG_CPU_ISOLATION is not set

#
# RCU Subsystem
#
CONFIG_TREE_RCU=y
# CONFIG_RCU_EXPERT is not set
CONFIG_SRCU=y
CONFIG_TREE_SRCU=y
CONFIG_TASKS_RCU_GENERIC=y
CONFIG_TASKS_TRACE_RCU=y
CONFIG_RCU_STALL_COMMON=y
CONFIG_RCU_NEED_SEGCBLIST=y
# end of RCU Subsystem

CONFIG_BUILD_BIN2C=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
# CONFIG_IKHEADERS is not set
CONFIG_LOG_BUF_SHIFT=18
CONFIG_LOG_CPU_MAX_BUF_SHIFT=15
CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13

#
# Scheduler features
#
CONFIG_UCLAMP_TASK=y
CONFIG_UCLAMP_BUCKETS_COUNT=5
# end of Scheduler features

CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y
CONFIG_CC_HAS_INT128=y
CONFIG_CGROUPS=y
CONFIG_PAGE_COUNTER=y
CONFIG_MEMCG=y
CONFIG_MEMCG_SWAP=y
CONFIG_MEMCG_KMEM=y
CONFIG_BLK_CGROUP=y
CONFIG_CGROUP_WRITEBACK=y
CONFIG_CGROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_CFS_BANDWIDTH=y
CONFIG_RT_GROUP_SCHED=y
# CONFIG_UCLAMP_TASK_GROUP is not set
CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_RDMA=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_HUGETLB=y
CONFIG_CPUSETS=y
CONFIG_PROC_PID_CPUSET=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_PERF=y
CONFIG_CGROUP_BPF=y
# CONFIG_CGROUP_DEBUG is not set
CONFIG_SOCK_CGROUP_DATA=y
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
CONFIG_IPC_NS=y
CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_CHECKPOINT_RESTORE=y
# CONFIG_SCHED_AUTOGROUP is not set
# CONFIG_SYSFS_DEPRECATED is not set
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_RD_XZ=y
CONFIG_RD_LZO=y
CONFIG_RD_LZ4=y
CONFIG_RD_ZSTD=y
CONFIG_BOOT_CONFIG=y
# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION=y
# CONFIG_LD_DEAD_CODE_DATA_ELIMINATION is not set
CONFIG_SYSCTL=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_BPF=y
CONFIG_EXPERT=y
CONFIG_MULTIUSER=y
CONFIG_SGETMASK_SYSCALL=y
CONFIG_SYSFS_SYSCALL=y
CONFIG_FHANDLE=y
CONFIG_POSIX_TIMERS=y
CONFIG_PRINTK=y
CONFIG_PRINTK_NMI=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_FUTEX_PI=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_AIO=y
CONFIG_IO_URING=y
CONFIG_ADVISE_SYSCALLS=y
CONFIG_MEMBARRIER=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_KALLSYMS_BASE_RELATIVE=y
CONFIG_BPF_SYSCALL=y
CONFIG_USERMODE_DRIVER=y
# CONFIG_BPF_PRELOAD is not set
CONFIG_USERFAULTFD=y
CONFIG_ARCH_HAS_MEMBARRIER_CALLBACKS=y
CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y
CONFIG_RSEQ=y
# CONFIG_DEBUG_RSEQ is not set
# CONFIG_EMBEDDED is not set
CONFIG_HAVE_PERF_EVENTS=y
# CONFIG_PC104 is not set

#
# Kernel Performance Events And Counters
#
CONFIG_PERF_EVENTS=y
# end of Kernel Performance Events And Counters

CONFIG_VM_EVENT_COUNTERS=y
CONFIG_SLUB_DEBUG=y
CONFIG_SLUB_MEMCG_SYSFS_ON=y
# CONFIG_COMPAT_BRK is not set
# CONFIG_SLAB is not set
CONFIG_SLUB=y
# CONFIG_SLOB is not set

Re: [PATCH 1/3] powerpc/uaccess: Switch __put_user_size_allowed() to __put_user_asm_goto()

2020-10-28 Thread Andreas Schwab
On Okt 28 2020, Michael Ellerman wrote:

> What config and compiler are you using?

gcc 4.9.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 1/3] powerpc/uaccess: Switch __put_user_size_allowed() to __put_user_asm_goto()

2020-10-27 Thread Andreas Schwab
On Okt 28 2020, Andreas Schwab wrote:

> On Sep 04 2020, Christophe Leroy wrote:
>
>> __put_user_asm_goto() provides more flexibility to GCC and avoids using
>> a local variable to tell if the write succeeded or not.
>> GCC can then avoid implementing a cmp in the fast path.
>
> That breaks CLONE_CHILD_SETTID.  I'm getting an assertion failure in
> __libc_fork (THREAD_GETMEM (self, tid) != ppid).

This is what schedule_tail now looks like.  As you can see, put_user has
become a nop:

455c <.schedule_tail>:
455c:   7c 08 02 a6 mflrr0
4560:   f8 01 00 10 std r0,16(r1)
4564:   f8 21 ff 91 stdur1,-112(r1)
4568:   4b ff cd 4d bl  12b4 <.finish_task_switch>
456c:   4b ff c0 99 bl  604 <.balance_callback>
4570:   e8 6d 01 88 ld  r3,392(r13)
4574:   e9 23 06 b0 ld  r9,1712(r3)
4578:   2f a9 00 00 cmpdi   cr7,r9,0
457c:   41 9e 00 14 beq cr7,4590 <.schedule_tail+0x34>
4580:   38 80 00 00 li  r4,0
4584:   38 a0 00 00 li  r5,0
4588:   48 00 00 01 bl  4588 <.schedule_tail+0x2c>
4588: R_PPC64_REL24 .__task_pid_nr_ns
458c:   60 00 00 00 nop
4590:   48 00 00 01 bl  4590 <.schedule_tail+0x34>
4590: R_PPC64_REL24 .calculate_sigpending
4594:   60 00 00 00 nop
4598:   38 21 00 70 addir1,r1,112
459c:   e8 01 00 10 ld  r0,16(r1)
45a0:   7c 08 03 a6 mtlrr0
45a4:   4e 80 00 20 blr

This is schedule_tail in 5.9:

455c <.schedule_tail>:
455c:   7c 08 02 a6 mflrr0
4560:   fb c1 ff f0 std r30,-16(r1)
4564:   fb e1 ff f8 std r31,-8(r1)
4568:   f8 01 00 10 std r0,16(r1)
456c:   f8 21 ff 81 stdur1,-128(r1)
4570:   4b ff cd 45 bl  12b4 <.finish_task_switch>
4574:   4b ff c0 91 bl  604 <.balance_callback>
4578:   eb cd 01 88 ld  r30,392(r13)
457c:   eb fe 06 b0 ld  r31,1712(r30)
4580:   2f bf 00 00 cmpdi   cr7,r31,0
4584:   41 9e 00 2c beq cr7,45b0 <.schedule_tail+0x54>
4588:   7f c3 f3 78 mr  r3,r30
458c:   38 80 00 00 li  r4,0
4590:   38 a0 00 00 li  r5,0
4594:   48 00 00 01 bl  4594 <.schedule_tail+0x38>
4594: R_PPC64_REL24 .__task_pid_nr_ns
4598:   60 00 00 00 nop
459c:   e9 3e 0a b8 ld  r9,2744(r30)
45a0:   7f bf 48 40 cmpld   cr7,r31,r9
45a4:   41 9d 00 0c bgt cr7,45b0 <.schedule_tail+0x54>
45a8:   2b a9 00 03 cmpldi  cr7,r9,3
45ac:   41 9d 00 14 bgt cr7,45c0 <.schedule_tail+0x64>
45b0:   48 00 00 01 bl  45b0 <.schedule_tail+0x54>
45b0: R_PPC64_REL24 .calculate_sigpending
45b4:   60 00 00 00 nop
45b8:   38 21 00 80 addir1,r1,128
45bc:   48 00 00 00 b   45bc <.schedule_tail+0x60>
45bc: R_PPC64_REL24 _restgpr0_30
45c0:   39 20 00 00 li  r9,0
45c4:   90 7f 00 00 stw r3,0(r31)
45c8:   4b ff ff e8 b   45b0 <.schedule_tail+0x54>


Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 1/3] powerpc/uaccess: Switch __put_user_size_allowed() to __put_user_asm_goto()

2020-10-27 Thread Andreas Schwab
On Sep 04 2020, Christophe Leroy wrote:

> __put_user_asm_goto() provides more flexibility to GCC and avoids using
> a local variable to tell if the write succeeded or not.
> GCC can then avoid implementing a cmp in the fast path.

That breaks CLONE_CHILD_SETTID.  I'm getting an assertion failure in
__libc_fork (THREAD_GETMEM (self, tid) != ppid).

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v2] powerpc: fix EDEADLOCK redefinition error in uapi/asm/errno.h

2020-09-17 Thread Andreas Schwab
On Sep 17 2020, Arnd Bergmann wrote:

> The errno man page says they are supposed to be synonyms,
> and glibc defines it that way, while musl uses the numbers
> from the kernel.

glibc also uses whatever the kernel defines.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] powerpc/32s: Fix module loading failure when VMALLOC_END is over 0xf0000000

2020-08-21 Thread Andreas Schwab
On Aug 21 2020, Christophe Leroy wrote:

> In is_module_segment(), when VMALLOC_END is over 0xf000,
> ALIGN(VMALLOC_END, SZ_256M) has value 0.
>
> In that case, addr >= ALIGN(VMALLOC_END, SZ_256M) is always
> true then is_module_segment() always returns false.
>
> Use (ALIGN(VMALLOC_END, SZ_256M) - 1) which will have
> value 0x and will be suitable for the comparison.
>
> Reported-by: Andreas Schwab 
> Signed-off-by: Christophe Leroy 
> Fixes: c49643319715 ("powerpc/32s: Only leave NX unset on segments used for 
> modules")

Thanks, that fixes the crash.

Tested-by: Andreas Schwab 

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v2 3/6] powerpc/32s: Only leave NX unset on segments used for modules

2020-08-20 Thread Andreas Schwab
On Jun 29 2020, Christophe Leroy wrote:

> Instead of leaving NX unset on all segments above the start
> of vmalloc space, only leave NX unset on segments used for
> modules.

I'm getting this crash:

kernel tried to execute exec-protected page (f294b000) - exploit attempt (uid: 
0)
BUG: Unable to handle kernel instruction fetch
Faulting instruction address: 0xf294b000
Oops: Kernel access of bad area, sig: 11 [#1]
BE PAGE_SIZE=4K MMU=Hash PowerMac
Modules linked in: pata_macio(+)
CPU: 0 PID: 87 Comm: udevd Not tainted 5.8.0-rc2-test #49
NIP:  f294b000 LR: 0005c60 CTR: f294b000
REGS: f18d9cc0 TRAP: 0400  Not tainted  (5.8.0-rc2-test)
MSR:  10009032   CR: 84222422  XER: 2000
GPR00: c0005c14 f18d9d78 ef30ca20  efe0 c00993d0 ef6da038 005e
GPR08: c09050b8 c08b  f18d9d78 44222422 10072070  0fefaca4
GPR16: 1006a00c f294d50b 0120 0124 c0096ea8 000e ef2776c0 ef2776e4
GPR24: f18fd6e8 0001 c086fe64 c086fe04  c08b f294b000 
NIP [f294b000] pata_macio_init+0x0/0xc0 [pata_macio]
LR [c0005c60] do_one_initcall+0x6c/0x160
Call Trace:
[f18d9d78] [c0005c14] do_one_initcall+0x20/0x160 (unreliable)
[f18d9dd8] [c009a22c] do_init_module+0x60/0x1c0
[f18d9df8] [c00993d8] load_module+0x16a8/0x1c14
[f18d9ea8] [c0099aa4] sys_finit_module+0x8c/0x94
[f18d9f38] [c0012174] ret_from_syscall+0x0/0x34
--- interrupt: c01 at 0xfdb4318
   LR = 0xfeee9c0
Instruction dump:
       
    <3d20c08b> 3d40c086 9421ffe0 8129106c
---[ end trace 85a98cc836109871 ]---

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v2] powerpc: select ARCH_HAS_MEMBARRIER_SYNC_CORE

2020-07-15 Thread Andreas Schwab
On Jul 15 2020, Nicholas Piggin wrote:

> diff --git a/arch/powerpc/include/asm/exception-64e.h 
> b/arch/powerpc/include/asm/exception-64e.h
> index 54a98ef7d7fe..071d7ccb830f 100644
> --- a/arch/powerpc/include/asm/exception-64e.h
> +++ b/arch/powerpc/include/asm/exception-64e.h
> @@ -204,7 +204,11 @@ exc_##label##_book3e:
>   LOAD_REG_ADDR(r3,interrupt_base_book3e);\
>   ori r3,r3,vector_offset@l;  \
>   mtspr   SPRN_IVOR##vector_number,r3;
> -
> +/*
> + * powerpc relies on return from interrupt/syscall being context 
> synchronising
> + * (which rfi is) to support ARCH_HAS_MEMBARRIER_SYNC_CORE without additional
> + * additional synchronisation instructions.

s/additonal//

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v2 2/2] powerpc/configs: replace deprecated riva/nvidia with nouveau

2020-05-18 Thread Andreas Schwab
On Mai 18 2020, Michael Ellerman wrote:

> The old drivers may be crufty but they presumably have been tested by
> people and at least somewhat work.

I can confirm that the nvidia fbdev driver is working perfectly fine.

> I gave it a quick spin on a G5 I have access to and dmesg has a bunch of
> errors in it (see below). I can't actually tell if the display is
> working because the machine is remote, and I can't go and check it at
> the moment because the office is closed.

The nouveau driver is completely borked.

[2.299204] nouveau :f0:10.0: NVIDIA NV34 (034100a2)
[2.363100] nouveau :f0:10.0: bios: version 04.34.20.19.00
[2.363273] nouveau :f0:10.0: bios: OOB 1 0962 0962
[2.363323] nouveau :f0:10.0: bios: OOB 1 0966 0966
[2.363332] nouveau :f0:10.0: bios: OOB 1 0963 0963
[2.363341] nouveau :f0:10.0: bios: OOB 1 0964 0964
[2.363387] nouveau :f0:10.0: bios: OOB 1 096a 096a
[2.363396] nouveau :f0:10.0: bios: OOB 1 0967 0967
[2.363405] nouveau :f0:10.0: bios: OOB 1 0968 0968
[2.363453] nouveau :f0:10.0: bios: OOB 1 096e 096e
[2.363462] nouveau :f0:10.0: bios: OOB 1 096b 096b
[2.363471] nouveau :f0:10.0: bios: OOB 1 096c 096c
[2.363516] nouveau :f0:10.0: bios: OOB 1 0972 0972
[2.363526] nouveau :f0:10.0: bios: OOB 1 096f 096f
[2.363534] nouveau :f0:10.0: bios: OOB 1 0970 0970
[2.363580] nouveau :f0:10.0: bios: OOB 1 0976 0976
[2.363589] nouveau :f0:10.0: bios: OOB 1 0973 0973
[2.363597] nouveau :f0:10.0: bios: OOB 1 0974 0974
[2.363643] nouveau :f0:10.0: bios: OOB 1 097a 097a
[2.363652] nouveau :f0:10.0: bios: OOB 1 0977 0977
[2.363661] nouveau :f0:10.0: bios: OOB 1 0978 0978
[2.363709] nouveau :f0:10.0: bios: OOB 1 097e 097e
[2.363718] nouveau :f0:10.0: bios: OOB 1 097b 097b
[2.363727] nouveau :f0:10.0: bios: OOB 1 097c 097c
[2.363772] nouveau :f0:10.0: bios: OOB 1 0982 0982
[2.363781] nouveau :f0:10.0: bios: OOB 1 097f 097f
[2.363790] nouveau :f0:10.0: bios: OOB 1 0980 0980
[2.363836] nouveau :f0:10.0: bios: OOB 1 0986 0986
[2.363845] nouveau :f0:10.0: bios: OOB 1 0983 0983
[2.363854] nouveau :f0:10.0: bios: OOB 1 0984 0984
[2.363900] nouveau :f0:10.0: bios: OOB 1 098a 098a
[2.363909] nouveau :f0:10.0: bios: OOB 1 0987 0987
[2.363918] nouveau :f0:10.0: bios: OOB 1 0988 0988
[2.363965] nouveau :f0:10.0: bios: OOB 1 098e 098e
[2.363974] nouveau :f0:10.0: bios: OOB 1 098b 098b
[2.363983] nouveau :f0:10.0: bios: OOB 1 098c 098c
[2.364029] nouveau :f0:10.0: bios: OOB 1 0992 0992
[2.364038] nouveau :f0:10.0: bios: OOB 1 098f 098f
[2.364047] nouveau :f0:10.0: bios: OOB 1 0990 0990
[2.364383] nouveau :f0:10.0: gpio: GPU is missing power, check its 
power cables.  Boot with nouveau.config=NvPowerChecks=0 to disable.
[2.364402] nouveau :f0:10.0: gpio: init failed, -22
[2.364431] nouveau :f0:10.0: init failed with -22
[2.364438] nouveau: DRM-master::0080: init failed with -22
[2.364450] nouveau :f0:10.0: DRM-master: Device allocation failed: -22
[2.365268] nouveau: probe of :f0:10.0 failed with error -22

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] macintosh: windfarm: fix MODINFO regression

2020-03-03 Thread Andreas Schwab
On Mär 03 2020, Wolfram Sang wrote:

> sound/aoa/codecs/onyx.c
> sound/aoa/codecs/tas.c

These are loaded explicitly via request_module (as snd-aoa-codec-%s).

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: vmlinux ELF header sometimes corrupt

2020-01-24 Thread Andreas Schwab
On Jan 22 2020, Rasmus Villemoes wrote:

> So the inode number and mtime/ctime are exactly the same, but for some
> reason Blocks: has changed? This is on an ext4 filesystem, but I don't
> suspect the filesystem to be broken, because it's always just vmlinux
> that ends up corrupt, and always in exactly this way with the first 52
> bytes having been wiped.

Note that the size of the ELF header (Elf32_Ehdr) is 52 bytes.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: Call for report - G5/PPC970 status

2019-12-12 Thread Andreas Schwab
On Dez 12 2019, Romain Dolbeau wrote:

> Can you share your kernel config, compiler version, and other details?

I'm using 4K pages, in case that matters, and gcc 4.8.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."
#
# Automatically generated file; DO NOT EDIT.
# Linux/powerpc 5.5.0-rc1 Kernel Configuration
#

#
# Compiler: gcc (SUSE Linux) 4.8.1 20130909 [gcc-4_8-branch revision 202388]
#
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=40801
CONFIG_CLANG_VERSION=0
CONFIG_CC_CAN_LINK=y
CONFIG_CC_HAS_ASM_GOTO=y
CONFIG_CC_HAS_WARN_MAYBE_UNINITIALIZED=y
CONFIG_CC_DISABLE_WARN_MAYBE_UNINITIALIZED=y
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_EXTABLE_SORT=y
CONFIG_THREAD_INFO_IN_TASK=y

#
# General setup
#
CONFIG_INIT_ENV_ARG_LIMIT=32
# CONFIG_COMPILE_TEST is not set
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_BUILD_SALT=""
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_KERNEL_GZIP=y
# CONFIG_KERNEL_XZ is not set
CONFIG_DEFAULT_HOSTNAME="(none)"
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
CONFIG_CROSS_MEMORY_ATTACH=y
CONFIG_USELIB=y
CONFIG_AUDIT=y
CONFIG_HAVE_ARCH_AUDITSYSCALL=y
CONFIG_AUDITSYSCALL=y

#
# IRQ subsystem
#
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
CONFIG_GENERIC_IRQ_MIGRATION=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
# CONFIG_GENERIC_IRQ_DEBUGFS is not set
# end of IRQ subsystem

CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_ARCH_HAS_TICK_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_CMOS_UPDATE=y

#
# Timers subsystem
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ_COMMON=y
# CONFIG_HZ_PERIODIC is not set
CONFIG_NO_HZ_IDLE=y
# CONFIG_NO_HZ_FULL is not set
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
# end of Timers subsystem

# CONFIG_PREEMPT_NONE is not set
CONFIG_PREEMPT_VOLUNTARY=y
# CONFIG_PREEMPT is not set

#
# CPU/Task time and stats accounting
#
CONFIG_VIRT_CPU_ACCOUNTING=y
# CONFIG_TICK_CPU_ACCOUNTING is not set
CONFIG_VIRT_CPU_ACCOUNTING_NATIVE=y
# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_PSI=y
# CONFIG_PSI_DEFAULT_DISABLED is not set
# end of CPU/Task time and stats accounting

# CONFIG_CPU_ISOLATION is not set

#
# RCU Subsystem
#
CONFIG_TREE_RCU=y
# CONFIG_RCU_EXPERT is not set
CONFIG_SRCU=y
CONFIG_TREE_SRCU=y
CONFIG_RCU_STALL_COMMON=y
CONFIG_RCU_NEED_SEGCBLIST=y
# end of RCU Subsystem

CONFIG_BUILD_BIN2C=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
# CONFIG_IKHEADERS is not set
CONFIG_LOG_BUF_SHIFT=18
CONFIG_LOG_CPU_MAX_BUF_SHIFT=15
CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13

#
# Scheduler features
#
CONFIG_UCLAMP_TASK=y
CONFIG_UCLAMP_BUCKETS_COUNT=5
# end of Scheduler features

CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y
CONFIG_CC_HAS_INT128=y
CONFIG_CGROUPS=y
CONFIG_PAGE_COUNTER=y
CONFIG_MEMCG=y
CONFIG_MEMCG_SWAP=y
# CONFIG_MEMCG_SWAP_ENABLED is not set
CONFIG_MEMCG_KMEM=y
CONFIG_BLK_CGROUP=y
CONFIG_CGROUP_WRITEBACK=y
CONFIG_CGROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_CFS_BANDWIDTH=y
CONFIG_RT_GROUP_SCHED=y
# CONFIG_UCLAMP_TASK_GROUP is not set
CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_RDMA=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_HUGETLB=y
CONFIG_CPUSETS=y
CONFIG_PROC_PID_CPUSET=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_PERF=y
CONFIG_CGROUP_BPF=y
# CONFIG_CGROUP_DEBUG is not set
CONFIG_SOCK_CGROUP_DATA=y
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
CONFIG_IPC_NS=y
CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_CHECKPOINT_RESTORE=y
# CONFIG_SCHED_AUTOGROUP is not set
# CONFIG_SYSFS_DEPRECATED is not set
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_RD_XZ=y
CONFIG_RD_LZO=y
CONFIG_RD_LZ4=y
# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION=y
# CONFIG_LD_DEAD_CODE_DATA_ELIMINATION is not set
CONFIG_SYSCTL=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_BPF=y
CONFIG_EXPERT=y
CONFIG_MULTIUSER=y
CONFIG_SGETMASK_SYSCALL=y
CONFIG_SYSFS_SYSCALL=y
CONFIG_FHANDLE=y
CONFIG_POSIX_TIMERS=y
CONFIG_PRINTK=y
CONFIG_PRINTK_NMI=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_FUTEX_PI=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_AIO=y
CONFIG_IO_URING=y
CONFIG_ADVISE_SYSCALLS=y
CONFIG_MEMBARRIER=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_KALLSYMS_BASE_RELATIVE=y
CONFIG_BPF_SYSCALL=y
CONFIG_USERFAULTFD=y
CONFIG_ARCH_HAS_MEMBARRIER_CALLBACKS=y
CONFIG_RSEQ=y
# CONFIG_DEBUG_RSEQ is not set
# CONFIG_EMBEDDED is not set
CONFIG_HAVE_PERF_EVENTS=y
# CONFIG_PC104 is not set

#
# Kernel Performance Events And Counte

Re: Call for report - G5/PPC970 status

2019-12-12 Thread Andreas Schwab
On Dez 11 2019, Romain Dolbeau wrote:

> Same question to anyone else with a G5 / PPC970 - what is it and does
> it boot recent PPC64 Linux kernel ?

My PowerMac7,3 (DP 2.0GHz) can boot 5.5-rc1 without issues.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: passing NULL to clock_getres (VDSO): terminated by unexpected signal 11

2019-10-20 Thread Andreas Schwab
On Okt 20 2019, Thomas Gleixner wrote:

> But for the sake of making a non-sensical specification happy we can add a
> NULL pointer check for this. The interesting question is what should be
> returned in this case.

0 if the clock id is valid, EINVAL otherwise.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: passing NULL to clock_getres (VDSO): terminated by unexpected signal 11

2019-10-20 Thread Andreas Schwab
On Okt 20 2019, Thomas Gleixner wrote:

> POSIX does not mention anything about the validity of the pointer handed to
> clock_getres().

Sure it does: "If the argument res is not NULL, the resolution of the
specified clock shall be stored in the location pointed to by res.  If
res is NULL, the clock resolution is not returned.".

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: passing NULL to clock_getres (VDSO): terminated by unexpected signal 11

2019-10-20 Thread Andreas Schwab
On Okt 20 2019, Thomas Gleixner  wrote:

> clock_getres(NULL) is hardly valid.

Of course not, it lacks a parameter.

> So special casing
>
> clock_getres(clock, NULL);
>
> just to make a test case happy is a pointless exercise which does not make
> any sense at all.

POSIX requires it to work.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: passing NULL to clock_getres (VDSO): terminated by unexpected signal 11

2019-10-20 Thread Andreas Schwab
On Okt 20 2019, Christophe Leroy  wrote:

> Le 19/10/2019 à 21:18, Andreas Schwab a écrit :
>> On Okt 19 2019, Christophe Leroy  wrote:
>>
>>> Hi Nathan,
>>>
>>> While trying to switch powerpc VDSO to C version of gettimeofday(), I'm
>>> getting the following kind of error with vdsotest:
>>>
>>> passing NULL to clock_getres (VDSO): terminated by unexpected signal 11
>>>
>>> Looking at commit a9446a906f52 ("lib/vdso/32: Remove inconsistent NULL
>>> pointer checks"), it seems that signal 11 is expected when passing NULL
>>> pointer.
>>>
>>> Any plan to fix vdsotest ?
>>
>> Passing NULL to clock_getres is valid, and required to return
>> successfully if the clock id is valid.
>>
>
> Do you mean the following commit is wrong ?
>
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/lib/vdso?id=a9446a906f52292c52ecbd5be78eaa4d8395756c

If it causes a valid call to clock_getres to fail, then yes.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Re: passing NULL to clock_getres (VDSO): terminated by unexpected signal 11

2019-10-19 Thread Andreas Schwab
On Okt 19 2019, Christophe Leroy  wrote:

> Hi Nathan,
>
> While trying to switch powerpc VDSO to C version of gettimeofday(), I'm
> getting the following kind of error with vdsotest:
>
> passing NULL to clock_getres (VDSO): terminated by unexpected signal 11
>
> Looking at commit a9446a906f52 ("lib/vdso/32: Remove inconsistent NULL
> pointer checks"), it seems that signal 11 is expected when passing NULL
> pointer.
>
> Any plan to fix vdsotest ?

Passing NULL to clock_getres is valid, and required to return
successfully if the clock id is valid.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH -next] ASoC: fsl_mqs: fix old-style function declaration

2019-10-11 Thread Andreas Schwab
On Okt 11 2019, YueHaibing  wrote:

> gcc warn about this:
>
> sound/soc/fsl/fsl_mqs.c:146:1: warning:
>  static is not at beginning of declaration [-Wold-style-declaration]

It's not a function, though.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 2/6] powerpc/64s/radix: tidy up TLB flushing code

2019-09-30 Thread Andreas Schwab
arch/powerpc/mm/book3s64/pgtable.c: In function ‘flush_partition’:
arch/powerpc/mm/book3s64/pgtable.c:216:3: error: implicit declaration of 
function ‘radix__flush_all_lpid_guest’ [-Werror=implicit-function-declaration]
   radix__flush_all_lpid_guest(lpid);
   ^
cc1: all warnings being treated as errors
make[4]: *** [arch/powerpc/mm/book3s64/pgtable.o] Error 1

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v12 01/12] lib: introduce copy_struct_{to, from}_user helpers

2019-09-05 Thread Andreas Schwab
On Sep 05 2019, Aleksa Sarai  wrote:

> diff --git a/lib/struct_user.c b/lib/struct_user.c
> new file mode 100644
> index ..7301ab1bbe98
> --- /dev/null
> +++ b/lib/struct_user.c
> @@ -0,0 +1,182 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * Copyright (C) 2019 SUSE LLC
> + * Copyright (C) 2019 Aleksa Sarai 
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#define BUFFER_SIZE 64
> +
> +/*
> + * "memset(p, 0, size)" but for user space buffers. Caller must have already
> + * checked access_ok(p, size).
> + */
> +static int __memzero_user(void __user *p, size_t s)
> +{
> + const char zeros[BUFFER_SIZE] = {};

Perhaps make that static?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: 5.2.7 kernel doesn't boot on G5

2019-08-16 Thread Andreas Schwab
On Aug 16 2019, Christian Marillat  wrote:

> On 15 août 2019 19:50, christophe leroy  wrote:
>
> [...]
>
>> Can you test with latest stable version, ie 5.2.8 ?
>
> Built from my G5 with make-kpkg and still doesn't boot :

FWIW, 5.2.0 is working fine on my G5 (PowerMac7,3).

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [RFC PATCH v2 02/12] powerpc/ptrace: drop unnecessary #ifdefs CONFIG_PPC64

2019-06-28 Thread Andreas Schwab
On Jun 28 2019, Christophe Leroy  wrote:

> Le 28/06/2019 à 18:36, Andreas Schwab a écrit :
>> On Jun 28 2019, Christophe Leroy  wrote:
>>
>>> diff --git a/arch/powerpc/include/uapi/asm/ptrace.h 
>>> b/arch/powerpc/include/uapi/asm/ptrace.h
>>> index f5f1ccc740fc..37d7befbb8dc 100644
>>> --- a/arch/powerpc/include/uapi/asm/ptrace.h
>>> +++ b/arch/powerpc/include/uapi/asm/ptrace.h
>>> @@ -43,12 +43,11 @@ struct pt_regs
>>> unsigned long link;
>>> unsigned long xer;
>>> unsigned long ccr;
>>> -#ifdef __powerpc64__
>>> -   unsigned long softe;/* Soft enabled/disabled */
>>> -#else
>>> -   unsigned long mq;   /* 601 only (not used at present) */
>>> +   union {
>>> +   unsigned long softe;/* Soft enabled/disabled */
>>> +   unsigned long mq;   /* 601 only (not used at present) */
>>> /* Used on APUS to hold IPL value. */
>>> -#endif
>>> +   };
>>
>> Anonymous unions are a C11 feature.
>>
>
> Is that a problem ?

Yes, this is a UAPI header.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [RFC PATCH v2 02/12] powerpc/ptrace: drop unnecessary #ifdefs CONFIG_PPC64

2019-06-28 Thread Andreas Schwab
On Jun 28 2019, Christophe Leroy  wrote:

> diff --git a/arch/powerpc/include/uapi/asm/ptrace.h 
> b/arch/powerpc/include/uapi/asm/ptrace.h
> index f5f1ccc740fc..37d7befbb8dc 100644
> --- a/arch/powerpc/include/uapi/asm/ptrace.h
> +++ b/arch/powerpc/include/uapi/asm/ptrace.h
> @@ -43,12 +43,11 @@ struct pt_regs
>   unsigned long link;
>   unsigned long xer;
>   unsigned long ccr;
> -#ifdef __powerpc64__
> - unsigned long softe;/* Soft enabled/disabled */
> -#else
> - unsigned long mq;   /* 601 only (not used at present) */
> + union {
> + unsigned long softe;/* Soft enabled/disabled */
> + unsigned long mq;   /* 601 only (not used at present) */
>   /* Used on APUS to hold IPL value. */
> -#endif
> +     };

Anonymous unions are a C11 feature.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 0/1] PPC32: fix ptrace() access to FPU registers

2019-06-18 Thread Andreas Schwab
On Jun 18 2019, Radu Rendec  wrote:

> Since you already have a working setup, it would be nice if you could
> add a printk to arch_ptrace() to print the address and confirm what I
> believe happens (by reading the gdb source code).

A ppc32 ptrace syscall goes through compat_arch_ptrace.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


[PATCH] powerpc/mm/32s: fix condition that is always true

2019-06-17 Thread Andreas Schwab
Move a misplaced paren that makes the condition always true.

Fixes: 63b2bc619565 ("powerpc/mm/32s: Use BATs for STRICT_KERNEL_RWX")
Signed-off-by: Andreas Schwab 
---
 arch/powerpc/mm/pgtable_32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index d53188dee18f..35cb96cfc258 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -360,7 +360,7 @@ void mark_initmem_nx(void)
unsigned long numpages = PFN_UP((unsigned long)_einittext) -
 PFN_DOWN((unsigned long)_sinittext);
 
-   if (v_block_mapped((unsigned long)_stext) + 1)
+   if (v_block_mapped((unsigned long)_stext + 1))
mmu_mark_initmem_nx();
else
change_page_attr(page, numpages, PAGE_KERNEL);
-- 
2.22.0

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] powerpc/32s: fix suspend/resume when IBATs 4-7 are used

2019-06-17 Thread Andreas Schwab
  AS  arch/powerpc/kernel/swsusp_32.o
arch/powerpc/kernel/swsusp_32.S: Assembler messages:
arch/powerpc/kernel/swsusp_32.S:109: Error: invalid bat number
arch/powerpc/kernel/swsusp_32.S:111: Error: invalid bat number
arch/powerpc/kernel/swsusp_32.S:113: Error: invalid bat number
arch/powerpc/kernel/swsusp_32.S:115: Error: invalid bat number
arch/powerpc/kernel/swsusp_32.S:117: Error: invalid bat number  
arch/powerpc/kernel/swsusp_32.S:119: Error: invalid bat number  
arch/powerpc/kernel/swsusp_32.S:121: Error: invalid bat number  
arch/powerpc/kernel/swsusp_32.S:123: Error: invalid bat number  
arch/powerpc/kernel/swsusp_32.S:143: Error: invalid bat number  
arch/powerpc/kernel/swsusp_32.S:145: Error: invalid bat number  
arch/powerpc/kernel/swsusp_32.S:147: Error: invalid bat number  
arch/powerpc/kernel/swsusp_32.S:149: Error: invalid bat number  
arch/powerpc/kernel/swsusp_32.S:151: Error: invalid bat number  
arch/powerpc/kernel/swsusp_32.S:153: Error: invalid bat number  
arch/powerpc/kernel/swsusp_32.S:155: Error: invalid bat number
arch/powerpc/kernel/swsusp_32.S:157: Error: invalid bat number
make[3]: *** [arch/powerpc/kernel/swsusp_32.o] Error 1

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v5 13/16] powerpc/mm/32s: Use BATs for STRICT_KERNEL_RWX

2019-06-16 Thread Andreas Schwab
On Jun 16 2019, christophe leroy  wrote:

> If any of registers IBATs 4 to 7 are used, could you adjust
> CONFIG_ETEXT_SHIFT so that only IBATs 0 to 3 be used, and check if
> suspend/resume works when IBATs 4 to 7 are not used ?

I forgot to remove my patch.  With only 0-3 used, suspend/resume works.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v5 13/16] powerpc/mm/32s: Use BATs for STRICT_KERNEL_RWX

2019-06-16 Thread Andreas Schwab
On Jun 16 2019, christophe leroy  wrote:

> If any of registers IBATs 4 to 7 are used

Nope.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v5 13/16] powerpc/mm/32s: Use BATs for STRICT_KERNEL_RWX

2019-06-16 Thread Andreas Schwab
On Jun 16 2019, christophe leroy  wrote:

> Le 15/06/2019 à 14:28, Andreas Schwab a écrit :
>> On Feb 21 2019, Christophe Leroy  wrote:
>>
>>> diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
>>> index a000768a5cc9..6e56a6240bfa 100644
>>> --- a/arch/powerpc/mm/pgtable_32.c
>>> +++ b/arch/powerpc/mm/pgtable_32.c
>>> @@ -353,7 +353,10 @@ void mark_initmem_nx(void)
>>> unsigned long numpages = PFN_UP((unsigned long)_einittext) -
>>>  PFN_DOWN((unsigned long)_sinittext);
>>>   - change_page_attr(page, numpages, PAGE_KERNEL);
>>> +   if (v_block_mapped((unsigned long)_stext) + 1)
>>
>> That is always true.
>>
>
> Did you boot with 'nobats' kernel parameter ?
>
> If not, that's normal to be true, it means that memory is mapped with BATs.

bool + 1 is always true.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] powerpc/mm/32s: only use MMU to mark initmem NX if STRICT_KERNEL_RWX

2019-06-15 Thread Andreas Schwab
On Jun 15 2019, Christophe Leroy  wrote:

> Andreas Schwab  a écrit :
>
>> If STRICT_KERNEL_RWX is disabled, never use the MMU to mark initmen
>> nonexecutable.
>
> I dont understand, can you elaborate ?

It breaks suspend.

> This area is mapped with BATs so using change_page_attr() is pointless.

There must be a reason STRICT_KERNEL_RWX is not available with
HIBERNATE.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


[PATCH] powerpc/mm/32s: only use MMU to mark initmem NX if STRICT_KERNEL_RWX

2019-06-15 Thread Andreas Schwab
If STRICT_KERNEL_RWX is disabled, never use the MMU to mark initmen
nonexecutable.

Also move a misplaced paren that makes the condition always true.

Fixes: 63b2bc619565 ("powerpc/mm/32s: Use BATs for STRICT_KERNEL_RWX")
Signed-off-by: Andreas Schwab 
---
 arch/powerpc/mm/pgtable_32.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index d53188dee18f..3935dc263d65 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -360,9 +360,11 @@ void mark_initmem_nx(void)
unsigned long numpages = PFN_UP((unsigned long)_einittext) -
 PFN_DOWN((unsigned long)_sinittext);
 
-   if (v_block_mapped((unsigned long)_stext) + 1)
+#ifdef CONFIG_STRICT_KERNEL_RWX
+   if (v_block_mapped((unsigned long)_stext + 1))
mmu_mark_initmem_nx();
else
+#endif
change_page_attr(page, numpages, PAGE_KERNEL);
 }
 
-- 
2.22.0

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v5 13/16] powerpc/mm/32s: Use BATs for STRICT_KERNEL_RWX

2019-06-15 Thread Andreas Schwab
On Feb 21 2019, Christophe Leroy  wrote:

> diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
> index a000768a5cc9..6e56a6240bfa 100644
> --- a/arch/powerpc/mm/pgtable_32.c
> +++ b/arch/powerpc/mm/pgtable_32.c
> @@ -353,7 +353,10 @@ void mark_initmem_nx(void)
>   unsigned long numpages = PFN_UP((unsigned long)_einittext) -
>PFN_DOWN((unsigned long)_sinittext);
>  
> - change_page_attr(page, numpages, PAGE_KERNEL);
> + if (v_block_mapped((unsigned long)_stext) + 1)

That is always true.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v5 13/16] powerpc/mm/32s: Use BATs for STRICT_KERNEL_RWX

2019-06-15 Thread Andreas Schwab
This breaks suspend (or resume) on the iBook G4.  no_console_suspend
doesn't give any clues, the display just stays dark.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook

2019-06-11 Thread Andreas Schwab
On Jun 10 2019, Larry Finger  wrote:

> I do not understand why the if statement returns true as neither of the
> values is zero.

That's because the format string does not make any sense.  You are
printing garbage.

> diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c
> index f7afdad..ba2489d 100644
> --- a/kernel/dma/mapping.c
> +++ b/kernel/dma/mapping.c
> @@ -317,9 +317,12 @@ int dma_supported(struct device *dev, u64 mask)
>
>  int dma_set_mask(struct device *dev, u64 mask)
>  {
> +   pr_info("mask 0x%llx, dma_mask 0x%llx, dma_supported 0x%llx\n",
> mask, dev->dma_mask,
> +   dma_supported(dev, mask));

None of the format directives match the type of the arguments.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] [RFC] Remove bdflush syscall stub

2019-05-28 Thread Andreas Schwab
On Mai 28 2019, Cyril Hrubis  wrote:

> I've tested the patch on i386. Before the patch calling bdflush() with
> attempt to tune a variable returned 0 and after the patch the syscall
> fails with EINVAL.

Should be ENOSYS, doesn't it?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: powerpc/mm: Only define MAX_PHYSMEM_BITS in SPARSEMEM configurations

2019-03-25 Thread Andreas Schwab
On Mär 25 2019, Michael Ellerman  wrote:

> So I'm inclined to just switch to always using SPARSEMEM on 64-bit
> Book3S, because that's what's well tested and we hardly need more code
> paths to test. Unless anyone has a strong objection, I haven't actually
> benchmarked FLATMEM vs SPARSEMEM on a G5.

Configuring with SPARSEMEM saves about 32Mb of memory.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: powerpc/mm: Only define MAX_PHYSMEM_BITS in SPARSEMEM configurations

2019-03-24 Thread Andreas Schwab
On Mär 24 2019, Ben Hutchings  wrote:

> Presumably you have CONFIG_PPC_BOOK3S_64 enabled and CONFIG_SPARSEMEM
> disabled?  Was this configuration actually usable?

Why not?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: powerpc/mm: Only define MAX_PHYSMEM_BITS in SPARSEMEM configurations

2019-03-24 Thread Andreas Schwab
On Mär 22 2019, Michael Ellerman  wrote:

> On Sun, 2019-03-17 at 01:17:56 UTC, Ben Hutchings wrote:
>> MAX_PHYSMEM_BITS only needs to be defined if CONFIG_SPARSEMEM is
>> enabled, and that was the case before commit 4ffe713b7587
>> ("powerpc/mm: Increase the max addressable memory to 2PB").
>> 
>> On 32-bit systems, where CONFIG_SPARSEMEM is not enabled, we now
>> define it as 46.  That is larger than the real number of physical
>> address bits, and breaks calculations in zsmalloc:
>> 
>> mm/zsmalloc.c:130:49: warning: right shift count is negative 
>> [-Wshift-count-negative]
>>   MAX(32, (ZS_MAX_PAGES_PER_ZSPAGE << PAGE_SHIFT >> OBJ_INDEX_BITS))
>>  ^~
>> ...
>> mm/zsmalloc.c:253:21: error: variably modified 'size_class' at file scope
>>   struct size_class *size_class[ZS_SIZE_CLASSES];
>>  ^~
>> 
>> Fixes: 4ffe713b7587 ("powerpc/mm: Increase the max addressable memory to 
>> 2PB")
>> Cc: sta...@vger.kernel.org
>> Signed-off-by: Ben Hutchings 
>
> Applied to powerpc fixes, thanks.
>
> https://git.kernel.org/powerpc/c/8bc086899816214fbc6047c9c7e15fca

In file included from ./arch/powerpc/include/asm/book3s/64/mmu.h:39:0,
 from ./arch/powerpc/include/asm/mmu.h:360,
 from ./arch/powerpc/include/asm/lppaca.h:36,
 from ./arch/powerpc/include/asm/paca.h:21,
 from ./arch/powerpc/include/asm/current.h:16,
 from ./include/linux/thread_info.h:21,
 from ./include/asm-generic/preempt.h:5,
 from ./arch/powerpc/include/generated/asm/preempt.h:1,
 from ./include/linux/preempt.h:78,
 from ./include/linux/spinlock.h:51,
 from ./include/linux/mmzone.h:8,
 from ./include/linux/gfp.h:6,
 from ./include/linux/slab.h:15,
 from ./include/linux/crypto.h:24,
 from ./include/crypto/algapi.h:15,
 from ./include/crypto/internal/hash.h:16,
 from arch/powerpc/crypto/md5-glue.c:15:
./arch/powerpc/include/asm/book3s/64/mmu-hash.h:584:6: error: 
"MAX_PHYSMEM_BITS" is not defined [-Werror=undef]
 #if (MAX_PHYSMEM_BITS > MAX_EA_BITS_PER_CONTEXT)
  ^

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] powerpc/64s: Fix possible corruption on big endian due to pgd/pud_present()

2019-02-16 Thread Andreas Schwab
On Feb 14 2019, Michael Ellerman  wrote:

> The fix is simple, we need to convert the result of the bitwise && to
> an int before returning it.

Alternatively, the return type could be changed to bool, so that the
compiler does the right thing by itself.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 01/11] powerpc: remove dead ifdefs in

2019-02-14 Thread Andreas Schwab
On Feb 13 2019, Christoph Hellwig  wrote:

> __KERNEL__ is never not defined for non-uapi headers, and GENERIC_CSUM

"... never not ... non-..."  That's a bit too negative, I think.  :-)

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [PATCH] powerpc: use PTRRELOC during early init

2018-10-03 Thread Andreas Schwab
On Okt 03 2018, Christophe LEROY  wrote:

> Did you try my proposed fix https://patchwork.ozlabs.org/patch/977195/ ?

That works as well.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


[PATCH] powerpc: use PTRRELOC during early init

2018-10-02 Thread Andreas Schwab
This fixes a crash on powerpc32 when using global data during early init
without relocating its address.

Fixes: 51c3c62b58 (powerpc: Avoid code patching freed init sections)
Signed-off-by: Andreas Schwab 
---
 arch/powerpc/lib/code-patching.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/lib/code-patching.c b/arch/powerpc/lib/code-patching.c
index 6ae2777c22..6192fdae36 100644
--- a/arch/powerpc/lib/code-patching.c
+++ b/arch/powerpc/lib/code-patching.c
@@ -29,7 +29,7 @@ static int __patch_instruction(unsigned int *exec_addr, 
unsigned int instr,
int err;
 
/* Make sure we aren't patching a freed init section */
-   if (init_mem_is_free && init_section_contains(exec_addr, 4)) {
+   if (*PTRRELOC(_mem_is_free) && init_section_contains(exec_addr, 
4)) {
pr_debug("Skipping init section patching addr: 0x%px\n", 
exec_addr);
return 0;
    }
-- 
2.19.0

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v4] powerpc: Avoid code patching freed init sections

2018-10-02 Thread Andreas Schwab
On Sep 14 2018, Michael Neuling  wrote:

> This stops us from doing code patching in init sections after they've
> been freed.

This breaks booting on PowerBook6,7, crashing very early.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: Oops running iptables -F OUTPUT

2018-08-28 Thread Andreas Schwab
On Aug 28 2018, Ard Biesheuvel  wrote:

> diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
> index 6a501b25dd85..57d09d5ceb1a 100644
> --- a/arch/powerpc/kernel/setup_64.c
> +++ b/arch/powerpc/kernel/setup_64.c
> @@ -779,7 +779,6 @@ EXPORT_SYMBOL(__per_cpu_offset);
>
>  void __init setup_per_cpu_areas(void)
>  {
> -   const size_t dyn_size = PERCPU_MODULE_RESERVE + 
> PERCPU_DYNAMIC_RESERVE;
> size_t atom_size;
> unsigned long delta;
> unsigned int cpu;
> @@ -795,7 +794,9 @@ void __init setup_per_cpu_areas(void)
> else
> atom_size = 1 << 20;
>
> -   rc = pcpu_embed_first_chunk(0, dyn_size, atom_size, pcpu_cpu_distance,
> +   rc = pcpu_embed_first_chunk(PERCPU_MODULE_RESERVE,
> +   PERCPU_DYNAMIC_RESERVE,
> +   atom_size, pcpu_cpu_distance,
> pcpu_fc_alloc, pcpu_fc_free);
> if (rc < 0)
> panic("cannot initialize percpu area (err=%d)", rc);

That didn't help.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Oops running iptables -F OUTPUT

2018-08-27 Thread Andreas Schwab
I'm getting this Oops when running iptables -F OUTPUT:

[   91.139409] Unable to handle kernel paging request for data at address 
0xd001fff12f34
[   91.139414] Faulting instruction address: 0xd16a5718
[   91.139419] Oops: Kernel access of bad area, sig: 11 [#1]
[   91.139426] BE SMP NR_CPUS=2 PowerMac
[   91.139434] Modules linked in: iptable_filter ip_tables x_tables bpfilter 
nfsd auth_rpcgss lockd grace nfs_acl sunrpc tun af_packet snd_aoa_codec_tas 
snd_aoa_fabric_layout snd_aoa snd_aoa_i2sbus snd_aoa_soundbus snd_pcm_oss 
snd_pcm snd_seq snd_timer snd_seq_device snd_mixer_oss snd sungem sr_mod 
firewire_ohci cdrom sungem_phy soundcore firewire_core pata_macio crc_itu_t sg 
hid_generic usbhid linear md_mod ohci_pci ohci_hcd ehci_pci ehci_hcd usbcore 
usb_common dm_snapshot dm_bufio dm_mirror dm_region_hash dm_log dm_mod sata_svw
[   91.139522] CPU: 1 PID: 3620 Comm: iptables Not tainted 4.19.0-rc1 #1
[   91.139526] NIP:  d16a5718 LR: d16a569c CTR: c06f560c
[   91.139531] REGS: c001fa577670 TRAP: 0300   Not tainted  (4.19.0-rc1)
[   91.139534] MSR:  9200b032   CR: 
84002484  XER: 2000
[   91.139553] DAR: d001fff12f34 DSISR: 4000 IRQMASK: 0 
GPR00: d16a569c c001fa5778f0 d16b0400  
GPR04: 0002  8001fa46418e c001fa0d05c8 
GPR08: d16b0400 d00037f13000 0001ff3e7000 d16a6fb8 
GPR12: c06f560c c780   
GPR16: 11635010 3fffa1b7aa68   
GPR20: 0003 10013918 116350c0 c0b88990 
GPR24: c0b88ba4  d001fff12f34  
GPR28: d16b8000 c001fa20f400 c001fa20f440  
[   91.139627] NIP [d16a5718] .alloc_counters.isra.10+0xbc/0x140 
[ip_tables]
[   91.139634] LR [d16a569c] .alloc_counters.isra.10+0x40/0x140 
[ip_tables]
[   91.139638] Call Trace:
[   91.139645] [c001fa5778f0] [d16a569c] 
.alloc_counters.isra.10+0x40/0x140 [ip_tables] (unreliable)
[   91.139655] [c001fa5779b0] [d16a5b54] 
.do_ipt_get_ctl+0x110/0x2ec [ip_tables]
[   91.139666] [c001fa577aa0] [c06233e0] .nf_getsockopt+0x68/0x88
[   91.139674] [c001fa577b40] [c0631608] .ip_getsockopt+0xbc/0x128
[   91.139682] [c001fa577bf0] [c065adf4] .raw_getsockopt+0x18/0x5c
[   91.139690] [c001fa577c60] [c05b5f60] 
.sock_common_getsockopt+0x2c/0x40
[   91.139697] [c001fa577cd0] [c05b3394] .__sys_getsockopt+0xa4/0xd0
[   91.139704] [c001fa577d80] [c05b5ab0] 
.__se_sys_socketcall+0x238/0x2b4
[   91.139712] [c001fa577e30] [c000a31c] system_call+0x5c/0x70
[   91.139716] Instruction dump:
[   91.139721] 39290040 7d3d4a14 7fbe4840 409cff98 8138 2b890001 419d000c 
393e0060 
[   91.139736] 4810 7d57c82a e93e0060 7d295214 <815a> 794807e1 41e20010 
7c210b78 
[   91.139752] ---[ end trace f5d1d5431651845d ]---


Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] Revert "net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends"

2018-06-19 Thread Andreas Schwab
On Jun 19 2018, Eric Dumazet  wrote:

> diff --git a/drivers/net/ethernet/sun/sungem.c 
> b/drivers/net/ethernet/sun/sungem.c
> index 
> 7a16d40a72d13cf1d522e8a3a396c826fe76f9b9..672d6748ab44f0890e92d5ca55d6ff6834c20dc9
>  100644
> --- a/drivers/net/ethernet/sun/sungem.c
> +++ b/drivers/net/ethernet/sun/sungem.c
> @@ -60,8 +60,7 @@
>  #include 
>  #include "sungem.h"
>  
> -/* Stripping FCS is causing problems, disabled for now */
> -#undef STRIP_FCS
> +#define STRIP_FCS
>  
>  #define DEFAULT_MSG(NETIF_MSG_DRV  | \
>  NETIF_MSG_PROBE| \
> @@ -435,7 +434,7 @@ static int gem_rxmac_reset(struct gem *gp)
> writel(desc_dma & 0x, gp->regs + RXDMA_DBLOW);
> writel(RX_RING_SIZE - 4, gp->regs + RXDMA_KICK);
> val = (RXDMA_CFG_BASE | (RX_OFFSET << 10) |
> -  ((14 / 2) << 13) | RXDMA_CFG_FTHRESH_128);
> +  (ETH_HLEN << 13) | RXDMA_CFG_FTHRESH_128);
> writel(val, gp->regs + RXDMA_CFG);
> if (readl(gp->regs + GREG_BIFCFG) & GREG_BIFCFG_M66EN)
> writel(((5 & RXDMA_BLANK_IPKTS) |
> @@ -857,6 +856,14 @@ static int gem_rx(struct gem *gp, int work_to_do)
>  
> csum = (__force __sum16)htons((status & RXDCTRL_TCPCSUM) ^ 
> 0x);
> skb->csum = csum_unfold(csum);
> +   {
> +   __wsum rsum = csum_partial(skb->data + ETH_HLEN, len - 
> ETH_HLEN, 0);
> +   if (csum != csum_fold(rsum) && net_ratelimit())
> +   pr_err("sungem wrong csum : %x/%x, len %u bytes\n",
> +   csum, csum_fold(rsum), len);
> +   print_hex_dump(KERN_ERR, "raw data: ", 
> DUMP_PREFIX_OFFSET,
> +   16, 1, skb->data, len, true);
> +   }
> skb->ip_summed = CHECKSUM_COMPLETE;
> skb->protocol = eth_type_trans(skb, gp->dev);
>  
> @@ -1761,7 +1768,7 @@ static void gem_init_dma(struct gem *gp)
> writel(0, gp->regs + TXDMA_KICK);
>  
> val = (RXDMA_CFG_BASE | (RX_OFFSET << 10) |
> -  ((14 / 2) << 13) | RXDMA_CFG_FTHRESH_128);
> +  (ETH_HLEN << 13) | RXDMA_CFG_FTHRESH_128);
> writel(val, gp->regs + RXDMA_CFG);
>  
> writel(desc_dma >> 32, gp->regs + RXDMA_DBHI);

With that patch I still get the wrong csum messages, but no longer the
hw csum failure messages (tested on a PowerMac G5).

[  662.659767] sungem: sungem wrong csum : 8359/7ca6, len 86 bytes, 
c001fee9cc02
[  662.659775] raw data: : 00 0d 93 43 81 62 d4 3d 7e 4c 48 b7 86 dd 61 
01  ...C.b.=~LH...a.
[  662.659778] raw data: 0010: 1c 1e 00 20 06 40 20 01 0a 62 17 11 88 01 00 
00  ... .@ ..b..
[  662.659780] raw data: 0020: 00 00 00 00 0a 38 20 01 0a 62 17 11 88 01 00 
00  .8 ..b..
[  662.659783] raw data: 0030: 00 00 00 00 00 07 9a 18 00 16 c1 9a 7e ea ea 
44  ~..D
[  662.659785] raw data: 0040: fb 4a 80 10 05 93 44 08 00 00 01 01 08 0a 59 
68  .JD...Yh
[  662.659788] raw data: 0050: ba e2 0e bb ac ae
..

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] Revert "net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends"

2018-06-19 Thread Andreas Schwab
On Jun 18 2018, Eric Dumazet  wrote:

> DUMP_PREFIX_ADDRESS might give us more information (say alignment problem, or 
> crossing page boundaries)

DUMP_PREFIX_ADDRESS is useless for that purpose.

Here are some samples of broken csums:

[  853.849225] sungem: sungem wrong csum : 9886/07be, len 94 bytes, 
c001fa187e02
[  853.849232] raw data: : 00 0d 93 43 81 62 18 d6 c7 51 b8 1c 08 00 45 
10  ...C.b...QE.
[  853.849235] raw data: 0010: 00 4c cb a0 40 00 40 11 d9 97 c0 a8 0a 01 c0 
a8  .L..@.@.
[  853.849237] raw data: 0020: 0a 07 00 7b 00 7b 00 38 69 e1 1c 03 0c f7 00 
00  ...{.{.8i...
[  853.849240] raw data: 0030: 08 f0 00 00 15 f0 c0 35 67 67 de d3 ca c9 d9 
5b  ...5gg.[
[  853.849242] raw data: 0040: 1f ff de d3 d2 86 8f 67 fa f2 de d3 d2 86 8f 
38  ...g...8
[  853.849244] raw data: 0050: 2f ff de d3 d2 86 8f 3b ff ff d1 93 bc 50
/..;.P

[  857.883052] sungem: sungem wrong csum : dbb4/c48f, len 94 bytes, 
c001fa185882
[  857.883058] raw data: : 00 0d 93 43 81 62 18 d6 c7 51 b8 1c 08 00 45 
00  ...C.b...QE.
[  857.883070] raw data: 0010: 00 4c a1 97 40 00 3a 11 ce ed d9 5b 2c 11 c0 
a8  .L..@.:[,...
[  857.883080] raw data: 0020: 0a 07 00 7b 00 7b 00 38 14 4b 24 02 06 ea 00 
00  ...{.{.8.K$.
[  857.883085] raw data: 0030: 00 0b 00 00 02 99 c0 a8 64 09 de d3 d2 5a 36 
e4  dZ6.
[  857.883090] raw data: 0040: bc f5 de d3 d2 8a 8f 2c 17 44 de d3 d2 8a 93 
8b  ...,.D..
[  857.883094] raw data: 0050: d7 b7 de d3 d2 8a 93 97 69 6e 39 7b d2 5a
in9{.Z

[  858.124689] sungem: sungem wrong csum : 1f4f/02d0, len 118 bytes, 
c001fa185602
[  858.124700] raw data: : 00 0d 93 43 81 62 d4 3d 7e 4c 48 b7 86 dd 61 
01  ...C.b.=~LH...a.
[  858.124705] raw data: 0010: 1e b1 00 3c 06 40 20 01 0a 62 17 11 88 01 00 
00  ...<.@ ..b..
[  858.124709] raw data: 0020: 00 00 00 00 0a 38 20 01 0a 62 17 11 88 01 00 
00  .8 ..b..
[  858.124714] raw data: 0030: 00 00 00 00 00 07 94 b4 00 16 86 f5 29 e8 36 
cb  ).6.
[  858.124718] raw data: 0040: 50 49 80 18 05 93 9a 53 00 00 01 01 08 0a 58 
b2  PI.S..X.
[  858.124723] raw data: 0050: de 54 61 5f 2f 3c 00 00 00 10 cc 08 55 f7 da 
21  .Ta_/<..U..!
[  858.124727] raw data: 0060: f4 60 0a 6b 3c aa b9 b3 7e 61 10 b8 c2 be 9a 
0b  .`.k<...~a..
[  858.124731] raw data: 0070: c7 e9 5b 97 1b ac
..[...

[  858.126522] sungem: sungem wrong csum : 0836/19e9, len 90 bytes, 
c001fa185382
[  858.126530] raw data: : 00 0d 93 43 81 62 d4 3d 7e 4c 48 b7 86 dd 61 
01  ...C.b.=~LH...a.
[  858.126532] raw data: 0010: 1e b1 00 20 06 40 20 01 0a 62 17 11 88 01 00 
00  ... .@ ..b..
[  858.126535] raw data: 0020: 00 00 00 00 0a 38 20 01 0a 62 17 11 88 01 00 
00  .8 ..b..
[  858.126537] raw data: 0030: 00 00 00 00 00 07 94 b4 00 16 86 f5 2a 04 36 
cb  *.6.
[  858.126540] raw data: 0040: 50 65 80 10 05 93 3e 56 00 00 01 01 08 0a 58 
b2  Pe>V..X.
[  858.126542] raw data: 0050: de 56 61 5f 30 4d 1d 58 42 d2
.Va_0M.XB.

[  858.131559] sungem: sungem wrong csum : 5891/c98d, len 90 bytes, 
c001fa185102
[  858.131567] raw data: : 00 0d 93 43 81 62 d4 3d 7e 4c 48 b7 86 dd 61 
01  ...C.b.=~LH...a.
[  858.131570] raw data: 0010: 1e b1 00 20 06 40 20 01 0a 62 17 11 88 01 00 
00  ... .@ ..b..
[  858.131572] raw data: 0020: 00 00 00 00 0a 38 20 01 0a 62 17 11 88 01 00 
00  .8 ..b..
[  858.131574] raw data: 0030: 00 00 00 00 00 07 94 b4 00 16 86 f5 2a 04 36 
cb  *.6.
[  858.131577] raw data: 0040: 50 a1 80 10 05 93 3e 10 00 00 01 01 08 0a 58 
b2  P.>...X.
[  858.131579] raw data: 0050: de 5b 61 5f 30 52 3f ea 70 9b
.[a_0R?.p.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH 1/3] powerpc: mac: fix rtc read functions

2018-06-18 Thread Andreas Schwab
On Jun 18 2018, Mathieu Malaterre  wrote:

> Sadly, trying again today does not work anymore. Adding some printk
> just before WARN_ON:
>
> +printk(KERN_ERR " rtc DBG pmu_get_time1: %lld %d %lld \n", now,
> RTC_OFFSET, now - RTC_OFFSET );
> +printk(KERN_ERR " rtc DBG pmu_get_time2: %x %x %x %x %d \n",
> req.reply[0], req.reply[1], req.reply[2], req.reply[3] ,
> req.reply_len);
>
> leads to:
>
> [0.00]  rtc DBG pmu_get_time1: 14096662 2082844800 -2068748138
> [0.00]  rtc DBG pmu_get_time2: 0 d7 19 16 4

A good value would have 0xd7 in the first byte.  The problem is that
pmu_set_rtc_time is also broken, and leads to an invalid time value
stored in the RTC.  Since pmu_request is a varargs function passing
values of type time64_t without casting won't work.

You need to reset your RTC before you can continue.

I think the right fix is to change nowtime in pmu_set_rtc_time and
cuda_set_rtc_time back to unsigned int (or to u32).

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] Revert "net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends"

2018-06-18 Thread Andreas Schwab
On Jun 17 2018, Eric Dumazet  wrote:

> Oh this is silly, please try :
>
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 
> c642304f178ce0a4e1358d59e45032a39f76fb3f..54dd9c18ecad817812898d6f335e1794a07dabbe
>  100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -1845,10 +1845,9 @@ EXPORT_SYMBOL(___pskb_trim);
>  int pskb_trim_rcsum_slow(struct sk_buff *skb, unsigned int len)
>  {
> if (skb->ip_summed == CHECKSUM_COMPLETE) {
> -   int delta = skb->len - len;
> +   __wsum csumdiff = skb_checksum(skb, len, skb->len - len, 0);
>  
> -   skb->csum = csum_sub(skb->csum,
> -skb_checksum(skb, len, delta, 0));
> +   skb->csum = csum_block_sub(skb->csum, csumdiff, len);
> }
> return __pskb_trim(skb, len);
>  }

That doesn't help either.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] Revert "net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends"

2018-06-17 Thread Andreas Schwab
On Jun 16 2018, Eric Dumazet  wrote:

> I would try something like :
>
> Basically do not bother using CHECKSUM_COMPLETE for small frames that might 
> have been padded.
>
> Since we need to bring one cache line in eth_type_trans() and further header 
> processing,
> computing the checksum in software will be almost free anyway.
>
> diff --git a/drivers/net/ethernet/sun/sungem.c 
> b/drivers/net/ethernet/sun/sungem.c
> index 
> 7a16d40a72d13cf1d522e8a3a396c826fe76f9b9..071039f211a8a33153e888bd4014314ba5e686a4
>  100644
> --- a/drivers/net/ethernet/sun/sungem.c
> +++ b/drivers/net/ethernet/sun/sungem.c
> @@ -855,9 +855,11 @@ static int gem_rx(struct gem *gp, int work_to_do)
> skb = copy_skb;
> }
>  
> -   csum = (__force __sum16)htons((status & RXDCTRL_TCPCSUM) ^ 
> 0x);
> -   skb->csum = csum_unfold(csum);
> -   skb->ip_summed = CHECKSUM_COMPLETE;
> +   if (len > ETH_ZLEN) {
> +   csum = (__force __sum16)htons((status & 
> RXDCTRL_TCPCSUM) ^ 0x);
> +   skb->csum = csum_unfold(csum);
> +   skb->ip_summed = CHECKSUM_COMPLETE;
> +   }
> skb->protocol = eth_type_trans(skb, gp->dev);
>  
> napi_gro_receive(>napi, skb);

That doesn't change anything.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH] Revert "net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends"

2018-06-17 Thread Andreas Schwab
On Jun 16 2018, Mathieu Malaterre  wrote:

> That's odd since it seems to only affect g4+sungem user. None of the
> ppc64 seems to be having it.

I'm also seeing it on a PowerMac G5.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v2 08/12] macintosh/via-pmu68k: Don't load driver on unsupported hardware

2018-06-09 Thread Andreas Schwab
On Jun 09 2018, Finn Thain  wrote:

> There is no ABI issue AFAIK. The value of pmu_kind is visible to userland 
> only on powerpc. /dev/pmu and /proc/pmu/* do not exist on m68k.

Then why are PMU_68K_V1 and PMU_68K_V2 defined in the first place?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [PATCH v2 08/12] macintosh/via-pmu68k: Don't load driver on unsupported hardware

2018-06-09 Thread Andreas Schwab
On Jun 09 2018, Michael Schmitz  wrote:

> Hi Finn,
>
> Am 08.06.2018 um 14:24 schrieb Finn Thain:
>> Don't load the via-pmu68k driver on early PowerBooks. The M50753 PMU
>> device found in those models was never supported by this driver.
>> Attempting to load the driver usually causes a boot hang.
>>
>> Cc: Geert Uytterhoeven 
>> Signed-off-by: Finn Thain 
>> ---
>>  arch/m68k/mac/misc.c   | 6 ++
>>  drivers/macintosh/via-pmu68k.c | 4 
>>  include/uapi/linux/pmu.h   | 1 -
>>  3 files changed, 2 insertions(+), 9 deletions(-)
> ...
>> diff --git a/include/uapi/linux/pmu.h b/include/uapi/linux/pmu.h
>> index 89cb1acea93a..30f64d46f5db 100644
>> --- a/include/uapi/linux/pmu.h
>> +++ b/include/uapi/linux/pmu.h
>> @@ -93,7 +93,6 @@ enum {
>>  PMU_HEATHROW_BASED, /* PowerBook G3 series */
>>  PMU_PADDINGTON_BASED,   /* 1999 PowerBook G3 */
>>  PMU_KEYLARGO_BASED, /* Core99 motherboard (PMU99) */
>> -PMU_68K_V1, /* 68K PMU, version 1 */
>>  PMU_68K_V2, /* 68K PMU, version 2 */
>>  };
>
> Is this enum used by any user space code? If so, perhaps rather leave the
> PMU_68K_V1 in there to avoid upsetting that?

It also changes the value of PMU_68K_V2, which is an ABI break.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: ppc32: semctl fails

2017-12-06 Thread Andreas Schwab
On Dez 06 2017, Joakim Tjernlund <joakim.tjernl...@infinera.com> wrote:

> st = semctl(sem, 0, IPC_STAT, );

This is not a valid use of IPC_STAT.  The fourth argument must be a
object of type union semun (not a pointer), with the .buf member
pointing to the struct semid_ds object.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Re: 32-bit powerpc, aty128fb: vmap allocation for size 135168 failed

2017-08-22 Thread Andreas Schwab
On Aug 18 2017, Meelis Roos <mr...@linux.ee> wrote:

> Aug 17 23:53:57 pohl kernel: [ 2940.146546] aty128fb :00:10.0: Invalid 
> PCI ROM header signature: expecting 0xaa55, got 0x
> Aug 17 23:54:02 pohl kernel: [ 2944.804838] aty128fb :00:10.0: Invalid 
> PCI ROM header signature: expecting 0xaa55, got 0x1110

I think these messages are harmless and expected.  This device has no
x86 option ROM but a OpenFirmware one.  This is likely unrelated to the
sddm crash.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Re: [PATCH] powerpc: fix invalid use of register expressions

2017-08-14 Thread Andreas Schwab
This fixes another invalid use of register expressions.

Signed-off-by: Andreas Schwab <sch...@linux-m68k.org>
---
 arch/powerpc/kernel/l2cr_6xx.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/l2cr_6xx.S b/arch/powerpc/kernel/l2cr_6xx.S
index 97ec8557f9..6408f09dbb 100644
--- a/arch/powerpc/kernel/l2cr_6xx.S
+++ b/arch/powerpc/kernel/l2cr_6xx.S
@@ -181,7 +181,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_SPEC7450)
mtctr   r4
li  r4,0
 1:
-   lwzxr0,r0,r4
+   lwzxr0,0,r4
addir4,r4,32/* Go to start of next cache line */
bdnz1b
isync
@@ -328,7 +328,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_L3CR)
mtctr   r4
li  r4,0
 1:
-   lwzxr0,r0,r4
+   lwzxr0,0,r4
dcbf0,r4
addir4,r4,32/* Go to start of next cache line */
bdnz1b
-- 
2.14.1

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Re: 4.13-rc3: Unrecoverable exception 4100

2017-08-07 Thread Andreas Schwab
On Aug 07 2017, Michael Ellerman <m...@ellerman.id.au> wrote:

> Ah of course. Not sure why I haven't seen it in any of my testing :/

It took me a whole gcc bootstrap to trigger it.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


[PATCH] powerpc: fix invalid use of register expressions

2017-08-05 Thread Andreas Schwab
binutils >= 2.26 now warns about misuse of register expressions in
assembler operands that are actually literals, for example:

arch/powerpc/kernel/entry_64.S:535: Warning: invalid register expression

Signed-off-by: Andreas Schwab <sch...@linux-m68k.org>
---
 arch/powerpc/include/asm/ppc_asm.h |  2 +-
 arch/powerpc/kernel/swsusp_asm64.S |  2 +-
 arch/powerpc/kvm/book3s_64_slb.S   |  2 +-
 arch/powerpc/lib/copypage_power7.S | 14 
 arch/powerpc/lib/copyuser_power7.S | 66 +++---
 arch/powerpc/lib/memcpy_power7.S   | 66 +++---
 arch/powerpc/lib/string_64.S   |  2 +-
 7 files changed, 77 insertions(+), 77 deletions(-)

diff --git a/arch/powerpc/include/asm/ppc_asm.h 
b/arch/powerpc/include/asm/ppc_asm.h
index 6baeeb9acd..daeda2bbe1 100644
--- a/arch/powerpc/include/asm/ppc_asm.h
+++ b/arch/powerpc/include/asm/ppc_asm.h
@@ -439,7 +439,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601)
 .machine push ;\
 .machine "power4" ;\
lis scratch,0x6000@h;   \
-   dcbtr0,scratch,0b01010; \
+   dcbt0,scratch,0b01010;  \
 .machine pop
 
 /*
diff --git a/arch/powerpc/kernel/swsusp_asm64.S 
b/arch/powerpc/kernel/swsusp_asm64.S
index 988f38dced..82d8aae81c 100644
--- a/arch/powerpc/kernel/swsusp_asm64.S
+++ b/arch/powerpc/kernel/swsusp_asm64.S
@@ -179,7 +179,7 @@ nothing_to_copy:
sld r3, r3, r0
li  r0, 0
 1:
-   dcbfr0,r3
+   dcbf0,r3
addir3,r3,0x20
bdnz1b
 
diff --git a/arch/powerpc/kvm/book3s_64_slb.S b/arch/powerpc/kvm/book3s_64_slb.S
index 3589c4e3d4..688722acd6 100644
--- a/arch/powerpc/kvm/book3s_64_slb.S
+++ b/arch/powerpc/kvm/book3s_64_slb.S
@@ -113,7 +113,7 @@ slb_do_enter:
 
/* Remove all SLB entries that are in use. */
 
-   li  r0, r0
+   li  r0, 0
slbmte  r0, r0
slbia
 
diff --git a/arch/powerpc/lib/copypage_power7.S 
b/arch/powerpc/lib/copypage_power7.S
index a84d333ecb..ca5fc8fa7e 100644
--- a/arch/powerpc/lib/copypage_power7.S
+++ b/arch/powerpc/lib/copypage_power7.S
@@ -45,13 +45,13 @@ _GLOBAL(copypage_power7)
 .machine push
 .machine "power4"
/* setup read stream 0  */
-   dcbtr0,r4,0b01000   /* addr from */
-   dcbtr0,r7,0b01010   /* length and depth from */
+   dcbt0,r4,0b01000/* addr from */
+   dcbt0,r7,0b01010   /* length and depth from */
/* setup write stream 1 */
-   dcbtst  r0,r9,0b01000   /* addr to */
-   dcbtst  r0,r10,0b01010  /* length and depth to */
+   dcbtst  0,r9,0b01000   /* addr to */
+   dcbtst  0,r10,0b01010  /* length and depth to */
eieio
-   dcbtr0,r8,0b01010   /* all streams GO */
+   dcbt0,r8,0b01010/* all streams GO */
 .machine pop
 
 #ifdef CONFIG_ALTIVEC
@@ -83,7 +83,7 @@ _GLOBAL(copypage_power7)
li  r12,112
 
.align  5
-1: lvx v7,r0,r4
+1: lvx v7,0,r4
lvx v6,r4,r6
lvx v5,r4,r7
lvx v4,r4,r8
@@ -92,7 +92,7 @@ _GLOBAL(copypage_power7)
lvx v1,r4,r11
lvx v0,r4,r12
addir4,r4,128
-   stvxv7,r0,r3
+   stvxv7,0,r3
stvxv6,r3,r6
stvxv5,r3,r7
stvxv4,r3,r8
diff --git a/arch/powerpc/lib/copyuser_power7.S 
b/arch/powerpc/lib/copyuser_power7.S
index 706b7cc198..d416a4a665 100644
--- a/arch/powerpc/lib/copyuser_power7.S
+++ b/arch/powerpc/lib/copyuser_power7.S
@@ -315,13 +315,13 @@ err1; stb r0,0(r3)
 .machine push
 .machine "power4"
/* setup read stream 0 */
-   dcbtr0,r6,0b01000   /* addr from */
-   dcbtr0,r7,0b01010   /* length and depth from */
+   dcbt0,r6,0b01000   /* addr from */
+   dcbt0,r7,0b01010   /* length and depth from */
/* setup write stream 1 */
-   dcbtst  r0,r9,0b01000   /* addr to */
-   dcbtst  r0,r10,0b01010  /* length and depth to */
+   dcbtst  0,r9,0b01000   /* addr to */
+   dcbtst  0,r10,0b01010  /* length and depth to */
eieio
-   dcbtr0,r8,0b01010   /* all streams GO */
+   dcbt0,r8,0b01010/* all streams GO */
 .machine pop
 
beq cr1,.Lunwind_stack_nonvmx_copy
@@ -376,26 +376,26 @@ err3; std r0,0(r3)
li  r11,48
 
bf  cr7*4+3,5f
-err3;  lvx v1,r0,r4
+err3;  lvx v1,0,r4
addir4,r4,16
-err3;  stvxv1,r0,r3
+err3;  stvxv1,0,r3
addir3,r3,16
 
 5: bf  cr7*4+2,6f
-err3;  lvx v1,r0,r4
+err3;  lvx v1,0,r4
 err3;  lvx v0,r4,r9
addir4,r4,32
-err3;  stvxv1,r0,r3
+err3;  stvxv1,0,r3
 err3;  stvxv0,r3,r9
addir3,r3,32
 
 6: bf  cr7*4+1,7f
-err3;  lvx v3,r0,r4
+err3;  lvx v3,0,r4
 err3;  lvx v2,r4,r9
 err3;  lvx v1,r4,r10
 err3;  lvx

Re: 4.13-rc3: Unrecoverable exception 4100

2017-08-04 Thread Andreas Schwab
No, this is really a 4.13-rc1 regression.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


  1   2   3   4   >