Re: [RFCv2 PATCH 4/4] powerpc: KASAN for 64bit Book3E

2019-03-12 Thread Christophe Leroy
Hi, Build failure with pmac32_defconfig. CC arch/powerpc/kernel/asm-offsets.s In file included from ./arch/powerpc/include/asm/book3s/32/pgtable.h:149:0, from ./arch/powerpc/include/asm/book3s/pgtable.h:8, from ./arch/powerpc/include/asm/pgtable.h:18,

Re: [PATCH v3] powerpc/pseries: Only wait for dying CPU after call to rtas_stop_self()

2019-03-12 Thread Gautham R Shenoy
Hello Thiago, On Mon, Mar 11, 2019 at 04:35:17PM -0300, Thiago Jung Bauermann wrote: > When testing DLPAR CPU add/remove on a system under stress, > pseries_cpu_die() doesn't wait long enough for a CPU to die: > > [ 446.983944] cpu 148 (hwid 148) Ready to die... > [ 446.984062] cpu 149 (hwid 14

Re: [PATCH v2 02/16] KVM: PPC: Book3S HV: add a new KVM device for the XIVE native exploitation mode

2019-03-12 Thread Cédric Le Goater
On 2/25/19 1:08 AM, David Gibson wrote: > On Fri, Feb 22, 2019 at 12:28:26PM +0100, Cédric Le Goater wrote: >> This is the basic framework for the new KVM device supporting the XIVE >> native exploitation mode. The user interface exposes a new KVM device >> to be created by QEMU when running on a L

Re: [PATCH 3/6] x86: clean up _TIF_SYSCALL_EMU handling using ptrace_syscall_enter hook

2019-03-12 Thread Sudeep Holla
On Tue, Mar 12, 2019 at 01:34:44AM +, Haibo Xu (Arm Technology China) wrote: > On 2019/3/12 2:34, Sudeep Holla wrote: > > (I thought I had sent this email, last Tuesday itself, but saw this in my > > draft today, something went wrong, sorry for the delay) > > > > On Tue, Mar 05, 2019 at 02:14:

Re: [PATCH 3/6] x86: clean up _TIF_SYSCALL_EMU handling using ptrace_syscall_enter hook

2019-03-12 Thread Sudeep Holla
On Mon, Mar 11, 2019 at 08:04:39PM -0700, Andy Lutomirski wrote: > On Mon, Mar 11, 2019 at 6:35 PM Haibo Xu (Arm Technology China) > wrote: > > [...] > > For the PTRACE_SYSEMU_SINGLESTEP request, ptrace only need to report(send > > SIGTRAP) at the entry of a system call, no need to report at the

Re: [PATCH v2 03/16] KVM: PPC: Book3S HV: XIVE: introduce a new capability KVM_CAP_PPC_IRQ_XIVE

2019-03-12 Thread Cédric Le Goater
On 2/25/19 1:35 AM, David Gibson wrote: > On Fri, Feb 22, 2019 at 12:28:27PM +0100, Cédric Le Goater wrote: >> The user interface exposes a new capability to let QEMU connect the >> vCPU to the XIVE KVM device if required. The capability is only >> advertised on a PowerNV Hypervisor as support for

Re: [PATCH v2 0/2] Append new variables to vmcoreinfo (PTRS_PER_PGD for arm64 and MAX_PHYSMEM_BITS for all archs)

2019-03-12 Thread Bhupesh Sharma
Hi Dave, On 03/11/2019 02:35 PM, Dave Young wrote: Hi Bhupesh, On 03/10/19 at 03:34pm, Bhupesh Sharma wrote: Changes since v1: - v1 was sent out as a single patch which can be seen here: http://lists.infradead.org/pipermail/kexec/2019-February/022411.html - v2 breaks the si

Re: [PATCH v2 03/16] KVM: PPC: Book3S HV: XIVE: introduce a new capability KVM_CAP_PPC_IRQ_XIVE

2019-03-12 Thread Cédric Le Goater
On 2/25/19 5:59 AM, Paul Mackerras wrote: > On Mon, Feb 25, 2019 at 11:35:27AM +1100, David Gibson wrote: >> On Fri, Feb 22, 2019 at 12:28:27PM +0100, Cédric Le Goater wrote: >>> + xc->xive = xive; >>> + xc->vcpu = vcpu; >>> + xc->server_num = cpu; >>> + xc->vp_id = xive->vp_base + cpu; >>

