Re: [PATCH V2 02/11] powerpc/mm/slice: when computing slice mask limit lowe slice max addr correctly

2017-03-16 Thread Aneesh Kumar K.V
Paul Mackerras writes: > On Thu, Mar 16, 2017 at 04:02:00PM +0530, Aneesh Kumar K.V wrote: >> For low slice max addr should be less that 4G > than > > A more verbose explanation of the off-by-1 error that you are fixing > is needed here. Tell us what

Re: [PATCH] powerpc/pasemi, cbe: Do not process decremeter or external wakeup from powersave

2017-03-16 Thread Michael Ellerman
Michael Ellerman writes: > Nicholas Piggin writes: > >> Hi, >> >> I would like to start using a dedicated stack for system reset interrupt >> and treat it as a Linux nmi, which makes it tricky to call complex >> interrupt handlers directly from the system reset trap handler. >> >> So I would lik

Re: [PATCH 8/8] powerpc/64s: idle POWER8 avoid full state loss recovery when possible

2017-03-16 Thread Nicholas Piggin
On Thu, 16 Mar 2017 21:42:01 +0530 Gautham R Shenoy wrote: Hey, thanks for the review. > Hi Nick, > > On Tue, Mar 14, 2017 at 07:23:49PM +1000, Nicholas Piggin wrote: > > If not all threads were in winkle, full state loss recovery is not > > necessary and can be avoided. A previous patch remove

Re: [PATCH 4/8] powerpc/64s: fix POWER9 machine check handler from stop state

2017-03-16 Thread Nicholas Piggin
On Fri, 17 Mar 2017 12:49:27 +1000 Nicholas Piggin wrote: > On Thu, 16 Mar 2017 18:10:48 +0530 > Mahesh Jagannath Salgaonkar wrote: > > > On 03/14/2017 02:53 PM, Nicholas Piggin wrote: > > Looks like we are not winding up.. Shouldn't we ? What if we may end up > > in pnv_wakeup_noloss() whic

[PATCH] powerpc/64s: fix idle wakeup potential to clobber registers

2017-03-16 Thread Nicholas Piggin
We concluded there may be a window where the idle wakeup code could get to pnv_wakeup_tb_loss (which clobbers non-volatile GPRs), but the hardware may set SRR1[46:47] to 01b (no state loss) which would result in the wakeup code failing to restore non-volatile GPRs. I was not able to trigger this c

[PATCH kernel v10 00/10] powerpc/kvm/vfio: Enable in-kernel acceleration

2017-03-16 Thread Alexey Kardashevskiy
This is my current queue of patches to add acceleration of TCE updates in KVM. This is based on Linus'es tree sha1 d528ae0d3dfe. Please comment. Thanks. Changes: v10: * fixed bugs in 10/10 * fixed 04/10 to avoid iommu_table get/put race in 10/10 v9: * renamed few exported symbols in 04/10 * ref

[PATCH kernel v10 10/10] KVM: PPC: VFIO: Add in-kernel acceleration for VFIO

2017-03-16 Thread Alexey Kardashevskiy
This allows the host kernel to handle H_PUT_TCE, H_PUT_TCE_INDIRECT and H_STUFF_TCE requests targeted an IOMMU TCE table used for VFIO without passing them to user space which saves time on switching to user space and back. This adds H_PUT_TCE/H_PUT_TCE_INDIRECT/H_STUFF_TCE handlers to KVM. KVM tr

[PATCH kernel v10 09/10] KVM: PPC: iommu: Unify TCE checking

2017-03-16 Thread Alexey Kardashevskiy
This reworks helpers for checking TCE update parameters in way they can be used in KVM. This should cause no behavioral change. Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson --- Changes: v6: * s/tce/gpa/ as TCE without permission bits is a GPA and this is what is passed everywhe

[PATCH kernel v10 08/10] KVM: PPC: Use preregistered memory API to access TCE list

2017-03-16 Thread Alexey Kardashevskiy
VFIO on sPAPR already implements guest memory pre-registration when the entire guest RAM gets pinned. This can be used to translate the physical address of a guest page containing the TCE list from H_PUT_TCE_INDIRECT. This makes use of the pre-registrered memory API to access TCE list pages in ord

[PATCH kernel v10 07/10] KVM: PPC: Pass kvm* to kvmppc_find_table()

2017-03-16 Thread Alexey Kardashevskiy
The guest view TCE tables are per KVM anyway (not per VCPU) so pass kvm* there. This will be used in the following patches where we will be attaching VFIO containers to LIOBNs via ioctl() to KVM (rather than to VCPU). Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson --- arch/powerp

[PATCH kernel v10 06/10] KVM: PPC: Enable IOMMU_API for KVM_BOOK3S_64 permanently

2017-03-16 Thread Alexey Kardashevskiy
It does not make much sense to have KVM in book3s-64 and not to have IOMMU bits for PCI pass through support as it costs little and allows VFIO to function on book3s KVM. Having IOMMU_API always enabled makes it unnecessary to have a lot of "#ifdef IOMMU_API" in arch/powerpc/kvm/book3s_64_vio*. Wi

[PATCH kernel v10 05/10] KVM: PPC: Reserve KVM_CAP_SPAPR_TCE_VFIO capability number

2017-03-16 Thread Alexey Kardashevskiy
This adds a capability number for in-kernel support for VFIO on SPAPR platform. The capability will tell the user space whether in-kernel handlers of H_PUT_TCE can handle VFIO-targeted requests or not. If not, the user space must not attempt allocating a TCE table in the host kernel via the KVM_CR

