[PATCH v1 18/20] powerpc/32s: Regroup 603 based CPUs in cputable

2020-10-22 Thread Christophe Leroy
In order to selectively build the kernel for 603 SW TLB handling, regroup all 603 based CPUs together. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/cputable.h | 14 +++--- arch/powerpc/kernel/cputable.c | 78 ++--- 2 files changed, 47 insertions(+), 4

[PATCH v1 19/20] powerpc/32s: Make support for 603 and 604+ selectable

2020-10-22 Thread Christophe Leroy
book3s/32 has two main families: - CPU with 603 cores that don't have HASH PTE table and perform SW TLB loading. - Other CPUs based on 604+ cores that have HASH PTE table. This leads to some complex logic and additionnal code to support both. This makes sense for distribution kernels that aim at r

[PATCH v1 20/20] powerpc/32s: Only build hash code when CONFIG_PPC_BOOK3S_604 is selected

2020-10-22 Thread Christophe Leroy
It is now possible to only build book3s/32 kernel for CPUs without hash table. Opt out hash related code when CONFIG_PPC_BOOK3S_604 is not selected. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_book3s_32.S | 12 arch/powerpc/mm/book3s32/Makefile| 4 +++- 2 file

[PATCH] powerpc/time: enable sched clock for irqtime

2020-10-22 Thread Pingfan Liu
When CONFIG_IRQ_TIME_ACCOUNTING and CONFIG_VIRT_CPU_ACCOUNTING_GEN, powerpc does not enable "sched_clock_irqtime" and can not utilize irq time accounting. Like x86, powerpc does not use the sched_clock_register() interface. So it needs an dedicated call to enable_sched_clock_irqtime() to enable ir

Re: [PATCH] powerpc/time: enable sched clock for irqtime

2020-10-22 Thread Pingfan Liu
I encounter a irq flood on Power9 machine, and tries a way to work around it by https://www.spinics.net/lists/kernel/msg3705028.html As irq time accounting is the foundation for the method, it needs to make irq accounting take effect on powerpc platform. On Thu, Oct 22, 2020 at 2:51 PM Pingfan Li

Re: [PATCH] serial: pmac_zilog: don't init if zilog is not available

2020-10-22 Thread Laurent Vivier
Le 22/10/2020 à 05:23, Finn Thain a écrit : > On Wed, 21 Oct 2020, Laurent Vivier wrote: > >> Le 21/10/2020 à 01:43, Finn Thain a écrit : >> >>> Laurent, can we avoid the irq == 0 warning splat like this? >>> >>> diff --git a/drivers/tty/serial/pmac_zilog.c >>> b/drivers/tty/serial/pmac_zilog.c >

Re: [PATCH] serial: pmac_zilog: don't init if zilog is not available

