Re: [1/3] powerpc: Use feature bit for RTC presence rather than timebase presence

2018-03-26 Thread Michael Ellerman
On Mon, 2018-03-19 at 21:46:11 UTC, Paul Mackerras wrote: > All PowerPC CPUs other than the original PPC601 have a timebase > register rather than the "real-time clock" (RTC) register that the > PPC601 (and the original POWER and POWER2 CPUs) had. Currently > we have a CPU feature bit to indicate

Re: [v2, 1/5] powerpc: Add CPU feature bits for TM bug workarounds on POWER9 v2.2

2018-03-26 Thread Michael Ellerman
On Wed, 2018-03-21 at 10:31:59 UTC, Paul Mackerras wrote: > This adds a CPU feature bit which is set for POWER9 "Nimbus" DD2.2 > processors which will be used to enable the hypervisor to assist > hardware with the handling of checkpointed register values while the > CPU is in suspend state, in orde

[PATCH 01/10] powerpc: Add security feature flags for Spectre/Meltdown

2018-03-26 Thread Michael Ellerman
This commit adds security feature flags to reflect the settings we receive from firmware regarding Spectre/Meltdown mitigations. The feature names reflect the names we are given by firmware on bare metal machines. See the hostboot source for details. Arguably these could be firmware features, but

[PATCH 02/10] powerpc/pseries: Add new H_GET_CPU_CHARACTERISTICS flags

2018-03-26 Thread Michael Ellerman
Add some additional values which have been defined for the H_GET_CPU_CHARACTERISTICS hypercall. Signed-off-by: Michael Ellerman --- arch/powerpc/include/asm/hvcall.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h inde

[PATCH 03/10] powerpc/pseries: Set or clear security feature flags

2018-03-26 Thread Michael Ellerman
Now that we have feature flags for security related things, set or clear them based on what we receive from the hypercall. Signed-off-by: Michael Ellerman --- arch/powerpc/platforms/pseries/setup.c | 43 ++ 1 file changed, 43 insertions(+) diff --git a/arch/power

[PATCH 04/10] powerpc/powernv: Set or clear security feature flags

2018-03-26 Thread Michael Ellerman
Now that we have feature flags for security related things, set or clear them based on what we see in the device tree provided by firmware. Signed-off-by: Michael Ellerman --- arch/powerpc/platforms/powernv/setup.c | 56 ++ 1 file changed, 56 insertions(+) diff -

[PATCH 05/10] powerpc/64s: Move cpu_show_meltdown()

2018-03-26 Thread Michael Ellerman
This landed in setup_64.c for no good reason other than we had nowhere else to put it. Now that we have a security-related file, that is a better place for it so move it. Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/security.c | 12 arch/powerpc/kernel/setup_64.c | 8 ---

[PATCH 06/10] powerpc/64s: Enhance the information in cpu_show_meltdown()

2018-03-26 Thread Michael Ellerman
Now that we have the security feature flags we can make the information displayed in the "meltdown" file more informative. Signed-off-by: Michael Ellerman --- arch/powerpc/include/asm/security_features.h | 1 + arch/powerpc/kernel/security.c | 30 ++-- 2 fi

[PATCH 07/10] powerpc/powernv: Use the security flags in pnv_setup_rfi_flush()

2018-03-26 Thread Michael Ellerman
Now that we have the security flags we can significantly simplify the code in pnv_setup_rfi_flush(), because we can use the flags instead of checking device tree properties and because the security flags have pessimistic defaults. Signed-off-by: Michael Ellerman --- arch/powerpc/platforms/powern

[PATCH 08/10] powerpc/pseries: Use the security flags in pseries_setup_rfi_flush()

2018-03-26 Thread Michael Ellerman
Now that we have the security flags we can simplify the code in pseries_setup_rfi_flush() because the security flags have pessimistic defaults. Signed-off-by: Michael Ellerman --- arch/powerpc/platforms/pseries/setup.c | 39 ++ 1 file changed, 16 insertions(+), 23

[PATCH 09/10] powerpc/64s: Wire up cpu_show_spectre_v1()

2018-03-26 Thread Michael Ellerman
Add a definition for cpu_show_spectre_v1() to override the generic version. Currently this just prints "Not affected" or "Vulnerable" based on the firmware flag. Although the kernel does have array_index_nospec() in a few places, we haven't yet audited all the powerpc code to see where it's necess

[PATCH 10/10] powerpc/64s: Wire up cpu_show_spectre_v2()

2018-03-26 Thread Michael Ellerman
Add a definition for cpu_show_spectre_v2() to override the generic version. This has several permuations, though in practice some may not occur we cater for any combination. The most verbose is: Mitigation: Indirect branch serialisation (kernel only), Indirect branch cache disabled, ori31 spe

Re: [PATCH] powerpc: Implement cross-endian emulation of larx and stcx instructions

2018-03-26 Thread Michael Ellerman
Paul Mackerras writes: > diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c > index fb9f58b..0590417 100644 > --- a/arch/powerpc/lib/sstep.c > +++ b/arch/powerpc/lib/sstep.c > @@ -2755,8 +2761,11 @@ int emulate_loadstore(struct pt_regs *regs, struct > instruction_op *op) >

