Re: [PATCH v2 26/35] powerpc/64: system call: Fix sparse warning about missing declaration

2019-11-26 Thread Christophe Leroy
Le 26/11/2019 à 22:44, Luc Van Oostenryck a écrit : On Tue, Nov 26, 2019 at 09:13:40PM +0100, Michal Suchanek wrote: Sparse warns about missing declarations for these functions: +arch/powerpc/kernel/syscall_64.c:108:23: warning: symbol 'syscall_exit_prepare' was not declared. Should it be

Re: [Very RFC 42/46] powernv/pci: Don't clear pdn->pe_number in pnv_pci_release_device

2019-11-26 Thread Alexey Kardashevskiy
On 20/11/2019 12:28, Oliver O'Halloran wrote: > Nothing looks at it anymore. With a small extra step we can ditch it (compile tested): https://github.com/aik/linux/commit/14db7061d48220354e83f8e100ab0cc1b7181da4 > > Signed-off-by: Oliver O'Halloran > --- >

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

2019-11-26 Thread Anju T Sudhakar
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 'imc' directory under `/debug/powerpc/`. In the subsequent

Re: [Very RFC 41/46] powernv/eeh: Remove pdn setup for SR-IOV VFs

2019-11-26 Thread Alexey Kardashevskiy
On 20/11/2019 12:28, Oliver O'Halloran wrote: > We don't need a pci_dn for the VF any more, so we can skip adding them. Excellent! Reviewed-by: Alexey Kardashevskiy > > Signed-off-by: Oliver O'Halloran > --- > arch/powerpc/platforms/powernv/pci-ioda.c | 16 > 1 file

Re: [Very RFC 40/46] powernv/npu: Don't drop refcount when looking up GPU pci_devs

2019-11-26 Thread Alexey Kardashevskiy
On 20/11/2019 12:28, Oliver O'Halloran wrote: > The comment here implies that we don't need to take a ref to the pci_dev > because the ioda_pe will always have one. This implies that the current > expection is that the pci_dev for an NPU device will *never* be torn > down since the ioda_pe

Re: [Very RFC 39/46] powernv/npu: Avoid pci_dn when mapping device_node to a pci_dev

2019-11-26 Thread Alexey Kardashevskiy
On 20/11/2019 12:28, Oliver O'Halloran wrote: > There's no need to use the pci_dn to find a device_node from a pci_dev. > Just search for the node pointed to by the pci_dev's of_node pointer. Reviewed-by: Alexey Kardashevskiy > > Signed-off-by: Oliver O'Halloran > --- >

Re: Bug 205201 - Booting halts if Dawicontrol DC-2976 UW SCSI board installed, unless RAM size limited to 3500M

2019-11-26 Thread Mike Rapoport
On Tue, Nov 26, 2019 at 05:40:26PM +0100, Christoph Hellwig wrote: > On Tue, Nov 26, 2019 at 12:26:38PM +0100, Christian Zigotzky wrote: > > Hello Christoph, > > > > The PCI TV card works with your patch! I was able to patch your Git kernel > > with the patch above. > > > > I haven't found any

Re: [PATCH v11 1/7] mm: ksm: Export ksm_madvise()

2019-11-26 Thread Bharata B Rao
On Tue, Nov 26, 2019 at 07:59:49PM -0800, Hugh Dickins wrote: > On Mon, 25 Nov 2019, Bharata B Rao wrote: > > > On PEF-enabled POWER platforms that support running of secure guests, > > secure pages of the guest are represented by device private pages > > in the host. Such pages needn't

Re: [Very RFC 38/46] powerpc/pci-hotplug: Scan the whole bus when using PCI_PROBE_NORMAL

2019-11-26 Thread Alexey Kardashevskiy
On 20/11/2019 12:28, Oliver O'Halloran wrote: > Currently when using the normal (i.e not building pci_dev's from the DT > node) probe method we only scan the devfn corresponding to the first child > of the bridge's DT node. This doesn't make much sense to me, but it seems > to have worked so

Re: [Very RFC 36/46] powernv/npu: Remove open-coded PE lookup for GPU device

2019-11-26 Thread Alexey Kardashevskiy
On 20/11/2019 12:28, Oliver O'Halloran wrote: > Signed-off-by: Oliver O'Halloran > --- > arch/powerpc/platforms/powernv/npu-dma.c | 13 ++--- > 1 file changed, 2 insertions(+), 11 deletions(-) > > diff --git a/arch/powerpc/platforms/powernv/npu-dma.c >