Re: [PATCH v2 04/16] KVM: PPC: Book3S HV: XIVE: add a control to initialize a source

2019-03-12 Thread Cédric Le Goater
On 2/25/19 3:10 AM, David Gibson wrote: > On Fri, Feb 22, 2019 at 12:28:28PM +0100, Cédric Le Goater wrote: >> The associated HW interrupt source is simply allocated at the OPAL/HW >> level and then MASKED. KVM only needs to know about its type: LSI or >> MSI. >> >> Signed-off-by: Cédric Le Goater

Re: [PATCH v3] powerpc/pseries: Only wait for dying CPU after call to rtas_stop_self()

2019-03-12 Thread Thiago Jung Bauermann
Gautham R Shenoy writes: >> Signed-off-by: Thiago Jung Bauermann > > Thanks for this version. I have tested the patch and we no longer see > the "Querying DEAD? cpu X (Y) shows 2" message. > > > Tested-and-Reviewed-by: Gautham R. Shenoy Thanks for reviewing and testing the patch! -- Thiago

Re: [PATCH v2 06/16] KVM: PPC: Book3S HV: XIVE: add controls for the EQ configuration

2019-03-12 Thread Cédric Le Goater
On 2/25/19 3:39 AM, David Gibson wrote: > On Fri, Feb 22, 2019 at 12:28:30PM +0100, Cédric Le Goater wrote: >> These controls will be used by the H_INT_SET_QUEUE_CONFIG and >> H_INT_GET_QUEUE_CONFIG hcalls from QEMU. They will also be used to >> restore the configuration of the XIVE EQs in the KVM

Re: [PATCH 00/14] entry: preempt_schedule_irq() callers scrub

2019-03-12 Thread Vineet Gupta
On 3/11/19 3:47 PM, Valentin Schneider wrote: > Hi, > > This is the continuation of [1] where I'm hunting down > preempt_schedule_irq() callers because of [2]. > > I told myself the best way to get this moving forward wouldn't be to write > doc about it, but to go write some fixes and get some di

Re: [PATCH v2 01/16] powerpc/xive: add OPAL extensions for the XIVE native exploitation support

2019-03-12 Thread Cédric Le Goater
On 2/26/19 5:21 AM, David Gibson wrote: > On Mon, Feb 25, 2019 at 11:11:58AM +0100, Cédric Le Goater wrote: >> On 2/25/19 4:50 AM, Michael Ellerman wrote: >>> Cédric Le Goater writes: >>> The support for XIVE native exploitation mode in Linux/KVM needs a couple more OPAL calls to configu

Re: [PATCH v2 4/7] dt-bindings: counter: ftm-quaddec

2019-03-12 Thread Rob Herring
On Wed, Mar 06, 2019 at 12:12:05PM +0100, Patrick Havelange wrote: > FlexTimer quadrature decoder driver. > > Signed-off-by: Patrick Havelange > Reviewed-by: Esben Haabendal > --- > Changes v2 > - None > --- > .../bindings/counter/ftm-quaddec.txt | 18 ++ > 1 file

[PATCH] kmemleak: skip scanning holes in the .bss section

2019-03-12 Thread Qian Cai
The commit 2d4f567103ff ("KVM: PPC: Introduce kvm_tmp framework") adds kvm_tmp[] into the .bss section and then free the rest of unused spaces back to the page allocator. kernel_init kvm_guest_init kvm_free_tmp free_reserved_area free_unref_page free_unref_page_prepar

Re: [PATCH] kmemleak: skip scanning holes in the .bss section

2019-03-12 Thread Qian Cai
Fixing some email addresses. On Tue, 2019-03-12 at 15:14 -0400, Qian Cai wrote: > The commit 2d4f567103ff ("KVM: PPC: Introduce kvm_tmp framework") adds > kvm_tmp[] into the .bss section and then free the rest of unused spaces > back to the page allocator. > > kernel_init >   kvm_guest_init >    

[PATCH] powerpc/64s: Include header file to fix a warning