Re: [RFC PATCH v2 0/2] Randomization of address chosen by mmap.

2018-03-26 Thread Michal Hocko
On Fri 23-03-18 20:55:49, Ilya Smith wrote: > > > On 23 Mar 2018, at 15:48, Matthew Wilcox wrote: > > > > On Thu, Mar 22, 2018 at 07:36:36PM +0300, Ilya Smith wrote: > >> Current implementation doesn't randomize address returned by mmap. > >> All the entropy ends with choosing mmap_base_addr at

Re: [PATCH 2/2] smp: introduce kick_active_cpus_sync()

2018-03-26 Thread Andrea Parri
Hi Yury, On Sun, Mar 25, 2018 at 08:50:04PM +0300, Yury Norov wrote: > kick_all_cpus_sync() forces all CPUs to sync caches by sending broadcast IPI. > If CPU is in extended quiescent state (idle task or nohz_full userspace), this > work may be done at the exit of this state. Delaying synchronizati

[PATCH V6 0/4] Add support for 4PB virtual address space on hash

2018-03-26 Thread Aneesh Kumar K.V
This patch series extended the max virtual address space value from 512TB to 4PB with 64K page size. We do that by allocating one vsid context for each 512TB range. More details of that is explained in patch 3. Changes from V5: * Fix for loop segmentation fault. * updates from Michael Changes fro

[PATCH V6 1/4] powerpc/mm/slice: Consolidate return path in slice_get_unmapped_area()

2018-03-26 Thread Aneesh Kumar K.V
In a following patch, on finding a free area we will need to do allocatinon of extra contexts as needed. Consolidating the return path for slice_get_unmapped_area() will make that easier. Split into a separate patch to make review easy. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Elle

[PATCH V6 3/4] powerpc/mm/hash64: Increase the VA range

2018-03-26 Thread Aneesh Kumar K.V
This patch increases the max virtual (effective) address value to 4PB. With 4K page size config we continue to limit ourself to 64TB. Signed-off-by: Aneesh Kumar K.V [mpe: Keep the H_PGTABLE_RANGE test, update it to work] Signed-off-by: Michael Ellerman --- arch/powerpc/include/asm/book3s/64/ha

[PATCH V6 2/4] powerpc/mm: Add support for handling > 512TB address in SLB miss

2018-03-26 Thread Aneesh Kumar K.V
For addresses above 512TB we allocate additional mmu contexts. To make it all easy, addresses above 512TB are handled with IR/DR=1 and with stack frame setup. The mmu_context_t is also updated to track the new extended_ids. To support upto 4PB we need a total 8 contexts. Signed-off-by: Aneesh Kum

[PATCH V6 4/4] powerpc/mm/hash: Don't memset pgd table if not needed

2018-03-26 Thread Aneesh Kumar K.V
We need to zero-out pgd table only if we share the slab cache with pud/pmd level caches. With the support of 4PB, we don't share the slab cache anymore. Instead of removing the code completely hide it within an #ifdef. We don't need to do this with any other page table level, because they all alloc

RE: RFC on writel and writel_relaxed

2018-03-26 Thread David Laight
> > This is a super performance critical operation for most drivers and > > directly impacts network performance. Perhaps there ought to be writel_nobarrier() (etc) that never contain any barriers at all. This might mean that they are always just the memory operation, but it would make it more obv

Re: RFC on writel and writel_relaxed

2018-03-26 Thread Will Deacon
Hi Ben, I don't seem to have the beginning of this thread, so please bounce it over if you'd like me to look at it! On Fri, Mar 23, 2018 at 11:16:08AM +1100, Benjamin Herrenschmidt wrote: > On Thu, 2018-03-22 at 12:51 -0500, Sinan Kaya wrote: > > On 3/22/2018 8:52 AM, Benjamin Herrenschmidt wrote

Re: RFC on writel and writel_relaxed

2018-03-26 Thread okaya
On 2018-03-26 07:44, Will Deacon wrote: Hi Ben, I don't seem to have the beginning of this thread, so please bounce it over if you'd like me to look at it! https://www.spinics.net/lists/linux-rdma/msg62570.html https://www.spinics.net/lists/linux-rdma/index.html#62666 On Fri, Mar 23, 20

Re: [PATCH v6 12/12] ima: Write modsig to the measurement list

2018-03-26 Thread Mimi Zohar
On Fri, 2018-03-16 at 17:38 -0300, Thiago Jung Bauermann wrote: > Define new "d-sig" template field which holds the digest that is expected > to match the one contained in the modsig. > > Also add modsig support to the "sig" template field, allowing the the > contents of the modsig to be included

Re: RFC on writel and writel_relaxed

2018-03-26 Thread Sinan Kaya
On 3/26/2018 8:11 AM, ok...@codeaurora.org wrote: > On 2018-03-26 07:44, Will Deacon wrote: >> Hi Ben, >> >> I don't seem to have the beginning of this thread, so please bounce it over >> if you'd like me to look at it! >> > > https://www.spinics.net/lists/linux-rdma/msg62570.html > > https://www

Re: [PATCH 2/2] smp: introduce kick_active_cpus_sync()