Re: [PATCH v2 29/35] powerpc/perf: remove current_is_64bit()

2019-11-26 Thread Christophe Leroy
Le 26/11/2019 à 21:13, Michal Suchanek a écrit : Since commit ed1cd6deb013 ("powerpc: Activate CONFIG_THREAD_INFO_IN_TASK") current_is_64bit() is quivalent to !is_32bit_task(). Remove the redundant function. Link: https://github.com/linuxppc/issues/issues/275 Link:

Re: [Very RFC 35/46] powernv/pci: Remove open-coded PE lookup in pnv_pci_release_device

2019-11-26 Thread Alexey Kardashevskiy
On 20/11/2019 12:28, Oliver O'Halloran wrote: > Signed-off-by: Oliver O'Halloran > --- > arch/powerpc/platforms/powernv/pci-ioda.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c >

Re: [Very RFC 34/46] powernv/pci: Remove open-coded PE lookup in pnv_pci_enable_device_hook()

2019-11-26 Thread Alexey Kardashevskiy
On 20/11/2019 12:28, Oliver O'Halloran wrote: > Signed-off-by: Oliver O'Halloran Reviewed-by: Alexey Kardashevskiy but better squash it. > --- > arch/powerpc/platforms/powernv/pci-ioda.c | 7 +-- > 1 file changed, 1 insertion(+), 6 deletions(-) > > diff --git

Re: [Very RFC 33/46] powernv/pci: Remove open-coded PE lookup in iommu notifier

2019-11-26 Thread Alexey Kardashevskiy
On 20/11/2019 12:28, Oliver O'Halloran wrote: > Signed-off-by: Oliver O'Halloran > --- > arch/powerpc/platforms/powernv/pci.c | 9 - > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/arch/powerpc/platforms/powernv/pci.c > b/arch/powerpc/platforms/powernv/pci.c >

Re: [Very RFC 32/46] powernv/pci: Remove open-coded PE lookup in iommu_bypass_supported()

2019-11-26 Thread Alexey Kardashevskiy
On 20/11/2019 12:28, Oliver O'Halloran wrote: > Signed-off-by: Oliver O'Halloran Reviewed-by: Alexey Kardashevskiy but honestly can be squashed into 31/46 or/and 33/46 or other similar patches. > --- > arch/powerpc/platforms/powernv/pci-ioda.c | 6 ++ > 1 file changed, 2

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

2019-11-26 Thread Sourabh Jain
On 11/25/19 12:10 AM, Michal Suchánek wrote: > On Sat, Nov 16, 2019 at 08:07:29PM +0530, Sourabh Jain wrote: >> >> >> On 11/9/19 6:29 PM, Michal Suchánek wrote: >>> On Sat, Nov 09, 2019 at 05:53:37PM +0530, Sourabh Jain wrote: As the number of FADump sysfs files increases it is hard to

Re: [Very RFC 31/46] powernv/pci: Remove open-coded PE lookup in pnv_pci_ioda_dma_dev_setup()

2019-11-26 Thread Alexey Kardashevskiy
On 20/11/2019 12:28, Oliver O'Halloran wrote: > Use the helper to look up the pnv_ioda_pe for the device we're configuring DMA > for. In the VF case there's no need set pdn->pe_number since nothing looks at > it any more. > > Signed-off-by: Oliver O'Halloran Reviewed-by: Alexey

Re: [Very RFC 30/46] powernv/pci: Remove open-coded PE lookup in PELT-V teardown

2019-11-26 Thread Alexey Kardashevskiy
On 20/11/2019 12:28, Oliver O'Halloran wrote: > Signed-off-by: Oliver O'Halloran > --- > arch/powerpc/platforms/powernv/pci-ioda.c | 12 +++- > 1 file changed, 7 insertions(+), 5 deletions(-) > > diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c >

Re: [Very RFC 29/46] powernv/pci: Remove open-coded PE lookup in PELT-V setup

2019-11-26 Thread Alexey Kardashevskiy
On 20/11/2019 12:28, Oliver O'Halloran wrote: > Signed-off-by: Oliver O'Halloran > --- > arch/powerpc/platforms/powernv/pci-ioda.c | 32 +-- > 1 file changed, 24 insertions(+), 8 deletions(-) > > diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c >

