[PATCH 5/5] powerpc/xmon: Dump ISA 2.07 SPRs

2016-07-07 Thread Michael Ellerman
Signed-off-by: Michael Ellerman --- arch/powerpc/include/asm/reg.h | 1 + arch/powerpc/xmon/xmon.c | 44 ++ 2 files changed, 45 insertions(+) diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index

Re: [v4] powerpc: Export thread_struct.used_vr/used_vsr to user space

2016-07-07 Thread Laurent Dufour
On 07/07/2016 15:21, Benjamin Herrenschmidt wrote: > On Thu, 2016-07-07 at 15:12 +0200, Laurent Dufour wrote: >> >> Basically, CRIU checkpoints the process register's state through the >> ptrace API, and it restores it through a signal frame at restart time. >> This is quite odd but that the way

Re: [PATCH V5 2/2] cpufreq: Reuse new freq-table helpers

2016-07-07 Thread Rafael J. Wysocki
On Monday, June 27, 2016 09:59:34 AM Viresh Kumar wrote: > This patch migrates few users of cpufreq tables to the new helpers that > work on sorted freq-tables. > > Signed-off-by: Viresh Kumar Applied, thanks! ___

[PATCH 3/3] powerpc/pseries: Use kernel hotplug queue for PowerVM hotplug events

2016-07-07 Thread John Allen
The sysfs interface used to handle PowerVM hotplug events should use the hotplug queue as well. PRRN events will soon be placing many hotplug events on the queue at once and we will need ordinary hotplug events to use the queue as well in order to ensure these events will still be handled and that

Re: [PATCH 02/41] drm: Fix broken use of _PAGE_NO_CACHE on powerpc

2016-07-07 Thread Benjamin Herrenschmidt
On Thu, 2016-07-07 at 22:38 +1000, Michael Ellerman wrote: > Benjamin Herrenschmidt writes: > > > That constant no longer exist. Use the proper accessor instead > > I still see it? Hrm, right, it does, I think it's just not always accessible or the wrong type. That

[PATCH 1/3] powerpc/pseries: Add pseries hotplug workqueue

2016-07-07 Thread John Allen
In support of PAPR changes to add a new hotplug interrupt, introduce a hotplug workqueue to avoid processing hotplug events in interrupt context. We will also take advantage of the queue on PowerVM to ensure hotplug events initiated from different sources (HMC and PRRN events) are handled and

Re: [PATCH] Remove lots of IS_ERR_VALUE abuses.

2016-07-07 Thread arvind Yadav
As per your concern, I have change commit message. Submit other patch. Thanks, Arvind Yadav On Thursday 07 July 2016 01:40 PM, Arnd Bergmann wrote: On Thursday, July 7, 2016 12:47:43 AM CEST Arvind Yadav wrote: Most users of IS_ERR_VALUE() in the kernel are wrong, as they pass an

[PATCH 3/5] powerpc/xmon: Adjust spacing of existing SPRs to make room for more

2016-07-07 Thread Michael Ellerman
Purely to make it pleasing to the eye. Signed-off-by: Michael Ellerman --- arch/powerpc/xmon/xmon.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 369501283994..efe6f4ee4634 100644

[PATCH 2/5] powerpc/xmon: Move static regno into its only user

2016-07-07 Thread Michael Ellerman
Signed-off-by: Michael Ellerman --- arch/powerpc/xmon/xmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index f351ba6a58ab..369501283994 100644 --- a/arch/powerpc/xmon/xmon.c +++

[PATCH] Removing lots of IS_ERR_VALUE abuses and compilation warning.

2016-07-07 Thread Arvind Yadav
Passing value in IS_ERR_VALUE() is wrong, as they pass an 'int' into a function that takes an 'unsigned long' argument. This happens to work because the type is sign-extended on 64-bit architectures before it gets converted into an unsigned type. Passing an 'unsigned

[PATCH 2/3] powerpc/pseries: Add support for hotplug interrupt source

2016-07-07 Thread John Allen
Add handler for new hotplug interrupt. For memory and CPU hotplug events, we will add the hotplug errorlog to the hotplug workqueue. Since PCI hotplug is not currently supported in the kernel, PCI hotplug events are written to the rtas_log_bug and are handled by rtas_errd. Signed-off-by: John

Re: [v4] powerpc: Export thread_struct.used_vr/used_vsr to user space

2016-07-07 Thread Benjamin Herrenschmidt
On Thu, 2016-07-07 at 15:12 +0200, Laurent Dufour wrote: > > Basically, CRIU checkpoints the process register's state through the > ptrace API, and it restores it through a signal frame at restart time. > This is quite odd but that the way it works on all the CRIU's supported > architectures. >

Re: [v4] powerpc: Export thread_struct.used_vr/used_vsr to user space

2016-07-07 Thread Benjamin Herrenschmidt
On Thu, 2016-07-07 at 23:21 +1000, Benjamin Herrenschmidt wrote: >  > I think the right fix is that if a restore_sigcontext() has the MSR > bits set, > it should set the corresponding used_* flag. Something like this: (totally untested) diff --git a/arch/powerpc/kernel/signal_32.c

[PATCH 4/5] powerpc/xmon: Dump ISA 2.06 SPRs