2018-03-26 Thread Paul E. McKenney
On Sun, Mar 25, 2018 at 11:11:54PM +0300, Yury Norov wrote: > On Sun, Mar 25, 2018 at 12:23:28PM -0700, Paul E. McKenney wrote: > > On Sun, Mar 25, 2018 at 08:50:04PM +0300, Yury Norov wrote: > > > kick_all_cpus_sync() forces all CPUs to sync caches by sending broadcast > > > IPI. > > > If CPU is

Re: [PATCH v6 11/12] ima: Implement support for module-style appended signatures

2018-03-26 Thread Mimi Zohar
On Fri, 2018-03-16 at 17:38 -0300, Thiago Jung Bauermann wrote: > This patch actually implements the appraise_type=imasig|modsig option, > allowing IMA to read and verify modsig signatures. > > In case both are present in the same file, IMA will first check whether the > key used by the xattr sign

Re: DMA Mapping Error in ppc64

2018-03-26 Thread Jared Bents
Hi Ben On Sat, Mar 24, 2018 at 3:19 AM, Benjamin Herrenschmidt wrote: > On Fri, 2018-03-23 at 07:41 -0500, Jared Bents wrote: >> Thank you for the advice. Looks like I get to try to rewrite the ath9k and >> ath10k drivers to use dma_alloc_coherent() instead of kmemdup() and >> dev_alloc_skb()

Re: RFC on writel and writel_relaxed

2018-03-26 Thread Arnd Bergmann
On Wed, Mar 21, 2018 at 2:58 PM, Sinan Kaya wrote: > On 3/21/2018 8:53 AM, Sinan Kaya wrote: >> BTW, I have no idea what compiler barrier does on PPC and if >> >> wrltel() == compiler barrier() + wrltel_relaxed() >> >> can be said. > > this should have been > > writel_relaxed() == compiler barrier

Re: [PATCH v6 04/12] ima: Introduce is_ima_sig()

2018-03-26 Thread Mimi Zohar
On Fri, 2018-03-16 at 17:38 -0300, Thiago Jung Bauermann wrote: > With the introduction of another IMA signature type (modsig), some places > will need to check for both of them. It is cleaner to do that if there's a > helper function to tell whether an xattr_value represents an IMA > signature. I

[PATCH -next] powerpc: Fix error return code in ppc4xx_msi_probe()

2018-03-26 Thread Wei Yongjun
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun --- arch/powerpc/platforms/4xx/msi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/4xx/msi.c b/arch/powerpc

[PATCH] powerpc/64s: return more carefully from sreset NMI

2018-03-26 Thread Nicholas Piggin
System Reset, being an NMI, must return more carefully than other interrupts. It has traditionally returned via the nromal return from exception path, but that has a number of problems. - r13 does not get restored if returning to kernel. This is for interrupts which may cause a context switch, w

[PATCH] powerpc/64s: sreset panic if there is no debugger or crash dump handlers

2018-03-26 Thread Nicholas Piggin
system_reset_exception does most of its own crash handling now, invoking the debugger or crash dumps if they are registered. If not, then it goes through to die() to print stack traces, and then is supposed to panic (according to comments). However after die() prints oopses, it does its own handli

[PATCH] powerpc/powernv/nvram: opal_nvram_write handle unknown OPAL errors

2018-03-26 Thread Nicholas Piggin
opal_nvram_write currently just assumes success if it encounters an error other than OPAL_BUSY or OPAL_BUSY_EVENT. Have it return -EIO on other errors instead. Signed-off-by: Nicholas Piggin --- arch/powerpc/platforms/powernv/opal-nvram.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arc

[RFC PATCH] powerpc/xmon: Use OPAL_DEBUG to debug srest in OPAL

2018-03-26 Thread Nicholas Piggin
xmon can be entered via sreset NMI (from a management sreset, or an NMI IPI), which can interrupt OPAL. Add checks to xmon to see if pc or sp are within OPAL memory, and if so, then use OPAL_DEBUG to print the opal stack and return the Linux stack, which can then be dumped by xmon The OPAL side of

Re: RFC on writel and writel_relaxed

2018-03-26 Thread Sinan Kaya
On 3/26/2018 9:43 AM, Arnd Bergmann wrote: > On Wed, Mar 21, 2018 at 2:58 PM, Sinan Kaya wrote: >> On 3/21/2018 8:53 AM, Sinan Kaya wrote: >>> BTW, I have no idea what compiler barrier does on PPC and if >>> >>> wrltel() == compiler barrier() + wrltel_relaxed() >>> >>> can be said. >> >> this shou

[PATCH v3 00/41] cxlflash: OCXL transport support and miscellaneous fixes

2018-03-26 Thread Uma Krishnan
This patch series adds OCXL support to the cxlflash driver. With this support, new devices using the OCXL transport will be supported by the cxlflash driver along with the existing CXL devices. An effort is made to keep this transport specific function independent of the existing core driver that c

[PATCH v3 01/41] cxlflash: Preserve number of interrupts for master contexts

2018-03-26 Thread Uma Krishnan
The number of interrupts requested for user contexts are stored in the context specific structures and utilized to manage the interrupts. For the master contexts, this number is only used once and therefore not saved. To prepare for future commits where the number of interrupts will be required in