Re: [Very RFC 28/46] powernv/iov: Move SR-IOV PF state out of pci_dn

2019-11-26 Thread Alexey Kardashevskiy
On 20/11/2019 12:28, Oliver O'Halloran wrote: > Move the SR-IOV into a platform specific structure. I'm sure stashing all the > SR-IOV state in pci_dn seemed like a good idea at the time, but it results in > a > lot of powernv specifics being leaked out of the platform directory. > > Moving

Re: [PATCH v11 1/7] mm: ksm: Export ksm_madvise()

2019-11-26 Thread Hugh Dickins
On Mon, 25 Nov 2019, Bharata B Rao wrote: > On PEF-enabled POWER platforms that support running of secure guests, > secure pages of the guest are represented by device private pages > in the host. Such pages needn't participate in KSM merging. This is > achieved by using ksm_madvise() call which

Re: [Very RFC 27/46] powernv/pci: Clear reserved PE freezes

2019-11-26 Thread Alexey Kardashevskiy
On 20/11/2019 12:28, Oliver O'Halloran wrote: > When we scan an empty slot the PHB gets an Unsupported Request from the > downstream bridge when there's no device present at that BDFN. Some older > PHBs (p7-IOC) don't allow further config space accesses while the PE is > frozen, so clear it

Re: [Very RFC 26/46] powernv/pci: Remove pdn from pnv_pci_cfg_{read|write}

2019-11-26 Thread Alexey Kardashevskiy
On 20/11/2019 12:28, Oliver O'Halloran wrote: > Remove the use of pci_dn from the low-level config space access functions. > These are used by the eeh's config ops and the bus config ops that we > provide to the PCI core. > > Signed-off-by: Oliver O'Halloran > --- >

Re: [Very RFC 22/46] powernv/eeh: Allocate eeh_dev's when needed

2019-11-26 Thread Alexey Kardashevskiy
On 25/11/2019 15:26, Oliver O'Halloran wrote: > On Mon, Nov 25, 2019 at 2:27 PM Alexey Kardashevskiy wrote: >> >> >> >> On 20/11/2019 12:28, Oliver O'Halloran wrote: >>> Have the PowerNV EEH backend allocate the eeh_dev if needed rather than >>> using >>> the one attached to the pci_dn. >> >>

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

2019-11-26 Thread Andrew Donnellan
Hi Haren, On 27/11/19 12:00 pm, Haren Myneni wrote: Haren Myneni (14): powerpc/vas: Describe vas-port and interrupts properties Revert "powerpc/powernv: remove the unused vas_win_paste_addr and vas_win_id functions" powerpc/vas: Define nx_fault_stamp in coprocessor_request_block

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

2019-11-26 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 13/14] powerpc/vas: Display process stuck message

2019-11-26 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 12/14] powerpc/VAS: Return credits after handling fault

2019-11-26 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 | 9 +

[PATCH 11/14] powerpc/vas: Do not use default credits for receive window

2019-11-26 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 10/14] powerpc/vas: Print CRB and FIFO values

2019-11-26 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

[PATCH 09/14] powerpc/vas: Update CSB and notify process for fault CRBs

2019-11-26 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 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 08/14] powerpc/vas: Take reference to PID and mm for user space windows

2019-11-26 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 07/14] powerpc/vas: Read and process fault CRBs

2019-11-26 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.

[PATCH 06/14] powerpc/vas: Setup fault handler per VAS instance

2019-11-26 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 | 54

[PATCH 05/14] powerpc/vas: Setup fault window per VAS instance

2019-11-26 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 04/14] powerpc/vas: Setup IRQ mapping and register port for each window

2019-11-26 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.

[PATCH 03/14] powerpc/vas: Define nx_fault_stamp in coprocessor_request_block

2019-11-26 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:

Re: [Very RFC 25/46] powernv/pci: Remove pdn from pnv_pci_config_check_eeh()

2019-11-26 Thread Alexey Kardashevskiy
On 20/11/2019 12:28, Oliver O'Halloran wrote: > Despite the name this function is generic PowerNV PCI code rather than > anything > EEH specific. Convert to take a phb and bdfn rather than a pci_dn. > > Signed-off-by: Oliver O'Halloran > --- > arch/powerpc/platforms/powernv/pci.c | 32

