Re: [PATCH] asm-generic: Force inlining of get_order() to work around gcc10 poor decision

2020-10-19 Thread Segher Boessenkool
On Mon, Oct 19, 2020 at 07:50:41AM +0200, Christophe Leroy wrote: > Le 19/10/2020 à 06:55, Joel Stanley a écrit : > >>In the old days, marking a function 'static inline' was forcing > >>GCC to inline, but since commit ac7c3e4ff401 ("compiler: enable > >>CONFIG_OPTIMIZE_INLINING forcibly") GCC may

Re: [PATCH v4 2/2] lkdtm/powerpc: Add SLB multihit test

2020-10-19 Thread Michael Ellerman
Hi Ganesh, Some comments below ... Ganesh Goudar writes: > To check machine check handling, add support to inject slb > multihit errors. > > Cc: Kees Cook > Reviewed-by: Michal Suchánek > Co-developed-by: Mahesh Salgaonkar > Signed-off-by: Mahesh Salgaonkar > Signed-off-by: Ganesh Goudar >

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

2020-10-19 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 instruction selection for argument %0 ever differs from argument %1. Fixes: 9bf2b5cdc5fe ("powerpc: Fixes for

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

2020-10-19 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

Re: [PATCH v4 2/2] lkdtm/powerpc: Add SLB multihit test

2020-10-19 Thread Michal Suchánek
On Mon, Oct 19, 2020 at 09:59:57PM +1100, Michael Ellerman wrote: > Hi Ganesh, > > Some comments below ... > > Ganesh Goudar writes: > > To check machine check handling, add support to inject slb > > multihit errors. > > > > Cc: Kees Cook > > Reviewed-by: Michal Suchánek > > Co-developed-by:

[PATCH v1 1/2] KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE (nested case only)

2020-10-19 Thread Bharata B Rao
Implements H_RPT_INVALIDATE hcall and supports only nested case currently. A KVM capability KVM_CAP_RPT_INVALIDATE is added to indicate the support for this hcall. Signed-off-by: Bharata B Rao --- Documentation/virt/kvm/api.rst| 17

Re: [PATCH] drm/amd/display: Fix missing declaration of enable_kernel_vsx()

2020-10-19 Thread kernel test robot
://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Christophe-Leroy/drm-amd-display-Fix-missing-declaration-of-enable_kernel_vsx/20201019-174155 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 7cf726a59435301046250c42131554d9ccc566b8

[PATCH v1 2/2] KVM: PPC: Book3S HV: Use H_RPT_INVALIDATE in nested KVM

2020-10-19 Thread Bharata B Rao
In the nested KVM case, replace H_TLB_INVALIDATE by the new hcall H_RPT_INVALIDATE if available. The availability of this hcall is determined from "hcall-rpt-invalidate" string in ibm,hypertas-functions DT property. Signed-off-by: Bharata B Rao --- arch/powerpc/kvm/book3s_64_mmu_radix.c | 26

Re: [PATCH] asm-generic: Force inlining of get_order() to work around gcc10 poor decision

2020-10-19 Thread Christophe Leroy
Le 19/10/2020 à 10:32, Segher Boessenkool a écrit : On Mon, Oct 19, 2020 at 07:50:41AM +0200, Christophe Leroy wrote: Le 19/10/2020 à 06:55, Joel Stanley a écrit : In the old days, marking a function 'static inline' was forcing GCC to inline, but since commit ac7c3e4ff401 ("compiler: enable

[PATCH] drm/amd/display: Fix missing declaration of enable_kernel_vsx()

2020-10-19 Thread Christophe Leroy
Include in order to avoid following build failure because of missing declaration of enable_kernel_vsx() CC [M] drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dcn_calcs.o In file included from ./drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:29, from

[PATCH v1 0/2] Use H_RPT_INVALIDATE for nested guest

2020-10-19 Thread Bharata B Rao
This patchset adds support for the new hcall H_RPT_INVALIDATE (currently handles nested case only) and replaces the nested tlb flush calls with this new hcall if the support for the same exists. Changes in v1: - - Removed the bits that added the FW_FEATURE_RPT_INVALIDATE feature as

[PATCH 3/3] powerpc: Fix pre-update addressing in inline assembly

2020-10-19 Thread Christophe Leroy
In several places, inline assembly uses the "%Un" modifier to enable the use of instruction with pre-update 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

Re: [PATCH] drm/amd/display: Fix missing declaration of enable_kernel_vsx()

2020-10-19 Thread Christophe Leroy
patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Christophe-Leroy/drm-amd-display-Fix-missing-declaration-of-enable_kernel_vsx/20201019-174155 base: https://git.kernel.org/pub/scm/linux/kernel/git

Re: [PATCH 3/3] powerpc: Fix pre-update addressing in inline assembly

2020-10-19 Thread kernel test robot
submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Christophe-Leroy/powerpc-uaccess-Don-t-use-m-constraint-with-GCC-4-9/20201019-201504 base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc

Re: [PATCH 11/20] dt-bindings: usb: dwc3: Add synopsys,dwc3 compatible string

2020-10-19 Thread Serge Semin
On Fri, Oct 16, 2020 at 01:53:40PM -0500, Rob Herring wrote: > On Thu, Oct 15, 2020 at 12:35:54AM +0300, Serge Semin wrote: > > On Wed, Oct 14, 2020 at 10:18:18PM +0200, Krzysztof Kozlowski wrote: > > > On Wed, Oct 14, 2020 at 01:13:53PM +0300, Serge Semin wrote: > > > > The DWC USB3 driver and

Re: [PATCH] drm/amd/display: Fix missing declaration of enable_kernel_vsx()

2020-10-19 Thread kernel test robot
://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Christophe-Leroy/drm-amd-display-Fix-missing-declaration-of-enable_kernel_vsx/20201019-174155 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 7cf726a59435301046250c42131554d9ccc566b8

Re: [PATCH 1/4] KVM: PPC: Book3S HV: Make struct kernel_param_ops definition const

2020-10-19 Thread Paolo Bonzini
On 04/10/20 02:18, Joe Perches wrote: > This should be const, so make it so. > > Signed-off-by: Joe Perches > --- > arch/powerpc/kvm/book3s_hv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c > index

Re: [PATCH 3/3] powerpc: Fix pre-update addressing in inline assembly

2020-10-19 Thread Christophe Leroy
to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Christophe-Leroy/powerpc-uaccess-Don-t-use-m-constraint-with-GCC-4-9/20201019-201504 base

Re: [PATCH] asm-generic: Force inlining of get_order() to work around gcc10 poor decision

2020-10-19 Thread Segher Boessenkool
On Mon, Oct 19, 2020 at 10:54:40AM +0200, Christophe Leroy wrote: > Le 19/10/2020 à 10:32, Segher Boessenkool a écrit : > >The kernel should just use __always_inline if that is what it *wants*; > >that is true here most likely. GCC could perhaps improve its heuristics > >so that it no longer

[PATCH v3] soc: fsl: dpio: Get the cpumask through cpumask_of(cpu)

2020-10-19 Thread Yi Wang
From: Hao Si The local variable 'cpumask_t mask' is in the stack memory, and its address is assigned to 'desc->affinity' in 'irq_set_affinity_hint()'. But the memory area where this variable is located is at risk of being modified. During LTP testing, the following error was generated: Unable

Re: [PATCH 2/8] powerpc/signal: Add unsafe_copy_{vsx,fpr}_from_user()

2020-10-19 Thread Christopher M. Riedl
On Fri Oct 16, 2020 at 10:48 AM CDT, Christophe Leroy wrote: > > > Le 15/10/2020 à 17:01, Christopher M. Riedl a écrit : > > Reuse the "safe" implementation from signal.c except for calling > > unsafe_copy_from_user() to copy into a local buffer. Unlike the > > unsafe_copy_{vsx,fpr}_to_user()

Re: [PATCH 6/8] powerpc/signal64: Replace setup_trampoline() w/ unsafe_setup_trampoline()

2020-10-19 Thread Christopher M. Riedl
On Fri Oct 16, 2020 at 10:56 AM CDT, Christophe Leroy wrote: > > > Le 15/10/2020 à 17:01, Christopher M. Riedl a écrit : > > From: Daniel Axtens > > > > Previously setup_trampoline() performed a costly KUAP switch on every > > uaccess operation. These repeated uaccess switches cause a

Re: [PATCH 7/8] powerpc/signal64: Rewrite handle_rt_signal64() to minimise uaccess switches

2020-10-19 Thread Christopher M. Riedl
On Fri Oct 16, 2020 at 11:00 AM CDT, Christophe Leroy wrote: > > > Le 15/10/2020 à 17:01, Christopher M. Riedl a écrit : > > From: Daniel Axtens > > > > Add uaccess blocks and use the 'unsafe' versions of functions doing user > > access where possible to reduce the number of times uaccess has to

Re: [PATCH 8/8] powerpc/signal64: Rewrite rt_sigreturn() to minimise uaccess switches

2020-10-19 Thread Christopher M. Riedl
On Fri Oct 16, 2020 at 11:07 AM CDT, Christophe Leroy wrote: > > > Le 15/10/2020 à 17:01, Christopher M. Riedl a écrit : > > From: Daniel Axtens > > > > Add uaccess blocks and use the 'unsafe' versions of functions doing user > > access where possible to reduce the number of times uaccess has to

Re: [PATCH 1/8] powerpc/uaccess: Add unsafe_copy_from_user

2020-10-19 Thread Christopher M. Riedl
On Fri Oct 16, 2020 at 10:17 AM CDT, Christophe Leroy wrote: > > > Le 15/10/2020 à 17:01, Christopher M. Riedl a écrit : > > Implement raw_copy_from_user_allowed() which assumes that userspace read > > access is open. Use this new function to implement raw_copy_from_user(). > > Finally, wrap the

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

2020-10-19 Thread Segher Boessenkool
On Mon, Oct 19, 2020 at 12:12:46PM +, Christophe Leroy wrote: > GCC 4.9 sometimes fails to build with "m<>" constraint in > inline assembly. > --- a/arch/powerpc/include/asm/uaccess.h > +++ b/arch/powerpc/include/asm/uaccess.h > @@ -223,7 +223,7 @@ do {

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

2020-10-19 Thread Segher Boessenkool
On Mon, Oct 19, 2020 at 12:12:47PM +, Christophe Leroy wrote: > 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 instruction selection for argument %0

Re: [PATCH 3/3] powerpc: Fix pre-update addressing in inline assembly

2020-10-19 Thread Segher Boessenkool
On Mon, Oct 19, 2020 at 12:12:48PM +, Christophe Leroy wrote: > In several places, inline assembly uses the "%Un" modifier > to enable the use of instruction with pre-update addressing, Calling this "pre-update" is misleading: the register is not updated before the address is generated (or

Re: [PATCH 3/8] powerpc: Mark functions called inside uaccess blocks w/ 'notrace'

2020-10-19 Thread Christopher M. Riedl
On Fri Oct 16, 2020 at 4:02 AM CDT, Christophe Leroy wrote: > > > Le 15/10/2020 à 17:01, Christopher M. Riedl a écrit : > > Functions called between user_*_access_begin() and user_*_access_end() > > should be either inlined or marked 'notrace' to prevent leaving > > userspace access exposed. Mark

Re: [PATCH 6/8] powerpc/signal64: Replace setup_trampoline() w/ unsafe_setup_trampoline()

2020-10-19 Thread Christophe Leroy
Le 20/10/2020 à 04:42, Christopher M. Riedl a écrit : On Fri Oct 16, 2020 at 10:56 AM CDT, Christophe Leroy wrote: Le 15/10/2020 à 17:01, Christopher M. Riedl a écrit : From: Daniel Axtens Previously setup_trampoline() performed a costly KUAP switch on every uaccess operation. These

[powerpc:fixes] BUILD SUCCESS 358ab796ce78ba271a6ff82834183ffb2cb68c4c

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

[powerpc:next-test] BUILD SUCCESS c9818c0abfb0c3500684bb2bc75981123d63134d

2020-10-19 Thread kernel test robot
-20201019 x86_64 randconfig-a002-20201019 x86_64 randconfig-a006-20201019 x86_64 randconfig-a003-20201019 x86_64 randconfig-a005-20201019 x86_64 randconfig-a001-20201019 i386 randconfig-a006-20201019 i386

[powerpc:merge] BUILD SUCCESS 96b5a60d059984a2f0eaef90e97f59ac4a76bff4

2020-10-19 Thread kernel test robot
allmodconfig powerpc allyesconfig powerpc allmodconfig powerpc allnoconfig x86_64 randconfig-a004-20201019 x86_64 randconfig-a002-20201019 x86_64 randconfig

[PATCH 2/2] powerpc/watchpoint: Workaround P10 DD1 issue with VSX-32 byte instructions

2020-10-19 Thread Ravi Bangoria
POWER10 DD1 has an issue where it generates watchpoint exceptions when it shouldn't. The conditions where this occur are: - octword op - ending address of DAWR range is less than starting address of op - those addresses need to be in the same or in two consecutive 512B blocks - 'op address

[PATCH 1/2] powerpc: Introduce POWER10_DD1 feature

2020-10-19 Thread Ravi Bangoria
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.c | 9 + 3 files