Re: [PATCH] powerpc/highmem: change BUG_ON() to WARN_ON()

2019-03-20 Thread Michael Ellerman
Christophe Leroy writes: > In arch/powerpc/mm/highmem.c, BUG_ON() is called only when > CONFIG_DEBUG_HIGHMEM is selected, this means the BUG_ON() is > not vital and can be replaced by a a WARN_ON > > At the sametime, use IS_ENABLED() instead of #ifdef to clean a bit. > > Signed-off-by: Christophe

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

2019-03-20 Thread Michael Ellerman
Catalin Marinas writes: > On Thu, Mar 21, 2019 at 12:15:46AM +1100, Michael Ellerman wrote: >> Catalin Marinas writes: >> > On Wed, Mar 13, 2019 at 10:57:17AM -0400, Qian Cai wrote: >> >> @@ -1531,7 +1547,14 @@ static void kmemleak_scan(void) >> >> >> >> /* data/bss scanning */ >> >>

Re: [RFC PATCH 1/1] KVM: PPC: Report single stepping capability

2019-03-20 Thread Alexey Kardashevskiy
On 21/03/2019 05:39, Fabiano Rosas wrote: > When calling the KVM_SET_GUEST_DEBUG ioctl, userspace might request > the next instruction to be single stepped via the > KVM_GUESTDBG_SINGLESTEP control bit of the kvm_guest_debug structure. > > We currently don't have support for guest single

Re: [PATCH 1/2] ibmvscsi: Protect ibmvscsi_head from concurrent modificaiton

2019-03-20 Thread Martin K. Petersen
Tyrel, > For each ibmvscsi host created during a probe or destroyed during a > remove we either add or remove that host to/from the global > ibmvscsi_head list. This runs the risk of concurrent modification. > > This patch adds a simple spinlock around the list modification calls > to prevent

[PATCH] powerpc/security: Fix spectre_v2 reporting

2019-03-20 Thread Michael Ellerman
When I updated the spectre_v2 reporting to handle software count cache flush I got the logic wrong when there's no software count cache enabled at all. The result is that on systems with the software count cache flush disabled we print: Mitigation: Indirect branch cache disabled, Software

Re: [PATCH 1/4] add generic builtin command line

2019-03-20 Thread Andrew Morton
On Wed, 20 Mar 2019 16:23:28 -0700 Daniel Walker wrote: > On Wed, Mar 20, 2019 at 03:53:19PM -0700, Andrew Morton wrote: > > On Tue, 19 Mar 2019 16:24:45 -0700 Daniel Walker wrote: > > > > > This code allows architectures to use a generic builtin command line. > > > > I wasn't cc'ed on [2/4].

Re: [PATCH 2/2] mm/dax: Don't enable huge dax mapping by default

2019-03-20 Thread Dan Williams
On Wed, Mar 20, 2019 at 8:09 PM Oliver wrote: > > On Thu, Mar 21, 2019 at 7:57 AM Dan Williams wrote: > > > > On Wed, Mar 20, 2019 at 8:34 AM Dan Williams > > wrote: > > > > > > On Wed, Mar 20, 2019 at 1:09 AM Aneesh Kumar K.V > > > wrote: > > > > > > > > Aneesh Kumar K.V writes: > > > > > >

Re: [PATCH 2/2] mm/dax: Don't enable huge dax mapping by default

2019-03-20 Thread Oliver
On Thu, Mar 21, 2019 at 7:57 AM Dan Williams wrote: > > On Wed, Mar 20, 2019 at 8:34 AM Dan Williams wrote: > > > > On Wed, Mar 20, 2019 at 1:09 AM Aneesh Kumar K.V > > wrote: > > > > > > Aneesh Kumar K.V writes: > > > > > > > Dan Williams writes: > > > > > > > >> > > > >>> Now what will be

Re: [PATCH v2 13/13] syscall_get_arch: add "struct task_struct *" argument

2019-03-20 Thread Paul Moore
On Sun, Mar 17, 2019 at 7:30 PM Dmitry V. Levin wrote: > > This argument is required to extend the generic ptrace API with > PTRACE_GET_SYSCALL_INFO request: syscall_get_arch() is going > to be called from ptrace_request() along with syscall_get_nr(), > syscall_get_arguments(),

Re: [PATCH 2/2] ibmvscsi: Fix empty event pool access during host removal

2019-03-20 Thread Martin K. Petersen
Tyrel, > The event pool used for queueing commands is destroyed fairly early in > the ibmvscsi_remove() code path. Since, this happens prior to the call > so scsi_remove_host() it is possible for further calls to queuecommand > to be processed which manifest as a panic due to a NULL pointer >

[PATCH 4/4] ibmvfc: Clean up transport events

2019-03-20 Thread Tyrel Datwyler
No change to functionality. Simply make transport event messages a litle clearer, and rework CRQ format enums such that we have separate enums for INIT messages and XPORT events. Signed-off-by: Tyrel Datwyler --- drivers/scsi/ibmvscsi/ibmvfc.c | 8 +--- drivers/scsi/ibmvscsi/ibmvfc.h | 7

[PATCH 3/4] ibmvfc: Byte swap status and error codes when logging

