[RFC PATCH 13/13] powerpc/vas: Free send window after credits returned

2019-10-18 Thread Haren Myneni
NX may be processing requests while trying to close window. Wait until all credits are returned and then free send window from VAS instance. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/

[RFC PATCH 12/13] powerpc/vas: Display process stuck message

2019-10-18 Thread Haren Myneni
Process can not close send window until all requests are processed. Means wait until window state is not busy and send credits are returned. Display debug message in case taking longer to close the window. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 26 +++

[RFC PATCH 11/13] powerpc/vas: Return credits after handling fault

2019-10-18 Thread Haren Myneni
NX expects OS to return credit for send window after processing each fault. Also credit has to be returned even for fault window. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 10 ++ arch/powerpc/platforms/powernv/vas-

[RFC PATCH 10/13] powerpc/vas: Do not use default credits for receive window

2019-10-18 Thread Haren Myneni
System checkstops if RxFIFO overruns with more requests than the maximum possible number of CRBs allowed in FIFO at any time. So max credits value (rxattr.wcreds_max) is set and is passed to vas_rx_win_open() by the the driver. Signed-off-by:Haren Myneni --- arch/powerpc/platforms/powernv/vas-

[RFC PATCH 09/13] powerpc/vas: Add and use tgid in vas_window to close window

2019-10-18 Thread Haren Myneni
In multi-thread applications, child can open a window but release FD will not be called upon its exit. NX Send window will be closed with release function. Parent thread will be closing it later upon its exit. The parent can also send NX requests with this window and NX can generate page faults.

[RFC PATCH 08/13] powerpc/vas: Print CRB and FIFO values

2019-10-18 Thread Haren Myneni
Dump FIFO values if could not find send window and print CRB for debugging. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 40 ++ 1 file changed, 40 insertions(+) diff --git a/arch/powerpc/platforms/

[RFC PATCH 07/13] powerpc/vas: Update CSB and notify process for fault CRBs

2019-10-18 Thread Haren Myneni
For each fault CRB, update fault address in CRB (fault_storage_addr) and translation error status in CSB. If the actual fault is in CSB, send signal to process with SIGSEGV. Process can send new request by touching the fault address. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Mynen

[RFC PATCH 06/13] powerpc/vas: Read and process fault CRBs

2019-10-18 Thread Haren Myneni
NX pastes CRB in fault FIFO and generates interrupt whenever faults on CRB. OS reads CRBs from fault FIFO and process them by setting faulting address in fault_storge_addr in CRB and update CSB. When CSB status is changed, process sends NX request after touching the fault address. Signed-off-by:

[RFC PATCH 05/13] powerpc/vas: Setup fault handler per VAS instance

2019-10-18 Thread Haren Myneni
Fault handler is created as kernel thread for each VAS instance and invoked whenever NX generates page fault. This thread reads CRBs from fault FIFO and process them. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-fault.c | 53 +++

[RFC PATCH 04/13] powerpc/vas: Setup fault window per VAS instance

2019-10-18 Thread Haren Myneni
Setup fault window for each VAS instance. When NX gets fault on request buffer, write fault CRBs in the corresponding fault FIFO and then sends an interrupt to the OS. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/Makefile | 2 +- arch

[RFC PATCH 03/13] powerpc/vas: Setup IRQ mapping and register port for each window

2019-10-18 Thread Haren Myneni
Read interrupt and port values from the device tree, setup IRQ mapping and register IRQ for each VAS instance. Set port value for each NX window. When NX sees a fault on CRB, kernel gets an interrupt and handles the fault. IRQ setup and fault handling is needed only for user space send windows.

[RFC PATCH 02/13] powerpc/vas: Define nx_fault_stamp in coprocessor_request_block

2019-10-18 Thread Haren Myneni
Kernel sets fault address and status in CRB for NX page fault on user space address after processing page fault. User space gets the signal and handles the fault mentioned in CRB by bringing the page in to memory and send NX request again. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren

[RFC PATCH 01/13] Revert "powerpc/powernv: remove the unused vas_win_paste_addr and vas_win_id functions"