[PATCH v3 02/41] cxlflash: Avoid clobbering context control register value

2018-03-26 Thread Uma Krishnan
From: "Matthew R. Ochs" The SISLite specification originally defined the context control register with a single field of bits to represent the LISN and also stipulated that the register reset value be 0. The cxlflash driver took advantage of this when programming the LISN for the master contexts

[PATCH v3 03/41] cxlflash: Add argument identifier names

2018-03-26 Thread Uma Krishnan
Checkpatch throws a warning when the argument identifier names are not included in the function definitions. To avoid these warnings, argument identifiers are added in the existing function definitions. Signed-off-by: Uma Krishnan Acked-by: Matthew R. Ochs --- drivers/scsi/cxlflash/backend.h |

[PATCH v3 04/41] cxlflash: Introduce OCXL backend

2018-03-26 Thread Uma Krishnan
Add initial infrastructure to support a new cxlflash transport, OCXL. Claim a dependency on OCXL and add a new file, ocxl_hw.c, which will host the backend routines that are specific to OCXL. Signed-off-by: Uma Krishnan Acked-by: Matthew R. Ochs Reviewed-by: Andrew Donnellan --- drivers/scsi/

[PATCH v3 05/41] cxlflash: Hardware AFU for OCXL

2018-03-26 Thread Uma Krishnan
When an adapter is initialized, transport specific configuration and MMIO mapping details need to be saved. For CXL, this data is managed by the underlying kernel module. To maintain a separation between the cxlflash core and underlying transports, introduce a new structure to store data specific t

[PATCH v3 06/41] cxlflash: Read host function configuration

2018-03-26 Thread Uma Krishnan
Per the OCXL specification, the underlying host can have multiple AFUs per function with each function supporting its own configuration. The host function configuration is read on the initialization path to evaluate the number of functions present and identify the features and configuration of the

[PATCH v3 07/41] cxlflash: Setup function acTag range

2018-03-26 Thread Uma Krishnan
The OCXL specification supports distributing acTags amongst different AFUs and functions on the link. The platform-specific acTag range for the link is obtained using the OCXL provider services and then assigned to the host function based on implementation. Signed-off-by: Uma Krishnan Acked-by: M

[PATCH v3 08/41] cxlflash: Read host AFU configuration

2018-03-26 Thread Uma Krishnan
The host AFU configuration is read on the initialization path to identify the features and configuration of the AFU. This data is cached for use in later configuration steps. Signed-off-by: Uma Krishnan Acked-by: Matthew R. Ochs Reviewed-by: Andrew Donnellan Reviewed-by: Frederic Barrat --- d

[PATCH v3 09/41] cxlflash: Setup AFU acTag range

2018-03-26 Thread Uma Krishnan
The OCXL specification supports distributing acTags amongst different AFUs and functions on the link. As cxlflash devices are expected to only support a single AFU per function, the entire range that was assigned to the function is also assigned to the AFU. Signed-off-by: Uma Krishnan Acked-by: M

[PATCH v3 10/41] cxlflash: Setup AFU PASID

2018-03-26 Thread Uma Krishnan
Per the OCXL specification, the maximum PASID supported by the AFU is indicated by a field within the configuration space. Similar to acTags, implementations can choose to use any sub-range of PASID within their assigned range. For cxlflash, the entire range is used. Signed-off-by: Uma Krishnan A

[PATCH v3 11/41] cxlflash: Adapter context support for OCXL

2018-03-26 Thread Uma Krishnan
Add support to create and release the adapter contexts for OCXL and provide means to specify certain contexts as a master. The existing cxlflash core has a design requirement that each host will have a single host context available by default. To satisfy this requirement, one host adapter context

[PATCH v3 12/41] cxlflash: Use IDR to manage adapter contexts

2018-03-26 Thread Uma Krishnan
A range of PASIDs are used as identifiers for the adapter contexts. These contexts may be destroyed and created randomly. Use an IDR to keep track of contexts that are in use and assign a unique identifier to new ones. Signed-off-by: Uma Krishnan Acked-by: Matthew R. Ochs --- drivers/scsi/cxlfl

[PATCH v3 13/41] cxlflash: Support adapter file descriptors for OCXL

2018-03-26 Thread Uma Krishnan
Allocate a file descriptor for an adapter context when requested. In order to allocate inodes for the file descriptors, a pseudo filesystem is created and used. Signed-off-by: Uma Krishnan Acked-by: Matthew R. Ochs --- drivers/scsi/cxlflash/ocxl_hw.c | 200 ++

[PATCH v3 14/41] cxlflash: Support adapter context discovery

2018-03-26 Thread Uma Krishnan
Provide means to obtain the process element of an adapter context as well as locate an adapter context by file. Signed-off-by: Uma Krishnan Acked-by: Matthew R. Ochs --- drivers/scsi/cxlflash/ocxl_hw.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/drivers/scsi/

[PATCH v3 15/41] cxlflash: Support image reload policy modification