[PATCH kernel v10 04/10] powerpc/vfio_spapr_tce: Add reference counting to iommu_table

2017-03-16 Thread Alexey Kardashevskiy
So far iommu_table obejcts were only used in virtual mode and had a single owner. We are going to change this by implementing in-kernel acceleration of DMA mapping requests. The proposed acceleration will handle requests in real mode and KVM will keep references to tables. This adds a kref to iomm

[PATCH kernel v10 03/10] powerpc/iommu/vfio_spapr_tce: Cleanup iommu_table disposal

2017-03-16 Thread Alexey Kardashevskiy
At the moment iommu_table can be disposed by either calling iommu_table_free() directly or it_ops::free(); the only implementation of free() is in IODA2 - pnv_ioda2_table_free() - and it calls iommu_table_free() anyway. As we are going to have reference counting on tables, we need an unified way o

[PATCH kernel v10 02/10] powerpc/powernv/iommu: Add real mode version of iommu_table_ops::exchange()

2017-03-16 Thread Alexey Kardashevskiy
In real mode, TCE tables are invalidated using special cache-inhibited store instructions which are not available in virtual mode This defines and implements exchange_rm() callback. This does not define set_rm/clear_rm/flush_rm callbacks as there is no user for those - exchange/exchange_rm are onl

[PATCH kernel v10 01/10] powerpc/mmu: Add real mode support for IOMMU preregistered memory

2017-03-16 Thread Alexey Kardashevskiy
This makes mm_iommu_lookup() able to work in realmode by replacing list_for_each_entry_rcu() (which can do debug stuff which can fail in real mode) with list_for_each_entry_lockless(). This adds realmode version of mm_iommu_ua_to_hpa() which adds explicit vmalloc'd-to-linear address conversion. Un

Re: [PATCH] tty: hvc: don't allocate a buffer for console print on stack

2017-03-16 Thread Greg Kroah-Hartman
On Fri, Feb 17, 2017 at 11:42:45PM +0300, Jan Dakinevich wrote: > The buffer is used by virtio console driver as DMA buffer. Since v4.9 > (if VMAP_STACK is enabled) we shouldn't use the stack for DMA. You shouldn't use 'static' data either, that's not always guaranteed to be DMA-able, right? > >

Re: [PATCH] powerpc/pseries: Don't give a warning when HPT resizing isn't available

2017-03-16 Thread Michael Ellerman
David Gibson writes: > As of 438cc81a41 "powerpc/pseries: Automatically resize HPT for memory hot > add/remove" when running on the pseries platform, we always attempt to > use the PAPR extension to resize the hashed page table (HPT) when we add > or remove memory. > > This is fine, but when the

Re: [PATCH 1/3] cxl: Re-factor cxl_pci_afu_read_err_buffer()

2017-03-16 Thread Andrew Donnellan
On 14/03/17 15:06, Vaibhav Jain wrote: This patch moves,renames and re-factors the function afu_pci_afu_err_buffer(). The function is now moved to native.c from pci.c and renamed as native_afu_read_err_buffer(). Also the ability of copying data from h/w enforcing 4/8 byte aligned access is usefu

Re: [PATCH V2 09/11] powerpc/mm: Lower the max real address to 51 bits

2017-03-16 Thread Aneesh Kumar K.V
On Friday 17 March 2017 02:56 AM, Benjamin Herrenschmidt wrote: On Thu, 2017-03-16 at 16:02 +0530, Aneesh Kumar K.V wrote: Max value supported by hardware is 51 bits address. Radix page table define a slot of 57 bits for future expansion. We restrict the value supported in linux kernel 51 bits

Re: [PATCH V2 11/11] powerpc/mm: Move hash specific pte bits to be top bits of RPN