2019-03-12 Thread Mathieu Malaterre
Make sure to include to provide the following prototype: hv_nmi_check_nonrecoverable. Remove the following warning treated as error (W=1): arch/powerpc/kernel/traps.c:393:6: error: no previous prototype for 'hv_nmi_check_nonrecoverable' [-Werror=missing-prototypes] Signed-off-by: Mathieu Mal

[PATCH] powerpc: sstep: Mark variable `rc` as unused in function 'analyse_instr'

2019-03-12 Thread Mathieu Malaterre
Add gcc attribute unused for `rc` variable. Fix warnings treated as errors with W=1: arch/powerpc/lib/sstep.c:1172:31: error: variable 'rc' set but not used [-Werror=unused-but-set-variable] Signed-off-by: Mathieu Malaterre --- arch/powerpc/lib/sstep.c | 2 +- 1 file changed, 1 insertion(+)

[PATCH] powerpc/64s: Mark 'dummy_copy_buffer' as used

2019-03-12 Thread Mathieu Malaterre
In commit 07d2a628bc00 ("powerpc/64s: Avoid cpabort in context switch when possible") a buffer 'dummy_copy_buffer' was introduced. gcc does not see this buffer being used in the inline assembly within function '__switch_to', explicitly marked this variable as being used. Prefer using '__aligned' t

[PATCH] powerpc: Make some functions static

2019-03-12 Thread Mathieu Malaterre
In commit cb9e4d10c448 ("[POWERPC] Add support for 750CL Holly board") new functions were added. Since these functions can be made static, make it so. While doing so, it turns out that holly_power_off and holly_halt are unused, so remove them. Silence the following warnings triggered using W=1:

Re: [PATCH] powerpc: sstep: Mark variable `rc` as unused in function 'analyse_instr'

2019-03-12 Thread Christophe Leroy
Le 12/03/2019 à 21:20, Mathieu Malaterre a écrit : Add gcc attribute unused for `rc` variable. Fix warnings treated as errors with W=1: arch/powerpc/lib/sstep.c:1172:31: error: variable 'rc' set but not used [-Werror=unused-but-set-variable] Signed-off-by: Mathieu Malaterre --- arch/

Re: [PATCH] powerpc/64s: Mark 'dummy_copy_buffer' as used

2019-03-12 Thread Christophe Leroy
On 03/12/2019 08:29 PM, Mathieu Malaterre wrote: In commit 07d2a628bc00 ("powerpc/64s: Avoid cpabort in context switch when possible") a buffer 'dummy_copy_buffer' was introduced. gcc does not see this buffer being used in the inline assembly within function '__switch_to', explicitly marked this

Re: [PATCH] kmemleak: skip scanning holes in the .bss section

2019-03-12 Thread Andrew Morton
On Tue, 12 Mar 2019 15:14:12 -0400 Qian Cai wrote: > The commit 2d4f567103ff ("KVM: PPC: Introduce kvm_tmp framework") adds > kvm_tmp[] into the .bss section and then free the rest of unused spaces > back to the page allocator. > > kernel_init > kvm_guest_init > kvm_free_tmp > free_r

Re: [PATCH] powerpc/64s: Include header file to fix a warning

2019-03-12 Thread Christophe Leroy
Le 12/03/2019 à 21:18, Mathieu Malaterre a écrit : Make sure to include to provide the following prototype: hv_nmi_check_nonrecoverable. Remove the following warning treated as error (W=1): arch/powerpc/kernel/traps.c:393:6: error: no previous prototype for 'hv_nmi_check_nonrecoverable'

[PATCH 00/14] entry: preempt_schedule_irq() callers scrub

2019-03-12 Thread Valentin Schneider
Hi, This is the continuation of [1] where I'm hunting down preempt_schedule_irq() callers because of [2]. I told myself the best way to get this moving forward wouldn't be to write doc about it, but to go write some fixes and get some discussions going, which is what this patch-set is about. I'v

[PATCH 08/14] powerpc: entry: Remove unneeded need_resched() loop

2019-03-12 Thread Valentin Schneider
Since the enabling and disabling of IRQs within preempt_schedule_irq() is contained in a need_resched() loop, we don't need the outer arch code loop. Signed-off-by: Valentin Schneider Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org --- arch

Re: [PATCH 00/14] entry: preempt_schedule_irq() callers scrub