2018-03-26 Thread Uma Krishnan
On a PERST, the AFU image can be reloaded or left intact. Provide means to set this image reload policy. Signed-off-by: Uma Krishnan Acked-by: Matthew R. Ochs --- drivers/scsi/cxlflash/ocxl_hw.c | 13 + drivers/scsi/cxlflash/ocxl_hw.h | 1 + 2 files changed, 14 insertions(+) diff

[PATCH v3 16/41] cxlflash: MMIO map the AFU

2018-03-26 Thread Uma Krishnan
When the AFU is configured, the global and per process MMIO regions are presented by the configuration space. Save these regions and map the global MMIO region that is used to access all of the control and provisioning data in the AFU. Signed-off-by: Uma Krishnan Acked-by: Matthew R. Ochs Review

[PATCH v3 17/41] cxlflash: Support starting an adapter context

2018-03-26 Thread Uma Krishnan
Once the adapter context is created, it needs to be started by assigning the MMIO space for the context and by enabling the process element in the link. This commit adds the skeleton for starting the context and assigns the context specific MMIO space. Master contexts have access to the global MMIO

[PATCH v3 18/41] cxlflash: Support process specific mappings

2018-03-26 Thread Uma Krishnan
Once the context is started, the assigned MMIO space can be mapped and unmapped. Provide means to map and unmap the context MMIO space. Signed-off-by: Uma Krishnan Acked-by: Matthew R. Ochs --- drivers/scsi/cxlflash/ocxl_hw.c | 24 1 file changed, 24 insertions(+) diff

[PATCH v3 19/41] cxlflash: Support AFU state toggling

2018-03-26 Thread Uma Krishnan
The AFU should be enabled following a successful configuration and disabled near the end of the cleanup path. Signed-off-by: Uma Krishnan Acked-by: Matthew R. Ochs Reviewed-by: Frederic Barrat --- drivers/scsi/cxlflash/ocxl_hw.c | 9 + 1 file changed, 9 insertions(+) diff --git a/driv

[PATCH v3 20/41] cxlflash: Support reading adapter VPD data

2018-03-26 Thread Uma Krishnan
Use the PCI VPD services to support reading the VPD data of the underlying adapter. Signed-off-by: Uma Krishnan Acked-by: Matthew R. Ochs --- drivers/scsi/cxlflash/ocxl_hw.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/drivers/scsi/cxlflash/ocxl_hw.c b/drivers/scsi/cxlfl

[PATCH v3 21/41] cxlflash: Setup function OCXL link

2018-03-26 Thread Uma Krishnan
After reading and modifying the function configuration, setup the OCXL link using the OCXL provider services. The link is released when the adapter is unconfigured. Signed-off-by: Uma Krishnan Acked-by: Matthew R. Ochs Reviewed-by: Frederic Barrat --- drivers/scsi/cxlflash/ocxl_hw.c | 25 +

[PATCH v3 22/41] cxlflash: Setup OCXL transaction layer

2018-03-26 Thread Uma Krishnan
The first function of the link needs to configure the transaction layer between the host and device. This is accomplished by a call to the OCXL provider services. Signed-off-by: Uma Krishnan Acked-by: Matthew R. Ochs --- drivers/scsi/cxlflash/ocxl_hw.c | 10 ++ 1 file changed, 10 insert

[PATCH v3 23/41] cxlflash: Support process element lifecycle

2018-03-26 Thread Uma Krishnan
As part of the context lifecycle, the associated process element within the Shared Process Area (SPA) of the link must be updated. Each process is defined by various parameters (pid, tid, PASID mm) that are stored in the SPA upon starting a context and invalidated when a context is stopped. Use th

[PATCH v3 24/41] cxlflash: Support AFU interrupt management

2018-03-26 Thread Uma Krishnan
Add support to allocate and free AFU interrupts using the OCXL provider services. The trigger page returned upon successful allocation will be mapped and exposed to the cxlflash core in a future commit. Signed-off-by: Uma Krishnan Acked-by: Matthew R. Ochs --- drivers/scsi/cxlflash/ocxl_hw.c |

[PATCH v3 25/41] cxlflash: Support AFU interrupt mapping and registration

2018-03-26 Thread Uma Krishnan
Add support to map and unmap the irq space and manage irq registrations with the kernel for each allocated AFU interrupt. Also support mapping the physical trigger page to obtain an effective address that will be provided to the cxlflash core in a future commit. Signed-off-by: Uma Krishnan Acked-

[PATCH v3 26/41] cxlflash: Support starting user contexts

2018-03-26 Thread Uma Krishnan
User contexts request interrupts and are started using the "start work" interface. Populate the start_work() fop to allocate and map interrupts before starting the user context. As part of starting the context, update the user process identification logic to properly derive the data required by the

[PATCH v3 27/41] cxlflash: Support adapter context polling

2018-03-26 Thread Uma Krishnan
The cxlflash userspace API requires that users be able to poll the adapter context for any pending events or interrupts from the AFU. Support polling on various events by implementing the AFU poll fop using a waitqueue. Signed-off-by: Uma Krishnan Acked-by: Matthew R. Ochs --- drivers/scsi/cxlf

[PATCH v3 28/41] cxlflash: Support adapter context reading