2019-03-20 Thread Tyrel Datwyler
Status and error codes are returned in big endian from the VIOS. The values are translated into a human readable format when logged, but the values are also logged. This patch byte swaps those values so that they are consistent between BE and LE platforms. Signed-off-by: Tyrel Datwyler ---

[PATCH 2/4] ibmvfc: Add failed PRLI to cmd_status lookup array

2019-03-20 Thread Tyrel Datwyler
The VIOS uses the SCSI_ERROR class to report PRLI failures. These errors are indicated with the combination of a IBMVFC_FC_SCSI_ERROR return status and 0x8000 error code. Add these codes to cmd_status[] with appropriate human readable error message. Signed-off-by: Tyrel Datwyler ---

[PATCH 1/4] ibmvfc: Remove "failed" from logged errors

2019-03-20 Thread Tyrel Datwyler
The text of messages logged with ibmvfc_log_error() always contain the term "failed". In the case of cancelled commands during EH they are reported back by the VIOS using error codes. This can be confusing to somebody looking at these log messages as to whether a command was successfully

[PATCH] powerpc: vmlinux.lds: Drop Binutils 2.18 workarounds

2019-03-20 Thread Joel Stanley
Segher added some workarounds for GCC 4.2 and bintuils 2.18. We now set 4.6 and 2.20 as the minimum, so they can be dropped. This is mostly a revert of c6995fe4 ("powerpc: Fix build bug with binutils < 2.18 and GCC < 4.2"). Signed-off-by: Joel Stanley --- arch/powerpc/kernel/vmlinux.lds.S

Re: [PATCH kernel RFC 2/2] vfio-pci-nvlink2: Implement interconnect isolation

2019-03-20 Thread David Gibson
On Wed, Mar 20, 2019 at 01:09:08PM -0600, Alex Williamson wrote: > On Wed, 20 Mar 2019 15:38:24 +1100 > David Gibson wrote: > > > On Tue, Mar 19, 2019 at 10:36:19AM -0600, Alex Williamson wrote: > > > On Fri, 15 Mar 2019 19:18:35 +1100 > > > Alexey Kardashevskiy wrote: > > > > > > > The

[PATCH 2/2] ibmvscsi: Fix empty event pool access during host removal

2019-03-20 Thread Tyrel Datwyler
The event pool used for queueing commands is destroyed fairly early in the ibmvscsi_remove() code path. Since, this happens prior to the call so scsi_remove_host() it is possible for further calls to queuecommand to be processed which manifest as a panic due to a NULL pointer dereference as seen

[PATCH 1/2] ibmvscsi: Protect ibmvscsi_head from concurrent modificaiton

2019-03-20 Thread Tyrel Datwyler
For each ibmvscsi host created during a probe or destroyed during a remove we either add or remove that host to/from the global ibmvscsi_head list. This runs the risk of concurrent modification. This patch adds a simple spinlock around the list modification calls to prevent concurrent updates as

Re: [PATCH 1/4] add generic builtin command line

2019-03-20 Thread Daniel Walker
On Wed, Mar 20, 2019 at 03:53:19PM -0700, Andrew Morton wrote: > On Tue, 19 Mar 2019 16:24:45 -0700 Daniel Walker wrote: > > > This code allows architectures to use a generic builtin command line. > > I wasn't cc'ed on [2/4]. No mailing lists were cc'ed on [0/4] but it > didn't say anything

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

2019-03-20 Thread David Gibson
On Wed, Mar 20, 2019 at 09:37:40AM +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 to configure the underlying > Event Queue in the XIVE IC. They will also be used to restore the > configuration of the XIVE

Re: [PATCH 1/4] add generic builtin command line

2019-03-20 Thread Andrew Morton
On Tue, 19 Mar 2019 16:24:45 -0700 Daniel Walker wrote: > This code allows architectures to use a generic builtin command line. I wasn't cc'ed on [2/4]. No mailing lists were cc'ed on [0/4] but it didn't say anything useful anyway ;) I'll queue them up for testing and shall await feedback

Re: [PATCH] hotplug/drc-info: ininitialize fndit to zero

2019-03-20 Thread Bjorn Helgaas
[+cc Michael B (original author)] On Sat, Mar 16, 2019 at 09:40:16PM +, Colin King wrote: > From: Colin Ian King > > Currently variable fndit is not initialized and contains a > garbage value, later it is set to 1 if a drc entry is found. > Ensure fndit is not containing garbage by

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-03-20 Thread Michael S. Tsirkin
On Wed, Mar 20, 2019 at 01:13:41PM -0300, Thiago Jung Bauermann wrote: > >> Another way of looking at this issue which also explains our reluctance > >> is that the only difference between a secure guest and a regular guest > >> (at least regarding virtio) is that the former uses swiotlb while the

Re: [PATCH 2/2] mm/dax: Don't enable huge dax mapping by default

2019-03-20 Thread Dan Williams
On Wed, Mar 20, 2019 at 8:34 AM Dan Williams wrote: > > On Wed, Mar 20, 2019 at 1:09 AM Aneesh Kumar K.V > wrote: > > > > Aneesh Kumar K.V writes: > > > > > Dan Williams writes: > > > > > >> > > >>> Now what will be page size used for mapping vmemmap? > > >> > > >> That's up to the

