Re: How to use "y" constraint in GCC inline powerpc assembly ?

2020-04-18 Thread Segher Boessenkool
Hi! On Sat, Apr 18, 2020 at 08:28:53AM +, Christophe Leroy wrote: > I'd like to use cr instead of gpr to return error condition from > __get_user(). > > I saw in GCC doc > (https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html) that it is > possible to use "y" as constraint to refer

[PATCHv3 26/50] powerpc: Add show_stack_loglvl()

2020-04-18 Thread Dmitry Safonov
Currently, the log-level of show_stack() depends on a platform realization. It creates situations where the headers are printed with lower log level or higher than the stacktrace (depending on a platform or user). Furthermore, it forces the logic decision from user to an architecture side. In

Re: [PATCH v6, 4/4] drivers: misc: new driver sram_uapi for user level SRAM access

2020-04-18 Thread Arnd Bergmann
On Sat, Apr 18, 2020 at 6:22 PM Wang Wenhu wrote: > +#define DRIVER_NAME"sram_uapi" > + > +#define SRAM_UAPI_IOCTL_SET_SRAM_TYPE 0 > +#define SRAM_UAPI_IOCTL_ALLOC 1 > +#define SRAM_UAPI_IOCTL_FREE 2 > + > +struct res_info { > + u32 offset; > + u32 size; > +};

Re: [PATCH v6, 4/4] drivers: misc: new driver sram_uapi for user level SRAM access

2020-04-18 Thread Arnd Bergmann
On Sat, Apr 18, 2020 at 6:22 PM Wang Wenhu wrote: > > A generic User-Kernel interface that allows a misc device created > by it to support file-operations of ioctl and mmap to access SRAM > memory from user level. Different kinds of SRAM alloction and free > APIs could be added to the available

[PATCH v6, 4/4] drivers: misc: new driver sram_uapi for user level SRAM access

2020-04-18 Thread Wang Wenhu
A generic User-Kernel interface that allows a misc device created by it to support file-operations of ioctl and mmap to access SRAM memory from user level. Different kinds of SRAM alloction and free APIs could be added to the available array and could be configured from user level. Signed-off-by:

[PATCH v6, 1/4] powerpc: sysdev: fix compile error for fsl_85xx_l2ctlr

2020-04-18 Thread Wang Wenhu
Include "linux/of_address.h" to fix the compile error for mpc85xx_l2ctlr_of_probe() when compiling fsl_85xx_cache_sram.c. CC arch/powerpc/sysdev/fsl_85xx_l2ctlr.o arch/powerpc/sysdev/fsl_85xx_l2ctlr.c: In function ‘mpc85xx_l2ctlr_of_probe’: arch/powerpc/sysdev/fsl_85xx_l2ctlr.c:90:11:

[PATCH v6, 2/4] powerpc: sysdev: fix compile error for fsl_85xx_cache_sram

2020-04-18 Thread Wang Wenhu
Include linux/io.h into fsl_85xx_cache_sram.c to fix the implicit-declaration compile error when building Cache-Sram. arch/powerpc/sysdev/fsl_85xx_cache_sram.c: In function ‘instantiate_cache_sram’: arch/powerpc/sysdev/fsl_85xx_cache_sram.c:97:26: error: implicit declaration of function

[PATCH v6, 3/4] powerpc: sysdev: fix compile warning for fsl_85xx_cache_sram

2020-04-18 Thread Wang Wenhu
Function instantiate_cache_sram should not be linked into the init section for its caller mpc85xx_l2ctlr_of_probe is none-__init. Cc: Greg Kroah-Hartman Cc: Arnd Bergmann Cc: Christophe Leroy Cc: Scott Wood Cc: Michael Ellerman Cc: Randy Dunlap Cc: linuxppc-dev@lists.ozlabs.org Fixes:

[PATCH v6,0/4] misc: new driver sram_uapi for user level SRAM access

2020-04-18 Thread Wang Wenhu
This series add a new misc device driver which act as an interface to access the Cache-SRAM from user level. This is extremely helpful for some user space applications that require high performance memory accesses. It also fixes the compile errors and warning of the Freescale MPC85xx Cache-SRAM