2020-10-22 Thread Geert Uytterhoeven
Hi Finn, On Thu, Oct 22, 2020 at 5:23 AM Finn Thain wrote: > The patch below seems to fix the problem for me. Does it work on your > system(s)? Thanks for your patch! > --- a/arch/m68k/mac/config.c > +++ b/arch/m68k/mac/config.c > @@ -776,16 +776,12 @@ static struct resource scc_b_rsrcs[] = { >

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread Greg KH
On Thu, Oct 22, 2020 at 12:39:14AM +0100, Al Viro wrote: > On Wed, Oct 21, 2020 at 06:13:01PM +0200, Greg KH wrote: > > On Fri, Sep 25, 2020 at 06:51:39AM +0200, Christoph Hellwig wrote: > > > From: David Laight > > > > > > This lets the compiler inline it into import_iovec() generating > > > muc

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread David Hildenbrand
On 22.10.20 10:26, Greg KH wrote: > On Thu, Oct 22, 2020 at 12:39:14AM +0100, Al Viro wrote: >> On Wed, Oct 21, 2020 at 06:13:01PM +0200, Greg KH wrote: >>> On Fri, Sep 25, 2020 at 06:51:39AM +0200, Christoph Hellwig wrote: From: David Laight This lets the compiler inline it into im

[PATCH] selftests/powerpc/eeh: disable kselftest timeout setting for eeh-basic

2020-10-22 Thread Po-Hsu Lin
The eeh-basic test got its own 60 seconds timeout (defined in commit 414f50434aa2 "selftests/eeh: Bump EEH wait time to 60s") per breakable device. And we have discovered that the number of breakable devices varies on different hardware. The device recovery time ranges from 0 to 35 seconds. In our

RE: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread David Laight
From: David Hildenbrand > Sent: 22 October 2020 09:35 > > On 22.10.20 10:26, Greg KH wrote: > > On Thu, Oct 22, 2020 at 12:39:14AM +0100, Al Viro wrote: > >> On Wed, Oct 21, 2020 at 06:13:01PM +0200, Greg KH wrote: > >>> On Fri, Sep 25, 2020 at 06:51:39AM +0200, Christoph Hellwig wrote: > Fro

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread David Hildenbrand
On 22.10.20 10:40, David Laight wrote: > From: David Hildenbrand >> Sent: 22 October 2020 09:35 >> >> On 22.10.20 10:26, Greg KH wrote: >>> On Thu, Oct 22, 2020 at 12:39:14AM +0100, Al Viro wrote: On Wed, Oct 21, 2020 at 06:13:01PM +0200, Greg KH wrote: > On Fri, Sep 25, 2020 at 06:51:39AM

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread Greg KH
On Thu, Oct 22, 2020 at 10:48:59AM +0200, David Hildenbrand wrote: > On 22.10.20 10:40, David Laight wrote: > > From: David Hildenbrand > >> Sent: 22 October 2020 09:35 > >> > >> On 22.10.20 10:26, Greg KH wrote: > >>> On Thu, Oct 22, 2020 at 12:39:14AM +0100, Al Viro wrote: > On Wed, Oct 21,

RE: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread David Laight
From: David Hildenbrand > Sent: 22 October 2020 09:49 ... > >>> But, this looks now to be a compiler bug. I'm using the latest version > >>> of clang and if I put "noinline" at the front of the function, > >>> everything works. > >> > >> Well, the compiler can do more invasive optimizations when i

RE: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread David Laight
From: Greg KH > Sent: 22 October 2020 10:02 ... > I'm running some more tests, trying to narrow things down as just adding > a "noinline" to the function that got moved here doesn't work on Linus's > tree at the moment because the function was split into multiple > functions. I was going to look a

[PATCH] powerpc/mm: move setting pte specific flags to pfn_pmd

2020-10-22 Thread Aneesh Kumar K.V
powerpc used to set the pte specific flags in set_pte_at(). This is different from other architectures. To be consistent with other architecture powerpc updated pfn_pte to set _PAGE_PTE with commit 379c926d6334 ("powerpc/mm: move setting pte specific flags to pfn_pte") The commit didn't do the sa

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread Arnd Bergmann
On Thu, Oct 22, 2020 at 10:26 AM Greg KH wrote: > On Thu, Oct 22, 2020 at 12:39:14AM +0100, Al Viro wrote: > > On Wed, Oct 21, 2020 at 06:13:01PM +0200, Greg KH wrote: > > > On Fri, Sep 25, 2020 at 06:51:39AM +0200, Christoph Hellwig wrote: > > > > > > I can't really figure out what the regression

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread David Hildenbrand
On 22.10.20 11:01, Greg KH wrote: > On Thu, Oct 22, 2020 at 10:48:59AM +0200, David Hildenbrand wrote: >> On 22.10.20 10:40, David Laight wrote: >>> From: David Hildenbrand Sent: 22 October 2020 09:35 On 22.10.20 10:26, Greg KH wrote: > On Thu, Oct 22, 2020 at 12:39:14AM +0100, A

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread David Hildenbrand
On 22.10.20 11:19, David Hildenbrand wrote: > On 22.10.20 11:01, Greg KH wrote: >> On Thu, Oct 22, 2020 at 10:48:59AM +0200, David Hildenbrand wrote: >>> On 22.10.20 10:40, David Laight wrote: From: David Hildenbrand > Sent: 22 October 2020 09:35 > > On 22.10.20 10:26, Greg KH wrot

RE: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread David Laight
From: David Hildenbrand > Sent: 22 October 2020 10:19 > > On 22.10.20 11:01, Greg KH wrote: > > On Thu, Oct 22, 2020 at 10:48:59AM +0200, David Hildenbrand wrote: > >> On 22.10.20 10:40, David Laight wrote: > >>> From: David Hildenbrand > Sent: 22 October 2020 09:35 > > On 22.10.20

[PATCH v3 1/3] powerpc/uaccess: Don't use "m<>" constraint with GCC 4.9

2020-10-22 Thread Christophe Leroy
GCC 4.9 sometimes fails to build with "m<>" constraint in inline assembly. CC lib/iov_iter.o In file included from ./arch/powerpc/include/asm/cmpxchg.h:6:0, from ./arch/powerpc/include/asm/atomic.h:11, from ./include/linux/atomic.h:7, from

[PATCH v3 2/3] powerpc: Fix incorrect stw{, ux, u, x} instructions in __set_pte_at

2020-10-22 Thread Christophe Leroy
From: Mathieu Desnoyers The placeholder for instruction selection should use the second argument's operand, which is %1, not %0. This could generate incorrect assembly code if the memory addressing of operand %0 is a different form from that of operand %1. Also remove the %Un placeholder because

[PATCH v3 3/3] powerpc: Fix update form addressing in inline assembly

2020-10-22 Thread Christophe Leroy
In several places, inline assembly uses the "%Un" modifier to enable the use of instruction with update form addressing, but the associated "<>" constraint is missing. As mentioned in previous patch, this fails with gcc 4.9, so "<>" can't be used directly. Use UPD_CONSTR macro everywhere %Un modi

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread Arnd Bergmann
On Thu, Oct 22, 2020 at 10:26 AM Greg KH wrote: > On Thu, Oct 22, 2020 at 12:39:14AM +0100, Al Viro wrote: > > On Wed, Oct 21, 2020 at 06:13:01PM +0200, Greg KH wrote: > > > On Fri, Sep 25, 2020 at 06:51:39AM +0200, Christoph Hellwig wrote: > > > > > > I can't really figure out what the regression

RE: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread David Laight
From: David Hildenbrand > Sent: 22 October 2020 10:25 ... > ... especially because I recall that clang and gcc behave slightly > differently: > > https://github.com/hjl-tools/x86-psABI/issues/2 > > "Function args are different: narrow types are sign or zero extended to > 32 bits, depending on the

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread David Hildenbrand
On 22.10.20 11:32, David Laight wrote: > From: David Hildenbrand >> Sent: 22 October 2020 10:25 > ... >> ... especially because I recall that clang and gcc behave slightly >> differently: >> >> https://github.com/hjl-tools/x86-psABI/issues/2 >> >> "Function args are different: narrow types are sign

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread Greg KH
On Thu, Oct 22, 2020 at 11:36:40AM +0200, David Hildenbrand wrote: > On 22.10.20 11:32, David Laight wrote: > > From: David Hildenbrand > >> Sent: 22 October 2020 10:25 > > ... > >> ... especially because I recall that clang and gcc behave slightly > >> differently: > >> > >> https://github.com/hjl

Re: [PATCH] powerpc: Send SIGBUS from machine_check

2020-10-22 Thread Joakim Tjernlund
ping Also Cc: sta...@vger.kernel.org On Thu, 2020-10-01 at 19:05 +0200, Joakim Tjernlund wrote: > Embedded PPC CPU should send SIGBUS to user space when applicable. > > Signed-off-by: Joakim Tjernlund > --- >  arch/powerpc/kernel/traps.c | 17 + >  1 file changed, 17 insertions(+

Re: [PATCH 1/2] powerpc: Introduce POWER10_DD1 feature

2020-10-22 Thread Michael Ellerman
Ravi Bangoria writes: > POWER10_DD1 feature flag will be needed while adding > conditional code that applies only for Power10 DD1. > > Signed-off-by: Ravi Bangoria > --- > arch/powerpc/include/asm/cputable.h | 8 ++-- > arch/powerpc/kernel/dt_cpu_ftrs.c | 3 +++ > arch/powerpc/kernel/prom.

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread Greg KH
On Thu, Oct 22, 2020 at 12:48:05PM +0200, Greg KH wrote: > On Thu, Oct 22, 2020 at 11:36:40AM +0200, David Hildenbrand wrote: > > On 22.10.20 11:32, David Laight wrote: > > > From: David Hildenbrand > > >> Sent: 22 October 2020 10:25 > > > ... > > >> ... especially because I recall that clang and g

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread David Hildenbrand
On 22.10.20 14:18, Greg KH wrote: > On Thu, Oct 22, 2020 at 12:48:05PM +0200, Greg KH wrote: >> On Thu, Oct 22, 2020 at 11:36:40AM +0200, David Hildenbrand wrote: >>> On 22.10.20 11:32, David Laight wrote: From: David Hildenbrand > Sent: 22 October 2020 10:25 ... > ... especially

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread Greg KH
On Thu, Oct 22, 2020 at 02:42:24PM +0200, David Hildenbrand wrote: > On 22.10.20 14:18, Greg KH wrote: > > On Thu, Oct 22, 2020 at 12:48:05PM +0200, Greg KH wrote: > >> On Thu, Oct 22, 2020 at 11:36:40AM +0200, David Hildenbrand wrote: > >>> On 22.10.20 11:32, David Laight wrote: > From: David

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread Greg KH
On Thu, Oct 22, 2020 at 02:57:59PM +0200, Greg KH wrote: > On Thu, Oct 22, 2020 at 02:42:24PM +0200, David Hildenbrand wrote: > > On 22.10.20 14:18, Greg KH wrote: > > > On Thu, Oct 22, 2020 at 12:48:05PM +0200, Greg KH wrote: > > >> On Thu, Oct 22, 2020 at 11:36:40AM +0200, David Hildenbrand wrote

[PATCH] powerpc/bitops: Fix possible undefined behaviour with fls() and fls64()

2020-10-22 Thread Christophe Leroy
fls() and fls64() are using __builtin_ctz() and _builtin_ctzll(). On powerpc, those builtins trivially use ctlzw and ctlzd power instructions. Allthough those instructions provide the expected result with input argument 0, __builtin_ctz() and __builtin_ctzll() are documented as undefined for value

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread Arnd Bergmann
On Thu, Oct 22, 2020 at 3:50 PM Greg KH wrote: > On Thu, Oct 22, 2020 at 02:57:59PM +0200, Greg KH wrote: > > On Thu, Oct 22, 2020 at 02:42:24PM +0200, David Hildenbrand wrote: > > > struct iovec *iovec_from_user(const struct iovec __user *uvec, > > > - unsigned long nr_segs, unsig

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread Greg KH
On Thu, Oct 22, 2020 at 04:28:20PM +0200, Arnd Bergmann wrote: > On Thu, Oct 22, 2020 at 3:50 PM Greg KH wrote: > > On Thu, Oct 22, 2020 at 02:57:59PM +0200, Greg KH wrote: > > > On Thu, Oct 22, 2020 at 02:42:24PM +0200, David Hildenbrand wrote: > > > > > struct iovec *iovec_from_user(const stru

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread Christoph Hellwig
On Thu, Oct 22, 2020 at 11:36:40AM +0200, David Hildenbrand wrote: > My thinking: if the compiler that calls import_iovec() has garbage in > the upper 32 bit > > a) gcc will zero it out and not rely on it being zero. > b) clang will not zero it out, assuming it is zero. > > But > > a) will zero

RE: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread David Laight
From: Greg KH > Sent: 22 October 2020 15:40 > > On Thu, Oct 22, 2020 at 04:28:20PM +0200, Arnd Bergmann wrote: ... > > Can you attach the iov_iter.s files from the broken build, plus the > > one with 'noinline' for comparison? Maybe something can be seen > > in there. > > I don't know how to extr

RE: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread David Laight
From: Christoph Hellwig > Sent: 22 October 2020 14:24 > > On Thu, Oct 22, 2020 at 11:36:40AM +0200, David Hildenbrand wrote: > > My thinking: if the compiler that calls import_iovec() has garbage in > > the upper 32 bit > > > > a) gcc will zero it out and not rely on it being zero. > > b) clang wi

