Re: [PATCH v5 0/3] LLVM/Clang fixes for a few defconfigs

2019-11-27 Thread Nathan Chancellor
On Thu, Nov 28, 2019 at 03:59:07PM +1100, Michael Ellerman wrote: > Nick Desaulniers writes: > > Hi Michael, > > Do you have feedback for Nathan? Rebasing these patches is becoming a > > nuisance for our CI, and we would like to keep building PPC w/ Clang. > > Sorry just lost in the flood of patc

Re: [PATCH v3 4/8] powerpc/vdso32: inline __get_datapage()

2019-11-27 Thread Michael Ellerman
Christophe Leroy writes: > Le 22/11/2019 à 07:38, Michael Ellerman a écrit : >> Michael Ellerman writes: >>> Christophe Leroy writes: __get_datapage() is only a few instructions to retrieve the address of the page where the kernel stores data to the VDSO. By inlining this fun

Re: [PATCH v11 0/7] KVM: PPC: Driver to manage pages of secure guest

2019-11-27 Thread Bharata B Rao
On Mon, Nov 25, 2019 at 08:36:24AM +0530, Bharata B Rao wrote: > Hi, > > This is the next version of the patchset that adds required support > in the KVM hypervisor to run secure guests on PEF-enabled POWER platforms. > Here is a fix for the issue Hugh identified with the usage of ksm_madvise()

Re: [PATCH v5 0/3] LLVM/Clang fixes for a few defconfigs

2019-11-27 Thread Michael Ellerman
Nick Desaulniers writes: > Hi Michael, > Do you have feedback for Nathan? Rebasing these patches is becoming a > nuisance for our CI, and we would like to keep building PPC w/ Clang. Sorry just lost in the flood of patches. Merged now. cheers > On Mon, Nov 18, 2019 at 8:57 PM Nathan Chancellor

Re: [Very RFC 45/46] powernv/pci: Remove requirement for a pdn in config accessors

2019-11-27 Thread Alexey Kardashevskiy
On 20/11/2019 12:28, Oliver O'Halloran wrote: > :toot: > > Signed-off-by: Oliver O'Halloran Squash it into 26/46 "powernv/pci: Remove pdn from pnv_pci_cfg_{read|write}". Thanks, > --- > arch/powerpc/platforms/powernv/pci.c | 10 -- > 1 file changed, 10 deletions(-) > > diff --git

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

2019-11-27 Thread Paul Mackerras
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(&kvm->lock) after possible freeing a variable > with kvm_put_kvm(kvm). Comments below... > diff --git a/arch/powerpc/kvm/book3s_64_vio.c > b/arch/powerpc

Re: [Very RFC 44/46] powerpc/pci: Don't set pdn->pe_number when applying the weird P8 NVLink PE hack

2019-11-27 Thread Alexey Kardashevskiy
On 20/11/2019 12:28, Oliver O'Halloran wrote: > P8 needs to shove four GPUs into three PEs for $reasons. Remove the > pdn->pe_assignment done there since we just use the pe_rmap[] now. Reviewed-by: Alexey Kardashevskiy > > Signed-off-by: Oliver O'Halloran > --- > arch/powerpc/platforms

Re: [Very RFC 43/46] powernv/pci: Do not set pdn->pe_number for NPU/CAPI devices

2019-11-27 Thread Alexey Kardashevskiy
cc: Greg. On 20/11/2019 12:28, Oliver O'Halloran wrote: > The only thing we need the pdn for in this function is setting the pe_number > field, which we don't use anymore. Fix the weird refcounting behaviour while > we're here. > > Signed-off-by: Oliver O'Halloran > --- > Either Fred, or Reza a

[PATCH] powerpc: add link stack flush mitigation status in debugfs.

2019-11-27 Thread Michal Suchanek
The link stack flush status is not visible in debugfs. It can be enabled even when count cache flush is disabled. Add separate file for its status. Signed-off-by: Michal Suchanek --- arch/powerpc/kernel/security.c | 12 1 file changed, 12 insertions(+) diff --git a/arch/powerpc/ker

[PATCH] selftests/powerpc: Use write_pmc instead of count_pmc to reset PMCs at the end of ebb selftests