Re: [PATCH] iommu: spapr_tce: Disable compile testing to fix build on book3s_32 config

2020-04-18 Thread Christophe Leroy
On 04/14/2020 02:26 PM, Krzysztof Kozlowski wrote: Although SPAPR_TCE_IOMMU itself can be compile tested on certain PowerPC configurations, its presence makes arch/powerpc/kvm/Makefile to select modules which do not build in such configuration. The arch/powerpc/kvm/ modules use

[PATCH AUTOSEL 4.19 43/47] ocxl: Add PCI hotplug dependency to Kconfig

2020-04-18 Thread Sasha Levin
From: Frederic Barrat [ Upstream commit 49ce94b8677c7d7a15c4d7cbbb9ff1cd8387827b ] The PCI hotplug framework is used to update the devices when a new image is written to the FPGA. Reviewed-by: Alastair D'Silva Reviewed-by: Andrew Donnellan Signed-off-by: Frederic Barrat Signed-off-by:

[PATCH AUTOSEL 4.19 41/47] powerpc/powernv/ioda: Fix ref count for devices with their own PE

2020-04-18 Thread Sasha Levin
From: Frederic Barrat [ Upstream commit 05dd7da76986937fb288b4213b1fa10dbe0d1b33 ] The pci_dn structure used to store a pointer to the struct pci_dev, so taking a reference on the device was required. However, the pci_dev pointer was later removed from the pci_dn structure, but the reference

[PATCH AUTOSEL 4.19 42/47] pci/hotplug/pnv-php: Remove erroneous warning

2020-04-18 Thread Sasha Levin
From: Frederic Barrat [ Upstream commit 658ab186dd22060408d94f5c5a6d02d809baba44 ] On powernv, when removing a device through hotplug, the following warning is logged: Invalid refcount <.> on <...> It may be incorrect, the refcount may be set to a higher value than 1 and be valid.

[PATCH AUTOSEL 4.19 22/47] Revert "powerpc/64: irq_work avoid interrupt when called with hardware irqs enabled"

2020-04-18 Thread Sasha Levin
From: Nicholas Piggin [ Upstream commit abc3fce76adbdfa8f87272c784b388cd20b46049 ] This reverts commit ebb37cf3ffd39fdb6ec5b07111f8bb2f11d92c5f. That commit does not play well with soft-masked irq state manipulations in idle, interrupt replay, and possibly others due to tracing code sometimes

[PATCH AUTOSEL 5.4 71/78] ocxl: Add PCI hotplug dependency to Kconfig

2020-04-18 Thread Sasha Levin
From: Frederic Barrat [ Upstream commit 49ce94b8677c7d7a15c4d7cbbb9ff1cd8387827b ] The PCI hotplug framework is used to update the devices when a new image is written to the FPGA. Reviewed-by: Alastair D'Silva Reviewed-by: Andrew Donnellan Signed-off-by: Frederic Barrat Signed-off-by:

[PATCH AUTOSEL 5.4 70/78] pci/hotplug/pnv-php: Remove erroneous warning

2020-04-18 Thread Sasha Levin
From: Frederic Barrat [ Upstream commit 658ab186dd22060408d94f5c5a6d02d809baba44 ] On powernv, when removing a device through hotplug, the following warning is logged: Invalid refcount <.> on <...> It may be incorrect, the refcount may be set to a higher value than 1 and be valid.

[PATCH AUTOSEL 5.4 69/78] powerpc/powernv/ioda: Fix ref count for devices with their own PE

2020-04-18 Thread Sasha Levin
From: Frederic Barrat [ Upstream commit 05dd7da76986937fb288b4213b1fa10dbe0d1b33 ] The pci_dn structure used to store a pointer to the struct pci_dev, so taking a reference on the device was required. However, the pci_dev pointer was later removed from the pci_dn structure, but the reference

[PATCH AUTOSEL 5.4 36/78] powerpc/pseries: Fix MCE handling on pseries

2020-04-18 Thread Sasha Levin
From: Ganesh Goudar [ Upstream commit a95a0a1654f16366360399574e10efd87e867b39 ] MCE handling on pSeries platform fails as recent rework to use common code for pSeries and PowerNV in machine check error handling tries to access per-cpu variables in realmode. The per-cpu variables may be outside