2016-07-07 Thread Michael Ellerman
Signed-off-by: Michael Ellerman --- arch/powerpc/xmon/xmon.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index efe6f4ee4634..ed6f73a74378 100644 --- a/arch/powerpc/xmon/xmon.c +++

Re: [v4] powerpc: Export thread_struct.used_vr/used_vsr to user space

2016-07-07 Thread Laurent Dufour
On 07/07/2016 13:15, Michael Ellerman wrote: > On Thu, 2016-07-07 at 07:49:36 UTC, Simon Guo wrote: >> From: Simon Guo >> >> These 2 fields track whether user process has used Altivec/VSX >> registers or not. They are used by kernel to setup signal frame >> on user stack

Re: [PATCH v2] irqchip/qeic: move qeic driver from drivers/soc/fsl/qe

2016-07-07 Thread Jason Cooper
Hi Zhao Qiang, On Thu, Jul 07, 2016 at 09:23:55AM +0800, Zhao Qiang wrote: > The driver stays the same. > > Signed-off-by: Zhao Qiang > --- > Changes for v2: > - modify the subject and commit msg > > drivers/irqchip/Makefile| 1 + >

[PATCH 0/3] powerpc/pseries: Add pseries hotplug queue and PowerVM/PowerKVM use cases

2016-07-07 Thread John Allen
This series introduces a new workqueue for handling hotplug events. On PowerKVM guests, this provides a work deferral mechanism to avoid processing hotplug events in interrupt context. On PowerVM lpars, this will be used to ensure that hotplug events initiated from the HMC and from PRRN events are

[PATCH] Removing lots of IS_ERR_VALUE abuses and compilation warning.

2016-07-07 Thread Arvind Yadav
Passing value in IS_ERR_VALUE() is wrong, as they pass an 'int' into a function that takes an 'unsigned long' argument.This happens to work because the type is sign-extended on 64-bit architectures before it gets converted into an unsigned type. Passing an 'unsigned short' or 'unsigned

[PATCH v4 6/9] powerpc: Add functions to read ELF files of any endianness.

2016-07-07 Thread Thiago Jung Bauermann
A little endian kernel might need to kexec a big endian kernel (the opposite is less likely but could happen as well), so we can't just cast the buffer with the binary to ELF structs and use them as is done elsewhere. This patch adds functions which do byte-swapping as necessary when populating

Re: Removing lots of IS_ERR_VALUE abuses and compilation warning.

2016-07-07 Thread Guenter Roeck
On Thu, Jul 07, 2016 at 09:30:14PM +0530, Arvind Yadav wrote: > Passing value in IS_ERR_VALUE() is wrong, as they pass an 'int' > into a function that takes an 'unsigned long' argument.This happens > to work because the type is sign-extended on 64-bit architectures > before it gets converted into

[PATCH v4 7/9] powerpc: Implement kexec_file_load.

2016-07-07 Thread Thiago Jung Bauermann
Adds the basic machinery needed by kexec_file_load. Signed-off-by: Josh Sklar Signed-off-by: Thiago Jung Bauermann Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman

[PATCH] Remove lots of IS_ERR_VALUE abuses and compilation warning.

2016-07-07 Thread Arvind Yadav
Passing value in IS_ERR_VALUE() is wrong, as they pass an 'int' into a function that takes an 'unsigned long' argument. This happens to work because the type is sign-extended on 64-bit architectures before it gets converted into an unsigned type. Passing an 'unsigned

Re: [PATCH 1/9] mm: Hardened usercopy

2016-07-07 Thread Kees Cook
On Thu, Jul 7, 2016 at 1:37 AM, Baruch Siach wrote: > Hi Kees, > > On Wed, Jul 06, 2016 at 03:25:20PM -0700, Kees Cook wrote: >> +#ifdef CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR > > Should be CONFIG_HARDENED_USERCOPY to match the slab/slub implementation > condition. > >> +const

Re: [PATCH 1/9] mm: Hardened usercopy

2016-07-07 Thread Rik van Riel
On Wed, 2016-07-06 at 15:25 -0700, Kees Cook wrote: > This is the start of porting PAX_USERCOPY into the mainline kernel. > This > is the first set of features, controlled by CONFIG_HARDENED_USERCOPY. > The > work is based on code by PaX Team and Brad Spengler, and an earlier > port > from Casey

[PATCH v4 2/9] kexec_file: Change kexec_add_buffer to take kexec_buf as argument.

2016-07-07 Thread Thiago Jung Bauermann
Adapt all callers to the new function prototype. In addition, change the type of kexec_buf.buffer from char * to void *. There is no particular reason for it to be a char *, and the change allows us to get rid of 3 existing casts to char * in the code. Signed-off-by: Thiago Jung Bauermann

[PATCH v4 3/9] kexec_file: Factor out kexec_locate_mem_hole from kexec_add_buffer.

2016-07-07 Thread Thiago Jung Bauermann
kexec_locate_mem_hole will be used by the PowerPC kexec_file_load implementation to find free memory for the purgatory stack. Signed-off-by: Thiago Jung Bauermann Cc: Eric Biederman Cc: Dave Young --- include/linux/kexec.h

[PATCH, RESEND, v2] powerpc/85xx: Don't report SRAM to L2 cache fallback as error

2016-07-07 Thread Claudiu Manoil
If the SRAM region parameters are missing the SRAM driver probing exits and the L2 region is configured as L2 cache entirely. This is the expected default behaviour, so it makes no sense to report it as an error. Signed-off-by: Claudiu Manoil --- v2: drop info print