2018-03-26 Thread Uma Krishnan
The cxlflash userspace API requires that users be able to read the adapter context for any pending events or interrupts from the AFU. Support reading various events by implementing the AFU read fop to copy out event data. Signed-off-by: Uma Krishnan Acked-by: Matthew R. Ochs --- drivers/scsi/cx

[PATCH v3 29/41] cxlflash: Support adapter context mmap and release

2018-03-26 Thread Uma Krishnan
The cxlflash userspace API requires that users be able to mmap and release the adapter context. Support mapping by implementing the AFU mmap fop to map the context MMIO space and install the corresponding page table entry upon page fault. Similarly, implement the AFU release fop to terminate and cl

[PATCH v3 30/41] cxlflash: Support file descriptor mapping

2018-03-26 Thread Uma Krishnan
The cxlflash core fop API requires a way to invoke the fault and release handlers of underlying transports using their native file-based APIs. This provides the core with the ability to insert selectively itself into the processing stream of these operations for cleanup. Implement these two fops to

[PATCH v3 31/41] cxlflash: Introduce object handle fop

2018-03-26 Thread Uma Krishnan
OCXL requires that AFUs use an opaque object handle to represent an AFU interrupt. The specification does not provide a common means to communicate the object handle to the AFU - each AFU must define this within the AFU specification. To support this model, the object handle must be passed back to

[PATCH v3 32/41] cxlflash: Setup LISNs for user contexts

2018-03-26 Thread Uma Krishnan
The SISLite specification has been updated for OCXL to support communicating data to generate AFU interrupts to the AFU. This includes a new capability bit that is advertised for OCXL AFUs and new registers to hold the object handle and translation PASID of each interrupt. For Power, the object han

[PATCH v3 33/41] cxlflash: Setup LISNs for master contexts

2018-03-26 Thread Uma Krishnan
Similar to user contexts, master contexts also require that the per-context LISN registers be programmed for certain AFUs. The mapped trigger page is obtained from underlying transport and registered with AFU for each master context. Signed-off-by: Uma Krishnan Acked-by: Matthew R. Ochs --- dri

[PATCH v3 34/41] cxlflash: Update synchronous interrupt status bits

2018-03-26 Thread Uma Krishnan
The SISLite specification has been updated to define new synchronous interrupt status bits. These bits are set by the AFU when a given PASID or EA is bad and a synchronous interrupt is triggered. The SISLite header file is updated to support these new bits. Note that there are also some formatting

[PATCH v3 35/41] cxlflash: Introduce OCXL context state machine

2018-03-26 Thread Uma Krishnan
In order to protect the OCXL hardware contexts from getting clobbered, a simple state machine is added to indicate when a context is in open, close or start state. The expected states are validated throughout the code to prevent illegal operations on a context. A mutex is added to protect writes to

[PATCH v3 36/41] cxlflash: Register for translation errors

2018-03-26 Thread Uma Krishnan
While enabling a context on the link, a predefined callback can be registered with the OCXL provider services to be notified on translation errors. These errors can in turn be passed back to the user on a read operation. Signed-off-by: Uma Krishnan Acked-by: Matthew R. Ochs --- drivers/scsi/cxl

[PATCH v3 37/41] cxlflash: Support AFU reset

2018-03-26 Thread Uma Krishnan
The cxlflash core driver resets the AFU when the master contexts are created in the initialization or recovery paths. Today, the OCXL provider service to perform this operation is pending implementation. To avoid a crash due to a missing fop, log an error once and return success to continue with ex

[PATCH v3 38/41] cxlflash: Enable OCXL operations

2018-03-26 Thread Uma Krishnan
This commit enables the OCXL operations for the OCXL devices. Signed-off-by: Uma Krishnan Acked-by: Matthew R. Ochs --- drivers/scsi/cxlflash/main.c | 9 +++-- drivers/scsi/cxlflash/main.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/cxlflash/main.c b/d

[PATCH v3 39/41] cxlflash: Synchronize reset and remove ops

2018-03-26 Thread Uma Krishnan
The following Oops can be encountered if a device removal or system shutdown is initiated while an EEH recovery is in process: [c00ff2f479c0] c00815256f18 cxlflash_pci_slot_reset+0xa0/0x100 [cxlflash] [c00ff2f47a30] c0080dae22e0 cxl_pci_slot_re

[PATCH v3 40/41] cxlflash: Remove commmands from pending list on timeout

2018-03-26 Thread Uma Krishnan
The following Oops can occur if an internal command sent to the AFU does not complete within the timeout: [c00ff101b810] c00816020d94 term_mc+0xfc/0x1b0 [cxlflash] [c00ff101b8a0] c00816020fb0 term_afu+0x168/0x280 [cxlflash] [c00ff101b930] c008160232ec cxlflash_pci_error_det

[PATCH v3 41/41] cxlflash: Handle spurious interrupts

2018-03-26 Thread Uma Krishnan
The following Oops can occur when there is heavy I/O traffic and the host is reset by a tool such as sg_reset. [c000200fff3fbc90] c0081690117c process_cmd_doneq+0x104/0x500 [cxlflash] (unreliable) [c000200fff3fbd80] c00816901648 cxlflash_rrq_irq+0xd0/

Re: RFC on writel and writel_relaxed