[PATCH 02/14] Revert "powerpc/powernv: remove the unused vas_win_paste_addr and vas_win_id functions"

2019-11-26 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. Added vas_win_id() and vas_win_paste_addr() with: commit

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

2019-11-26 Thread Haren Myneni
[PATCH 01/14] powerpc/vas: Describe vas-port and interrupts properties 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

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

2019-11-26 Thread Haren Myneni
Applications 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 credits

Re: [Very RFC 24/46] powernv/pci: Make the pre-cfg EEH freeze check use eeh_dev rather than pci_dn

2019-11-26 Thread Alexey Kardashevskiy
On 20/11/2019 12:28, Oliver O'Halloran wrote: > Squash another usage in preperation for making the config accessors pci_dn. > > Signed-off-by: Oliver O'Halloran Reviewed-by: Alexey Kardashevskiy > --- > We might want to move this into eeh-powernv.c > --- >

[PATCH v3 2/2] powerpc/kvm/book3e: Replace current->mm by kvm->mm

2019-11-26 Thread Leonardo Bras
Given that in kvm_create_vm() there is: kvm->mm = current->mm; And that on every kvm_*_ioctl we have: if (kvm->mm != current->mm) return -EIO; I see no reason to keep using current->mm instead of kvm->mm. By doing so, we would reduce the use of 'global' variables on code, relying more

[PATCH v3 1/2] powerpc/kvm/book3s: Replace current->mm by kvm->mm

2019-11-26 Thread Leonardo Bras
Given that in kvm_create_vm() there is: kvm->mm = current->mm; And that on every kvm_*_ioctl we have: if (kvm->mm != current->mm) return -EIO; I see no reason to keep using current->mm instead of kvm->mm. By doing so, we would reduce the use of 'global' variables on code, relying more

[PATCH v3 0/2] Replace current->mm by kvm->mm on powerpc/kvm

2019-11-26 Thread Leonardo Bras
Replace current->mm by kvm->mm on powerpc/kvm By replacing, we would reduce the use of 'global' current on code, relying more in the contents of kvm struct. On code, I found that in kvm_create_vm() there is: kvm->mm = current->mm; And that on every kvm_*_ioctl we have tests like that: if

Re: [PATCH v2] dma-mapping: treat dev->bus_dma_mask as a DMA limit

2019-11-26 Thread Robin Murphy
On 2019-11-26 6:51 pm, Nicolas Saenz Julienne wrote: On Mon, 2019-11-25 at 16:33 +, Robin Murphy wrote: On 25/11/2019 7:44 am, Christoph Hellwig wrote: On Sat, Nov 23, 2019 at 09:51:08AM -0700, Nathan Chancellor wrote: Just as an FYI, this introduces a warning on arm32 allyesconfig for

Re: [PATCH v2 26/35] powerpc/64: system call: Fix sparse warning about missing declaration

2019-11-26 Thread Luc Van Oostenryck
On Tue, Nov 26, 2019 at 09:13:40PM +0100, Michal Suchanek wrote: > Sparse warns about missing declarations for these functions: > > +arch/powerpc/kernel/syscall_64.c:108:23: warning: symbol > 'syscall_exit_prepare' was not declared. Should it be static? > +arch/powerpc/kernel/syscall_64.c:18:6:

Re: [PATCH net v2 0/4] ibmvnic: Harden device commands and queries

2019-11-26 Thread David Miller
From: Thomas Falcon Date: Mon, 25 Nov 2019 17:12:52 -0600 > This patch series fixes some shortcomings with the current > VNIC device command implementation. The first patch fixes > the initialization of driver completion structures used > for device commands. Additionally, all waits for device >

Re: [PATCH v3] libfdt: define INT32_MAX and UINT32_MAX in libfdt_env.h

2019-11-26 Thread Rob Herring
On Wed, Nov 13, 2019 at 04:12:02PM +0900, Masahiro Yamada wrote: > The DTC v1.5.1 added references to (U)INT32_MAX. > > This is no problem for user-space programs since defines > (U)INT32_MAX along with (u)int32_t. > > For the kernel space, libfdt_env.h needs to be adjusted before we > pull in

[PATCH v2 35/35] MAINTAINERS: perf: Add pattern that matches ppc perf to the perf entry.