2019-11-27 Thread Desnes A. Nunes do Rosario
By using count_pmc() to reset the pmc instead of write_pmc(), an extra count is performed on ebb_state.stats.pmc_count[PMC_INDEX(pmc)] more than the value accounted by ebb_state.stats.ebb_count in the main test loops. This extra pmc_count makes a few tests fail occasionally on PowerVM systems with

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

2019-11-27 Thread Paolo Bonzini
On 26/11/19 18:52, Leonardo Bras wrote: > Fixes a possible 'use after free' of kvm variable. > It does use mutex_unlock(&kvm->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

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

2019-11-27 Thread Haren Myneni
"Linuxppc-dev" wrote on 11/27/2019 12:46:09 AM: > > > > +static void notify_process(pid_t pid, u64 fault_addr) > > +{ > > + int rc; > > + struct kernel_siginfo info; > > + > > + memset(&info, 0, sizeof(info)); > > + > > + info.si_signo = SIGSEGV; > > + info.si_errno = EFAULT; > > +

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

2019-11-27 Thread Haren Myneni
"Linuxppc-dev" wrote on 11/27/2019 12:30:55 AM: > > > +#define crb_csb_addr(c) __be64_to_cpu(c->csb_addr) > > +#define crb_nx_fault_addr(c) __be64_to_cpu > (c->stamp.nx.fault_storage_addr) > > +#define crb_nx_flags(c) c->stamp.nx.flags > > +#define crb_nx_fault_status(c) c->stamp.

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

2019-11-27 Thread Haren Myneni
"Linuxppc-dev" wrote on 11/27/2019 12:28:10 AM: > > On Tue, Nov 26, 2019 at 05:03:27PM -0800, Haren Myneni wrote: > > > > This reverts commit 452d23c0f6bd97f2fd8a9691fee79b76040a0feb. > > > > User space send windows (NX GZIP compression) need vas_win_paste_addr() > > to mmap window paste address

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

2019-11-27 Thread Leonardo Bras
On Wed, 2019-11-27 at 17:40 +0100, Paolo Bonzini wrote: > > > >if (ret >= 0) > >list_add_rcu(&stt->list, &kvm->arch.spapr_tce_tables); > > - else > > - kvm_put_kvm(kvm); > > > >mutex_unlock(&kvm->lock); > > > >if (ret >= 0) > >

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

2019-11-27 Thread Leonardo Bras
Result of Travis-CI testing the change: https://travis-ci.org/LeoBras/linux-ppc/builds/617712012 signature.asc Description: This is a digitally signed message part

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

2019-11-27 Thread Christian Zigotzky
On 27 November 2019 at 07:56 am, Mike Rapoport wrote: Maybe we'll simply force bottom up allocation before calling swiotlb_init()? Anyway, it's the last memblock allocation. diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 62f74b1b33bd..771e6cf7e2b9 100644 --- a/arch/powerpc/mm

Re: [PATCH v4 2/2] powerpc/irq: inline call_do_irq() and call_do_softirq()

2019-11-27 Thread Christophe Leroy
Le 27/11/2019 à 15:59, Segher Boessenkool a écrit : On Wed, Nov 27, 2019 at 02:50:30PM +0100, Christophe Leroy wrote: So what do we do ? We just drop the "r2" clobber ? You have to make sure your asm code works for all ABIs. This is quite involved if you do a call to an external function.

Re: [PATCH v4 2/2] powerpc/irq: inline call_do_irq() and call_do_softirq()

2019-11-27 Thread Segher Boessenkool
On Wed, Nov 27, 2019 at 02:50:30PM +0100, Christophe Leroy wrote: > So what do we do ? We just drop the "r2" clobber ? You have to make sure your asm code works for all ABIs. This is quite involved if you do a call to an external function. The compiler does *not* see this call, so you will have

Re: [PATCH v3 4/8] powerpc/vdso32: inline __get_datapage()

2019-11-27 Thread Christophe Leroy
Hi Michael, Le 22/11/2019 à 07:38, Michael Ellerman a écrit : Michael Ellerman writes: Christophe Leroy writes: __get_datapage() is only a few instructions to retrieve the address of the page where the kernel stores data to the VDSO. By inlining this function into its users, a bl/blr pair a

Re: [PATCH v1 1/4] powerpc/fixmap: don't clear fixmap area in paging_init()

2019-11-27 Thread Christophe Leroy
Le 26/11/2019 à 02:13, Michael Ellerman a écrit : On Thu, 2019-09-12 at 13:49:41 UTC, Christophe Leroy wrote: fixmap is intended to map things permanently like the IMMR region on FSL SOC (8xx, 83xx, ...), so don't clear it when initialising paging() Signed-off-by: Christophe Leroy Applied

Re: [PATCH v4 2/2] powerpc/irq: inline call_do_irq() and call_do_softirq()

2019-11-27 Thread Christophe Leroy
Le 25/11/2019 à 15:25, Segher Boessenkool a écrit : On Mon, Nov 25, 2019 at 09:32:23PM +1100, Michael Ellerman wrote: Segher Boessenkool writes: +static inline void call_do_irq(struct pt_regs *regs, void *sp) +{ + register unsigned long r3 asm("r3") = (unsigned long)regs; + + /*

[GIT PULL] y2038: syscall implementation cleanups

2019-11-27 Thread Arnd Bergmann
The following changes since commit a99d8080aaf358d5d23581244e5da23b35e340b9: Linux 5.4-rc6 (2019-11-03 14:07:26 -0800) are available in the Git repository at: git://git.kernel.org:/pub/scm/linux/kernel/git/arnd/playground.git tags/y2038-cleanups-5.5 for you to fetch changes up to b111df8447

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

2019-11-27 Thread Greg Kurz
On Wed, 27 Nov 2019 10:47:45 +0100 Frederic Barrat wrote: > > > Le 27/11/2019 à 10:33, Greg Kurz a écrit : > > On Wed, 27 Nov 2019 10:10:13 +0100 > > Frederic Barrat wrote: > > > >> > >> > >> Le 27/11/2019 à 09:24, Greg Kurz a écrit : > >>> On Wed, 27 Nov 2019 18:09:40 +1100 > >>> Alexey Kard

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

2019-11-27 Thread Greg Kurz
On Wed, 27 Nov 2019 10:10:13 +0100 Frederic Barrat wrote: > > > Le 27/11/2019 à 09:24, Greg Kurz a écrit : > > On Wed, 27 Nov 2019 18:09:40 +1100 > > Alexey Kardashevskiy wrote: > > > >> > >> > >> On 20/11/2019 12:28, Oliver O'Halloran wrote: > >>> The comment here implies that we don't need

[PATCH 1/3] powerpc/pseries: Account for SPURR ticks on idle CPUs

2019-11-27 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" On PSeries LPARs, to compute the utilization, tools such as lparstat need to know the [S]PURR ticks when the CPUs were busy or idle. In the pseries cpuidle driver, we keep track of the idle PURR ticks in the VPA variable "wait_state_cycles". This patch extends the suppo

[PATCH 0/3] pseries: Track and expose idle PURR and SPURR ticks

2019-11-27 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" On PSeries LPARs, the data centers planners desire a more accurate view of system utilization per resource such as CPU to plan the system capacity requirements better. Such accuracy can be obtained by reading PURR/SPURR registers for CPU resource utilization. Tools such

[PATCH 2/3] powerpc/sysfs: Show idle_purr and idle_spurr for every CPU

2019-11-27 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" On Pseries LPARs, to calculate utilization, we need to know the [S]PURR ticks when the CPUs were busy or idle. The total PURR and SPURR ticks are already exposed via the per-cpu sysfs files /sys/devices/system/cpu/cpuX/purr and /sys/devices/system/cpu/cpuX/spurr. This

[PATCH 3/3] Documentation: Document sysfs interfaces purr, spurr, idle_purr, idle_spurr

2019-11-27 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Add documentation for the following sysfs interfaces: /sys/devices/system/cpu/cpuX/purr /sys/devices/system/cpu/cpuX/spurr /sys/devices/system/cpu/cpuX/idle_purr /sys/devices/system/cpu/cpuX/idle_spurr Signed-off-by: Gautham R. Shenoy --- Documentation/ABI/testing/sys

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

2019-11-27 Thread Greg Kurz
On Wed, 27 Nov 2019 20:40:00 +1100 "Oliver O'Halloran" wrote: > On Wed, Nov 27, 2019 at 8:34 PM Greg Kurz wrote: > > > > > > If everyone is ok with leaking a reference in the NPU case, I guess > > this isn't a problem. But if we move forward with Oliver's patch, a > > pci_dev_put() would be need

Re: [Y2038] [PATCH 07/23] y2038: vdso: powerpc: avoid timespec references

2019-11-27 Thread Arnd Bergmann
On Thu, Nov 21, 2019 at 5:25 PM Christophe Leroy wrote: > Arnd Bergmann a écrit : > > On Wed, Nov 20, 2019 at 11:43 PM Ben Hutchings > > wrote: > >> > >> On Fri, 2019-11-08 at 22:07 +0100, Arnd Bergmann wrote: > >> > @@ -192,7 +190,7 @@ V_FUNCTION_BEGIN(__kernel_time) > >> > bl __get_

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

2019-11-27 Thread Michal Suchanek
Signed-off-by: Michal Suchanek --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 9d3a5c54a41d..4d2a43542c83 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12774,6 +12774,8 @@ F: arch/*/kernel/*/perf_event*.c F: arch/*/kernel/*/*/perf_e

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

2019-11-27 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 --- arch/powerpc/perf/Makefile | 5 +- arch/powerpc/perf/callchain.c| 362 +

[PATCH v2 rebase 31/34] powerpc/64: make buildable without CONFIG_COMPAT

2019-11-27 Thread Michal Suchanek
There are numerous references to 32bit functions in generic and 64bit code so ifdef them out. Signed-off-by: Michal Suchanek --- arch/powerpc/include/asm/thread_info.h | 4 ++-- arch/powerpc/kernel/Makefile | 6 +++--- arch/powerpc/kernel/entry_64.S | 2 ++ arch/powerpc/kernel/

[PATCH v2 rebase 32/34] powerpc/64: Make COMPAT user-selectable disabled on littleendian by default.

2019-11-27 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 --- arch/powerpc/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kcon

[PATCH v2 rebase 30/34] powerpc/perf: consolidate valid_user_sp

2019-11-27 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 va

[PATCH v2 rebase 29/34] powerpc/perf: consolidate read_user_stack_32

2019-11-27 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 --- arch/powerpc/perf/callchain.c | 59 +++--

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

2019-11-27 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(+), 140

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

2019-11-27 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 uncon

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

2019-11-27 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 stat

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

2019-11-27 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 t

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

2019-11-27 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 rebase 23/34] powerpc/64: system call implement the bulk of the logic in C

2019-11-27 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% faste

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

2019-11-27 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 does

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

2019-11-27 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 rebase 20/34] powerpc/64s/exception: only test KVM in SRR interrupts when PR KVM is supported

2019-11-27 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 rebase 19/34] powerpc/64s/exception: add more comments for interrupt handlers