2018-03-26 Thread Jason Gunthorpe
On Mon, Mar 26, 2018 at 11:08:45AM +, David Laight wrote: > > > This is a super performance critical operation for most drivers and > > > directly impacts network performance. > > Perhaps there ought to be writel_nobarrier() (etc) that never contain > any barriers at all. > This might mean tha

Re: [PATCH 17/21] powerpc: Add missing prototype for sys_debug_setcontext

2018-03-26 Thread Mathieu Malaterre
Michael, On Thu, Mar 8, 2018 at 11:36 AM, Michael Ellerman wrote: > Mathieu Malaterre writes: > >> On Sun, Mar 4, 2018 at 11:54 AM, Michael Ellerman >> wrote: >>> Mathieu Malaterre writes: >>> In commit 81e7009ea46c ("powerpc: merge ppc signal.c and ppc64 signal32.c") the function s

Re: [PATCH 2/2] smp: introduce kick_active_cpus_sync()

2018-03-26 Thread Steven Rostedt
On Mon, 26 Mar 2018 10:53:13 +0200 Andrea Parri wrote: > > --- a/kernel/smp.c > > +++ b/kernel/smp.c > > @@ -724,6 +724,30 @@ void kick_all_cpus_sync(void) > > } > > EXPORT_SYMBOL_GPL(kick_all_cpus_sync); > > > > +/** > > + * kick_active_cpus_sync - Force CPUs that are not in extended > > + *

Re: [PATCH v12 04/22] selftests/vm: typecast the pkey register

2018-03-26 Thread Thiago Jung Bauermann
Dave Hansen writes: > On 02/21/2018 05:55 PM, Ram Pai wrote: >> -static inline unsigned int _rdpkey_reg(int line) >> +static inline pkey_reg_t _rdpkey_reg(int line) >> { >> -unsigned int pkey_reg = __rdpkey_reg(); >> +pkey_reg_t pkey_reg = __rdpkey_reg(); >> >> -dprintf4("rdpkey_reg

Re: RFC on writel and writel_relaxed

2018-03-26 Thread Arnd Bergmann
On Mon, Mar 26, 2018 at 6:54 PM, Jason Gunthorpe wrote: > On Mon, Mar 26, 2018 at 11:08:45AM +, David Laight wrote: >> > > This is a super performance critical operation for most drivers and >> > > directly impacts network performance. >> >> Perhaps there ought to be writel_nobarrier() (etc) t

Re: RFC on writel and writel_relaxed

2018-03-26 Thread Jason Gunthorpe
On Mon, Mar 26, 2018 at 09:44:15PM +0200, Arnd Bergmann wrote: > On Mon, Mar 26, 2018 at 6:54 PM, Jason Gunthorpe wrote: > > On Mon, Mar 26, 2018 at 11:08:45AM +, David Laight wrote: > >> > > This is a super performance critical operation for most drivers and > >> > > directly impacts network

[PATCH script] hwmon: Use octal not symbolic permissions

2018-03-26 Thread Joe Perches
drivers/hwmon is the most frequent user of symbolic permissions like S_IRUGO in the kernel tree. $ git grep -w -P "S_[A-Z]{5,5}" | \ cut -f1 -d: | cut -f1-2 -d"/" | sed -r 's/[A-Za-z0-9_-]+\.[ch]$//' | \ sort | uniq -c | sort -rn | head 3862 drivers/hwmon 814 drivers/scsi 763 driver

[PATCH] powerpc: Clear branch trap (MSR.BE) before delivering SIGTRAP

2018-03-26 Thread Matt Evans
When using SIG_DBG_BRANCH_TRACING, MSR.BE is left enabled in the user context when single_step_exception() prepares the SIGTRAP delivery. The resulting branch-trap-within-the-SIGTRAP-handler isn't healthy. Commit 2538c2d08f46141550a1e68819efa8fe31c6e3dc broke this, by replacing an MSR mask operat

Re: [RFC PATCH v2 0/2] Randomization of address chosen by mmap.

2018-03-26 Thread Ilya Smith
> On 26 Mar 2018, at 11:46, Michal Hocko wrote: > > On Fri 23-03-18 20:55:49, Ilya Smith wrote: >> >>> On 23 Mar 2018, at 15:48, Matthew Wilcox wrote: >>> >>> On Thu, Mar 22, 2018 at 07:36:36PM +0300, Ilya Smith wrote: Current implementation doesn't randomize address returned by mmap. >>

Re: RFC on writel and writel_relaxed

2018-03-26 Thread Arnd Bergmann
On Mon, Mar 26, 2018 at 10:25 PM, Jason Gunthorpe wrote: > On Mon, Mar 26, 2018 at 09:44:15PM +0200, Arnd Bergmann wrote: >> On Mon, Mar 26, 2018 at 6:54 PM, Jason Gunthorpe wrote: >> > On Mon, Mar 26, 2018 at 11:08:45AM +, David Laight wrote: >> >> > > This is a super performance critical op

Re: RFC on writel and writel_relaxed

2018-03-26 Thread Jason Gunthorpe
On Mon, Mar 26, 2018 at 10:43:43PM +0200, Arnd Bergmann wrote: > On Mon, Mar 26, 2018 at 10:25 PM, Jason Gunthorpe wrote: > > On Mon, Mar 26, 2018 at 09:44:15PM +0200, Arnd Bergmann wrote: > >> On Mon, Mar 26, 2018 at 6:54 PM, Jason Gunthorpe wrote: > >> > On Mon, Mar 26, 2018 at 11:08:45AM +

Re: RFC on writel and writel_relaxed

2018-03-26 Thread Arnd Bergmann
On Mon, Mar 26, 2018 at 11:09 PM, Jason Gunthorpe wrote: > On Mon, Mar 26, 2018 at 10:43:43PM +0200, Arnd Bergmann wrote: >> On Mon, Mar 26, 2018 at 10:25 PM, Jason Gunthorpe wrote: >> > On Mon, Mar 26, 2018 at 09:44:15PM +0200, Arnd Bergmann wrote: >> >> On Mon, Mar 26, 2018 at 6:54 PM, Jason Gu

Re: [PATCH v9 24/24] powerpc/mm: Add speculative page fault

2018-03-26 Thread David Rientjes
On Tue, 13 Mar 2018, Laurent Dufour wrote: > diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c > index 866446cf2d9a..104f3cc86b51 100644 > --- a/arch/powerpc/mm/fault.c > +++ b/arch/powerpc/mm/fault.c > @@ -392,6 +392,9 @@ static int __do_page_fault(struct pt_regs *regs, unsigned > l

Re: [PATCH v9 23/24] x86/mm: Add speculative pagefault handling

2018-03-26 Thread David Rientjes
On Tue, 13 Mar 2018, Laurent Dufour wrote: > diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c > index e6af2b464c3d..a73cf227edd6 100644 > --- a/arch/x86/mm/fault.c > +++ b/arch/x86/mm/fault.c > @@ -1239,6 +1239,9 @@ __do_page_fault(struct pt_regs *regs, unsigned long > error_code, >

Re: [PATCH v9 20/24] perf: Add a speculative page fault sw event

2018-03-26 Thread David Rientjes
On Tue, 13 Mar 2018, Laurent Dufour wrote: > Add a new software event to count succeeded speculative page faults. > > Signed-off-by: Laurent Dufour Acked-by: David Rientjes

Re: [PATCH v9 21/24] perf tools: Add support for the SPF perf event

2018-03-26 Thread David Rientjes
On Tue, 13 Mar 2018, Laurent Dufour wrote: > Add support for the new speculative faults event. > > Signed-off-by: Laurent Dufour Acked-by: David Rientjes Aside: should there be a new spec_flt field for struct task_struct that complements maj_flt and min_flt and be exported through /proc/pid/

Re: RFC on writel and writel_relaxed

2018-03-26 Thread Benjamin Herrenschmidt
On Mon, 2018-03-26 at 10:54 -0600, Jason Gunthorpe wrote: > On Mon, Mar 26, 2018 at 11:08:45AM +, David Laight wrote: > > > > This is a super performance critical operation for most drivers and > > > > directly impacts network performance. > > > > Perhaps there ought to be writel_nobarrier() (

Re: RFC on writel and writel_relaxed

2018-03-26 Thread Sinan Kaya
On 3/26/2018 5:30 PM, Arnd Bergmann wrote: >> But that was never a requirement of writel(), >> Documentation/memory-barriers.txt gives an explicit example demanding >> the wmb() before writel() for ordering system memory against writel. > Indeed, but it's in an example for when to use dma_wmb(), no

Re: RFC on writel and writel_relaxed

2018-03-26 Thread Benjamin Herrenschmidt
On Mon, 2018-03-26 at 23:30 +0200, Arnd Bergmann wrote: > Most of the drivers have a unwound loop with writeq() or something to > > do it. > > But isn't the writeq() barrier much more expensive than anything you'd > do in function calls? It is for us, and will break any write combining. > > > >

Re: RFC on writel and writel_relaxed

2018-03-26 Thread Benjamin Herrenschmidt
On Mon, 2018-03-26 at 17:46 -0400, Sinan Kaya wrote: > On 3/26/2018 5:30 PM, Arnd Bergmann wrote: > > > But that was never a requirement of writel(), > > > Documentation/memory-barriers.txt gives an explicit example demanding > > > the wmb() before writel() for ordering system memory against writel

Re: RFC on writel and writel_relaxed

2018-03-26 Thread Sinan Kaya
On 3/26/2018 6:01 PM, Benjamin Herrenschmidt wrote: > On Mon, 2018-03-26 at 17:46 -0400, Sinan Kaya wrote: >> On 3/26/2018 5:30 PM, Arnd Bergmann wrote: But that was never a requirement of writel(), Documentation/memory-barriers.txt gives an explicit example demanding the wmb() befor

Re: [PATCH 6/6] doc/devicetree: NVDIMM region documentation

2018-03-26 Thread Rob Herring
On Fri, Mar 23, 2018 at 07:12:09PM +1100, Oliver O'Halloran wrote: > Add device-tree binding documentation for the nvdimm region driver. > > Cc: devicet...@vger.kernel.org > Signed-off-by: Oliver O'Halloran > --- > .../devicetree/bindings/nvdimm/nvdimm-region.txt | 45 > ++

  1   2   >