2019-11-26 Thread Michal Suchanek
Signed-off-by: Michal Suchanek --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 66cc549ac327..853690adb36f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12842,6 +12842,8 @@ F: arch/*/kernel/*/perf_event*.c F:

[PATCH v2 34/35] powerpc/perf: split callchain.c by bitness

2019-11-26 Thread Michal Suchanek
Building callchain.c with !COMPAT proved quite ugly with all the defines. Splitting out the 32bit and 64bit parts looks better. No code change intended. Signed-off-by: Michal Suchanek --- v6: - move current_is_64bit consolidetaion to earlier patch - move defines to the top of callchain_32.c

[PATCH v2 33/35] powerpc/64: Make COMPAT user-selectable disabled on littleendian by default.

2019-11-26 Thread Michal Suchanek
On bigendian ppc64 it is common to have 32bit legacy binaries but much less so on littleendian. Signed-off-by: Michal Suchanek Reviewed-by: Christophe Leroy --- v3: make configurable --- arch/powerpc/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git

[PATCH v2 32/35] powerpc/64: make buildable without CONFIG_COMPAT

2019-11-26 Thread Michal Suchanek
There are numerous references to 32bit functions in generic and 64bit code so ifdef them out. Signed-off-by: Michal Suchanek --- v2: - fix 32bit ifdef condition in signal.c - simplify the compat ifdef condition in vdso.c - 64bit is redundant - simplify the compat ifdef condition in callchain.c -

[PATCH v2 31/35] powerpc/perf: consolidate valid_user_sp

2019-11-26 Thread Michal Suchanek
Merge the 32bit and 64bit version. Halve the check constants on 32bit. Use STACK_TOP since it is defined. Passing is_64 is now redundant since is_32bit_task() is used to determine which callchain variant should be used. Use STACK_TOP and is_32bit_task() directly. This removes a page from the

[PATCH v2 30/35] powerpc/perf: consolidate read_user_stack_32

2019-11-26 Thread Michal Suchanek
There are two almost identical copies for 32bit and 64bit. The function is used only in 32bit code which will be split out in next patch so consolidate to one function. Signed-off-by: Michal Suchanek Reviewed-by: Christophe Leroy --- v6: new patch v8: move the consolidated function out of the

[PATCH v2 29/35] powerpc/perf: remove current_is_64bit()

2019-11-26 Thread Michal Suchanek
Since commit ed1cd6deb013 ("powerpc: Activate CONFIG_THREAD_INFO_IN_TASK") current_is_64bit() is quivalent to !is_32bit_task(). Remove the redundant function. Link: https://github.com/linuxppc/issues/issues/275 Link: https://lkml.org/lkml/2019/9/12/540 Fixes: linuxppc#275 Suggested-by:

[PATCH v2 28/35] powerpc: move common register copy functions from signal_32.c to signal.c

2019-11-26 Thread Michal Suchanek
These functions are required for 64bit as well. Signed-off-by: Michal Suchanek Reviewed-by: Christophe Leroy --- arch/powerpc/kernel/signal.c| 141 arch/powerpc/kernel/signal_32.c | 140 --- 2 files changed, 141 insertions(+),

[PATCH v2 27/35] powerpc: Add back __ARCH_WANT_SYS_LLSEEK macro

2019-11-26 Thread Michal Suchanek
This partially reverts commit caf6f9c8a326 ("asm-generic: Remove unneeded __ARCH_WANT_SYS_LLSEEK macro") When CONFIG_COMPAT is disabled on ppc64 the kernel does not build. There is resistance to both removing the llseek syscall from the 64bit syscall tables and building the llseek interface

[PATCH v2 26/35] powerpc/64: system call: Fix sparse warning about missing declaration

2019-11-26 Thread Michal Suchanek
Sparse warns about missing declarations for these functions: +arch/powerpc/kernel/syscall_64.c:108:23: warning: symbol 'syscall_exit_prepare' was not declared. Should it be static? +arch/powerpc/kernel/syscall_64.c:18:6: warning: symbol 'system_call_exception' was not declared. Should it be

[PATCH v2 25/35] powerpc/64s/exception: remove lite interrupt return

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin The difference between lite and regular returns is that the lite case restores all NVGPRs, whereas lite skips that. This is quite clumsy though, most interrupts want the NVGPRs saved for debugging, not to modify in the caller, so the NVGPRs restore is not necessary most of