[RFC PATCH 1/1] KVM: PPC: Report single stepping capability

2019-03-20 Thread Fabiano Rosas
When calling the KVM_SET_GUEST_DEBUG ioctl, userspace might request the next instruction to be single stepped via the KVM_GUESTDBG_SINGLESTEP control bit of the kvm_guest_debug structure. We currently don't have support for guest single stepping implemented in Book3S HV. This patch adds the

[RFC PATCH 0/1] KVM: PPC: Inform userspace about singlestep support

2019-03-20 Thread Fabiano Rosas
I am looking for a way to inform userspace about the lack of an implementation in KVM HV for single stepping of instructions (KVM_GUESTDGB_SINGLESTEP bit from SET_GUEST_DEBUG ioctl). This will be used by QEMU to decide whether to attempt a call to the set_guest_debug ioctl (for BookE, KVM PR) or

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

2019-03-20 Thread Qian Cai
On Wed, 2019-03-20 at 18:16 +, Catalin Marinas wrote: > I think I have a simpler idea. Kmemleak allows punching holes in > allocated objects, so just turn the data/bss sections into dedicated > kmemleak objects. This happens when kmemleak is initialised, before the > initcalls are invoked. The

Re: [PATCH kernel RFC 2/2] vfio-pci-nvlink2: Implement interconnect isolation

2019-03-20 Thread Alex Williamson
On Wed, 20 Mar 2019 15:38:24 +1100 David Gibson wrote: > On Tue, Mar 19, 2019 at 10:36:19AM -0600, Alex Williamson wrote: > > On Fri, 15 Mar 2019 19:18:35 +1100 > > Alexey Kardashevskiy wrote: > > > > > The NVIDIA V100 SXM2 GPUs are connected to the CPU via PCIe links and > > > (on POWER9)

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

2019-03-20 Thread Catalin Marinas
On Thu, Mar 21, 2019 at 12:15:46AM +1100, Michael Ellerman wrote: > Catalin Marinas writes: > > On Wed, Mar 13, 2019 at 10:57:17AM -0400, Qian Cai wrote: > >> @@ -1531,7 +1547,14 @@ static void kmemleak_scan(void) > >> > >>/* data/bss scanning */ > >>scan_large_block(_sdata, _edata); >

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

2019-03-20 Thread Joe Perches
On Wed, 2019-03-20 at 16:34 +1100, Alastair D'Silva wrote: > From: Alastair D'Silva > > Use %# instead of using a literal '0x' I do not suggest this as reasonable. There are 10's of thousands of uses of 0x%x in the kernel and converting them to save a byte seems unnecessary. $ git grep -P

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-03-20 Thread Thiago Jung Bauermann
Hello Michael, Sorry for the delay in responding. We had some internal discussions on this. Michael S. Tsirkin writes: > On Mon, Feb 04, 2019 at 04:14:20PM -0200, Thiago Jung Bauermann wrote: >> >> Hello Michael, >> >> Michael S. Tsirkin writes: >> >> > On Tue, Jan 29, 2019 at 03:42:44PM

Re: [PATCH 2/2] mm/dax: Don't enable huge dax mapping by default

2019-03-20 Thread Dan Williams
On Wed, Mar 20, 2019 at 1:09 AM Aneesh Kumar K.V wrote: > > Aneesh Kumar K.V writes: > > > Dan Williams writes: > > > >> > >>> Now what will be page size used for mapping vmemmap? > >> > >> That's up to the architecture's vmemmap_populate() implementation. > >> > >>> Architectures > >>>

Re: [PATCH] compiler: allow all arches to enable CONFIG_OPTIMIZE_INLINING