2019-11-27 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 --git

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

2019-11-27 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 rebase 17/34] powerpc/64s/exception: re-inline some handlers

2019-11-27 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 b/arch/powe

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

2019-11-27 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 enti

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

2019-11-27 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 --- a

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

2019-11-27 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, there

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

2019-11-27 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 a/arch/powerpc/kernel/

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

2019-11-27 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 tha

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

2019-11-27 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 stre

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

2019-11-27 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 rebase 09/34] powerpc/64s/exception: Add ISIDE option

2019-11-27 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 a/arch/powerpc/kernel/excepti

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

2019-11-27 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 f318869607db..bef0c

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

2019-11-27 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 17e4aaf6ed42..f3188

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

2019-11-27 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 f70c9fb2566a..17e4a

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

2019-11-27 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 --- arch/p

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

2019-11-27 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 --- arch/powerpc/ker

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

2019-11-27 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 595e215515

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

2019-11-27 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 ind

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

2019-11-27 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 p

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

2019-11-27 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 in

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

2019-11-27 Thread Oliver O'Halloran
On Wed, Nov 27, 2019 at 4:24 PM Alexey Kardashevskiy wrote: > > > > 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/po

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

2019-11-27 Thread Michal Suchánek
On Wed, Nov 27, 2019 at 06:41:09AM +0100, Christophe Leroy wrote: > > > 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. > >

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