[PATCH AUTOSEL 5.4 35/78] Revert "powerpc/64: irq_work avoid interrupt when called with hardware irqs enabled"

2020-04-18 Thread Sasha Levin
From: Nicholas Piggin [ Upstream commit abc3fce76adbdfa8f87272c784b388cd20b46049 ] This reverts commit ebb37cf3ffd39fdb6ec5b07111f8bb2f11d92c5f. That commit does not play well with soft-masked irq state manipulations in idle, interrupt replay, and possibly others due to tracing code sometimes

[PATCH AUTOSEL 5.5 73/75] ocxl: Add PCI hotplug dependency to Kconfig

2020-04-18 Thread Sasha Levin
From: Frederic Barrat [ Upstream commit 49ce94b8677c7d7a15c4d7cbbb9ff1cd8387827b ] The PCI hotplug framework is used to update the devices when a new image is written to the FPGA. Reviewed-by: Alastair D'Silva Reviewed-by: Andrew Donnellan Signed-off-by: Frederic Barrat Signed-off-by:

[PATCH AUTOSEL 5.5 71/75] powerpc/powernv/ioda: Fix ref count for devices with their own PE

2020-04-18 Thread Sasha Levin
From: Frederic Barrat [ Upstream commit 05dd7da76986937fb288b4213b1fa10dbe0d1b33 ] The pci_dn structure used to store a pointer to the struct pci_dev, so taking a reference on the device was required. However, the pci_dev pointer was later removed from the pci_dn structure, but the reference

[PATCH AUTOSEL 5.5 72/75] pci/hotplug/pnv-php: Remove erroneous warning

2020-04-18 Thread Sasha Levin
From: Frederic Barrat [ Upstream commit 658ab186dd22060408d94f5c5a6d02d809baba44 ] On powernv, when removing a device through hotplug, the following warning is logged: Invalid refcount <.> on <...> It may be incorrect, the refcount may be set to a higher value than 1 and be valid.

[PATCH AUTOSEL 5.5 38/75] powerpc/pseries: Fix MCE handling on pseries

2020-04-18 Thread Sasha Levin
From: Ganesh Goudar [ Upstream commit a95a0a1654f16366360399574e10efd87e867b39 ] MCE handling on pSeries platform fails as recent rework to use common code for pSeries and PowerNV in machine check error handling tries to access per-cpu variables in realmode. The per-cpu variables may be outside

[PATCH AUTOSEL 5.5 37/75] Revert "powerpc/64: irq_work avoid interrupt when called with hardware irqs enabled"

2020-04-18 Thread Sasha Levin
From: Nicholas Piggin [ Upstream commit abc3fce76adbdfa8f87272c784b388cd20b46049 ] This reverts commit ebb37cf3ffd39fdb6ec5b07111f8bb2f11d92c5f. That commit does not play well with soft-masked irq state manipulations in idle, interrupt replay, and possibly others due to tracing code sometimes

[PATCH AUTOSEL 5.6 39/73] Revert "powerpc/64: irq_work avoid interrupt when called with hardware irqs enabled"

2020-04-18 Thread Sasha Levin
From: Nicholas Piggin [ Upstream commit abc3fce76adbdfa8f87272c784b388cd20b46049 ] This reverts commit ebb37cf3ffd39fdb6ec5b07111f8bb2f11d92c5f. That commit does not play well with soft-masked irq state manipulations in idle, interrupt replay, and possibly others due to tracing code sometimes

[PATCH AUTOSEL 5.6 40/73] powerpc/pseries: Fix MCE handling on pseries

2020-04-18 Thread Sasha Levin
From: Ganesh Goudar [ Upstream commit a95a0a1654f16366360399574e10efd87e867b39 ] MCE handling on pSeries platform fails as recent rework to use common code for pSeries and PowerNV in machine check error handling tries to access per-cpu variables in realmode. The per-cpu variables may be outside

Re: [PATCH 3/4] dma-mapping: add a dma_ops_bypass flag to struct device