2019-03-20 Thread Arnd Bergmann
On Wed, Mar 20, 2019 at 10:41 AM Arnd Bergmann wrote: > > I've added your patch to my randconfig test setup and will let you > know if I see anything noticeable. I'm currently testing clang-arm32, > clang-arm64 and gcc-x86. This is the only additional bug that has come up so far: `.exit.text'

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

2019-03-20 Thread Michael Ellerman
Catalin Marinas writes: > Hi Qian, > > On Wed, Mar 13, 2019 at 10:57:17AM -0400, Qian Cai wrote: >> @@ -1531,7 +1547,14 @@ static void kmemleak_scan(void) >> >> /* data/bss scanning */ >> scan_large_block(_sdata, _edata); >> -scan_large_block(__bss_start, __bss_stop); >> + >> +

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

2019-03-20 Thread Laurent Vivier
On 20/03/2019 13:47, Michael Ellerman wrote: > Laurent Vivier writes: >> Hi Michael, >> >> as it seems good now, could you pick up this patch for merging? > > I'll start picking up patches for next starting after rc2, so next week. > > If you think it's a bug fix I can put it into fixes now,

Re: [PATCH] compiler: allow all arches to enable CONFIG_OPTIMIZE_INLINING

2019-03-20 Thread Arnd Bergmann
On Wed, Mar 20, 2019 at 11:19 AM Masahiro Yamada wrote: > On Wed, Mar 20, 2019 at 6:39 PM Arnd Bergmann wrote: > > > > On Wed, Mar 20, 2019 at 7:41 AM Masahiro Yamada > > wrote: > > > > > It is unclear to me how to fix it. > > > That's why I ended up with "depends on !MIPS". > > > > > > > > >

Re: [PATCH v5 05/10] powerpc: Add a framework for Kernel Userspace Access Protection

2019-03-20 Thread Christophe Leroy
Le 20/03/2019 à 13:57, Michael Ellerman a écrit : Christophe Leroy writes: Le 08/03/2019 à 02:16, Michael Ellerman a écrit : From: Christophe Leroy This patch implements a framework for Kernel Userspace Access Protection. Then subarches will have the possibility to provide their own

Re: powerpc/vdso64: Fix CLOCK_MONOTONIC inconsistencies across Y2038

2019-03-20 Thread Michael Ellerman
On Wed, 2019-03-13 at 13:14:38 UTC, Michael Ellerman wrote: > Jakub Drnec reported: > Setting the realtime clock can sometimes make the monotonic clock go > back by over a hundred years. Decreasing the realtime clock across > the y2k38 threshold is one reliable way to reproduce. Allegedly

Re: [v2, 01/10] powerpc/6xx: fix setup and use of SPRN_SPRG_PGDIR for hash32

2019-03-20 Thread Michael Ellerman
On Mon, 2019-03-11 at 08:30:27 UTC, Christophe Leroy wrote: > 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

Re: [PATCH v5 02/10] powerpc/powernv/idle: Restore AMR/UAMOR/AMOR after idle

2019-03-20 Thread Michael Ellerman
Akshay Adiga writes: > On Fri, Mar 08, 2019 at 12:16:11PM +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. >>

Re: [PATCH v5 05/10] powerpc: Add a framework for Kernel Userspace Access Protection

2019-03-20 Thread Michael Ellerman
Christophe Leroy writes: > Le 08/03/2019 à 02:16, Michael Ellerman a écrit : >> From: Christophe Leroy >> >> This patch implements a framework for Kernel Userspace Access >> Protection. >> >> Then subarches will have the possibility to provide their own >> implementation by providing

[PATCH] powerpc/dts/fsl: add crypto node alias for B4

2019-03-20 Thread Horia Geantă
crypto node alias is needed by U-boot to identify the node and perform fix-ups, like adding "fsl,sec-era" property. Signed-off-by: Horia Geantă --- arch/powerpc/boot/dts/fsl/b4qds.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/boot/dts/fsl/b4qds.dtsi

Re: [PATCH] powerpc: Make some functions static

2019-03-20 Thread Michael Ellerman
Mathieu Malaterre writes: > On Tue, Mar 12, 2019 at 10:14 PM Christophe Leroy > wrote: >> >> >> >> 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

Re: Disable kcov for slb routines.

2019-03-20 Thread Michael Ellerman
Mahesh Jagannath Salgaonkar writes: > On 3/14/19 5:13 PM, Michael Ellerman wrote: >> On Mon, 2019-03-04 at 08:25:51 UTC, Mahesh J Salgaonkar wrote: >>> From: Mahesh Salgaonkar >>> >>> The kcov instrumentation inside SLB routines causes duplicate SLB entries >>> to be added resulting into SLB

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

2019-03-20 Thread Michael Ellerman
Laurent Vivier writes: > Hi Michael, > > as it seems good now, could you pick up this patch for merging? I'll start picking up patches for next starting after rc2, so next week. If you think it's a bug fix I can put it into fixes now, but I don't think it's a bug fix is it? cheers

Re: Shift overflow warnings in arch/powerpc/boot/addnote.c on 32-bit builds

2019-03-20 Thread Michael Ellerman
Mark Cave-Ayland writes: > Hi all, > > Whilst building the latest git master on my G4 I noticed the following shift > overflow > warnings in the build log for arch/powerpc/boot/addnote.c: > > > arch/powerpc/boot/addnote.c: In function ‘main’: > arch/powerpc/boot/addnote.c:75:47: warning: right

Re: [RESEND PATCH v2] powerpc: mute unused-but-set-variable warnings

2019-03-20 Thread Michael Ellerman
Qian Cai writes: > On 3/19/19 5:21 AM, Christophe Leroy wrote: >> Is there a reason for resending ? AFAICS, both are identical and still marked >> new in patchwork: >> https://patchwork.ozlabs.org/project/linuxppc-dev/list/?submitter=76055 >> > > "RESEND" because of no maintainer response for

Re: [PATCH] compiler: allow all arches to enable CONFIG_OPTIMIZE_INLINING

2019-03-20 Thread Masahiro Yamada
Hi Arnd, On Wed, Mar 20, 2019 at 6:39 PM Arnd Bergmann wrote: > > On Wed, Mar 20, 2019 at 7:41 AM Masahiro Yamada > wrote: > > > It is unclear to me how to fix it. > > That's why I ended up with "depends on !MIPS". > > > > > > MODPOST vmlinux.o > > arch/mips/mm/sc-mips.o: In function

[PATCH v1 27/27] powerpc/mm: flatten function __find_linux_pte() step 3

2019-03-20 Thread Christophe Leroy
__find_linux_pte() is full of if/else which is hard to follow allthough the handling is pretty simple. Previous patches left a { } block. This patch removes it. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/pgtable.c | 98 +++ 1 file changed,

[PATCH v1 26/27] powerpc/mm: flatten function __find_linux_pte() step 2

2019-03-20 Thread Christophe Leroy
__find_linux_pte() is full of if/else which is hard to follow allthough the handling is pretty simple. Previous patch left { } blocks. This patch removes the first one by shifting its content to the left. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/pgtable.c | 62

[PATCH v1 25/27] powerpc/mm: flatten function __find_linux_pte()

2019-03-20 Thread Christophe Leroy
__find_linux_pte() is full of if/else which is hard to follow allthough the handling is pretty simple. This patch flattens the function by getting rid of as much if/else as possible. In order to ease the review, this is done in two steps. Signed-off-by: Christophe Leroy ---

[PATCH v1 24/27] powerpc: define subarch SLB_ADDR_LIMIT_DEFAULT

2019-03-20 Thread Christophe Leroy
This patch defines a subarch specific SLB_ADDR_LIMIT_DEFAULT to remove the #ifdefs around the setup of mm->context.slb_addr_limit Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/64/slice.h | 2 ++ arch/powerpc/include/asm/nohash/32/slice.h | 2 ++

[PATCH v1 23/27] powerpc/mm: remove a couple of #ifdef CONFIG_PPC_64K_PAGES in mm/slice.c

2019-03-20 Thread Christophe Leroy
This patch replaces a couple of #ifdef CONFIG_PPC_64K_PAGES by IS_ENABLED(CONFIG_PPC_64K_PAGES) to improve code maintainability. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/slice.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/mm/slice.c

[PATCH v1 22/27] powerpc/mm: move slice_mask_for_size() into mmu.h

2019-03-20 Thread Christophe Leroy
Move slice_mask_for_size() into subarch mmu.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/64/mmu.h | 22 + arch/powerpc/include/asm/nohash/32/mmu-8xx.h | 18 ++ arch/powerpc/mm/slice.c | 36

[PATCH v1 21/27] powerpc/mm: hand a context_t over to slice_mask_for_size() instead of mm_struct

2019-03-20 Thread Christophe Leroy
slice_mask_for_size() only uses mm->context, so hand directly a pointer to the context. This will help moving the function in subarch mmu.h in the next patch by avoiding having to include the definition of struct mm_struct Signed-off-by: Christophe Leroy --- arch/powerpc/mm/slice.c | 34

[PATCH v1 19/27] powerpc/mm: drop slice DEBUG

2019-03-20 Thread Christophe Leroy
slice is now an improved functionnality. Drop the DEBUG stuff. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/slice.c | 62 - 1 file changed, 4 insertions(+), 58 deletions(-) diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c

[PATCH v1 20/27] powerpc/mm: remove unnecessary #ifdef CONFIG_PPC64

2019-03-20 Thread Christophe Leroy
For PPC32 that's a noop, but gcc is smart enough ignore it. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/slice.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c index 99983dc4e484..f98b9e812c62 100644 ---

[PATCH v1 18/27] powerpc/mm: cleanup remaining ifdef mess in hugetlbpage.c

2019-03-20 Thread Christophe Leroy
Only 3 subarches support huge pages. So when it either 2 of them, it is not the third one. And mmu_has_feature() is known by all subarches so IS_ENABLED() can be used instead of #ifdef Signed-off-by: Christophe Leroy --- arch/powerpc/mm/hugetlbpage.c | 12 +--- 1 file changed, 5

[PATCH v1 17/27] powerpc/mm: cleanup HPAGE_SHIFT setup

2019-03-20 Thread Christophe Leroy
Only book3s/64 may select default among several HPAGE_SHIFT at runtime. 8xx always defines 512K pages as default FSL_BOOK3E always defines 4M pages as default This patch limits HUGETLB_PAGE_SIZE_VARIABLE to book3s/64 moves the definitions in subarches files. Signed-off-by: Christophe Leroy ---

[PATCH v1 16/27] powerpc/mm: move hugetlb_disabled into asm/hugetlb.h

2019-03-20 Thread Christophe Leroy
No need to have this in asm/page.h, move it into asm/hugetlb.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/hugetlb.h | 2 ++ arch/powerpc/include/asm/page.h| 1 - arch/powerpc/kernel/fadump.c | 1 + arch/powerpc/mm/hash_utils_64.c| 1 + 4 files changed, 4

[PATCH v1 15/27] powerpc/mm: cleanup ifdef mess in add_huge_page_size()

2019-03-20 Thread Christophe Leroy
Introduce a subarch specific helper check_and_get_huge_psize() to check the huge page sizes and cleanup the ifdef mess in add_huge_page_size() Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/64/hugetlb.h | 27 +

[PATCH v1 14/27] powerpc/mm: no slice for nohash/64

2019-03-20 Thread Christophe Leroy
Only nohash/32 and book3s/64 support mm slices. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/64/slice.h | 7 --- arch/powerpc/include/asm/slice.h | 4 +--- arch/powerpc/platforms/Kconfig.cputype | 4 3 files changed, 5 insertions(+), 10 deletions(-)

[PATCH v1 13/27] powerpc/mm: define get_slice_psize() all the time

2019-03-20 Thread Christophe Leroy
get_slice_psize() can be defined regardless of CONFIG_PPC_MM_SLICES to avoid ifdefs Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/slice.h | 4 arch/powerpc/mm/hugetlbpage.c| 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git

[PATCH v1 11/27] powerpc/mm: split asm/hugetlb.h into dedicated subarch files

2019-03-20 Thread Christophe Leroy
Three subarches support hugepages: - fsl book3e - book3s/64 - 8xx This patch splits asm/hugetlb.h to reduce the #ifdef mess. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/64/hugetlb.h | 41 +++ arch/powerpc/include/asm/hugetlb.h | 89

[PATCH v1 12/27] powerpc/mm: add a helper to populate hugepd

2019-03-20 Thread Christophe Leroy
This patchs adds a subarch helper to populate hugepd. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/64/hugetlb.h | 5 + arch/powerpc/include/asm/nohash/32/hugetlb-8xx.h | 8 arch/powerpc/include/asm/nohash/hugetlb-book3e.h | 6 ++

[PATCH v1 10/27] powerpc/mm: make gup_hugepte() static

2019-03-20 Thread Christophe Leroy
gup_huge_pd() is the only user of gup_hugepte() and it is located in the same file. This patch moves gup_huge_pd() after gup_hugepte() and makes gup_hugepte() static. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/pgtable.h | 3 --- arch/powerpc/mm/hugetlbpage.c | 38

[PATCH v1 09/27] powerpc/mm: make hugetlbpage.c depend on CONFIG_HUGETLB_PAGE

2019-03-20 Thread Christophe Leroy
The only function in hugetlbpage.c which doesn't depend on CONFIG_HUGETLB_PAGE is gup_hugepte(), and this function is only called from gup_huge_pd() which depends on CONFIG_HUGETLB_PAGE so all the content of hugetlbpage.c depends on CONFIG_HUGETLB_PAGE. This patch modifies Makefile to only

[PATCH v1 08/27] powerpc/mm: move __find_linux_pte() out of hugetlbpage.c

2019-03-20 Thread Christophe Leroy
__find_linux_pte() is the only function in hugetlbpage.c which is compiled in regardless on CONFIG_HUGETLBPAGE This patch moves it in pgtable.c. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/hugetlbpage.c | 103 - arch/powerpc/mm/pgtable.c |

[PATCH v1 07/27] powerpc/book3e: hugetlbpage is only for CONFIG_PPC_FSL_BOOK3E

2019-03-20 Thread Christophe Leroy
As per Kconfig.cputype, only CONFIG_PPC_FSL_BOOK3E gets to select SYS_SUPPORTS_HUGETLBFS so simplify accordingly. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/Makefile | 2 +- arch/powerpc/mm/hugetlbpage-book3e.c | 47 +++- 2 files changed, 20

[PATCH v1 06/27] powerpc/64: only book3s/64 supports CONFIG_PPC_64K_PAGES

2019-03-20 Thread Christophe Leroy
CONFIG_PPC_64K_PAGES cannot be selected by nohash/64 Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig | 1 - arch/powerpc/include/asm/nohash/64/pgalloc.h | 3 --- arch/powerpc/include/asm/nohash/64/pgtable.h | 4 arch/powerpc/include/asm/nohash/64/slice.h

[PATCH v1 05/27] powerpc/mm: drop slice_set_user_psize()

2019-03-20 Thread Christophe Leroy
slice_set_user_psize() is not used anymore, drop it. Fixes: 1753dd183036 ("powerpc/mm/slice: Simplify and optimise slice context initialisation") Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/64/slice.h | 5 - arch/powerpc/include/asm/nohash/64/slice.h | 1 - 2 files

[PATCH v1 02/27] powerpc/mm: don't BUG in add_huge_page_size()

2019-03-20 Thread Christophe Leroy
No reason to BUG() in add_huge_page_size(). Just WARN and reject the add. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/hugetlbpage.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c index

[PATCH v1 00/27] Reduce ifdef mess in hugetlbpage.c and slice.c

2019-03-20 Thread Christophe Leroy
The main purpose of this series is to reduce the amount of #ifdefs in hugetlbpage.c and slice.c At the same time, it does some cleanup by reducing the number of BUG_ON() and dropping unused functions. It also removes 64k pages related code in nohash/64 as 64k pages are can only by selected on

[PATCH v1 01/27] powerpc/mm: Don't BUG() in hugepd_page()

2019-03-20 Thread Christophe Leroy
Don't BUG(), just warn and return NULL. If the NULL value is not handled, it will get catched anyway. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/hugetlb.h | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/hugetlb.h

[PATCH v1 04/27] powerpc/book3e: drop mmu_get_tsize()

2019-03-20 Thread Christophe Leroy
This function is not used anymore, drop it. Fixes: b42279f0165c ("powerpc/mm/nohash: MM_SLICE is only used by book3s 64") Signed-off-by: Christophe Leroy --- arch/powerpc/mm/hugetlbpage-book3e.c | 5 - 1 file changed, 5 deletions(-) diff --git a/arch/powerpc/mm/hugetlbpage-book3e.c

[PATCH v1 03/27] powerpc/mm: don't BUG() in slice_mask_for_size()

2019-03-20 Thread Christophe Leroy
When no mask is found for the page size, WARN() and return NULL instead of BUG()ing. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/slice.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c index

Re: [PATCH] compiler: allow all arches to enable CONFIG_OPTIMIZE_INLINING

2019-03-20 Thread Arnd Bergmann
On Wed, Mar 20, 2019 at 7:21 AM Masahiro Yamada wrote: > > Commit 60a3cdd06394 ("x86: add optimized inlining") introduced > CONFIG_OPTIMIZE_INLINING, but it has been available only for x86. > > The idea is obviously arch-agnostic although we need some code fixups. > This commit moves the config

Re: [PATCH] compiler: allow all arches to enable CONFIG_OPTIMIZE_INLINING

2019-03-20 Thread Arnd Bergmann
On Wed, Mar 20, 2019 at 7:41 AM Masahiro Yamada wrote: > It is unclear to me how to fix it. > That's why I ended up with "depends on !MIPS". > > > MODPOST vmlinux.o > arch/mips/mm/sc-mips.o: In function `mips_sc_prefetch_enable.part.2': > sc-mips.c:(.text+0x98): undefined reference to