2019-11-27 Thread Frederic Barrat
Le 27/11/2019 à 10:33, Greg Kurz a écrit : On Wed, 27 Nov 2019 10:10:13 +0100 Frederic Barrat wrote: Le 27/11/2019 à 09:24, Greg Kurz a écrit : On Wed, 27 Nov 2019 18:09:40 +1100 Alexey Kardashevskiy wrote: On 20/11/2019 12:28, Oliver O'Halloran wrote: The comment here implies that

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

2019-11-27 Thread Oliver O'Halloran
On Wed, Nov 27, 2019 at 8:34 PM Greg Kurz wrote: > > > If everyone is ok with leaking a reference in the NPU case, I guess > this isn't a problem. But if we move forward with Oliver's patch, a > pci_dev_put() would be needed for OpenCAPI, correct ? Yes, but I think that's fair enough. By conventi

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

2019-11-27 Thread Christoph Hellwig
On Wed, Nov 27, 2019 at 01:20:36AM -0800, Haren Myneni wrote: > Thanks for the review. > vas_win_paste_addr() will be used in NX compression driver and planning to > post this series soon. Can I add this change later as part of this series? Please only add core functionality and exports with the a

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

2019-11-27 Thread Frederic Barrat
Le 27/11/2019 à 09:24, Greg Kurz a écrit : On Wed, 27 Nov 2019 18:09:40 +1100 Alexey Kardashevskiy wrote: 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

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

