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

2019-12-08 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 +-

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

2019-12-08 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 ---

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

2019-12-08 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 ++

[PATCH v5 1/6] Documentation/ABI: add ABI documentation for /sys/kernel/fadump_*

2019-12-08 Thread Sourabh Jain
Add missing ABI documentation for existing 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-fadump_release_mem

Re: [PATCH] powerpc/archrandom: fix arch_get_random_seed_int()

2019-12-08 Thread Michael Ellerman
On Wed, 2019-12-04 at 11:50:15 UTC, Ard Biesheuvel wrote: > Commit 01c9348c7620ec65 > > powerpc: Use hardware RNG for arch_get_random_seed_* not arch_get_random_* > > updated arch_get_random_[int|long]() to be NOPs, and moved the hardware > RNG backing to arch_get_random_seed_[int|long]()

Re: [PATCH] powerpc/pmem: Convert to EXPORT_SYMBOL_GPL

2019-12-08 Thread Michael Ellerman
On Mon, 2019-12-02 at 06:40:18 UTC, "Aneesh Kumar K.V" wrote: > All other architecture export this as GPL symbol > > Signed-off-by: Aneesh Kumar K.V Applied to powerpc fixes, thanks. https://git.kernel.org/powerpc/c/551003fff7235ce935bc1fefb72d12b63a408bd0 cheers

Re: [PATCH] powerpc: ensure that swiotlb buffer is allocated from low memory

2019-12-08 Thread Mike Rapoport
On Mon, Dec 09, 2019 at 04:43:17PM +1100, Michael Ellerman wrote: > Mike Rapoport writes: > > From: Mike Rapoport > > > > Some powerpc platforms (e.g. 85xx) limit DMA-able memory way below 4G. If a > > system has more physical memory than this limit, the swiotlb buffer is not > > addressable

[PATCH V2 13/13] powerpc/vas: Free send window in VAS instance after credits returned

2019-12-08 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

[PATCH V2 03/13] powerpc/vas: Read interrupts and vas-port device tree properties

2019-12-08 Thread Haren Myneni
Read interrupts and vas-port device tree properties per each VAS instance. NX generates an interrupt when it sees page fault on the request buffer. Interrupts property is used to setup IRQ for handing the fault and set port value for each user space send window. Signed-off-by: Haren Myneni ---

[PATCH V2 09/13] powerpc/vas: Print CRB and FIFO values

2019-12-08 Thread Haren Myneni
Dump FIFO entry 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 | 41 ++ 1 file changed, 41 insertions(+) diff --git

[PATCH 1/2] powerpc/irq: don't use current_stack_pointer() in check_stack_overflow()

2019-12-08 Thread Christophe Leroy
current_stack_pointer() doesn't return the stack pointer, but the caller's stack frame. See commit bfe9a2cfe91a ("powerpc: Reimplement __get_SP() as a function not a define") and commit acf620ecf56c ("powerpc: Rename __get_SP() to current_stack_pointer()") for details. The purpose of

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

2019-12-08 Thread Haren Myneni
Applications will 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

[PATCH] powerpc/irq: fix stack overflow verification

2019-12-08 Thread Christophe Leroy
Before commit 0366a1c70b89 ("powerpc/irq: Run softirqs off the top of the irq stack"), check_stack_overflow() was called by do_IRQ(), before switching to the irq stack. In that commit, do_IRQ() was renamed __do_irq(), and is now executing on the irq stack, so check_stack_overflow() has just become

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

2019-12-08 Thread Haren Myneni
For each fault CRB, update fault address in CRB (fault_storage_addr) and translation error status in CSB so that user space can touch the fault address and resend the request. If the user space passed invalid CSB address send signal to process with SIGSEGV. Signed-off-by: Sukadev Bhattiprolu

[PATCH v5 6/6] powerpc/fadump: sysfs for fadump memory reservation

2019-12-08 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 | 5

Re: [PATCH v3] platforms/powernv: Avoid re-registration of imc debugfs directory

2019-12-08 Thread Michael Ellerman
On Wed, 2019-11-27 at 07:20:35 UTC, Anju T Sudhakar wrote: > export_imc_mode_and_cmd() function which creates the debugfs interface for > imc-mode and imc-command, is invoked when each nest pmu units is > registered. > When the first nest pmu unit is registered, export_imc_mode_and_cmd() > creates

Re: [PATCH v2] powerpc/perf: Disable trace_imc pmu

2019-12-08 Thread Michael Ellerman
On Mon, 2019-11-18 at 03:44:52 UTC, Madhavan Srinivasan wrote: > When a root user or a user with CAP_SYS_ADMIN > privilege use trace_imc performance monitoring > unit events, to monitor application or KVM threads, > may result in a checkstop (System crash). Reason > being frequent switch of the

[PATCH V2 07/13] powerpc/vas: Take reference to PID and mm for user space windows

2019-12-08 Thread Haren Myneni
Process close windows after its requests are completed. In multi-thread applications, child can open a window but release FD will not be called upon its exit. 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

[PATCH v5 3/6] powerpc/fadump: reorganize /sys/kernel/fadump_* sysfs files

2019-12-08 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 backward compatibility a symlink has been added for every sysfs