[PATCH v4 11/17] KVM: introduce a 'mmap' method for KVM devices

2019-03-20 Thread Cédric Le Goater
Some KVM devices will want to handle special mappings related to the underlying HW. For instance, the XIVE interrupt controller of the POWER9 processor has MMIO pages for thread interrupt management and for interrupt source control that need to be exposed to the guest when the OS has the required

[PATCH v4 13/17] KVM: PPC: Book3S HV: XIVE: add a mapping for the source ESB pages

2019-03-20 Thread Cédric Le Goater
Each source is associated with an Event State Buffer (ESB) with a even/odd pair of pages which provides commands to manage the source: to trigger, to EOI, to turn off the source for instance. The custom VM fault handler will deduce the guest IRQ number from the offset of the fault, and the ESB

[PATCH v4 10/17] KVM: PPC: Book3S HV: XIVE: add get/set accessors for the VP XIVE state

2019-03-20 Thread Cédric Le Goater
The state of the thread interrupt management registers needs to be collected for migration. These registers are cached under the 'xive_saved_state.w01' field of the VCPU when the VPCU context is pulled from the HW thread. An OPAL call retrieves the backup of the IPB register in the underlying XIVE

[PATCH v4 12/17] KVM: PPC: Book3S HV: XIVE: add a TIMA mapping