[PATCH v2 23/35] powerpc/64: system call implement the bulk of the logic in C

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin System call entry and particularly exit code is beyond the limit of what is reasonable to implement in asm. This conversion moves all conditional branches out of the asm code, except for the case that all GPRs should be restored at exit. Null syscall test is about 5%

[PATCH v2 24/35] powerpc/64s: interrupt return in C

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin Implement the bulk of interrupt return logic in C. The asm return code must handle a few cases: restoring full GPRs, and emulating stack store. The asm return code is moved into 64e for now. The new logic has made allowance for 64e, but I don't have a full environment that

[PATCH v2 22/35] powerpc/64: system call remove non-volatile GPR save optimisation

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin powerpc has an optimisation where interrupts avoid saving the non-volatile (or callee saved) registers to the interrupt stack frame if they are not required. Two problems with this are that an interrupt does not always know whether it will need non-volatiles; and if it

[PATCH v2 21/35] powerpc/64s/exception: soft nmi interrupt should not use ret_from_except

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin The soft nmi handler does not reconcile interrupt state, so it should not return via the normal ret_from_except path. Return like other NMIs, using the EXCEPTION_RESTORE_REGS macro. This becomes important when the scv interrupt is implemented, which must handle soft-masked

[PATCH v2 20/35] powerpc/64s/exception: only test KVM in SRR interrupts when PR KVM is supported

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin Apart from SRESET, MCE, and syscall (hcall variant), the SRR type interrupts are not escalated to hypervisor mode, so delivered to the OS. When running PR KVM, the OS is the hypervisor, and the guest runs with MSR[PR]=1, so these interrupts must test if a guest was running

[PATCH v2 19/35] powerpc/64s/exception: add more comments for interrupt handlers

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin A few of the non-standard handlers are left uncommented. Some more description could be added to some. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 391 --- 1 file changed, 353 insertions(+), 38 deletions(-) diff

[PATCH v2 18/35] powerpc/64s/exception: Clean up SRR specifiers

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin Remove more magic numbers and replace with nicely named bools. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 68 +--- 1 file changed, 32 insertions(+), 36 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S

[PATCH v2 17/35] powerpc/64s/exception: re-inline some handlers

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin The reduction in interrupt entry size allows some handlers to be re-inlined. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S

[PATCH v2 16/35] powerpc/64s/exception: hdecrementer avoid touching the stack

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin The hdec interrupt handler is reported to sometimes fire in Linux if KVM leaves it pending after a guest exists. This is harmless, so there is a no-op handler for it. The interrupt handler currently uses the regular kernel stack. Change this to avoid touching the stack

[PATCH v2 15/35] powerpc/64s/exception: trim unused arguments from KVMTEST macro

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index abf26db36427..9fa71d51ecf4 100644 ---

[PATCH v2 14/35] powerpc/64s/exception: remove the SPR saving patch code macros

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin These are used infrequently enough they don't provide much help, so inline them. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 82 ++-- 1 file changed, 28 insertions(+), 54 deletions(-) diff --git

[PATCH v2 13/35] powerpc/64s/exception: remove confusing IEARLY option

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin Replace IEARLY=1 and IEARLY=2 with IBRANCH_COMMON, which controls if the entry code branches to a common handler; and IREALMODE_COMMON, which controls whether the common handler should remain in real mode. These special cases no longer avoid loading the SRR registers,

[PATCH v2 12/35] powerpc/64s/exception: move KVM test to common code

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin This allows more code to be moved out of unrelocated regions. The system call KVMTEST is changed to be open-coded and remain in the tramp area to avoid having to move it to entry_64.S. The custom nature of the system call entry code means the hcall case can be made more

[PATCH v2 11/35] powerpc/64s/exception: move soft-mask test to common code

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin As well as moving code out of the unrelocated vectors, this allows the masked handlers to be moved to common code, and allows the soft_nmi handler to be generated more like a regular handler. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 106

[PATCH v2 10/35] powerpc/64s/exception: move real->virt switch into the common handler

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin The real mode interrupt entry points currently use rfid to branch to the common handler in virtual mode. This is a significant amount of code, and forces other code (notably the KVM test) to live in the real mode handler. In the interest of minimising the amount of code

[PATCH v2 09/35] powerpc/64s/exception: Add ISIDE option

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin Rather than using DAR=2 to select the i-side registers, add an explicit option. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git