[PATCH v5 2/6] sysfs: wrap __compat_only_sysfs_link_entry_to_kobj function to change the symlink name

2019-12-08 Thread Sourabh Jain
The __compat_only_sysfs_link_entry_to_kobj function creates a symlink to a kobject but doesn't provide an option to change the symlink file name. This patch adds a wrapper function compat_only_sysfs_link_entry_to_kobj that extends the __compat_only_sysfs_link_entry_to_kobj functionality which

[PATCH v5 5/6] Documentation/ABI: mark /sys/kernel/fadump_* sysfs files deprecated

2019-12-08 Thread Sourabh Jain
Add a deprecation note in FADump sysfs ABI documentation files and move them from ABI/testing to ABI/obsolete directory. Signed-off-by: Sourabh Jain --- .../ABI/{testing => obsolete}/sysfs-kernel-fadump_enabled | 2 ++ .../{testing => obsolete}/sysfs-kernel-fadump_registered | 2 ++

[PATCH v5 4/6] powerpc/powernv: move core and fadump_release_opalcore under new kobject

2019-12-08 Thread Sourabh Jain
The /sys/firmware/opal/core and /sys/kernel/fadump_release_opalcore sysfs files are used to export and release the OPAL memory on PowerNV platform. let's organize them into a new kobject under /sys/firmware/opal/mpipl/ directory. A symlink is added to maintain the backward compatibility for

Re: [PATCH] powerpc: ensure that swiotlb buffer is allocated from low memory

2019-12-08 Thread Michael Ellerman
Mike Rapoport writes: > From: Mike Rapoport > > Some powerpc platforms (e.g. 85xx) limit DMA-able memory way below 4G. If a > system has more physical memory than this limit, the swiotlb buffer is not > addressable because it is allocated from memblock using top-down mode. > > Force memblock to

[PATCH V2 05/13] powerpc/vas: Setup thread IRQ handler per VAS instance

2019-12-08 Thread Haren Myneni
Setup thread IRQ handler per each VAS instance. When NX sees a fault on CRB, kernel gets an interrupt and vas_fault_handler will be executed to process fault CRBs. Read all valid CRBs from fault FIFO, determine the corresponding send window from CRB and process fault requests. Signed-off-by:

[PATCH V2 06/13] powerpc/vas: Register NX with fault window ID and IRQ port value

2019-12-08 Thread Haren Myneni
For each user space send window, register NX with fault window ID and port value so that NX paste CRBs in this fault FIFO when it sees fault on the request buffer. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Haren Myneni --- arch/powerpc/platforms/powernv/vas-window.c | 15

[PATCH 2/2] powerpc/irq: use IS_ENABLED() in check_stack_overflow()

2019-12-08 Thread Christophe Leroy
Instead of #ifdef, use IS_ENABLED(CONFIG_DEBUG_STACKOVERFLOW). This enable GCC to check for code validity even when the option is not selected. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/irq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git

Re: [bug] userspace hitting sporadic SIGBUS on xfs (Power9, ppc64le), v4.19 and later

2019-12-08 Thread Eric Sandeen
On 12/6/19 6:09 PM, dftxbs3e wrote: > Hello! > > I am very happy that someone has found this issue. > > I have been suffering from rather random SIGBUS errors in similar > conditions described by the author. > > I don't have much troubleshooting information to provide, however, I hit > the

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

2019-12-08 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:

[PATCH V2 01/13] powerpc/vas: Describe vas-port and interrupts properties

2019-12-08 Thread Haren Myneni
Signed-off-by: Haren Myneni --- Documentation/devicetree/bindings/powerpc/ibm,vas.txt | 5 + 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/powerpc/ibm,vas.txt b/Documentation/devicetree/bindings/powerpc/ibm,vas.txt index bf11d2f..12de08b 100644 ---

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

2019-12-08 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

[PATCH v5 0/6] reorganize and add FADump sysfs files

2019-12-08 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. Patch series reorganizes the

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

2019-12-08 Thread Christophe Leroy
Hi, What do you mean by NX ? Up to now, NX has been standing for No-eXecute. That's a bit in segment registers on book3s/32 to forbid executing code. Therefore, some of your text is really misleading. If NX means something else for you, your text must be unambiguous. Christophe Le

[PATCH] powerpc/irq: don't use current_stack_pointer() in do_IRQ()

2019-12-08 Thread Christophe Leroy
Before commit 7306e83ccf5c ("powerpc: Don't use CURRENT_THREAD_INFO to find the stack"), the current stack base address was obtained by calling current_thread_info(). That inline function was simply masking out the value of r1. In that commit, it was changed to using current_stack_pointer(),

[tip: sched/urgent] sched/rt, powerpc: Use CONFIG_PREEMPTION

2019-12-08 Thread tip-bot2 for Thomas Gleixner
The following commit has been merged into the sched/urgent branch of tip: Commit-ID: fdc5569eaba997852e0bfb57d11af496e4c1fa9a Gitweb: https://git.kernel.org/tip/fdc5569eaba997852e0bfb57d11af496e4c1fa9a Author:Thomas Gleixner AuthorDate:Thu, 24 Oct 2019 18:04:58 +02:00