2019-03-20 Thread Cédric Le Goater
Each thread has an associated Thread Interrupt Management context composed of a set of registers. These registers let the thread handle priority management and interrupt acknowledgment. The most important are : - Interrupt Pending Buffer (IPB) - Current Processor Priority (CPPR)

[PATCH v4 15/17] KVM: PPC: Book3S HV: XIVE: activate XIVE exploitation mode

2019-03-20 Thread Cédric Le Goater
Full support for the XIVE native exploitation mode is now available, advertise the capability KVM_CAP_PPC_IRQ_XIVE for guests running on PowerNV KVM Hypervisors only. Support for nested guests (pseries KVM Hypervisor) is not yet available. XIVE should also have been activated which is default

[PATCH v4 05/17] KVM: PPC: Book3S HV: XIVE: add a control to configure a source

2019-03-20 Thread Cédric Le Goater
This control will be used by the H_INT_SET_SOURCE_CONFIG hcall from QEMU to configure the target of a source and also to restore the configuration of a source when migrating the VM. The XIVE source interrupt structure is extended with the value of the Effective Interrupt Source Number. The EISN

[PATCH v4 09/17] KVM: PPC: Book3S HV: XIVE: add a control to dirty the XIVE EQ pages

2019-03-20 Thread Cédric Le Goater
When migration of a VM is initiated, a first copy of the RAM is transferred to the destination before the VM is stopped, but there is no guarantee that the EQ pages in which the event notifications are queued have not been modified. To make sure migration will capture a consistent memory state,