[PATCH] Need proper type casting before assignment, Remove compilation Warning.

2016-07-07 Thread Arvind Yadav
-Return type of 'qe_muram_alloc' is 'unsigned long', That Was trying to assigned in ucc_fast_tx_virtual_fifo_base_offset and ucc_fast_rx_virtual_fifo_base_offset. These variable are 'unsigned int'. So before assginment need a proper type casting. -Passing value in IS_ERR_VALUE() is wrong, as they

Re: [PATCH 0/9] mm: Hardened usercopy

2016-07-07 Thread Kees Cook
On Thu, Jul 7, 2016 at 3:30 AM, Christian Borntraeger wrote: > On 07/07/2016 12:25 AM, Kees Cook wrote: >> Hi, >> >> This is a start of the mainline port of PAX_USERCOPY[1]. After I started >> writing tests (now in lkdtm in -next) for Casey's earlier port[2], I >> kept

[PATCH v4 0/9] kexec_file_load implementation for PowerPC

2016-07-07 Thread Thiago Jung Bauermann
Hello, Note: We are currently discussing whether we need a new syscall so that userspace can provide a custom device tree for the new kernel. Even if that ends up being the way forward, it would affect only patches 7 and 8, and even in those patches a significant part of the code would stay the

Re: Remove lots of IS_ERR_VALUE abuses and compilation warning.

2016-07-07 Thread arvind Yadav
Yes, You are right, -Now Return type of 'qe_muram_alloc' is 'unsigned long', That Was trying to assigned in ucc_fast_tx_virtual_fifo_base_offset and ucc_fast_rx_virtual_fifo_base_offset. These variable are 'unsigned int'. So before assignment need a proper type casting. -Passing value in

Re: [PATCH 4/9] arm64/uaccess: Enable hardened usercopy

2016-07-07 Thread Kees Cook
On Thu, Jul 7, 2016 at 6:07 AM, Mark Rutland wrote: > Hi, > > On Wed, Jul 06, 2016 at 03:25:23PM -0700, Kees Cook wrote: >> Enables CONFIG_HARDENED_USERCOPY checks on arm64. As done by KASAN in -next, >> renames the low-level functions to __arch_copy_*_user() so a static

Re: [PATCH] Removing lots of IS_ERR_VALUE abuses and compilation warning.

2016-07-07 Thread Arnd Bergmann
On Thursday, July 7, 2016 8:42:16 PM CEST Arvind Yadav wrote: > Passing value in IS_ERR_VALUE() is wrong, as they > pass an 'int' into a function that takes an 'unsigned long' > argument. This happens to work because the type is sign-extended > on 64-bit architectures before it

Re: t1040 IFC flash driver Extended Chip Select

2016-07-07 Thread Daniel Walker
On 07/06/2016 05:57 PM, Scott Wood wrote: On 07/06/2016 03:23 PM, Daniel Walker wrote: Hi, We are using the t1040 platform, and we have found that we need to populate this register. In the Technical Reference Manual it's description is section 24.3.2. This option appears in the driver, but it

[PATCH v4 9/9] powerpc: Add purgatory for kexec_file_load implementation.

2016-07-07 Thread Thiago Jung Bauermann
This purgatory implementation comes from kexec-tools, almost unchanged. The only changes were that the sha256_regions global variable was renamed to sha_regions to match what kexec_file_load expects, and to use the sha256.c file from x86's purgatory to avoid adding yet another SHA-256

Re: Remove lots of IS_ERR_VALUE abuses and compilation warning.

2016-07-07 Thread Guenter Roeck
On Thu, Jul 07, 2016 at 08:57:29PM +0530, Arvind Yadav wrote: > Passing value in IS_ERR_VALUE() is wrong, as they > pass an 'int' into a function that takes an 'unsigned long' > argument. This happens to work because the type is sign-extended > on 64-bit architectures before it gets

Re: [PATCH 1/9] mm: Hardened usercopy

2016-07-07 Thread Kees Cook
On Thu, Jul 7, 2016 at 4:01 AM, Arnd Bergmann wrote: > On Wednesday, July 6, 2016 3:25:20 PM CEST Kees Cook wrote: >> This is the start of porting PAX_USERCOPY into the mainline kernel. This >> is the first set of features, controlled by CONFIG_HARDENED_USERCOPY. The >> work is

[PATCH] Removing lots of IS_ERR_VALUE abuses and compilation warning.

2016-07-07 Thread Arvind Yadav
Passing value in IS_ERR_VALUE() is wrong, as they pass an 'int' into a function that takes an 'unsigned long' argument. This happens to work because the type is sign-extended on 64-bit architectures before it gets converted into an unsigned type. Passing an 'unsigned

[PATCH v4 1/9] kexec_file: Allow arch-specific memory walking for kexec_add_buffer

2016-07-07 Thread Thiago Jung Bauermann
Allow architectures to specify a different memory walking function for kexec_add_buffer. x86 uses iomem to track reserved memory ranges, but PowerPC uses the memblock subsystem. Signed-off-by: Thiago Jung Bauermann Cc: Eric Biederman Cc: Dave

[PATCH v4 5/9] powerpc: Generalize elf64_apply_relocate_add.