2019-03-12 Thread Valentin Schneider
On 12/03/2019 18:03, Vineet Gupta wrote: [...] >> Regarding that loop, archs seem to fall in 3 categories: >> A) Those that don't have the loop > > Please clarify that this is the right thing to do (since core code already > has the > loop) hence no fixing is required for this "category" > Righ

RE: [PATCH v2 2/2] crash_core, vmcoreinfo: Append 'MAX_PHYSMEM_BITS' to vmcoreinfo

2019-03-12 Thread Kazuhito Hagio
Hi Bhupesh, -Original Message- > Right now user-space tools like 'makedumpfile' and 'crash' need to rely > on a best-guess method of determining value of 'MAX_PHYSMEM_BITS' > supported by underlying kernel. > > This value is used in user-space code to calculate the bit-space > required to

Re: [PATCH] powerpc: sstep: Mark variable `rc` as unused in function 'analyse_instr'

2019-03-12 Thread Mathieu Malaterre
On Tue, Mar 12, 2019 at 9:56 PM Christophe Leroy wrote: > > > > Le 12/03/2019 à 21:20, Mathieu Malaterre a écrit : > > Add gcc attribute unused for `rc` variable. > > > > Fix warnings treated as errors with W=1: > > > >arch/powerpc/lib/sstep.c:1172:31: error: variable 'rc' set but not used >

Re: [PATCH] powerpc: Make some functions static

2019-03-12 Thread Christophe Leroy
Le 12/03/2019 à 21:31, Mathieu Malaterre a écrit : In commit cb9e4d10c448 ("[POWERPC] Add support for 750CL Holly board") new functions were added. Since these functions can be made static, make it so. While doing so, it turns out that holly_power_off and holly_halt are unused, so remove them.

[PATCH v2] powerpc/32: sstep: Move variable `rc` within CONFIG_PPC64 sentinels

2019-03-12 Thread Mathieu Malaterre
Fix warnings treated as errors with W=1: arch/powerpc/lib/sstep.c:1172:31: error: variable 'rc' set but not used [-Werror=unused-but-set-variable] Suggested-by: Christophe Leroy Signed-off-by: Mathieu Malaterre --- v2: as suggested prefer CONFIG_PPC64 sentinel instead of unused keyword arc

Re: [PATCH] powerpc: sstep: Mark variable `rc` as unused in function 'analyse_instr'

2019-03-12 Thread Christophe Leroy
Le 12/03/2019 à 22:12, Mathieu Malaterre a écrit : On Tue, Mar 12, 2019 at 9:56 PM Christophe Leroy wrote: Le 12/03/2019 à 21:20, Mathieu Malaterre a écrit : Add gcc attribute unused for `rc` variable. Fix warnings treated as errors with W=1: arch/powerpc/lib/sstep.c:1172:31: error

[PATCH v10 03/18] powerpc: prepare string/mem functions for KASAN

2019-03-12 Thread Christophe Leroy
CONFIG_KASAN implements wrappers for memcpy() memmove() and memset() Those wrappers are doing the verification then call respectively __memcpy() __memmove() and __memset(). The arches are therefore expected to rename their optimised functions that way. For files on which KASAN is inhibited, #defin

[PATCH v10 04/18] powerpc: remove CONFIG_CMDLINE #ifdef mess

2019-03-12 Thread Christophe Leroy
This patch makes CONFIG_CMDLINE defined at all time. It avoids having to enclose related code inside #ifdef CONFIG_CMDLINE Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig| 6 +++--- arch/powerpc/kernel/prom_init.c | 9 +++-- 2 files changed, 6 insertions(+), 9 deletions(

[PATCH v10 02/18] powerpc/32: Move early_init() in a separate file

2019-03-12 Thread Christophe Leroy
In preparation of KASAN, move early_init() into a separate file in order to allow deactivation of KASAN for that function. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/Makefile | 2 +- arch/powerpc/kernel/early_32.c | 36 arch/powerpc/kernel/set

[PATCH v10 01/18] powerpc/6xx: fix setup and use of SPRN_SPRG_PGDIR for hash32

2019-03-12 Thread Christophe Leroy
Not only the 603 but all 6xx need SPRN_SPRG_PGDIR to be initialised at startup. This patch move it from __setup_cpu_603() to start_here() and __secondary_start(), close to the initialisation of SPRN_THREAD. Previously, virt addr of PGDIR was retrieved from thread struct. Now that it is the phys ad