Re: [PATCH] crypto: vmx - fix copy-paste error in CTR mode

2019-03-20 Thread Ondrej Mosnáček
Hi Daniel, pi 15. 3. 2019 o 3:09 Daniel Axtens napísal(a): > The original assembly imported from OpenSSL has two copy-paste > errors in handling CTR mode. When dealing with a 2 or 3 block tail, > the code branches to the CBC decryption exit path, rather than to > the CTR exit path. > > This

[PATCH v4 17/17] KVM: PPC: Book3S HV: XIVE: clear the vCPU interrupt presenters

2019-03-20 Thread Cédric Le Goater
When the VM boots, the CAS negotiation process determines which interrupt mode to use and invokes a machine reset. At that time, the previous KVM interrupt device is 'destroyed' before the chosen one is created. Upon destruction, the vCPU interrupt presenters using the KVM device should be cleared

[PATCH v4 16/17] KVM: introduce a KVM_DESTROY_DEVICE ioctl

2019-03-20 Thread Cédric Le Goater
The 'destroy' method is currently used to destroy all devices when the VM is destroyed after the vCPUs have been freed. This new KVM ioctl exposes the same KVM device method. It acts as a software reset of the VM to 'destroy' selected devices when necessary and perform the required cleanups on

[PATCH v4 14/17] KVM: PPC: Book3S HV: XIVE: add passthrough support