2019-10-18 Thread Haren Myneni
This reverts commit 452d23c0f6bd97f2fd8a9691fee79b76040a0feb. User space send windows (NX GZIP compression) need vas_win_paste_addr() to mmap window paste address and vas_win_id() to get window ID when window address is given. vas_win_id() is introduced in original commit 61f3cca8cda97 (powerpc

[RFC PATCH 00/13] powerpc/vas: Page fault handling for user space NX requests

2019-10-18 Thread Haren Myneni
Applications can send compression / decompression requests to NX with COPY/PASTE instructions. When NX is processing these requests, can hit fault on the request buffer (not in memory). It issues an interrupt and pastes fault CRB in fault FIFO. Expects kernel to handle this fault and return credi

[PATCH AUTOSEL 4.14 04/56] powerpc/powernv: hold device_hotplug_lock when calling memtrace_offline_pages()

2019-10-18 Thread Sasha Levin
From: David Hildenbrand [ Upstream commit 5666848774ef43d3db5151ec518f1deb63515c20 ] Let's perform all checking + offlining + removing under device_hotplug_lock, so nobody can mess with these devices via sysfs concurrently. [da...@redhat.com: take device_hotplug_lock outside of loop] Link: ht

[PATCH AUTOSEL 4.19 005/100] powerpc/powernv: hold device_hotplug_lock when calling memtrace_offline_pages()

2019-10-18 Thread Sasha Levin
From: David Hildenbrand [ Upstream commit 5666848774ef43d3db5151ec518f1deb63515c20 ] Let's perform all checking + offlining + removing under device_hotplug_lock, so nobody can mess with these devices via sysfs concurrently. [da...@redhat.com: take device_hotplug_lock outside of loop] Link: ht

Re: [PATCH 0/7] towards QE support on ARM

2019-10-18 Thread Li Yang
On Fri, Oct 18, 2019 at 3:54 PM Rasmus Villemoes wrote: > > On 18/10/2019 22.16, Leo Li wrote: > > > >> > >> There have been several attempts in the past few years to allow building > >> the > >> QUICC engine drivers for platforms other than PPC. This is (the beginning > >> of) > >> yet another

Re: [PATCH v2 00/33] Kill pr_warning in the whole linux code

2019-10-18 Thread Joe Perches
(Adding Stephen Rothwell) On Fri, 2019-10-18 at 17:22 +0200, Christoph Hellwig wrote: > As I said before: please just send Linus a scripted conversion after > the next -rc1. There is no point in creating all this churn. I again ask for a scripted mechanism to be added to -next to allow these ty

Re: [PATCH v2 00/33] Kill pr_warning in the whole linux code

2019-10-18 Thread Christoph Hellwig
As I said before: please just send Linus a scripted conversion after the next -rc1. There is no point in creating all this churn.

Re: [PATCH v2 00/33] Kill pr_warning in the whole linux code

2019-10-18 Thread Petr Mladek
On Fri 2019-10-18 11:17:10, Kefeng Wang wrote: > There are pr_warning and pr_warng to show WARNING level message, > most of the code using pr_warn, number based on next-20191017, > > pr_warn: 5206 pr_warning: 546 (tools: 399, others: 147) > > Let's carry on with the work to standardize the logg

Re: [PATCH 0/7] towards QE support on ARM

2019-10-18 Thread Rasmus Villemoes
On 18/10/2019 22.16, Leo Li wrote: > >> >> There have been several attempts in the past few years to allow building the >> QUICC engine drivers for platforms other than PPC. This is (the beginning of) >> yet another attempt. I hope I can get someone to pick up these relatively >> trivial patches (

RE: [PATCH 0/7] towards QE support on ARM

2019-10-18 Thread Leo Li
> -Original Message- > From: Rasmus Villemoes > Sent: Friday, October 18, 2019 7:52 AM > To: Qiang Zhao ; Leo Li ; Greg > Kroah-Hartman ; Jiri Slaby > ; Timur Tabi ; linuxppc- > d...@lists.ozlabs.org; linux-arm-ker...@lists.infradead.org; linux- > ker...@vger.kernel.org; linux-ser...@vg

Re: [PATCH v4 3/3] powerpc/prom_init: Use -ffreestanding to avoid a reference to bcmp

2019-10-18 Thread Segher Boessenkool
On Fri, Oct 18, 2019 at 12:00:22PM -0700, Nathan Chancellor wrote: > Just as an FYI, there was some more discussion around the availablity > and use of bcmp in this LLVM bug which spawned > commit 5f074f3e192f ("lib/string.c: implement a basic bcmp"). > > https://bugs.llvm.org/show_bug.cgi?id=4103

Re: [PATCH v4 3/3] powerpc/prom_init: Use -ffreestanding to avoid a reference to bcmp

2019-10-18 Thread Nathan Chancellor
On Mon, Oct 14, 2019 at 02:11:41PM -0500, Segher Boessenkool wrote: > On Mon, Oct 14, 2019 at 08:56:12AM -0700, Nick Desaulniers wrote: > > On Mon, Oct 14, 2019 at 2:35 AM Segher Boessenkool > > wrote: > > > > > > On Sun, Oct 13, 2019 at 07:51:01PM -0700, Nathan Chancellor wrote: > > > > r374662 g

Re: [PATCH 4/7] soc: fsl: qe: replace spin_event_timeout by readx_poll_timeout_atomic

2019-10-18 Thread Christoph Hellwig
On Fri, Oct 18, 2019 at 02:52:31PM +0200, Rasmus Villemoes wrote: > /* wait for the QE_CR_FLG to clear */ > - ret = spin_event_timeout((ioread32be(&qe_immr->cp.cecr) & QE_CR_FLG) == > 0, > - 100, 0); > - /* On timeout (e.g. failure), the expression will b

Re: [PATCH -next 03/13] hwrng: exynos - use devm_platform_ioremap_resource() to simplify code

2019-10-18 Thread Łukasz Stelmach
It was <2019-10-16 śro 12:46>, when YueHaibing wrote: > Use devm_platform_ioremap_resource() to simplify the code a bit. > This is detected by coccinelle. > > Signed-off-by: YueHaibing > --- > drivers/char/hw_random/exynos-trng.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > Acked

Re: [PATCH] powerpc/prom_init: Undo relocation before entering secure mode

2019-10-18 Thread Ram Pai
On Wed, Sep 11, 2019 at 01:34:33PM -0300, Thiago Jung Bauermann wrote: > The ultravisor will do an integrity check of the kernel image but we > relocated it so the check will fail. Restore the original image by > relocating it back to the kernel virtual base address. > > This works because during

[PATCH v2 4/4] powerpc/fadump: sysfs for fadump memory reservation

2019-10-18 Thread Sourabh Jain
Add a sys interface to allow querying the memory reserved by FADump for saving the crash dump. Also added Documentation/ABI for the new sysfs file. Signed-off-by: Sourabh Jain --- Documentation/ABI/testing/sysfs-kernel-fadump| 7 +++ Documentation/powerpc/firmware-assisted-dump.rst |

[PATCH v2 1/4] Documentation/ABI: add ABI documentation for /sys/kernel/fadump_*

2019-10-18 Thread Sourabh Jain
Add the missing ABI documentation for the already available FADump sysfs files. Signed-off-by: Sourabh Jain --- Documentation/ABI/testing/sysfs-kernel-fadump_enabled | 7 +++ Documentation/ABI/testing/sysfs-kernel-fadump_registered | 8 Documentation/ABI/testing/sysfs-kernel-fa

[PATCH v2 3/4] Documentation/ABI: mark /sys/kernel/fadump_* sysfs files deprecated

2019-10-18 Thread Sourabh Jain
The /sys/kernel/fadump_* sysfs files are replicated under /sys/kernel/fadump/ directory. But we need to keep the old sysfs files to maintain the backward compatibility. The sysfs files are scheduled to remove by 2021. Signed-off-by: Sourabh Jain --- .../sysfs-kernel-fadump_enabled

[PATCH v2 2/4] powerpc/fadump: reorganize /sys/kernel/fadump_* sysfs files

2019-10-18 Thread Sourabh Jain
As the number of FADump sysfs files increases it is hard to manage all of them inside /sys/kernel directory. It's better to have all the FADump related sysfs files in a dedicated directory /sys/kernel/fadump. But in order to maintain the backward compatibility the /sys/kernel/fadump_* sysfs files a

[PATCH v2 0/4] reorganize and add FADump sysfs files

2019-10-18 Thread Sourabh Jain
Currently, FADump sysfs files are present inside /sys/kernel directory. But as the number of FADump sysfs file increases it is not a good idea to push all of them in /sys/kernel directory. It is better to have separate directory to keep all the FADump sysfs files. The patch series reorganizes the

Re: [PATCH 2/7] soc: fsl: qe: drop volatile qualifier of struct qe_ic::regs

2019-10-18 Thread Christophe Leroy
Le 18/10/2019 à 14:52, Rasmus Villemoes a écrit : The actual io accessors (e.g. in_be32) implicitly add a volatile qualifier to their address argument. Remove volatile from the struct definition and the qe_ic_(read/write) helpers, in preparation for switching from the ppc-specific io accessors

Re: [PATCH 1/7] soc: fsl: qe: remove space-before-tab

2019-10-18 Thread Christophe Leroy
Le 18/10/2019 à 14:52, Rasmus Villemoes a écrit : Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/fsl/qe/qe.c b/drivers/soc/fsl/qe/qe.c index 417df7e19281..6fcbfad408de 100644 --- a/drivers/soc/

[PATCH 6/7] serial: ucc_uart.c: explicitly include asm/cpm.h

2019-10-18 Thread Rasmus Villemoes
This driver uses #defines from asm/cpm.h, so instead of relying on some other header pulling that in, do that explicitly. Signed-off-by: Rasmus Villemoes --- drivers/tty/serial/ucc_uart.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_u

[PATCH 4/7] soc: fsl: qe: replace spin_event_timeout by readx_poll_timeout_atomic

2019-10-18 Thread Rasmus Villemoes
In preparation for allowing QE to be built for architectures other than ppc, use the generic readx_poll_timeout_atomic() helper from iopoll.h rather than the ppc-only spin_event_timeout(). Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe.c | 13 +++-- 1 file changed, 7 insertion

[PATCH 3/7] soc: fsl: qe: avoid ppc-specific io accessors

2019-10-18 Thread Rasmus Villemoes
In preparation for allowing to build QE support for architectures other than PPC, replace the ppc-specific io accessors. Done via $ spatch --sp-file io.cocci --in-place drivers/soc/fsl/qe/ where io.cocci is @@ expression addr, val; @@ - out_be32(addr, val) + iowrite32be(val, addr) @@ expression

[PATCH 0/7] towards QE support on ARM

2019-10-18 Thread Rasmus Villemoes
There have been several attempts in the past few years to allow building the QUICC engine drivers for platforms other than PPC. This is (the beginning of) yet another attempt. I hope I can get someone to pick up these relatively trivial patches (I _think_ they shouldn't change functionality at all)

[PATCH 2/7] soc: fsl: qe: drop volatile qualifier of struct qe_ic::regs

2019-10-18 Thread Rasmus Villemoes
The actual io accessors (e.g. in_be32) implicitly add a volatile qualifier to their address argument. Remove volatile from the struct definition and the qe_ic_(read/write) helpers, in preparation for switching from the ppc-specific io accessors to generic ones. Signed-off-by: Rasmus Villemoes ---

[PATCH 1/7] soc: fsl: qe: remove space-before-tab

2019-10-18 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/fsl/qe/qe.c b/drivers/soc/fsl/qe/qe.c index 417df7e19281..6fcbfad408de 100644 --- a/drivers/soc/fsl/qe/qe.c +++ b/drivers/soc/fsl/qe/qe.c @@ -378,8 +378,

Re: [PATCH v8 1/5] kasan: support backing vmalloc space with real shadow memory

2019-10-18 Thread Andrey Ryabinin
On 10/16/19 4:22 PM, Mark Rutland wrote: > Hi Andrey, > > On Wed, Oct 16, 2019 at 03:19:50PM +0300, Andrey Ryabinin wrote: >> On 10/14/19 4:57 PM, Daniel Axtens wrote: > + /* > + * Ensure poisoning is visible before the shadow is made visible > + * to other CPUs. > + */ >

[PATCH v12 06/22] powerpc: mm: Add p?d_leaf() definitions

2019-10-18 Thread Steven Price
walk_page_range() is going to be allowed to walk page tables other than those of user space. For this it needs to know when it has reached a 'leaf' entry in the page tables. This information is provided by the p?d_leaf() functions/macros. For powerpc pmd_large() already exists and does what we wan

Re: [PATCH 0/4] crypto: nx - convert to skcipher API

2019-10-18 Thread Herbert Xu
On Sat, Oct 12, 2019 at 09:39:14PM -0700, Eric Biggers wrote: > This series converts the PowerPC Nest (NX) implementations of AES modes > from the deprecated "blkcipher" API to the "skcipher" API. This is > needed in order for the blkcipher API to be removed. > > This patchset is compile-tested o

Re: [PATCH v3 06/15] powerpc/32: prepare for CONFIG_VMAP_STACK

2019-10-18 Thread Andrew Donnellan
On 18/10/19 5:46 pm, Christophe Leroy wrote: Le 17/10/2019 à 09:36, Andrew Donnellan a écrit : On 10/9/19 7:16 pm, Christophe Leroy wrote: +#if defined(CONFIG_VMAP_STACK) && CONFIG_THREAD_SHIFT < PAGE_SHIFT +#define THREAD_SHIFT    PAGE_SHIFT +#else   #define THREAD_SHIFT    CONFIG_TH