[PATCH v10 00/18] KASAN for powerpc/32 and RFC for 64bit Book3E

2019-03-12 Thread Christophe Leroy
This series adds KASAN support to powerpc/32 32 bits tested on nohash/32 (8xx), book3s/32 (mpc832x ie 603) and qemu mac99 64bit Book3E tested by Daniel on e6500 Changes in v10: - Prepended the patch which fixes boot on hash32 - Reduced ifdef mess related to CONFIG_CMDLINE in prom_init.c - Fixed s

[PATCH v10 06/18] powerpc/mm: don't use direct assignation during early boot.

2019-03-12 Thread Christophe Leroy
In kernel/cputable.c, explicitly use memcpy() instead of *y = *x; This will allow GCC to replace it with __memcpy() when KASAN is selected. Acked-by: Dmitry Vyukov Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/cputable.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletion

[PATCH v10 07/18] powerpc/32: use memset() instead of memset_io() to zero BSS

2019-03-12 Thread Christophe Leroy
Since commit 400c47d81ca38 ("powerpc32: memset: only use dcbz once cache is enabled"), memset() can be used before activation of the cache, so no need to use memset_io() for zeroing the BSS. Acked-by: Dmitry Vyukov Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/early_32.c | 4 ++-- 1 f

[PATCH v10 05/18] powerpc/prom_init: don't use string functions from lib/

2019-03-12 Thread Christophe Leroy
When KASAN is active, the string functions in lib/ are doing the KASAN checks. This is too early for prom_init. This patch implements dedicated string functions for prom_init, which will be compiled in with KASAN disabled. Size of prom_init before the patch: textdata bss dec he

[PATCH v10 09/18] powerpc/32: prepare shadow area for KASAN

2019-03-12 Thread Christophe Leroy
This patch prepares a shadow area for KASAN. The shadow area will be at the top of the kernel virtual memory space above the fixmap area and will occupy one eighth of the total kernel virtual memory space. Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig.debug| 5 + arch/po

[PATCH v10 08/18] powerpc/32: make KVIRT_TOP dependent on FIXMAP_START

2019-03-12 Thread Christophe Leroy
When we add KASAN shadow area, KVIRT_TOP can't be anymore fixed at 0xfe00. This patch uses FIXADDR_START to define KVIRT_TOP. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/pgtable.h | 13 ++--- arch/powerpc/include/asm/nohash/32/pgtable.h | 13 ++---

[PATCH v10 10/18] powerpc: disable KASAN instrumentation on early/critical files.

2019-03-12 Thread Christophe Leroy
All files containing functions run before kasan_early_init() is called must have KASAN instrumentation disabled. For those file, branch profiling also have to be disabled otherwise each if () generates a call to ftrace_likely_update(). Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/Mak

[PATCH v10 11/18] powerpc/32: Add KASAN support

2019-03-12 Thread Christophe Leroy
This patch adds KASAN support for PPC32. The following patch will add an early activation of hash table for book3s. Until then, a warning will be raised if trying to use KASAN on an hash 6xx. To support KASAN, this patch initialises that MMU mapings for accessing to the KASAN shadow area defined i

[PATCH v10 12/18] powerpc/32s: move hash code patching out of MMU_init_hw()

2019-03-12 Thread Christophe Leroy
For KASAN, hash table handling will be activated early for accessing to KASAN shadow areas. In order to avoid any modification of the hash functions while they are still used with the early hash table, the code patching is moved out of MMU_init_hw() and put close to the big-bang switch to the fina

[PATCH v10 13/18] powerpc/32s: set up an early static hash table for KASAN.

2019-03-12 Thread Christophe Leroy
KASAN requires early activation of hash table, before memblock() functions are available. This patch implements an early hash_table statically defined in __initdata. During early boot, a single page table is used. For hash32, when doing the final init, one page table is allocated for each PGD en

[PATCH v10 14/18] powerpc/32s: map kasan zero shadow with PAGE_READONLY instead of PAGE_KERNEL_RO

2019-03-12 Thread Christophe Leroy
For hash32, the zero shadow page gets mapped with PAGE_READONLY instead of PAGE_KERNEL_RO, because the PP bits don't provide a RO kernel, so PAGE_KERNEL_RO is equivalent to PAGE_KERNEL. By using PAGE_READONLY, the page is RO for both kernel and user, but this is not a security issue as it contains