2017-03-16 Thread Aneesh Kumar K.V
On Friday 17 March 2017 04:04 AM, Paul Mackerras wrote: On Thu, Mar 16, 2017 at 04:02:09PM +0530, Aneesh Kumar K.V wrote: . /* pte contains a translation */ + +/* + * Top and bottom bits of RPN which can be used by hash + * translation mode, because we expect them to be zero + * otherw

[PATCH v3 07/10] VAS: Define vas_rx_win_open() interface

2017-03-16 Thread Sukadev Bhattiprolu
Define the vas_rx_win_open() interface. This interface is intended to be used by the Nest Accelerator (NX) driver(s) to setup receive windows for one or more NX engines (which implement compression/encryption algorithms in the hardware). Follow-on patches will provide an interface to close the win

[PATCH v3 09/10] VAS: Define vas_tx_win_open()

2017-03-16 Thread Sukadev Bhattiprolu
Define an interface to open a VAS send window. This interface is intended to be used the Nest Accelerator (NX) driver(s) to open a send window and use it to submit compression/encryption requests to a VAS receive window. The receive window, identified by the [node, chip, cop] parameters, must alre

[PATCH v3 08/10] VAS: Define vas_win_close() interface

2017-03-16 Thread Sukadev Bhattiprolu
Define the vas_win_close() interface which should be used to close a send or receive windows. While the hardware configurations required to open send and receive windows differ, the configuration to close a window is the same for both. So we use a single interface to close the window. Signed-off-

[PATCH v3 10/10] VAS: Define copy/paste interfaces

2017-03-16 Thread Sukadev Bhattiprolu
Define interfaces (wrappers) to the 'copy' and 'paste' instructions (which are new in PowerISA 3.0). These are intended to be used to by NX driver(s) to submit Coprocessor Request Blocks (CRBs) to the NX hardware engines. Signed-off-by: Sukadev Bhattiprolu --- Changelog[v3] - Map raw CR

[PATCH v3 05/10] VAS: Define helpers to init window context

2017-03-16 Thread Sukadev Bhattiprolu
Define helpers to initialize window context registers of the VAS hardware. These will be used in follow-on patches when opening/closing VAS windows. Signed-off-by: Sukadev Bhattiprolu --- Changelog[v3] - Have caller, rather than init_xlate_regs() reset window regs so we don't re

[PATCH v3 06/10] VAS: Define helpers to alloc/free windows

2017-03-16 Thread Sukadev Bhattiprolu
Define helpers to allocate/free VAS window objects. These will be used in follow-on patches when opening/closing windows. Signed-off-by: Sukadev Bhattiprolu --- drivers/misc/vas/vas-window.c | 74 +-- 1 file changed, 72 insertions(+), 2 deletions(-) diff

[PATCH v3 01/10] VAS: Define macros, register fields and structures

2017-03-16 Thread Sukadev Bhattiprolu
Define macros for the VAS hardware registers and bit-fields as well as couple of data structures needed by the VAS driver. Signed-off-by: Sukadev Bhattiprolu --- Changelog[v3] - Rename winctx->pid to winctx->pidr to reflect that its a value from the PID register (SPRN_PID), not

[PATCH v3 03/10] VAS: Define vas_init() and vas_exit()

2017-03-16 Thread Sukadev Bhattiprolu
Implement vas_init() and vas_exit() functions for a new VAS module. This VAS module is essentially a library for other device drivers and kernel users of the NX coprocessors like NX-842 and NX-GZIP. Signed-off-by: Sukadev Bhattiprolu --- Changelog[v3]: - Zero vas_instances memory on alloc

[PATCH v3 04/10] VAS: Define helpers for access MMIO regions

2017-03-16 Thread Sukadev Bhattiprolu
Define some helper functions to access the MMIO regions. We use these in a follow-on patches to read/write VAS hardware registers. These helpers are also used to later issue 'paste' instructions to submit requests to the NX hardware engines. Signed-off-by: Sukadev Bhattiprolu --- Changelog [v3]:

[PATCH v3 02/10] Move GET_FIELD/SET_FIELD to vas.h

2017-03-16 Thread Sukadev Bhattiprolu
Move the GET_FIELD and SET_FIELD macros to vas.h as VAS and other users of VAS, including NX-842 can use those macros. There is a lot of related code between the VAS/NX kernel drivers and skiboot. For consistency switch the order of parameters in SET_FIELD to match the order in skiboot. Signed-of

[PATCH v3 00/10] Enable VAS

2017-03-16 Thread Sukadev Bhattiprolu
Power9 introduces a hardware subsystem referred to as the Virtual Accelerator Switchboard (VAS). VAS allows kernel subsystems and user space processes to directly access the Nest Accelerator (NX) engines which implement compression and encryption algorithms in the hardware. NX has been in Power pr

Re: [PATCH 4/8] powerpc/64s: fix POWER9 machine check handler from stop state

2017-03-16 Thread Nicholas Piggin
On Thu, 16 Mar 2017 18:10:48 +0530 Mahesh Jagannath Salgaonkar wrote: > On 03/14/2017 02:53 PM, Nicholas Piggin wrote: > > The ISA specifies power save wakeup can cause a machine check interrupt. > > The machine check handler currently has code to handle that for POWER8, > > but POWER9 crashes wh

Re: [PATCH kernel v9 10/10] KVM: PPC: VFIO: Add in-kernel acceleration for VFIO

2017-03-16 Thread Alexey Kardashevskiy
Thanks for the quick review, there is one comment below. On 17/03/17 03:51, Alex Williamson wrote: > On Thu, 16 Mar 2017 18:09:32 +1100 > Alexey Kardashevskiy wrote: > >> This allows the host kernel to handle H_PUT_TCE, H_PUT_TCE_INDIRECT >> and H_STUFF_TCE requests targeted an IOMMU TCE table u

Re: [PATCH] kernfs: Check KERNFS_HAS_RELEASE before calling kernfs_release_file()

2017-03-16 Thread Greg Kroah-Hartman
On Thu, Mar 16, 2017 at 05:14:30PM -0400, Tejun Heo wrote: > Hello, Greg. > > On Tue, Mar 14, 2017 at 11:08:29AM +0800, Greg Kroah-Hartman wrote: > > Tejun, want to take this through your tree, or at the least, give me an > > ack for this? > > Just acked. I think going through your tree is bette

Re: [Patch v5] powerpc/powernv: add hdat attribute to sysfs

2017-03-16 Thread Oliver O'Halloran
On Thu, Mar 2, 2017 at 4:44 PM, Matt Brown wrote: > The HDAT data area is consumed by skiboot and turned into a device-tree. > In some cases we would like to look directly at the HDAT, so this patch > adds a sysfs node to allow it to be viewed. This is not possible through > /dev/mem as it is res

[PATCH] powerpc/pseries: Don't give a warning when HPT resizing isn't available

2017-03-16 Thread David Gibson
As of 438cc81a41 "powerpc/pseries: Automatically resize HPT for memory hot add/remove" when running on the pseries platform, we always attempt to use the PAPR extension to resize the hashed page table (HPT) when we add or remove memory. This is fine, but when the extension is available we'll give

Re: [RFC PATCH 00/13] Introduce first class virtual address spaces

2017-03-16 Thread Till Smejkal
On Thu, 16 Mar 2017, Thomas Gleixner wrote: > Why do we need yet another mechanism to represent something which looks > like a file instead of simply using existing mechanisms and extend them? You are right. I also recognized during the discussion with Andy, Chris, Matthew, Luck, Rich and the oth

Re: [RFC PATCH 00/13] Introduce first class virtual address spaces

2017-03-16 Thread Till Smejkal
On Thu, 16 Mar 2017, Thomas Gleixner wrote: > On Thu, 16 Mar 2017, Till Smejkal wrote: > > On Thu, 16 Mar 2017, Thomas Gleixner wrote: > > > Why do we need yet another mechanism to represent something which looks > > > like a file instead of simply using existing mechanisms and extend them? > > >

Re: [RFC PATCH 00/13] Introduce first class virtual address spaces

2017-03-16 Thread Thomas Gleixner
On Thu, 16 Mar 2017, Till Smejkal wrote: > On Thu, 16 Mar 2017, Thomas Gleixner wrote: > > Why do we need yet another mechanism to represent something which looks > > like a file instead of simply using existing mechanisms and extend them? > > You are right. I also recognized during the discussion

Re: [RFC PATCH 00/13] Introduce first class virtual address spaces

2017-03-16 Thread Thomas Gleixner
On Wed, 15 Mar 2017, Till Smejkal wrote: > On Wed, 15 Mar 2017, Andy Lutomirski wrote: > > > VAS segments on the other side would provide a functionality to > > > achieve the same without the need of any mounted filesystem. However, > > > I agree, that this is just a small advantage compared to wh

Re: [RFC PATCH 00/13] Introduce first class virtual address spaces

2017-03-16 Thread Till Smejkal
On Wed, 15 Mar 2017, Luck, Tony wrote: > On Wed, Mar 15, 2017 at 03:02:34PM -0700, Till Smejkal wrote: > > I don't agree here. VAS segments are basically in-memory files that are > > handled by > > the kernel directly without using a file system. Hence, if an application > > uses a VAS > > segmen

Re: [RFC PATCH 00/13] Introduce first class virtual address spaces

2017-03-16 Thread Luck, Tony
On Wed, Mar 15, 2017 at 03:02:34PM -0700, Till Smejkal wrote: > I don't agree here. VAS segments are basically in-memory files that are > handled by > the kernel directly without using a file system. Hence, if an application > uses a VAS > segment to store data the same rules apply as if it uses

Re: [RFC PATCH 00/13] Introduce first class virtual address spaces

2017-03-16 Thread Till Smejkal
On Wed, 15 Mar 2017, Andy Lutomirski wrote: > On Wed, Mar 15, 2017 at 12:44 PM, Till Smejkal > wrote: > > On Wed, 15 Mar 2017, Andy Lutomirski wrote: > >> > One advantage of VAS segments is that they can be globally queried by > >> > user programs > >> > which means that VAS segments can be share

Re: [PATCH V2 07/11] powerpc/mm: Conditional defines of pte bits are messy

2017-03-16 Thread Paul Mackerras
On Thu, Mar 16, 2017 at 04:02:05PM +0530, Aneesh Kumar K.V wrote: > Signed-off-by: Aneesh Kumar K.V I think it would be better if the subject was something like "Define _PAGE_SOFT_DIRTY unconditionally" and the comment about conditional defines was the patch description. For the code change: Re

Re: [PATCH V2 05/11] powerpc/mm: Add translation mode information in /proc/cpuinfo

2017-03-16 Thread Paul Mackerras
On Thu, Mar 16, 2017 at 04:02:03PM +0530, Aneesh Kumar K.V wrote: > With this we have on powernv and pseries /proc/cpuinfo reporting > > timebase: 51200 > platform: PowerNV > model : 8247-22L > machine : PowerNV 8247-22L > firmware: OPAL > MMU

Re: [PATCH V2 09/11] powerpc/mm: Lower the max real address to 51 bits

2017-03-16 Thread Paul Mackerras
On Thu, Mar 16, 2017 at 04:02:07PM +0530, Aneesh Kumar K.V wrote: > Max value supported by hardware is 51 bits address. Radix page table define > a slot of 57 bits for future expansion. We restrict the value supported in > linux kernel 51 bits, so that we can use the bits between 57-51 for storing

Re: [PATCH V2 03/11] powerpc/mm: Cleanup bits definition between hash and radix.

2017-03-16 Thread Paul Mackerras
On Thu, Mar 16, 2017 at 04:02:01PM +0530, Aneesh Kumar K.V wrote: > Define everything based on bits present in pgtable.h. This will help in easily > identifying overlapping bits between hash/radix. > > No functional change with this patch. > > Signed-off-by: Aneesh Kumar K.V Reviewed-by: Paul M

Re: [PATCH V2 10/11] powerpc/mm/radix: Make max pfn bits a variable

2017-03-16 Thread Paul Mackerras
On Thu, Mar 16, 2017 at 04:02:08PM +0530, Aneesh Kumar K.V wrote: > This makes max pysical address bits a variable so that hash and radix > translation mode can choose what value to use. In this patch we also switch > the > radix translation mode to use 57 bits. This make it resilient to future >

Re: [PATCH V2 02/11] powerpc/mm/slice: when computing slice mask limit lowe slice max addr correctly

2017-03-16 Thread Paul Mackerras
On Thu, Mar 16, 2017 at 04:02:00PM +0530, Aneesh Kumar K.V wrote: > For low slice max addr should be less that 4G than A more verbose explanation of the off-by-1 error that you are fixing is needed here. Tell us what goes wrong with the current code an

Re: [PATCH V2 06/11] powerpc/mm/hugetlb: Filter out hugepage size not supported by page table layout

2017-03-16 Thread Paul Mackerras
On Thu, Mar 16, 2017 at 04:02:04PM +0530, Aneesh Kumar K.V wrote: > Without this if firmware reports 1MB page size support we will crash > trying to use 1MB as hugetlb page size. > > echo 300 > /sys/kernel/mm/hugepages/hugepages-1024kB/nr_hugepages > > kernel BUG at ./arch/powerpc/include/asm/hug

Re: [PATCH V2 04/11] powerpc/mm/radix: rename _PAGE_LARGE to R_PAGE_LARGE

2017-03-16 Thread Paul Mackerras
On Thu, Mar 16, 2017 at 04:02:02PM +0530, Aneesh Kumar K.V wrote: > This bit is only used by radix and it is nice to follow the naming style of > having > bit name start with H_/R_ depending on which translation mode they are used. > > No functional change in this patch. > > Signed-off-by: Anees

Re: [PATCH V2 08/11] powerpc/mm: Express everything based on Radix page table defines

2017-03-16 Thread Paul Mackerras
On Thu, Mar 16, 2017 at 04:02:06PM +0530, Aneesh Kumar K.V wrote: > Signed-off-by: Aneesh Kumar K.V This change seems correct, but of minimal benefit. The subject could be better expressed. How about "Define all PTE bits based on radix definitions" or something like that? "Everything" is a bit

Re: [PATCH V2 11/11] powerpc/mm: Move hash specific pte bits to be top bits of RPN

2017-03-16 Thread Paul Mackerras
On Thu, Mar 16, 2017 at 04:02:09PM +0530, Aneesh Kumar K.V wrote: > We don't support the full 57 bits of physical address and hence can overload > the top bits of RPN as hash specific pte bits. > > Signed-off-by: Aneesh Kumar K.V > --- > arch/powerpc/include/asm/book3s/64/hash.h| 18 ++--

Re: [PATCH V2 01/11] powerpc/mm/nohash: MM_SLICE is only used by book3s 64

2017-03-16 Thread Paul Mackerras
On Thu, Mar 16, 2017 at 04:01:59PM +0530, Aneesh Kumar K.V wrote: > BOOKE code is dead code as per the Kconfig details. So make it simpler > by enabling MM_SLICE only for book3s_64. The changes w.r.t nohash is just > removing deadcode. W.r.t ppc64, 4k without hugetlb will now enable MM_SLICE. > But

Re: [PATCH V2 09/11] powerpc/mm: Lower the max real address to 51 bits

2017-03-16 Thread Benjamin Herrenschmidt
On Thu, 2017-03-16 at 16:02 +0530, Aneesh Kumar K.V wrote: > Max value supported by hardware is 51 bits address. Radix page table define > a slot of 57 bits for future expansion. We restrict the value supported in > linux kernel 51 bits, so that we can use the bits between 57-51 for storing > hash

Re: [PATCH] kernfs: Check KERNFS_HAS_RELEASE before calling kernfs_release_file()

2017-03-16 Thread Tejun Heo
Hello, Greg. On Tue, Mar 14, 2017 at 11:08:29AM +0800, Greg Kroah-Hartman wrote: > Tejun, want to take this through your tree, or at the least, give me an > ack for this? Just acked. I think going through your tree is better for this one. Thanks! -- tejun

Re: [PATCH] kernfs: Check KERNFS_HAS_RELEASE before calling kernfs_release_file()

2017-03-16 Thread Tejun Heo
On Tue, Mar 14, 2017 at 08:17:00AM +0530, Vaibhav Jain wrote: > Recently started seeing a kernel oops when a module tries removing a > memory mapped sysfs bin_attribute. On closer investigation the root > cause seems to be kernfs_release_file() trying to call > kernfs_op.release() callback that's N

[PATCH v2 2/2] powerpc/fadump: update fadump documentation

2017-03-16 Thread Hari Bathini
With the unnecessary restriction to reserve memory for fadump at the top of RAM forgone, update the documentation accordingly. Signed-off-by: Hari Bathini --- Documentation/powerpc/firmware-assisted-dump.txt | 34 +++--- 1 file changed, 17 insertions(+), 17 deletions(-) diff -

[PATCH v2 1/2] powerpc/fadump: reserve memory at an offset closer to bottom of RAM

2017-03-16 Thread Hari Bathini
Currently, the area to preserve boot memory is reserved at the top of RAM. This leaves fadump vulnerable to memory hot-remove operations. As memory for fadump has to be reserved early in the boot process, fadump can't be registered after a memory hot-remove operation. Though this problem can't be e

Re: [PATCH] net: ethernet: fs_enet: Remove useless includes

2017-03-16 Thread David Miller
From: Christophe Leroy Date: Thu, 16 Mar 2017 10:18:04 +0100 (CET) > CONFIG_8xx is being deprecated. Since the includes dependent on > CONFIG_8xx are useless, just drop them. > > Signed-off-by: Christophe Leroy Applied.

Re: [PATCH] isdn: hardware: mISDN: Remove reference to CONFIG_8xx

2017-03-16 Thread David Miller
From: Christophe Leroy Date: Thu, 16 Mar 2017 10:18:02 +0100 (CET) > CONFIG_8xx is deprecated and should soon be removed in favor > of CONFIG_PPC_8xx. > Anyway, hfc_multi_8xx.h only uses 8xx I/O ports which are > linked to the CPM1 communication processor included in the 8xx > rather than the 8xx

RE: [PATCH 08/29] drivers, md: convert mddev.active from atomic_t to refcount_t

2017-03-16 Thread Reshetova, Elena
> On Tue, 2017-03-14 at 12:29 +, Reshetova, Elena wrote: > > > Elena Reshetova writes: > > > > > > > refcount_t type and corresponding API should be > > > > used instead of atomic_t when the variable is used as > > > > a reference counter. This allows to avoid accidental > > > > refcounter ove

Re: [PATCH kernel v9 10/10] KVM: PPC: VFIO: Add in-kernel acceleration for VFIO

2017-03-16 Thread Alex Williamson
On Thu, 16 Mar 2017 18:09:32 +1100 Alexey Kardashevskiy wrote: > This allows the host kernel to handle H_PUT_TCE, H_PUT_TCE_INDIRECT > and H_STUFF_TCE requests targeted an IOMMU TCE table used for VFIO > without passing them to user space which saves time on switching > to user space and back. >

Re: [GIT PULL 0/6] perf/core improvements and fixes

2017-03-16 Thread Ingo Molnar
;perf-core-for-mingo-4.12-20170314' of > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core > (2017-03-15 19:27:27 +0100) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git > tags/perf-

Re: [PATCH 8/8] powerpc/64s: idle POWER8 avoid full state loss recovery when possible

2017-03-16 Thread Gautham R Shenoy
Hi Nick, On Tue, Mar 14, 2017 at 07:23:49PM +1000, Nicholas Piggin wrote: > If not all threads were in winkle, full state loss recovery is not > necessary and can be avoided. A previous patch removed this optimisation > due to some complexity with the implementation. Re-implement it by > counting

[GIT PULL 0/6] perf/core improvements and fixes

2017-03-16 Thread Arnaldo Carvalho de Melo
linux into perf/core (2017-03-15 19:27:27 +0100) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.12-20170316 for you to fetch changes up to 61f35d750683b21e9e3836e309195c79c1daed74: uprobes: Default UPROBES_E

[PATCH 2/6] trace/kprobes: Fix check for kretprobe offset within function entry

2017-03-16 Thread Arnaldo Carvalho de Melo
From: "Naveen N. Rao" perf specifies an offset from _text and since this offset is fed directly into the arch-specific helper, kprobes tracer rejects installation of kretprobes through perf. Fix this by looking up the actual offset from a function for the specified sym+offset. Refactor and reuse

Re: [PATCH 4/8] powerpc/64s: fix POWER9 machine check handler from stop state

2017-03-16 Thread Gautham R Shenoy
Hi, On Thu, Mar 16, 2017 at 11:05:20PM +1000, Nicholas Piggin wrote: > On Thu, 16 Mar 2017 18:10:48 +0530 > Mahesh Jagannath Salgaonkar wrote: > > > On 03/14/2017 02:53 PM, Nicholas Piggin wrote: > > > The ISA specifies power save wakeup can cause a machine check interrupt. > > > The machine che

Re: [PATCH 4/8] powerpc/64s: fix POWER9 machine check handler from stop state

2017-03-16 Thread Nicholas Piggin
On Thu, 16 Mar 2017 18:10:48 +0530 Mahesh Jagannath Salgaonkar wrote: > On 03/14/2017 02:53 PM, Nicholas Piggin wrote: > > The ISA specifies power save wakeup can cause a machine check interrupt. > > The machine check handler currently has code to handle that for POWER8, > > but POWER9 crashes wh

Re: [PATCH 7/8] powerpc/64s: idle do not hold reservation longer than required

2017-03-16 Thread Nicholas Piggin
On Thu, 16 Mar 2017 18:13:28 +0530 Gautham R Shenoy wrote: > Hi Nick, > > On Tue, Mar 14, 2017 at 07:23:48PM +1000, Nicholas Piggin wrote: > > When taking the core idle state lock, grab it immediately like a > > regular lock, rather than adding more tests in there. Holding the lock > > keeps it

Re: [PATCH 1/4] crypto: powerpc - Factor out the core CRC vpmsum algorithm

2017-03-16 Thread Daniel Axtens
> So although this sits in arch/powerpc, it's heavy on the crypto which is > not my area of expertise (to say the least!), so I think it should > probably go via Herbert and the crypto tree? That was my thought as well. Sorry - probably should have put that in the comments somewhere. Regards, Dan

Re: [PATCH 7/8] powerpc/64s: idle do not hold reservation longer than required

2017-03-16 Thread Gautham R Shenoy
Hi Nick, On Tue, Mar 14, 2017 at 07:23:48PM +1000, Nicholas Piggin wrote: > When taking the core idle state lock, grab it immediately like a > regular lock, rather than adding more tests in there. Holding the lock > keeps it stable, so there is no need to do it whole holding the > reservation. I

Re: [PATCH 4/8] powerpc/64s: fix POWER9 machine check handler from stop state

2017-03-16 Thread Mahesh Jagannath Salgaonkar
On 03/14/2017 02:53 PM, Nicholas Piggin wrote: > The ISA specifies power save wakeup can cause a machine check interrupt. > The machine check handler currently has code to handle that for POWER8, > but POWER9 crashes when trying to execute the P8 style sleep > instructions. > > So queue up the mac

Re: [PATCH 5/8] powerpc/64s: use PACA_THREAD_IDLE_STATE only in POWER8

2017-03-16 Thread Nicholas Piggin
On Thu, 16 Mar 2017 17:24:03 +0530 Gautham R Shenoy wrote: > Hi Nick, > > On Tue, Mar 14, 2017 at 07:23:46PM +1000, Nicholas Piggin wrote: > > POWER9 does not use this field, so it should be moved into the POWER8 > > code. Update the documentation in the paca struct too. > > > > Signed-off-by:

Re: [PATCH 6/8] powerpc/64s: idle expand usable core idle state bits

2017-03-16 Thread Gautham R Shenoy
Hi Nick, On Tue, Mar 14, 2017 at 07:23:47PM +1000, Nicholas Piggin wrote: > In preparation for adding more bits to the core idle state word, > move the lock bit up, and unlock by flipping the lock bit rather > than masking off all but the thread bits. > > Add branch hints for atomic operations wh

Re: [PATCH 5/8] powerpc/64s: use PACA_THREAD_IDLE_STATE only in POWER8

2017-03-16 Thread Gautham R Shenoy
Hi Nick, On Tue, Mar 14, 2017 at 07:23:46PM +1000, Nicholas Piggin wrote: > POWER9 does not use this field, so it should be moved into the POWER8 > code. Update the documentation in the paca struct too. > > Signed-off-by: Nicholas Piggin > --- > arch/powerpc/include/asm/paca.h | 12 ++

Re: [PATCH 3/8] powerpc/64s: use alternative feature patching

2017-03-16 Thread Gautham R Shenoy
On Tue, Mar 14, 2017 at 07:23:44PM +1000, Nicholas Piggin wrote: > This reduces the number of nops for POWER8. Nice! > > Signed-off-by: Nicholas Piggin Reviewed-by: Gautham R. Shenoy > --- > arch/powerpc/kernel/idle_book3s.S | 19 --- > 1 file changed, 12 insertions(+), 7 del

Re: [PATCH 2/8] powerpc/64s: stop using bit in HSPRG0 to test winkle

2017-03-16 Thread Gautham R Shenoy
Hi Nick, On Tue, Mar 14, 2017 at 07:23:43PM +1000, Nicholas Piggin wrote: > The POWER8 idle code has a neat trick of programming the power on engine > to restore a low bit into HSPRG0, so idle wakeup code can test and see > if it has been programmed this way and therefore lost all state, and > avo

Re: [PATCH 1/4] crypto: powerpc - Factor out the core CRC vpmsum algorithm

2017-03-16 Thread Anton Blanchard
Hi David, > While not part of this change, the unrolled loops look as though > they just destroy the cpu cache. > I'd like be convinced that anything does CRC over long enough buffers > to make it a gain at all. btrfs data checksumming is one area. > With modern (not that modern now) superscalar

[PATCH updated] powerpc/mm/hash: Skip using reserved virtual address range

2017-03-16 Thread Aneesh Kumar K.V
Now that we use all the available virtual address range, we need to make sure we don't generate VSID such that it overlaps with the reserved vsid range. Reserved vsid range include the virtual address range used by the adjunct partition and also the VRMA virtual segment. We find the context value t

Re: ioctl structs differ from x86_64?

2017-03-16 Thread Michael Ellerman
Harshal Patil writes: > Hello, > I am looking into a bug, https://bugzilla.linux.ibm.com/show_bug.cgi?id=152493 > ( external mirror is at, https://github.com/opencontainers/runc/issues/1364) > Recently in runc code, they added this code > https://github.com/opencontainers/runc/commit/eea28f480db

Re: [PATCH 1/4] crypto: powerpc - Factor out the core CRC vpmsum algorithm

2017-03-16 Thread Michael Ellerman
Daniel Axtens writes: > The core nuts and bolts of the crc32c vpmsum algorithm will > also work for a number of other CRC algorithms with different > polynomials. Factor out the function into a new asm file. > > To handle multiple users of the function, a user simply > provides constants, defines

Re: [PATCH 2/4] crypto: powerpc - Re-enable non-REFLECTed CRCs

2017-03-16 Thread Michael Ellerman
Daniel Axtens writes: > When CRC32c was included in the kernel, Anton ripped out > the #ifdefs around reflected polynomials, because CRC32c > is always reflected. However, not all CRCs use reflection > so we'd like to make it optional. > > Restore the REFLECT parts from Anton's original CRC32 > i

[PATCH V4 10/14] powerpc/mm/hash: Convert mask to unsigned long

2017-03-16 Thread Aneesh Kumar K.V
This doesn't have any functional change. But helps in avoiding mistakes in case the shift bit changes Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/mmu-hash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/book3s/64/mmu-hash.

[PATCH V4 11/14] powerpc/mm/hash: Increase VA range to 128TB

2017-03-16 Thread Aneesh Kumar K.V
We update the hash linux page table layout such that we can support 512TB. But we limit the TASK_SIZE to 128TB. We can switch to 128TB by default without conditional because that is the max virtual address supported by other architectures. We will later add a mechanism to on-demand increase the app

[PATCH V4 14/14] powerpc/mm/hash: Skip using reserved virtual address range

2017-03-16 Thread Aneesh Kumar K.V
Now that we use all the available virtual address range, we need to make sure we don't generate VSID such that it overlaps with the reserved vsid range. Reserved vsid range include the virtual address range used by the adjunct partition and also the VRMA virtual segment. We find the context value t

[PATCH V4 13/14] powerpc/mm/hash64: Store task size in PACA

2017-03-16 Thread Aneesh Kumar K.V
We can optmize the slice page size array copy to paca by copying only the range based on task size. This will require us to not look at page size array beyond task size in PACA on slb fault. To enable that copy task size to paca which will be used during slb fault. We can take slb fault on an mm e

[PATCH V4 12/14] powerpc/mm/slice: Use mm task_size as max value of slice index

2017-03-16 Thread Aneesh Kumar K.V
In the followup patch, we will increase the slice array sice to handle 512TB range, but will limit the task size to 128TB. Avoid doing uncessary computation and avoid doing slice mask related operation above task_size. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/mmu-ha

[PATCH V4 05/14] powerpc/mm/slice: Move slice_mask struct definition to slice.c

2017-03-16 Thread Aneesh Kumar K.V
This structure definition need not be in a header since this is used only by slice.c file. So move it to slice.c. This also allow us to use SLICE_NUM_HIGH instead of 64. I also switch the low_slices type to u64 from u16. This doesn't have an impact on size of struct due to padding added with u16 t

[PATCH V4 09/14] powerpc/mm/hash: VSID 0 is no more an invalid VSID

2017-03-16 Thread Aneesh Kumar K.V
This is now used by linear mapped region of the kernel. User space still should not see a VSID 0. But having that VSID check confuse the reader. Remove the same and convert the error checking to be based on addr value Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/mmu-has

[PATCH V4 04/14] powerpc/mm: Remove redundant TASK_SIZE_USER64 checks

2017-03-16 Thread Aneesh Kumar K.V
The check against VSID range is implied when we check task size against hash and radix pgtable range[1], because we make sure page table range cannot exceed vsid range. [1] BUILD_BUG_ON(TASK_SIZE_USER64 > H_PGTABLE_RANGE); BUILD_BUG_ON(TASK_SIZE_USER64 > RADIX_PGTABLE_RANGE); The check for smalle

[PATCH V4 07/14] powerpc/mm/hash: Move kernel context to the starting of context range

2017-03-16 Thread Aneesh Kumar K.V
With current kernel, we use the top 4 context for the kernel. Kernel VSIDs are built using these top context values and effective segemnt ID. In the following patches, we want to increase the max effective address to 512TB. We achieve that by increasing the effective segments IDs there by increas

[PATCH V4 08/14] powerpc/mm/hash: Support 68 bit VA

2017-03-16 Thread Aneesh Kumar K.V
Inorder to support large effective address range (512TB), we want to increase the virtual address bits to 68. But we do have platforms like p4 and p5 that can only do 65 bit VA. We support those platforms by limiting context bits on them to 16. The protovsid -> vsid conversion is verified to work

[PATCH V4 06/14] powerpc/mm/slice: Update slice mask printing to use bitmap printing.

2017-03-16 Thread Aneesh Kumar K.V
We now get output like below which is much better. [0.935306] good_mask low_slice: 0-15 [0.935360] good_mask high_slice: 0-511 Compared to [0.953414] good_mask: - 1. I also fixed an error with slice_dbg printing. Signed-off-by: Aneesh Kumar K.

[PATCH V4 03/14] powerpc/mm: Move copy_mm_to_paca to paca.c

2017-03-16 Thread Aneesh Kumar K.V
We also update the function arg to struct mm_struct. Move this so that function finds the definition of struct mm_struct. No functional change in this patch. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/paca.h | 18 +- arch/powerpc/kernel/paca.c | 19

[PATCH V4 02/14] powerpc/mm/slice: Update the function prototype

2017-03-16 Thread Aneesh Kumar K.V
This avoid copying the slice_mask struct as function return value Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/slice.c | 62 ++--- 1 file changed, 28 insertions(+), 34 deletions(-) diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c

[PATCH V4 01/14] powerpc/mm/slice: Convert slice_mask high slice to a bitmap

2017-03-16 Thread Aneesh Kumar K.V
In followup patch we want to increase the va range which will result in us requiring high_slices to have more than 64 bits. To enable this convert high_slices to bitmap. We keep the number bits same in this patch and later change that to higher value Signed-off-by: Aneesh Kumar K.V --- arch/powe

[PATCH V4 00/14] powerpc/mm/ppc64: Add 128TB support

2017-03-16 Thread Aneesh Kumar K.V
This patch series increase the effective virtual address range of applications from 64TB to 128TB. We do that by supporting a 68 bit virtual address. On platforms that can only do 65 bit virtual address we limit the max contexts to a 16bit value instead of 19. The patch series also switch the pag

[PATCH V2 11/11] powerpc/mm: Move hash specific pte bits to be top bits of RPN

2017-03-16 Thread Aneesh Kumar K.V
We don't support the full 57 bits of physical address and hence can overload the top bits of RPN as hash specific pte bits. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/hash.h| 18 ++ arch/powerpc/include/asm/book3s/64/pgtable.h | 19

  1   2   >