2016-07-07 Thread Thiago Jung Bauermann
When apply_relocate_add is called, modules are already loaded at their final location in memory so Elf64_Shdr.sh_addr can be used for accessing the section contents as well as the base address for relocations. This is not the case for kexec's purgatory, because it will only be copied to its final

Re: [PATCH 1/9] mm: Hardened usercopy

2016-07-07 Thread Rik van Riel
On Wed, 2016-07-06 at 15:25 -0700, Kees Cook wrote: >  > + /* Allow kernel rodata region (if not marked as Reserved). > */ > + if (ptr >= (const void *)__start_rodata && > + end <= (const void *)__end_rodata) > + return NULL; > One comment here. __check_object_size

Re: [PATCH 1/9] mm: Hardened usercopy

2016-07-07 Thread Kees Cook
On Thu, Jul 7, 2016 at 3:42 AM, Thomas Gleixner wrote: > On Wed, 6 Jul 2016, Kees Cook wrote: >> + >> +#if defined(CONFIG_FRAME_POINTER) && defined(CONFIG_X86) >> + const void *frame = NULL; >> + const void *oldframe; >> +#endif > > That's ugly Yeah, I'd like to have

[PATCH v4 4/9] powerpc: Factor out relocation code from module_64.c to elf_util_64.c.

2016-07-07 Thread Thiago Jung Bauermann
The kexec_file_load system call needs to relocate the purgatory, so factor out the module relocation code so that it can be shared. This patch's purpose is to move the ELF relocation logic from apply_relocate_add to elf_util_64.c with as few changes as possible. The following changes were needed:

[PATCH v4 8/9] powerpc: Add support for loading ELF kernels with kexec_file_load.

2016-07-07 Thread Thiago Jung Bauermann
This uses all the infrastructure built up by the previous patches in the series to load an ELF vmlinux file and an initrd. It uses the flattened device tree at initial_boot_params as a base and adjusts memory reservations and its /chosen node for the next kernel. elf64_apply_relocate_add was

Re: [PATCH 1/9] mm: Hardened usercopy

2016-07-07 Thread Baruch Siach
Hi Kees, On Thu, Jul 07, 2016 at 01:25:21PM -0400, Kees Cook wrote: > On Thu, Jul 7, 2016 at 1:37 AM, Baruch Siach wrote: > > On Wed, Jul 06, 2016 at 03:25:20PM -0700, Kees Cook wrote: > >> +#ifdef CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR > > > > Should be

Re: Removing lots of IS_ERR_VALUE abuses and compilation warning.

2016-07-07 Thread arvind Yadav
Yes, You are right, -Now Return type of 'qe_muram_alloc' is 'unsigned long', That Was trying to assigned in member of this structure 'ucc_geth_private' . This structure variable are 'unsigned int'. So before assignment need a proper type casting. -Passing value in IS_ERR_VALUE() is wrong.

Re: [PATCH v21 8/8] Documentation: dt: usable-memory and elfcorehdr nodes for arm64 kexec

2016-07-07 Thread Thiago Jung Bauermann
Am Donnerstag, 07 Juli 2016, 11:00:25 schrieb AKASHI Takahiro: > On Wed, Jul 06, 2016 at 04:29:18PM -0300, Thiago Jung Bauermann wrote: > > Hi, > > > > Am Mittwoch, 06 Juli 2016, 16:52:26 schrieb AKASHI Takahiro: > > > +linux,usable-memory > > > +--- > > > + > > > +This property

Re: [PATCH 1/9] mm: Hardened usercopy