2019-11-27 Thread Greg Kurz
On Wed, 27 Nov 2019 18:09:40 +1100 Alexey Kardashevskiy wrote: > > > 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 p

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

2019-11-27 Thread Christoph Hellwig
On Wed, Nov 27, 2019 at 08:56:25AM +0200, Mike Rapoport wrote: > Maybe we'll simply force bottom up allocation before calling > swiotlb_init()? Anyway, it's the last memblock allocation. That should work, but I don't think it is the proper fix. The underlying issue here is that ZONE_DMA/DMA32 siz

Re: [PATCH] powerpc/32: drop unused ISA_DMA_THRESHOLD

2019-11-27 Thread Christoph Hellwig
On Mon, Nov 25, 2019 at 11:20:33AM +0200, Mike Rapoport wrote: > From: Mike Rapoport > > The ISA_DMA_THRESHOLD variable is set by several platforms but never > referenced. > Remove it. Looks good: Reviewed-by: Christoph Hellwig

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

2019-11-27 Thread Christoph Hellwig
> > +static void notify_process(pid_t pid, u64 fault_addr) > +{ > + int rc; > + struct kernel_siginfo info; > + > + memset(&info, 0, sizeof(info)); > + > + info.si_signo = SIGSEGV; > + info.si_errno = EFAULT; > + info.si_code = SEGV_MAPERR; > + > + info.si_addr = (void

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

2019-11-27 Thread Christoph Hellwig
> > +struct task_struct *fault_handler; > + > +void vas_wakeup_fault_handler(int virq, void *arg) > +{ > + struct vas_instance *vinst = arg; > + > + atomic_inc(&vinst->pending_fault); > + wake_up(&vinst->fault_wq); > +} > + > +/* > + * Fault handler thread for each VAS instance and pr

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

2019-11-27 Thread Christoph Hellwig
> +/* > + * We do not remove VAS instances. The following functions are needed > + * when VAS hotplug is supported. > + */ > +#if 0 Please don't add dead code to the kernel tree.

Re: [PATCH 04/14] powerpc/vas: Setup IRQ mapping and register port for each window

2019-11-27 Thread Christoph Hellwig
> +static irqreturn_t vas_irq_handler(int virq, void *data) > +{ > + struct vas_instance *vinst = data; > + > + pr_devel("VAS %d: virq %d\n", vinst->vas_id, virq); > + > + return IRQ_HANDLED; > +} An empty interrupt handler is rather pointless. It later grows code, but adding it witho

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

2019-11-27 Thread Christoph Hellwig
> +#define crb_csb_addr(c) __be64_to_cpu(c->csb_addr) > +#define crb_nx_fault_addr(c) __be64_to_cpu(c->stamp.nx.fault_storage_addr) > +#define crb_nx_flags(c) c->stamp.nx.flags > +#define crb_nx_fault_status(c) c->stamp.nx.fault_status Except for crb_nx_fault_addr a

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

2019-11-27 Thread Christoph Hellwig
On Tue, Nov 26, 2019 at 05:03:27PM -0800, Haren Myneni wrote: > > 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 giv