Re: [PATCH] powerpc/bitops: Fix possible undefined behaviour with fls() and fls64()

2020-10-22 Thread Segher Boessenkool
On Thu, Oct 22, 2020 at 02:05:46PM +, Christophe Leroy wrote: > fls() and fls64() are using __builtin_ctz() and _builtin_ctzll(). > On powerpc, those builtins trivially use ctlzw and ctlzd power > instructions. > > Allthough those instructions provide the expected result with > input argument

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread Matthew Wilcox
On Thu, Oct 22, 2020 at 04:35:17PM +, David Laight wrote: > Wait... > readv(2) defines: > ssize_t readv(int fd, const struct iovec *iov, int iovcnt); It doesn't really matter what the manpage says. What does the AOSP libc header say? > But the syscall is defined as: > > SYSCALL_DEFINE

RE: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread David Laight
From: Matthew Wilcox > Sent: 22 October 2020 17:41 > > On Thu, Oct 22, 2020 at 04:35:17PM +, David Laight wrote: > > Wait... > > readv(2) defines: > > ssize_t readv(int fd, const struct iovec *iov, int iovcnt); > > It doesn't really matter what the manpage says. What does the AOSP > lib

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread Arnd Bergmann
On Thu, Oct 22, 2020 at 7:54 PM Nick Desaulniers wrote: > On Thu, Oct 22, 2020 at 9:35 AM David Laight wrote: > > > > Which makes it a bug in the kernel C syscall wrappers. > > They need to explicitly mask the high bits of 32bit > > arguments on arm64 but not x86-64. > > Why not x86-64? Wouldn't

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread Al Viro
On Thu, Oct 22, 2020 at 05:40:40PM +0100, Matthew Wilcox wrote: > On Thu, Oct 22, 2020 at 04:35:17PM +, David Laight wrote: > > Wait... > > readv(2) defines: > > ssize_t readv(int fd, const struct iovec *iov, int iovcnt); > > It doesn't really matter what the manpage says. What does the A

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread Al Viro
On Thu, Oct 22, 2020 at 12:04:52PM -0700, Nick Desaulniers wrote: > Passing an `unsigned long` as an `unsigned int` does no such > narrowing: https://godbolt.org/z/TvfMxe (same vice-versa, just tail > calls, no masking instructions). > So if rw_copy_check_uvector() is inlined into import_iovec() (

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread Al Viro
On Thu, Oct 22, 2020 at 08:24:58PM +0100, Al Viro wrote: > On Thu, Oct 22, 2020 at 12:04:52PM -0700, Nick Desaulniers wrote: > > > Passing an `unsigned long` as an `unsigned int` does no such > > narrowing: https://godbolt.org/z/TvfMxe (same vice-versa, just tail > > calls, no masking instructions

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread Al Viro
On Thu, Oct 22, 2020 at 08:24:58PM +0100, Al Viro wrote: > Depending upon the calling conventions, compiler might do truncation in > caller or > in a callee, but it must be done _somewhere_. Unless I'm misreading AAPCS64, "Unlike in the 32-bit AAPCS, named integral values must be narrowe

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread Arnd Bergmann
On Thu, Oct 22, 2020 at 9:05 PM Nick Desaulniers wrote: > > On Thu, Oct 22, 2020 at 11:13 AM Arnd Bergmann wrote: > > > > On Thu, Oct 22, 2020 at 7:54 PM Nick Desaulniers > > wrote: > > > On Thu, Oct 22, 2020 at 9:35 AM David Laight > > > wrote: > > > > > > > > Which makes it a bug in the kern

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread Al Viro
On Thu, Oct 22, 2020 at 09:06:29PM +0100, Al Viro wrote: > On Thu, Oct 22, 2020 at 08:24:58PM +0100, Al Viro wrote: > > > Depending upon the calling conventions, compiler might do truncation in > > caller or > > in a callee, but it must be done _somewhere_. > > Unless I'm misreading AAPCS64, >