2019-03-20 Thread Cédric Le Goater
The KVM XICS-over-XIVE device and the proposed KVM XIVE native device implement an IRQ space for the guest using the generic IPI interrupts of the XIVE IC controller. These interrupts are allocated at the OPAL level and "mapped" into the guest IRQ number space in the range 0-0x1FFF. Interrupt

[PATCH v4 08/17] KVM: PPC: Book3S HV: XIVE: add a control to sync the sources

2019-03-20 Thread Cédric Le Goater
This control will be used by the H_INT_SYNC hcall from QEMU to flush event notifications on the XIVE IC owning the source. Signed-off-by: Cédric Le Goater Reviewed-by: David Gibson --- Changes since v2 : - fixed locking on source block arch/powerpc/include/uapi/asm/kvm.h| 1 +

[PATCH v4 07/17] KVM: PPC: Book3S HV: XIVE: add a global reset control

2019-03-20 Thread Cédric Le Goater
This control is to be used by the H_INT_RESET hcall from QEMU. Its purpose is to clear all configuration of the sources and EQs. This is necessary in case of a kexec (for a kdump kernel for instance) to make sure that no remaining configuration is left from the previous boot setup so that the new

[PATCH v4 06/17] KVM: PPC: Book3S HV: XIVE: add controls for the EQ configuration

2019-03-20 Thread Cédric Le Goater
These controls will be used by the H_INT_SET_QUEUE_CONFIG and H_INT_GET_QUEUE_CONFIG hcalls from QEMU to configure the underlying Event Queue in the XIVE IC. They will also be used to restore the configuration of the XIVE EQs and to capture the internal run-time state of the EQs. Both 'get' and

[PATCH v4 04/17] KVM: PPC: Book3S HV: XIVE: add a control to initialize a source

2019-03-20 Thread Cédric Le Goater
The XIVE KVM device maintains a list of interrupt sources for the VM which are allocated in the pool of generic interrupts (IPIs) of the main XIVE IC controller. These are used for the CPU IPIs as well as for virtual device interrupts. The IRQ number space is defined by QEMU. The XIVE device

[PATCH v4 03/17] KVM: PPC: Book3S HV: XIVE: introduce a new capability KVM_CAP_PPC_IRQ_XIVE

2019-03-20 Thread Cédric Le Goater
The user interface exposes a new capability KVM_CAP_PPC_IRQ_XIVE to let QEMU connect the vCPU presenters to the XIVE KVM device if required. The capability is not advertised for now as the full support for the XIVE native exploitation mode is not yet available. When this is case, the capability

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

2019-03-20 Thread Cédric Le Goater
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, only available when running on a L0 hypervisor. Support for nested guests is not available yet. The XIVE device reuses the device

[PATCH v4 01/17] powerpc/xive: add OPAL extensions for the XIVE native exploitation support

2019-03-20 Thread Cédric Le Goater
The support for XIVE native exploitation mode in Linux/KVM needs a couple more OPAL calls to get and set the state of the XIVE internal structures being used by a sPAPR guest. Signed-off-by: Cédric Le Goater Reviewed-by: David Gibson --- Changes since v3: - rebased on 5.1-rc1 Changes

[PATCH v4 00/17] KVM: PPC: Book3S HV: add XIVE native exploitation mode

2019-03-20 Thread Cédric Le Goater
Hello, On the POWER9 processor, the XIVE interrupt controller can control interrupt sources using MMIOs to trigger events, to EOI or to turn off the sources. Priority management and interrupt acknowledgment is also controlled by MMIO in the CPU presenter sub-engine. PowerNV/baremetal Linux runs

Re: [PATCH 2/2] mm/dax: Don't enable huge dax mapping by default

2019-03-20 Thread Aneesh Kumar K.V
Dan Williams writes: > >> Now what will be page size used for mapping vmemmap? > > That's up to the architecture's vmemmap_populate() implementation. > >> Architectures >> possibly will use PMD_SIZE mapping if supported for vmemmap. Now a >> device-dax with struct page in the device will have

Re: [PATCH 2/2] mm/dax: Don't enable huge dax mapping by default

2019-03-20 Thread Aneesh Kumar K.V
Aneesh Kumar K.V writes: > Dan Williams writes: > >> >>> Now what will be page size used for mapping vmemmap? >> >> That's up to the architecture's vmemmap_populate() implementation. >> >>> Architectures >>> possibly will use PMD_SIZE mapping if supported for vmemmap. Now a >>> device-dax with

[PATCH 3/3] powerpc/mm: print hash info in a helper

2019-03-20 Thread Christophe Leroy
Reduce #ifdef mess by defining a helper to print hash info at startup. In the meantime, remove the display of hash table address to reduce leak of non necessary information. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/setup-common.c | 19 +--

  1   2   >