[PATCH v2 08/35] powerpc/64s/exception: Remove old INT_KVM_HANDLER

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 55 +--- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index

[PATCH v2 07/35] powerpc/64s/exception: Remove old INT_COMMON macro

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 51 +--- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index

[PATCH v2 06/35] powerpc/64s/exception: Remove old INT_ENTRY macro

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 68 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index

[PATCH v2 05/35] powerpc/64s/exception: Move all interrupt handlers to new style code gen macros

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin Aside from label names and BUG line numbers, the generated code change is an additional HMI KVM handler added for the "late" KVM handler, because early and late HMI generation is achieved by defining two different interrupt types. Signed-off-by: Nicholas Piggin ---

[PATCH v2 04/35] powerpc/64s/exception: Expand EXC_COMMON and EXC_COMMON_ASYNC macros

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin These don't provide a large amount of code sharing. Removing them makes code easier to shuffle around. For example, some of the common instructions will be moved into the common code gen macro. No generated code change. Signed-off-by: Nicholas Piggin ---

[PATCH v2 03/35] powerpc/64s/exception: Add GEN_KVM macro that uses INT_DEFINE parameters

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin No generated code change. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index

[PATCH v2 02/35] powerpc/64s/exception: Add GEN_COMMON macro that uses INT_DEFINE parameters

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin No generated code change. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 24 +--- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S

[PATCH v2 01/35] powerpc/64s/exception: Introduce INT_DEFINE parameter block for code generation

2019-11-26 Thread Michal Suchanek
From: Nicholas Piggin The code generation macro arguments are difficult to read, and defaults can't easily be used. This introduces a block where parameters can be set for interrupt handler code generation by the subsequent macros, and adds the first generation macro for interrupt entry. One

[PATCH v2 00/35] exception cleanup, syscall in C and !COMPAT

2019-11-26 Thread Michal Suchanek
Hello, This is merge of https://patchwork.ozlabs.org/cover/1162376/ (except two last experimental patches) and https://patchwork.ozlabs.org/patch/1162079/ rebased on top of master. There was minor conflict in Makefile in the latter series. Refreshed the patchset to fix build error on ppc32 and

Re: [PATCH v2] of: unittest: fix memory leak in attach_node_and_children

2019-11-26 Thread Rob Herring
On Tue, 26 Nov 2019 02:48:04 +0100, Erhard Furtner wrote: > In attach_node_and_children memory is allocated for full_name via > kasprintf. If the condition of the 1st if is not met the function > returns early without freeing the memory. Add a kfree() to fix that. > > This has been detected with

Re: [PATCH v2] dma-mapping: treat dev->bus_dma_mask as a DMA limit

2019-11-26 Thread Nicolas Saenz Julienne
On Mon, 2019-11-25 at 16:33 +, Robin Murphy wrote: > On 25/11/2019 7:44 am, Christoph Hellwig wrote: > > On Sat, Nov 23, 2019 at 09:51:08AM -0700, Nathan Chancellor wrote: > > > Just as an FYI, this introduces a warning on arm32 allyesconfig for me: > > > > I think the dma_limit argument to

Re: [PATCH 1/1] powerpc/kvm/book3s: Fixes possible 'use after release' of kvm

2019-11-26 Thread Sean Christopherson
On Tue, Nov 26, 2019 at 02:52:12PM -0300, Leonardo Bras wrote: > Fixes a possible 'use after free' of kvm variable. > It does use mutex_unlock(>lock) after possible freeing a variable > with kvm_put_kvm(kvm). Moving the calls to kvm_put_kvm() to the end of the functions doesn't actually fix a

[PATCH 1/1] powerpc/kvm/book3s: Fixes possible 'use after release' of kvm

2019-11-26 Thread Leonardo Bras
Fixes a possible 'use after free' of kvm variable. It does use mutex_unlock(>lock) after possible freeing a variable with kvm_put_kvm(kvm). Signed-off-by: Leonardo Bras --- arch/powerpc/kvm/book3s_64_vio.c | 3 +-- virt/kvm/kvm_main.c | 8 2 files changed, 5 insertions(+),

[PATCH v2 1/2] powerpc/hw_breakpoints: Rewrite 8xx breakpoints to allow any address range size.