2020-04-18 Thread Joerg Roedel
Hi Christoph, On Tue, Apr 14, 2020 at 02:25:05PM +0200, Christoph Hellwig wrote: > +static inline bool dma_map_direct(struct device *dev, > + const struct dma_map_ops *ops) > +{ > + if (likely(!ops)) > + return true; > + if (!dev->dma_ops_bypass) > +

Re: [PATCH] iommu: spapr_tce: Disable compile testing to fix build on book3s_32 config

2020-04-18 Thread Joerg Roedel
On Tue, Apr 14, 2020 at 04:26:30PM +0200, Krzysztof Kozlowski wrote: > Reported-by: Geert Uytterhoeven > Fixes: e93a1695d7fb ("iommu: Enable compile testing for some of drivers") > Signed-off-by: Krzysztof Kozlowski > --- > drivers/iommu/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1

Re: [PATCH 1/2] signal: Factor copy_siginfo_to_external32 from copy_siginfo_to_user32

2020-04-18 Thread Eric W. Biederman
Christophe Leroy writes: > Le 17/04/2020 à 23:09, Eric W. Biederman a écrit : >> >> To remove the use of set_fs in the coredump code there needs to be a >> way to convert a kernel siginfo to a userspace compat siginfo. >> >> Call that function copy_siginfo_to_compat and factor it out of >>

Re: [RFC PATCH] powerpc/64/signal: balance return predictor stack in signal trampoline

2020-04-18 Thread Nicholas Piggin
Excerpts from Alan Modra's message of April 18, 2020 9:40 am: > On Fri, Apr 17, 2020 at 07:17:47PM +1000, Nicholas Piggin wrote: >> I don't know much about dwarf, gdb still seems to recognize the signal >> frame and unwind properly if I break inside a signal handler. > > Yes, the dwarf unwind

Re: [RFC PATCH 1/3] powerpc/mm: Introduce temporary mm

2020-04-18 Thread Christophe Leroy
Le 23/03/2020 à 05:52, Christopher M. Riedl a écrit : x86 supports the notion of a temporary mm which restricts access to temporary PTEs to a single CPU. A temporary mm is useful for situations where a CPU needs to perform sensitive operations (such as patching a STRICT_KERNEL_RWX kernel)

Re: [RFC PATCH] powerpc/lib: Fixing use a temporary mm for code patching

2020-04-18 Thread Christophe Leroy
Le 15/04/2020 à 18:22, Christopher M Riedl a écrit : On April 15, 2020 4:12 AM Christophe Leroy wrote: Le 15/04/2020 à 07:16, Christopher M Riedl a écrit : On March 26, 2020 9:42 AM Christophe Leroy wrote: This patch fixes the RFC series identified below. It fixes three points: -

How to use "y" constraint in GCC inline powerpc assembly ?

2020-04-18 Thread Christophe Leroy
Hi Segher, I'd like to use cr instead of gpr to return error condition from __get_user(). I saw in GCC doc (https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html) that it is possible to use "y" as constraint to refer to "Any condition register field, cr0…cr7". I tried the test

Re: [PATCH 8/8] exec: open code copy_string_kernel

2020-04-18 Thread Christophe Leroy
Le 14/04/2020 à 09:01, Christoph Hellwig a écrit : Currently copy_string_kernel is just a wrapper around copy_strings that simplifies the calling conventions and uses set_fs to allow passing a kernel pointer. But due to the fact the we only need to handle a single kernel argument pointer,

Re: [PATCH 1/2] signal: Factor copy_siginfo_to_external32 from copy_siginfo_to_user32

2020-04-18 Thread Christophe Leroy
Le 17/04/2020 à 23:09, Eric W. Biederman a écrit : To remove the use of set_fs in the coredump code there needs to be a way to convert a kernel siginfo to a userspace compat siginfo. Call that function copy_siginfo_to_compat and factor it out of copy_siginfo_to_user32. I find it a pitty

[PATCH] soc: fsl: guts: remove unneeded semicolon in fsl_soc_die_match()

2020-04-18 Thread Jason Yan
Fix the following coccicheck warning: drivers/soc/fsl/guts.c:120:2-3: Unneeded semicolon Reported-by: Hulk Robot Signed-off-by: Jason Yan --- drivers/soc/fsl/guts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c index