2016-07-07 Thread Kees Cook
On Thu, Jul 7, 2016 at 12:35 PM, Rik van Riel wrote: > On Wed, 2016-07-06 at 15:25 -0700, Kees Cook wrote: >> >> + /* Allow kernel rodata region (if not marked as Reserved). >> */ >> + if (ptr >= (const void *)__start_rodata && >> + end <= (const void

[PATCH] Need proper type casting before assignment, Remove compilation Warning.

2016-07-07 Thread Arvind Yadav
-Return type of 'qe_muram_alloc' is 'unsigned long', That Was trying to assigned in ucc_fast_tx_virtual_fifo_base_offset and ucc_fast_rx_virtual_fifo_base_offset. These variable are 'unsigned int'. So before assginment need a proper type casting. -Passing value in IS_ERR_VALUE() is wrong, as they

Re: t1040 IFC flash driver Extended Chip Select

2016-07-07 Thread Daniel Walker
On 07/07/2016 12:26 PM, Scott Wood wrote: On 07/07/2016 10:48 AM, Daniel Walker wrote: On 07/06/2016 05:57 PM, Scott Wood wrote: On 07/06/2016 03:23 PM, Daniel Walker wrote: Hi, We are using the t1040 platform, and we have found that we need to populate this register. In the Technical

Re: [kernel-hardening] Re: [PATCH 9/9] mm: SLUB hardened usercopy support

2016-07-07 Thread Kees Cook
On Thu, Jul 7, 2016 at 12:35 AM, Michael Ellerman wrote: > Kees Cook writes: > >> Under CONFIG_HARDENED_USERCOPY, this adds object size checking to the >> SLUB allocator to catch any copies that may span objects. >> >> Based on code from PaX and

Re: [PATCH 1/9] mm: Hardened usercopy

2016-07-07 Thread Thomas Gleixner
On Thu, 7 Jul 2016, Kees Cook wrote: > On Thu, Jul 7, 2016 at 3:42 AM, Thomas Gleixner wrote: > > I'd rather make that a weak function returning 1 which can be replaced by > > x86 for CONFIG_FRAME_POINTER=y. That also allows other architectures to > > implement their specific

Re: [PATCH 08/14] cxl: Add kernel APIs to get & set the max irqs per context

2016-07-07 Thread Ian Munsie
Excerpts from Frederic Barrat's message of 2016-07-06 20:11:48 +0200: > > Le 04/07/2016 15:22, Ian Munsie a écrit : > > From: Ian Munsie > > > > These APIs will be used by the Mellanox CX4 support. While they function > > standalone to configure existing behaviour, their

Re: [PATCH 10/14] cxl: Add support for interrupts on the Mellanox CX4

2016-07-07 Thread Ian Munsie
Excerpts from Frederic Barrat's message of 2016-07-06 20:41:42 +0200: > I think we want: > if (WARN_ON(hwirq <= 0)) > cxl_find_afu_irq() returns 0 if doesn't find the irq, which is not > supposed to happen here. Good catch - will fix in v2. Cheers, -Ian

Re: [PATCH 14/14] cxl: Add cxl_check_and_switch_mode() API to switch bi-modal cards

2016-07-07 Thread Ian Munsie
Excerpts from andrew.donnellan's message of 2016-07-07 11:18:37 +1000: > > This is to balance the 'get' done in cxl_check_and_switch_mode(), right? > > A comment wouldn't hurt. I think we're missing the 'put' on the first > > error path above (!bridge). > > Yep, it's to balance the pci_dev_get()

Re: [PATCH 07/14] cxl: Add support for using the kernel API with a real PHB

2016-07-07 Thread Ian Munsie
Excerpts from Frederic Barrat's message of 2016-07-06 20:30:41 +0200: > > > @@ -1572,6 +1575,9 @@ static pci_ers_result_t cxl_pci_error_detected(struct > > pci_dev *pdev, > >*/ > > for (i = 0; i < adapter->slices; i++) { > > afu = adapter->afu[i]; > > +

Re: [PATCH 06/14] powerpc/powernv: Add support for the cxl kernel api on the real phb

2016-07-07 Thread Ian Munsie
Excerpts from Frederic Barrat's message of 2016-07-06 19:38:18 +0200: > > > +/* No special handling for cxl function: */ > > +if (PCI_FUNC(dev->devfn) == 0) > > +return true; > > I believe that is the first time we're getting a hint of the black magic > which is going to occur

Re: [RFC] arm64: kexec_file_load support

2016-07-07 Thread Dave Young
On 07/05/16 at 05:03pm, AKASHI Takahiro wrote: > Hi Dave, > > On Tue, Jul 05, 2016 at 09:25:56AM +0800, Dave Young wrote: > > On 07/04/16 at 03:58pm, AKASHI Takahiro wrote: > > > Hi, > > > > > > On Fri, Jul 01, 2016 at 12:46:31PM -0300, Thiago Jung Bauermann wrote: > > > > Am Freitag, 01 Juli

Re: [PATCH 14/14] cxl: Add cxl_check_and_switch_mode() API to switch bi-modal cards

2016-07-07 Thread Andrew Donnellan
On 07/07/16 16:26, Ian Munsie wrote: We could probably use a dedicated error label for all the error paths before the pci_dev_put in the main function so we don't need it in every error path. Yep, I've added that. If we explicitly match the Vendor + Device ID we will also match the

Re: [PATCH 1/9] mm: Hardened usercopy

2016-07-07 Thread Thomas Gleixner
On Wed, 6 Jul 2016, Kees Cook wrote: > + > +#if defined(CONFIG_FRAME_POINTER) && defined(CONFIG_X86) > + const void *frame = NULL; > + const void *oldframe; > +#endif That's ugly > + > + /* Object is not on the stack at all. */ > + if (obj + len <= stack || stackend <= obj) > +

Re: [PATCH 14/14] cxl: Add cxl_check_and_switch_mode() API to switch bi-modal cards

2016-07-07 Thread Andrew Donnellan
On 07/07/16 16:44, Andrew Donnellan wrote: We can match the vendor, device ID *and* class code - unfortunately there isn't a macro for this, which makes it a little bit less aesthetically pleasing, but I'm pretty sure this works. Something like the below, which works fine: /* * Matches a

Re: [PATCH v2 0/4] implement vcpu preempted check

2016-07-07 Thread Wanpeng Li
2016-07-06 20:28 GMT+08:00 Paolo Bonzini : > > > On 06/07/2016 14:08, Wanpeng Li wrote: >> 2016-07-06 18:44 GMT+08:00 Paolo Bonzini : >>> >>> >>> On 06/07/2016 08:52, Peter Zijlstra wrote: On Tue, Jun 28, 2016 at 10:43:07AM -0400, Pan Xinhui wrote:

Re: [PATCH 0/9] mm: Hardened usercopy

2016-07-07 Thread Christian Borntraeger
On 07/07/2016 12:25 AM, Kees Cook wrote: > Hi, > > This is a start of the mainline port of PAX_USERCOPY[1]. After I started > writing tests (now in lkdtm in -next) for Casey's earlier port[2], I > kept tweaking things further and further until I ended up with a whole > new patch series. To that

Re: [PATCH 1/9] mm: Hardened usercopy

2016-07-07 Thread Arnd Bergmann
On Wednesday, July 6, 2016 3:25:20 PM CEST Kees Cook wrote: > This is the start of porting PAX_USERCOPY into the mainline kernel. This > is the first set of features, controlled by CONFIG_HARDENED_USERCOPY. The > work is based on code by PaX Team and Brad Spengler, and an earlier port > from Casey

[PATCH v4] powerpc: Export thread_struct.used_vr/used_vsr to user space

2016-07-07 Thread wei . guo . simon
From: Simon Guo These 2 fields track whether user process has used Altivec/VSX registers or not. They are used by kernel to setup signal frame on user stack correctly regarding vector part. CRIU(Checkpoint and Restore In User space) builds signal frame for restored

Re: [PATCH] Remove lots of IS_ERR_VALUE abuses.

2016-07-07 Thread Arnd Bergmann
On Thursday, July 7, 2016 12:47:43 AM CEST Arvind Yadav wrote: > Most users of IS_ERR_VALUE() in the kernel are wrong, as they > pass an 'int' into a function that takes an 'unsigned long' > argument. This happens to work because the type is sign-extended > on 64-bit architectures

Re: [PATCH 2/4] soc: fsl: add GUTS driver for QorIQ platforms

2016-07-07 Thread Arnd Bergmann
On Thursday, July 7, 2016 2:35:33 AM CEST Yangbo Lu wrote: > Hi Arnd, > > Could you reply when you see the email? > If your method doesn’t resolve the problem, we still want to use our old > patchset. > > This guts driver had been discussed about one year and blocked many > workaround

Re: [PATCH v2 0/4] implement vcpu preempted check

2016-07-07 Thread Peter Zijlstra
On Thu, Jul 07, 2016 at 06:12:51PM +0800, Wanpeng Li wrote: > Btw, do this in preemption > notifier means that the vCPU is real preempted on host, however, > depends on vmexit is different semantic I think. Not sure; suppose the vcpu is about to reenter, eg, we're in vcpu_enter_guest() but

Re: [PATCH v2 0/4] implement vcpu preempted check

2016-07-07 Thread Peter Zijlstra
On Thu, Jul 07, 2016 at 11:42:15AM +0200, Peter Zijlstra wrote: > I suspect you want something like so; except this has holes in. > > We clear KVM_ST_PAD_PREEMPT before disabling preemption and we set it > after enabling it, this means that if we get preempted in between, the > vcpu is reported

Re: [PATCH v2 0/4] implement vcpu preempted check

2016-07-07 Thread Peter Zijlstra
On Thu, Jul 07, 2016 at 06:27:26PM +0800, Wanpeng Li wrote: > In addition, I see xen's vcpu_runstate_info::state is updated during > schedule, so I think I can do this similarly through kvm preemption > notifier. IIUC, xen hypervisor has VCPUOP_get_runstate_info hypercall > implemention, so the

Re: [v4] powerpc: Export thread_struct.used_vr/used_vsr to user space

2016-07-07 Thread Michael Ellerman
On Thu, 2016-07-07 at 07:49:36 UTC, Simon Guo wrote: > From: Simon Guo > > These 2 fields track whether user process has used Altivec/VSX > registers or not. They are used by kernel to setup signal frame > on user stack correctly regarding vector part. I still dislike

Re: [PATCH v2 0/4] implement vcpu preempted check

2016-07-07 Thread Peter Zijlstra
On Thu, Jul 07, 2016 at 11:42:15AM +0200, Peter Zijlstra wrote: > +static void update_steal_time_preempt(struct kvm_vcpu *vcpu) > +{ > + struct kvm_steal_time *st; > + > + if (!(vcpu->arch.st.msr_val & KVM_MSR_ENABLED)) > + return; > + > + if

RE: [PATCH 2/4] soc: fsl: add GUTS driver for QorIQ platforms

2016-07-07 Thread Yangbo Lu
Hi Arnd, Could you reply when you see the email? If your method doesn’t resolve the problem, we still want to use our old patchset. This guts driver had been discussed about one year and blocked many workaround upstream. So please help to review and comment soon. Thanks a lot. Best regards,

Re: [PATCH v2 0/4] implement vcpu preempted check

2016-07-07 Thread Wanpeng Li
2016-07-07 18:12 GMT+08:00 Wanpeng Li : > 2016-07-07 17:42 GMT+08:00 Peter Zijlstra : >> On Thu, Jul 07, 2016 at 04:48:05PM +0800, Wanpeng Li wrote: >>> 2016-07-06 20:28 GMT+08:00 Paolo Bonzini : >>> > Hmm, you're right. We can use

Re: [PATCH v2 0/4] implement vcpu preempted check

2016-07-07 Thread Peter Zijlstra
On Thu, Jul 07, 2016 at 04:48:05PM +0800, Wanpeng Li wrote: > 2016-07-06 20:28 GMT+08:00 Paolo Bonzini : > > Hmm, you're right. We can use bit 0 of struct kvm_steal_time's flags to > > indicate that pad[0] is a "VCPU preempted" field; if pad[0] is 1, the > > VCPU has been

Re: [PATCH 4/9] arm64/uaccess: Enable hardened usercopy

2016-07-07 Thread Mark Rutland
Hi, On Wed, Jul 06, 2016 at 03:25:23PM -0700, Kees Cook wrote: > Enables CONFIG_HARDENED_USERCOPY checks on arm64. As done by KASAN in -next, > renames the low-level functions to __arch_copy_*_user() so a static inline > can do additional work before the copy. The checks themselves look fine,

Re: [PATCH v2 0/4] implement vcpu preempted check

2016-07-07 Thread Wanpeng Li
2016-07-07 17:42 GMT+08:00 Peter Zijlstra : > On Thu, Jul 07, 2016 at 04:48:05PM +0800, Wanpeng Li wrote: >> 2016-07-06 20:28 GMT+08:00 Paolo Bonzini : >> > Hmm, you're right. We can use bit 0 of struct kvm_steal_time's flags to >> > indicate that pad[0]

[PATCH v7 04/11] powerpc/powernv: Rename reusable idle functions to hardware agnostic names

2016-07-07 Thread Shreyas B. Prabhu
Functions like power7_wakeup_loss, power7_wakeup_noloss, power7_wakeup_tb_loss are used by POWER7 and POWER8 hardware. They can also be used by POWER9. Hence rename these functions hardware agnostic names. Suggested-by: Gautham R. Shenoy Signed-off-by: Shreyas B. Prabhu

[PATCH v7 08/11] cpuidle/powernv: Use CPUIDLE_STATE_MAX instead of MAX_POWERNV_IDLE_STATES

2016-07-07 Thread Shreyas B. Prabhu
Use cpuidle's CPUIDLE_STATE_MAX macro instead of powernv specific MAX_POWERNV_IDLE_STATES. Cc: Rafael J. Wysocki Cc: Daniel Lezcano Cc: linux...@vger.kernel.org Acked-by: Daniel Lezcano Signed-off-by: Shreyas B.

[PATCH v7 09/11] cpuidle/powernv: cleanup powernv_add_idle_states

2016-07-07 Thread Shreyas B. Prabhu
- Use stack instead of kzalloc'ed memory for variables while probing device tree for idle states. - Set cap for number of idle states that can be added to cpuidle_state_table - Minor change in way we check of_property_read_u32_array for error for sake of consistency - Drop unnecessary

Re: t1040 IFC flash driver Extended Chip Select

2016-07-07 Thread Scott Wood
On 07/07/2016 10:48 AM, Daniel Walker wrote: > On 07/06/2016 05:57 PM, Scott Wood wrote: >> On 07/06/2016 03:23 PM, Daniel Walker wrote: >>> Hi, >>> >>> We are using the t1040 platform, and we have found that we need to >>> populate this register. In the Technical Reference Manual it's >>>

[PATCH v7 01/11] powerpc/powernv: Use PNV_THREAD_WINKLE macro while requesting for winkle

2016-07-07 Thread Shreyas B. Prabhu
Signed-off-by: Shreyas B. Prabhu --- -No changes since v4 Changes in v4 = - New in v4 arch/powerpc/kernel/idle_power7.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/idle_power7.S

[PATCH v7 07/11] powerpc/powernv: Add platform support for stop instruction

2016-07-07 Thread Shreyas B. Prabhu
POWER ISA v3 defines a new idle processor core mechanism. In summary, a) new instruction named stop is added. This instruction replaces instructions like nap, sleep, rvwinkle. b) new per thread SPR named Processor Stop Status and Control Register (PSSCR) is added which controls

[PATCH v7 06/11] powerpc/powernv: abstraction for saving SPRs before entering deep idle states

2016-07-07 Thread Shreyas B. Prabhu
Create a function for saving SPRs before entering deep idle states. This function can be reused for POWER9 deep idle states. Reviewed-by: Gautham R. Shenoy Signed-off-by: Shreyas B. Prabhu --- - No changes since v3 Changes in v3:

Re: t1040 IFC flash driver Extended Chip Select

2016-07-07 Thread Daniel Walker
On 07/07/2016 01:34 PM, Scott Wood wrote: On 07/07/2016 02:44 PM, Daniel Walker wrote: It seems natual that if cspr is in the device tree, you would also want cspr_ext because both are used to identify the device. The fact that it's missing to me is strange. As I said in my prior email, even if

Re: t1040 IFC flash driver Extended Chip Select

2016-07-07 Thread Scott Wood
On 07/07/2016 03:52 PM, Daniel Walker wrote: > On 07/07/2016 01:34 PM, Scott Wood wrote: >> On 07/07/2016 02:44 PM, Daniel Walker wrote: >>> It seems natual that if cspr is in the device tree, you would also want >>> cspr_ext because both are used to identify the device. The fact that >>> it's

Re: [PATCH 2/4] soc: fsl: add GUTS driver for QorIQ platforms

2016-07-07 Thread Scott Wood
On Thu, 2016-07-07 at 10:30 +0200, Arnd Bergmann wrote: > On Thursday, July 7, 2016 2:35:33 AM CEST Yangbo Lu wrote: > > > > Hi Arnd, > > > > Could you reply when you see the email? > > If your method doesn’t resolve the problem, we still want to use our old > > patchset. > > > > This guts

[PATCH v7 03/11] powerpc/powernv: Rename idle_power7.S to idle_book3s.S

2016-07-07 Thread Shreyas B. Prabhu
idle_power7.S handles idle entry/exit for POWER7, POWER8 and in next patch for POWER9. Rename the file to a non-hardware specific name. Reviewed-by: Gautham R. Shenoy Signed-off-by: Shreyas B. Prabhu --- Changes in v7: = - File

[PATCH v7 11/11] powerpc/powernv: Use deepest stop state when cpu is offlined

2016-07-07 Thread Shreyas B. Prabhu
If hardware supports stop state, use the deepest stop state when the cpu is offlined. Reviewed-by: Gautham R. Shenoy Signed-off-by: Shreyas B. Prabhu --- - No changes since v1 arch/powerpc/platforms/powernv/idle.c| 15 +--

[PATCH v7 00/11] powerpc/powernv/cpuidle: Add support for POWER ISA v3 idle states

2016-07-07 Thread Shreyas B. Prabhu
POWER ISA v3 defines a new idle processor core mechanism. In summary, a) new instruction named stop is added. This instruction replaces instructions like nap, sleep, rvwinkle. b) new per thread SPR named PSSCR is added which controls the behavior of stop instruction.

[PATCH v7 05/11] powerpc/powernv: Make pnv_powersave_common more generic

2016-07-07 Thread Shreyas B. Prabhu
pnv_powersave_common does common steps needed before entering idle state and eventually changes MSR to MSR_IDLE and does rfid to pnv_enter_arch207_idle_mode. Move the updation of HSTATE_HWTHREAD_STATE to pnv_powersave_common from pnv_enter_arch207_idle_mode and make it more generic by passing the

Re: t1040 IFC flash driver Extended Chip Select

2016-07-07 Thread Daniel Walker
On 07/07/2016 02:23 PM, Scott Wood wrote: I suspect that add the usage of cspr_ext into the driver would fix the issue we have. It reads like you would find that acceptable ? What specifically is the problem you're having? Is it that CSPR_EXT is not getting written to, and thus the device does

[PATCH v7 02/11] powerpc/kvm: make hypervisor state restore a function

2016-07-07 Thread Shreyas B. Prabhu
In the current code, when the thread wakes up in reset vector, some of the state restore code and check for whether a thread needs to branch to kvm is duplicated. Reorder the code such that this duplication is avoided. At a higher level this is what the change looks like- Before this patch -

[PATCH v7 10/11] cpuidle/powernv: Add support for POWER ISA v3 idle states

2016-07-07 Thread Shreyas B. Prabhu
POWER ISA v3 defines a new idle processor core mechanism. In summary, a) new instruction named stop is added. b) new per thread SPR named PSSCR is added which controls the behavior of stop instruction. Supported idle states and value to be written to PSSCR register to enter any idle

Re: t1040 IFC flash driver Extended Chip Select

2016-07-07 Thread Scott Wood
On 07/07/2016 02:44 PM, Daniel Walker wrote: > It seems natual that if cspr is in the device tree, you would also want > cspr_ext because both are used to identify the device. The fact that > it's missing to me is strange. As I said in my prior email, even if > uboot sets those, you could have

Re: t1040 IFC flash driver Extended Chip Select

2016-07-07 Thread Daniel Walker
On 07/07/2016 03:37 PM, Scott Wood wrote: On 07/07/2016 05:01 PM, Daniel Walker wrote: On 07/07/2016 02:59 PM, Scott Wood wrote: On 07/07/2016 04:49 PM, Daniel Walker wrote: On 07/07/2016 02:23 PM, Scott Wood wrote: I suspect that add the usage of cspr_ext into the driver would fix the issue

Re: t1040 IFC flash driver Extended Chip Select

2016-07-07 Thread Scott Wood
On 07/07/2016 05:01 PM, Daniel Walker wrote: > On 07/07/2016 02:59 PM, Scott Wood wrote: >> On 07/07/2016 04:49 PM, Daniel Walker wrote: >>> On 07/07/2016 02:23 PM, Scott Wood wrote: I suspect that add the usage of cspr_ext into the driver would fix the issue we have. It reads like you

Re: t1040 IFC flash driver Extended Chip Select

2016-07-07 Thread Daniel Walker
On 07/07/2016 02:59 PM, Scott Wood wrote: On 07/07/2016 04:49 PM, Daniel Walker wrote: On 07/07/2016 02:23 PM, Scott Wood wrote: I suspect that add the usage of cspr_ext into the driver would fix the issue we have. It reads like you would find that acceptable ? What specifically is the problem

Re: [PATCH v7 09/11] cpuidle/powernv: cleanup powernv_add_idle_states

2016-07-07 Thread Michael Neuling
>   /* > @@ -230,7 +238,7 @@ static int powernv_add_idle_states(void) >   strcpy(powernv_states[nr_idle_states].desc, > "FastSleep"); >   powernv_states[nr_idle_states].flags = > CPUIDLE_FLAG_TIMER_STOP; >  

Re: t1040 IFC flash driver Extended Chip Select

2016-07-07 Thread Scott Wood
On 07/07/2016 04:49 PM, Daniel Walker wrote: > On 07/07/2016 02:23 PM, Scott Wood wrote: >> >> I suspect that add the usage of cspr_ext into the driver would fix the >> issue we have. It reads like you would find that acceptable ? >> What specifically is the problem you're having? Is it that

  1   2   >