[PATCH RFC v3 15/18] kasan: do not open-code addr_has_shadow

2019-03-12 Thread Christophe Leroy
From: Daniel Axtens We have a couple of places checking for the existence of a shadow mapping for an address by open-coding the inverse of the check in addr_has_shadow. Replace the open-coded versions with the helper. This will be needed in future to allow architectures to override the layout of

[PATCH RFC v3 17/18] kasan: allow architectures to provide an outline readiness check

2019-03-12 Thread Christophe Leroy
From: Daniel Axtens In powerpc (as I understand it), we spend a lot of time in boot running in real mode before MMU paging is initialised. During this time we call a lot of generic code, including printk(). If we try to access the shadow region during this time, things fail. My attempts to move

[PATCH RFC v3 16/18] kasan: allow architectures to manage the memory-to-shadow mapping

2019-03-12 Thread Christophe Leroy
From: Daniel Axtens Currently, shadow addresses are always addr >> shift + offset. However, for powerpc, the virtual address space is fragmented in ways that make this simple scheme impractical. Allow architectures to override: - kasan_shadow_to_mem - kasan_mem_to_shadow - addr_has_shadow Re

[PATCH RFC v3 18/18] powerpc: KASAN for 64bit Book3E

2019-03-12 Thread Christophe Leroy
From: Daniel Axtens Wire up KASAN. Only outline instrumentation is supported. The KASAN shadow area is mapped into vmemmap space: 0x8000 0400 to 0x8000 0600 . To do this we require that vmemmap be disabled. (This is the default in the kernel config that QorIQ provides for the

Re: [PATCH v10 05/18] powerpc/prom_init: don't use string functions from lib/

2019-03-12 Thread Daniel Axtens
Hi Christophe, In trying to extend my KASAN implementation to Book3S 64bit, I found one other change needed to prom_init. I don't know if you think it should go in this patch, the next one, or somewhere else entirely - I will leave it up to you. Just let me know if you want me to carry it separate

Re: [PATCH 3/6] x86: clean up _TIF_SYSCALL_EMU handling using ptrace_syscall_enter hook

2019-03-12 Thread Haibo Xu (Arm Technology China)
On 2019/3/12 20:09, Sudeep Holla wrote: > On Mon, Mar 11, 2019 at 08:04:39PM -0700, Andy Lutomirski wrote: >> On Mon, Mar 11, 2019 at 6:35 PM Haibo Xu (Arm Technology China) >> wrote: >>> > > [...] > >>> For the PTRACE_SYSEMU_SINGLESTEP request, ptrace only need to report(send >>> SIGTRAP) at the

[PATCH 1/1] arch/powerpc: Don't assume start_text & head_end align

2019-03-12 Thread Alastair D'Silva
From: Alastair D'Silva When building LTO kernels, the start_text symbol is not guaranteed to mark the end of the head section. Instead, look explicitly for __head_end. Signed-off-by: Alastair D'Silva --- arch/powerpc/tools/head_check.sh | 10 +- 1 file changed, 5 insertions(+), 5 dele

[PATCH 1/1] arch/powerpc: Rework local_paca to avoid LTO warnings

2019-03-12 Thread Alastair D'Silva
From: Alastair D'Silva When building an LTO kernel, the existing code generates warnings: ./arch/powerpc/include/asm/paca.h:37:30: warning: register of ‘local_paca’ used for multiple global register variables register struct paca_struct *local_paca asm("r13");

Re: [PATCH] powerpc/64s: Mark 'dummy_copy_buffer' as used

2019-03-12 Thread Michael Ellerman
Christophe Leroy writes: > On 03/12/2019 08:29 PM, Mathieu Malaterre wrote: >> In commit 07d2a628bc00 ("powerpc/64s: Avoid cpabort in context switch >> when possible") a buffer 'dummy_copy_buffer' was introduced. gcc does >> not see this buffer being used in the inline assembly within function >>

[PATCH 1/5] ocxl: Rename struct link to ocxl_link

2019-03-12 Thread Alastair D'Silva
From: Alastair D'Silva The term 'link' is ambiguous (especially when the struct is used for a list), so rename it for clarity. Signed-off-by: Alastair D'Silva Reviewed-by: Greg Kurz --- drivers/misc/ocxl/file.c | 5 ++--- drivers/misc/ocxl/link.c | 36 ++-- 2

[PATCH 2/5] ocxl: Clean up printf formats

2019-03-12 Thread Alastair D'Silva
From: Alastair D'Silva Use %# instead of using a literal '0x' Signed-off-by: Alastair D'Silva --- drivers/misc/ocxl/config.c | 6 +++--- drivers/misc/ocxl/context.c | 2 +- drivers/misc/ocxl/trace.h | 10 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/mi

[PATCH v2 0/5] ocxl: OpenCAPI Cleanup

2019-03-12 Thread Alastair D'Silva
From: Alastair D'Silva Some minor cleanups for the OpenCAPI driver as a prerequisite for an ocxl driver refactoring to allow the driver core to be utilised by external drivers. Changelog: V2: - remove intermediate assignment of 'link' var in 'Rename struct link to ocxl_link'

[PATCH 3/5] ocxl: read_pasid never returns an error, so make it void

2019-03-12 Thread Alastair D'Silva
From: Alastair D'Silva No need for a return value in read_pasid as it only returns 0. Signed-off-by: Alastair D'Silva Reviewed-by: Greg Kurz --- drivers/misc/ocxl/config.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/misc/ocxl/config.c b/drivers/misc/oc

[PATCH 5/5] ocxl: Remove some unused exported symbols

2019-03-12 Thread Alastair D'Silva
From: Alastair D'Silva Remove some unused exported symbols. Signed-off-by: Alastair D'Silva --- drivers/misc/ocxl/config.c| 2 -- drivers/misc/ocxl/ocxl_internal.h | 23 +++ include/misc/ocxl.h | 23 --- 3 files changed, 23 inserti

[PATCH 4/5] ocxl: Remove superfluous 'extern' from headers

2019-03-12 Thread Alastair D'Silva
From: Alastair D'Silva The 'extern' keyword adds no value here. Signed-off-by: Alastair D'Silva --- drivers/misc/ocxl/ocxl_internal.h | 54 +++ include/misc/ocxl.h | 36 ++--- 2 files changed, 44 insertions(+), 46 deletions(-) diff --g

[PATCH 0/7] Refactor OCXL driver to allow external drivers to use it

2019-03-12 Thread Alastair D'Silva
From: Alastair D'Silva This series reworks the OpenCAPI driver to split frontend (driver interactions) from backend (hardware interactions). This allows external drivers to utilise the core of the generic OpenCAPI driver to communicate with specific OpenCAPI hardware. Alastair D'Silva (7): oc

[PATCH 1/7] ocxl: Provide global MMIO accessors for external drivers

2019-03-12 Thread Alastair D'Silva
From: Alastair D'Silva External drivers that communicate via OpenCAPI will need to make MMIO calls to interact with the devices. Signed-off-by: Alastair D'Silva Reviewed-by: Greg Kurz --- drivers/misc/ocxl/Makefile | 2 +- drivers/misc/ocxl/mmio.c | 234 +++

[PATCH 2/7] ocxl: Allow external drivers to use OpenCAPI contexts

2019-03-12 Thread Alastair D'Silva
From: Alastair D'Silva Most OpenCAPI operations require a valid context, so exposing these functions to external drivers is necessary. Signed-off-by: Alastair D'Silva Reviewed-by: Greg Kurz --- drivers/misc/ocxl/context.c | 9 +-- drivers/misc/ocxl/file.c | 2 +- drivers/

[PATCH 3/7] ocxl: Split pci.c

2019-03-12 Thread Alastair D'Silva
From: Alastair D'Silva In preparation for making core code available for external drivers, move the core code out of pci.c and into core.c Signed-off-by: Alastair D'Silva --- drivers/misc/ocxl/Makefile| 1 + drivers/misc/ocxl/core.c | 517 ++ driv

[PATCH 4/7] ocxl: Don't pass pci_dev around

2019-03-12 Thread Alastair D'Silva
From: Alastair D'Silva This data is already available in a struct Signed-off-by: Alastair D'Silva --- drivers/misc/ocxl/core.c | 38 +- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/drivers/misc/ocxl/core.c b/drivers/misc/ocxl/core.c index

[PATCH 5/7] ocxl: Create a clear delineation between ocxl backend & frontend

2019-03-12 Thread Alastair D'Silva
From: Alastair D'Silva The OCXL driver contains both frontend code for interacting with userspace, as well as backend code for interacting with the hardware. This patch separates the backend code from the frontend so that it can be used by other device drivers that communicate via OpenCAPI. Rel

[PATCH 6/7] ocxl: afu_irq only deals with IRQ IDs, not offsets

2019-03-12 Thread Alastair D'Silva
From: Alastair D'Silva The use of offsets is required only in the frontend, so alter the IRQ API to only work with IRQ IDs in the backend. Signed-off-by: Alastair D'Silva --- drivers/misc/ocxl/afu_irq.c | 31 +-- drivers/misc/ocxl/context.c | 7 +--

[PATCH 7/7] ocxl: move event_fd handling to frontend

2019-03-12 Thread Alastair D'Silva
From: Alastair D'Silva Event_fd is only used in the driver frontend, so it does not need to exist in the backend code. Relocate it to the frontend and provide an opaque mechanism for consumers instead. Signed-off-by: Alastair D'Silva --- drivers/misc/ocxl/afu_irq.c | 69 +

Re: [PATCH v2 03/16] KVM: PPC: Book3S HV: XIVE: introduce a new capability KVM_CAP_PPC_IRQ_XIVE

2019-03-12 Thread David Gibson
On Tue, Mar 12, 2019 at 03:03:25PM +0100, Cédric Le Goater wrote: > On 2/25/19 1:35 AM, David Gibson wrote: > > On Fri, Feb 22, 2019 at 12:28:27PM +0100, Cédric Le Goater wrote: [snip] > >> +int kvmppc_xive_native_connect_vcpu(struct kvm_device *dev, > >> + struct kvm_v

Re: [PATCH v2 06/16] KVM: PPC: Book3S HV: XIVE: add controls for the EQ configuration

2019-03-12 Thread David Gibson
On Tue, Mar 12, 2019 at 06:00:38PM +0100, Cédric Le Goater wrote: > On 2/25/19 3:39 AM, David Gibson wrote: > > On Fri, Feb 22, 2019 at 12:28:30PM +0100, Cédric Le Goater wrote: > >> These controls will be used by the H_INT_SET_QUEUE_CONFIG and > >> H_INT_GET_QUEUE_CONFIG hcalls from QEMU. They wil

Re: [PATCH v2] powerpc/mm: move warning from resize_hpt_for_hotplug()

2019-03-12 Thread David Gibson
On Fri, Mar 08, 2019 at 11:54:13AM +0100, Laurent Vivier wrote: > resize_hpt_for_hotplug() reports a warning when it cannot > resize the hash page table ("Unable to resize hash page > table to target order") but in some cases it's not a problem > and can make user thinks something has not worked pr

Re: [PATCH v2] fs/dax: deposit pagetable even when installing zero page

2019-03-12 Thread Aneesh Kumar K.V
Hi Dan/Andrew/Jan, "Aneesh Kumar K.V" writes: > Architectures like ppc64 use the deposited page table to store hardware > page table slot information. Make sure we deposit a page table when > using zero page at the pmd level for hash. > > Without this we hit > > Unable to handle kernel paging

Re: [PATCH v2] powerpc/mm: move warning from resize_hpt_for_hotplug()

2019-03-12 Thread Christophe Leroy
Le 08/03/2019 à 11:54, Laurent Vivier a écrit : resize_hpt_for_hotplug() reports a warning when it cannot resize the hash page table ("Unable to resize hash page table to target order") but in some cases it's not a problem and can make user thinks something has not worked properly. This patch

Re: [PATCH v4 2/9] powerpc/powernv/idle: Restore AMR/UAMOR/AMOR after idle

2019-03-12 Thread Akshay Adiga
On Fri, Mar 01, 2019 at 01:49:10AM +1100, Michael Ellerman wrote: > In order to implement KUAP (Kernel Userspace Access Protection) on > Power9 we will be using the AMR, and therefore indirectly the > UAMOR/AMOR. > > So save/restore these regs in the idle code. > > Signed-off-by: Michael Ellerman