2019-11-26 Thread Christophe Leroy
Unlike standard powerpc, Powerpc 8xx doesn't have SPRN_DABR, but it has a breakpoint support based on a set of comparators which allow more flexibility. Commit 4ad8622dc548 ("powerpc/8xx: Implement hw_breakpoint") implemented breakpoints by emulating the DABR behaviour. It did this by setting one

[PATCH v2 2/2] selftests/powerpc: enable range tests on 8xx in ptrace-hwbreak.c selftest

2019-11-26 Thread Christophe Leroy
8xx is now able to support any range length so range tests can be enabled. Signed-off-by: Christophe Leroy --- v2: new --- tools/testing/selftests/powerpc/ptrace/ptrace-hwbreak.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git

Re: Bug 205201 - Booting halts if Dawicontrol DC-2976 UW SCSI board installed, unless RAM size limited to 3500M

2019-11-26 Thread Christoph Hellwig
On Tue, Nov 26, 2019 at 12:26:38PM +0100, Christian Zigotzky wrote: > Hello Christoph, > > The PCI TV card works with your patch! I was able to patch your Git kernel > with the patch above. > > I haven't found any error messages in the dmesg yet. Thanks. Unfortunately this is a bit of a hack as

[PATCH] powernv/opal-sensor-groups: Add documentation for the sysfs interfaces

2019-11-26 Thread Gautham R. Shenoy
From: Shilpasri G Bhat Commit bf9571550f52 ("powerpc/powernv: Add support to clear sensor groups data") added a mechanism to clear sensor-group data via a sysfs interface. However, the ABI for that interface has not been documented. This patch documents the ABI for the sysfs interface for

[PATCH v2] powerpc/8xx: Fix permanently mapped IMMR region.

2019-11-26 Thread Christophe Leroy
When not using large TLBs, the IMMR region is still mapped as a whole block in the FIXMAP area. Properly report that the IMMR region is block-mapped even when not using large TLBs. Signed-off-by: Christophe Leroy --- v2: rebased on today's powerpc/next (this drops the change to mem.c which is

[PATCH v4 16/16] powerpc/32s: Activate CONFIG_VMAP_STACK

2019-11-26 Thread Christophe Leroy
A few changes to retrieve DAR and DSISR from struct regs instead of retrieving them directly, as they may have changed due to a TLB miss. Also modifies hash_page() and friends to work with virtual data addresses instead of physical ones. Same on load_up_fpu() and load_up_altivec().

[PATCH v4 14/16] powerpc/32s: reorganise DSI handler.

2019-11-26 Thread Christophe Leroy
The part decidated to handling hash_page() is fully unneeded for processors not having real hash pages like the 603. Lets enlarge the content of the feature fixup, and provide an alternative which jumps directly instead of getting NIPs. Also, in preparation of VMAP stacks, the end of DSI handler

[PATCH v4 15/16] powerpc/32s: avoid crossing page boundary while changing SRR0/1.

2019-11-26 Thread Christophe Leroy
Trying VMAP_STACK with KVM, vmlinux was not starting. This was due to SRR0 and SRR1 clobbered by an ISI due to the rfi being in a different page than the mtsrr0/1: c0003fe0 : c0003fe0: 38 83 00 54 addir4,r3,84 c0003fe4: 7c 60 00 a6 mfmsr r3 c0003fe8: 70 60 00 30

[PATCH v4 13/16] powerpc/8xx: Enable CONFIG_VMAP_STACK

2019-11-26 Thread Christophe Leroy
This patch enables CONFIG_VMAP_STACK. For that, a few changes are done in head_8xx.S. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S | 34 -- arch/powerpc/platforms/Kconfig.cputype | 1 + 2 files changed, 29 insertions(+), 6

[PATCH v4 12/16] powerpc/8xx: split breakpoint exception

2019-11-26 Thread Christophe Leroy
Breakpoint exception is big. Split it to support future growth on exception prolog. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/kernel/head_8xx.S

[PATCH v4 06/16] powerpc/32: prepare for CONFIG_VMAP_STACK

2019-11-26 Thread Christophe Leroy
To support CONFIG_VMAP_STACK, the kernel has to activate Data MMU Translation for accessing the stack. Before doing that it must save SRR0, SRR1 and also DAR and DSISR when relevant, in order to not loose them in case there is a Data TLB Miss once the translation is reactivated. This patch adds

  1   2   >