Re: [PATCH] treewide: Convert macro and uses of __section(foo) to __section("foo")

2020-10-22 Thread Joe Perches
On Thu, 2020-10-22 at 13:42 -0700, Nick Desaulniers wrote: > .On Wed, Oct 21, 2020 at 7:36 PM Joe Perches wrote: > > Use a more generic form for __section that requires quotes to avoid > > complications with clang and gcc differences. [] > > a quick test of x86_64 and s390 would be good. x86_64

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread Eric Biggers
On Thu, Oct 22, 2020 at 10:00:44AM -0700, Nick Desaulniers wrote: > On Thu, Oct 22, 2020 at 9:40 AM Matthew Wilcox wrote: > > > > On Thu, Oct 22, 2020 at 04:35:17PM +, David Laight wrote: > > > Wait... > > > readv(2) defines: > > > ssize_t readv(int fd, const struct iovec *iov, int iovcn

Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread Al Viro
On Thu, Oct 22, 2020 at 01:59:32PM -0700, Eric Biggers wrote: > Also note the following program succeeds on Linux 5.9 on x86_64. On kernels > that have this bug, it should fail. (I couldn't get it to actually fail, so > it > must depend on the compiler and/or the kernel config...) It doesn't.

RE: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread David Laight
From: Nick Desaulniers > Sent: 22 October 2020 20:05 > ... > Passing an `unsigned long` as an `unsigned int` does no such > narrowing: https://godbolt.org/z/TvfMxe (same vice-versa, just tail > calls, no masking instructions). Right but is the called function going to use 32bit ops and/or mask th

RE: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c"

2020-10-22 Thread David Laight
From: Al Viro > Sent: 22 October 2020 20:25 > > On Thu, Oct 22, 2020 at 12:04:52PM -0700, Nick Desaulniers wrote: > > > Passing an `unsigned long` as an `unsigned int` does no such > > narrowing: https://godbolt.org/z/TvfMxe (same vice-versa, just tail > > calls, no masking instructions). > > So

Re: [PATCH] treewide: Convert macro and uses of __section(foo) to __section("foo")

2020-10-22 Thread Nick Desaulniers
.On Wed, Oct 21, 2020 at 7:36 PM Joe Perches wrote: > > Use a more generic form for __section that requires quotes to avoid > complications with clang and gcc differences. > > Remove the quote operator # from compiler_attributes.h __section macro. > > Convert all unquoted __section(foo) uses to qu

Re: [PATCH] powerpc: Send SIGBUS from machine_check

2020-10-22 Thread Michael Ellerman
Joakim Tjernlund writes: > Embedded PPC CPU should send SIGBUS to user space when applicable. Yeah, but it's not clear that it's applicable in all cases. At least I need some reasoning for why it's safe in all cases below to just send a SIGBUS and take no other action. Is there a particular CPU

Re: [PATCH] selftests/powerpc/eeh: disable kselftest timeout setting for eeh-basic

2020-10-22 Thread Michael Ellerman
Po-Hsu Lin writes: > The eeh-basic test got its own 60 seconds timeout (defined in commit > 414f50434aa2 "selftests/eeh: Bump EEH wait time to 60s") per breakable > device. > > And we have discovered that the number of breakable devices varies > on different hardware. The device recovery time rang

[PATCH] powerpc/85xx: Fix declaration made after definition

2020-10-22 Thread Michael Ellerman
Currently the clang build of corenet64_smp_defconfig fails with: arch/powerpc/platforms/85xx/corenet_generic.c:210:1: error: attribute declaration must precede definition machine_arch_initcall(corenet_generic, corenet_gen_publish_devices); Fix it by moving the initcall definition prior to t

Re: [PATCH] selftests/powerpc/eeh: disable kselftest timeout setting for eeh-basic

2020-10-22 Thread Po-Hsu Lin
On Fri, Oct 23, 2020 at 10:07 AM Michael Ellerman wrote: > > Po-Hsu Lin writes: > > The eeh-basic test got its own 60 seconds timeout (defined in commit > > 414f50434aa2 "selftests/eeh: Bump EEH wait time to 60s") per breakable > > device. > > > > And we have discovered that the number of breakab

[PATCHv2] selftests/powerpc/eeh: disable kselftest timeout setting for eeh-basic

2020-10-22 Thread Po-Hsu Lin
The eeh-basic test got its own 60 seconds timeout (defined in commit 414f50434aa2 "selftests/eeh: Bump EEH wait time to 60s") per breakable device. And we have discovered that the number of breakable devices varies on different hardware. The device recovery time ranges from 0 to 35 seconds. In our

[PATCH] powerpc/ps3: Drop unused DBG macro

2020-10-22 Thread Michael Ellerman
This DBG macro is unused, and has been unused since the file was originally merged into mainline. Just drop it. Signed-off-by: Michael Ellerman --- arch/powerpc/boot/ps3.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/arch/powerpc/boot/ps3.c b/arch/powerpc/boot/ps3.c index 6e4efbdb6b

Re: [PATCH] serial: pmac_zilog: don't init if zilog is not available

2020-10-22 Thread Finn Thain
On Thu, 22 Oct 2020, Geert Uytterhoeven wrote: > > Thanks for your patch... > You're welcome. > I can't say I'm a fan of this... > Sorry. > > The real issue is this "extern struct platform_device scc_a_pdev, > scc_b_pdev", circumventing the driver framework. > > Can we get rid of that? >

[PATCH] net: ucc_geth: Drop extraneous parentheses in comparison

2020-10-22 Thread Michael Ellerman
Clang warns about the extra parentheses in this comparison: drivers/net/ethernet/freescale/ucc_geth.c:1361:28: warning: equality comparison with extraneous parentheses if ((ugeth->phy_interface == PHY_INTERFACE_MODE_SGMII)) ~^~~ It seem

[PATCH] powerpc: Add config fragment for disabling -Werror

2020-10-22 Thread Michael Ellerman
This makes it easy to disable building with -Werror: $ make defconfig $ grep WERROR .config # CONFIG_PPC_DISABLE_WERROR is not set CONFIG_PPC_WERROR=y $ make disable-werror.config GEN Makefile Using .config as base Merging arch/powerpc/configs/disable-werror.config Value o

[powerpc:fixes] BUILD SUCCESS 4ff753feab021242144818b9a3ba011238218145

2020-10-22 Thread kernel test robot
i386 randconfig-a002-20201022 i386 randconfig-a005-20201022 i386 randconfig-a003-20201022 i386 randconfig-a001-20201022 i386 randconfig-a006-20201022 i386 randconfig-a004-20201022 x86_64

Re: [PATCH] treewide: Convert macro and uses of __section(foo) to __section("foo")

2020-10-22 Thread Miguel Ojeda
On Thu, Oct 22, 2020 at 4:36 AM Joe Perches wrote: > > Use a more generic form for __section that requires quotes to avoid > complications with clang and gcc differences. I performed visual inspection (one by one...) and the only thing I saw is that sometimes the `__attribute__` has a whitespace

Re: C vdso

2020-10-22 Thread Christophe Leroy
Hi Michael, Le 24/09/2020 à 15:17, Christophe Leroy a écrit : Hi Michael Le 17/09/2020 à 14:33, Michael Ellerman a écrit : Hi Christophe, Christophe Leroy writes: Hi Michael, What is the status with the generic C vdso merge ? In some mail, you mentionned having difficulties getting it work