[PATCH v3] powerpc32: provide VIRT_CPU_ACCOUNTING

2016-02-10 Thread Christophe Leroy
This patch provides VIRT_CPU_ACCOUTING to PPC32 architecture. PPC32 doesn't have the PACA structure, so we use the task_info structure to store the accounting data. In order to reuse on PPC32 the PPC64 functions, all u64 data has been replaced by 'unsigned long' so that it is u32 on PPC32 and u64

mpc8641si-pre.dtsi and mpc8641si-post.dtsi

2016-02-10 Thread Alessio Igor Bogani
Hi Kumar, Scott and all, I'm wondering if actual make sense create files in subject to consolidate five device tree (gef_ppc9a.dts, gef_sbc310.dts, gef_sbc610.dts, mpc8641_hpcn.dts and sbc8641d.dts). If it makes sense what device tree can I take as example? Thank you very much! Ciao, Alessio

[PATCH 2/3] powerpc/pseries: Update LMB associativity index during DLPAR add/remove

2016-02-10 Thread Nathan Fontenot
The associativity array index specified for a LMB in the device tree, /ibm,dynamic-reconfiguration-memory/ibm,dynamic-memory, needs to be updated prior to DLPAR adding a LMB and after DLPAR removing a LMB. Without doing this step in the DLPAR add process a LMB could be configured with the

[PATCH 3/3] powerpc/pseries: Cleanup property cloning in memory dlpar

2016-02-10 Thread Nathan Fontenot
Now that the DLPAR add/remove flow updates the ibm,dynamic-memory device tree property each time we add or remove a LMB the work needed to clone this property can be reduced. Prior to performing any memory DLPAR operation we now clone the device tree property once and convert it to cpu format.

[PATCH v8 1/8] ppc64 (le): prepare for -mprofile-kernel

2016-02-10 Thread Torsten Duwe
The gcc switch -mprofile-kernel, available for ppc64 on gcc > 4.8.5, allows to call _mcount very early in the function, which low-level ASM code and code patching functions need to consider. Especially the link register and the parameter registers are still alive and not yet saved into a new stack

[PATCH v8 2/8] ppc64le FTRACE_WITH_REGS implementation

2016-02-10 Thread Torsten Duwe
Implement FTRACE_WITH_REGS for powerpc64, on ELF ABI v2. Initial work started by Vojtech Pavlik, used with permission. * arch/powerpc/kernel/entry_64.S: - Implement an effective ftrace_caller that works from within the kernel binary as well as from modules. *

Re: [PATCH v3] powerpc32: provide VIRT_CPU_ACCOUNTING

2016-02-10 Thread kbuild test robot
Hi Christophe, [auto build test ERROR on powerpc/next] [also build test ERROR on v4.5-rc3 next-20160210] [if your patch is applied to the wrong git tree, please drop us a note to help improving the system] url: https://github.com/0day-ci/linux/commits/Christophe-Leroy/powerpc32-provide

[PATCH v8 3/8] ppc use ftrace_modify_all_code default

2016-02-10 Thread Torsten Duwe
Convert ppc's arch_ftrace_update_code from its own function copy to use the generic default functionality (without stop_machine -- our instructions are properly aligned and the replacements atomic ;) With this we gain error checking and the much-needed function_trace_op handling. Signed-off-by:

Re: [PATCH v3] powerpc32: provide VIRT_CPU_ACCOUNTING

2016-02-10 Thread kbuild test robot
Hi Christophe, [auto build test ERROR on powerpc/next] [also build test ERROR on v4.5-rc3 next-20160210] [if your patch is applied to the wrong git tree, please drop us a note to help improving the system] url: https://github.com/0day-ci/linux/commits/Christophe-Leroy/powerpc32-provide

[PATCH 0/3] powerpc/pseries: Update affinity index during memory dlpar

2016-02-10 Thread Nathan Fontenot
When adding or removing a LMB the associativity index for the LMB needs to be updated in the device tree property ibm,dynamic-memory. Without updating the associativity index for a LMB before adding the LMB it could be added with the incorrect affinity. For LMBs that are not present at boot the

[PATCH 1/3] powerpc/pseries: Refactor dlpar_add_lmb() code

2016-02-10 Thread Nathan Fontenot
Re-factor dlpar_lmb_add() routine by moving the validation of the lmb flags and the acquireing of the DRC to a wrapper around the work to add the memory to the system. This is done to make handling of errors during the addition of the memory easier and to facilitate the upcoming addition of

[PATCH v8 0/8] ftrace with regs + live patching for ppc64 LE (ABI v2)

2016-02-10 Thread Torsten Duwe
Changes since V7: * drop "notrace" attribute for MMU-aiding functions and their callees. * merge "-mprofile-kernel"-stripping patches into one. Changes since v6: * include Petr's patch, on popular demand ;) * move #ifdefs out of functions for readability; introduce static helper

[PATCH v8 4/8] ppc64 ftrace_with_regs configuration variables

2016-02-10 Thread Torsten Duwe
* arch/powerpc/Makefile: - globally use -mprofile-kernel in case it's configured, available and bug-free. * arch/powerpc/gcc-mprofile-kernel-notrace.sh: - make sure -mprofile-kernel works and has none of the known bugs. * arch/powerpc/kernel/ftrace.c: - error out on

[PATCH v8 5/8] ppc64 ftrace_with_regs: disable profiling for some files

2016-02-10 Thread Torsten Duwe
Using -mprofile-kernel on early boot code not only confuses the checker but is also useless, as the infrastructure is not yet in place. Proceed like with -pg (remove it from CFLAGS), equally with time.o, ftrace and its helper files. * arch/powerpc/kernel/Makefile, arch/powerpc/lib/Makefile:

Re: [PATCH v7 07/10] ppc64 ftrace: disable profiling for some files

2016-02-10 Thread Torsten Duwe
On Wed, Feb 10, 2016 at 11:33:33AM +1100, Michael Ellerman wrote: > On Mon, 2016-01-25 at 16:31 +0100, Torsten Duwe wrote: > > > This patch complements the "notrace" attribute for selected functions. > > It adds -mprofile-kernel to the cc flags to be stripped from the command > > line for

[PATCH v8 7/8] Enable LIVEPATCH to be configured on ppc64le and add livepatch.o if it is selected

2016-02-10 Thread Torsten Duwe
Signed-off-by: Torsten Duwe --- arch/powerpc/Kconfig | 3 +++ arch/powerpc/kernel/Makefile | 1 + 2 files changed, 4 insertions(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index e5f288c..8c7a327 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig

Re: [PATCH v7 06/10] ppc64 ftrace: disable profiling for some functions

2016-02-10 Thread Torsten Duwe
On Wed, Feb 10, 2016 at 12:50:38PM +1100, Michael Ellerman wrote: > On Mon, 2016-01-25 at 16:31 +0100, Torsten Duwe wrote: > > > At least POWER7/8 have MMUs that don't completely autoload; > > a normal, recoverable memory fault might pass through these functions. > > If a dynamic tracer function

[PATCH v8 6/8] Implement kernel live patching for ppc64le (ABIv2)

2016-02-10 Thread Torsten Duwe
* create the appropriate files+functions arch/powerpc/include/asm/livepatch.h klp_check_compiler_support, klp_arch_set_pc arch/powerpc/kernel/livepatch.c with a stub for klp_write_module_reloc This is architecture-independent work in progress. * introduce a

[PATCH v8 8/8] livepatch: Detect offset for the ftrace location during build

2016-02-10 Thread Torsten Duwe
From: Petr Mladek Livepatch works on x86_64 and s390 only when the ftrace call is at the very beginning of the function. But PPC is different. We need to handle TOC and save LR there before calling the global ftrace handler. Now, the problem is that the extra operations have

Re: [PATCH v6 8/9] Implement kernel live patching for ppc64le (ABIv2)

2016-02-10 Thread Torsten Duwe
On Tue, Feb 02, 2016 at 04:46:27PM +0300, Denis Kirjanov wrote: > > + > > +#ifdef CONFIG_LIVEPATCH > > +static inline int klp_check_compiler_support(void) > > +{ > > +#if !defined(_CALL_ELF) || _CALL_ELF != 2 || > > !defined(CC_USING_MPROFILE_KERNEL) > > + return 1; > > +#endif > > + return 0;

Re: mpc8641si-pre.dtsi and mpc8641si-post.dtsi

2016-02-10 Thread Scott Wood
On Wed, 2016-02-10 at 15:40 +0100, Alessio Igor Bogani wrote: > Hi Kumar, Scott and all, > > I'm wondering if actual make sense create files in subject to > consolidate five device tree (gef_ppc9a.dts, gef_sbc310.dts, > gef_sbc610.dts, mpc8641_hpcn.dts and sbc8641d.dts). If it makes sense > what

Re: Fix kgdb on little endian ppc64le

2016-02-10 Thread Balbir Singh
On Tue, 2016-02-09 at 21:11 +1100, Michael Ellerman wrote: > On Mon, 2016-01-02 at 06:03:25 UTC, Balbir Singh wrote: > > From: Balbir Singh > > > > I spent some time trying to use kgdb and debugged my inability to > > resume from kgdb_handle_breakpoint(). NIP is not

[PATCH v4] powerpc32: provide VIRT_CPU_ACCOUNTING

2016-02-10 Thread Christophe Leroy
This patch provides VIRT_CPU_ACCOUTING to PPC32 architecture. PPC32 doesn't have the PACA structure, so we use the task_info structure to store the accounting data. In order to reuse on PPC32 the PPC64 functions, all u64 data has been replaced by 'unsigned long' so that it is u32 on PPC32 and u64

Re: [PATCH v8 0/8] ftrace with regs + live patching for ppc64 LE (ABI v2)

2016-02-10 Thread Balbir Singh
On Wed, 2016-02-10 at 18:29 +0100, Torsten Duwe wrote: > Changes since V7: >   * drop "notrace" attribute for MMU-aiding functions > and their callees. >   * merge "-mprofile-kernel"-stripping patches into one. > > Changes since v6: >   * include Petr's patch, on popular demand ;) >   * move

Re: [PATCH v4] powerpc32: provide VIRT_CPU_ACCOUNTING

2016-02-10 Thread Denis Kirjanov
On 2/11/16, Christophe Leroy wrote: > This patch provides VIRT_CPU_ACCOUTING to PPC32 architecture. > PPC32 doesn't have the PACA structure, so we use the task_info > structure to store the accounting data. > > In order to reuse on PPC32 the PPC64 functions, all u64 data

Re: [PATCH v8 4/8] ppc64 ftrace_with_regs configuration variables

2016-02-10 Thread Balbir Singh
On Wed, 2016-02-10 at 17:25 +0100, Torsten Duwe wrote: snip > diff --git a/arch/powerpc/gcc-mprofile-kernel-notrace.sh > b/arch/powerpc/gcc-mprofile-kernel-notrace.sh > new file mode 100755 > index 000..68d6482 > --- /dev/null > +++ b/arch/powerpc/gcc-mprofile-kernel-notrace.sh > @@ -0,0

Re: [PATCH kernel v2 1/6] KVM: PPC: Rework H_PUT_TCE/H_GET_TCE handlers

2016-02-10 Thread Paul Mackerras
On Fri, Jan 22, 2016 at 12:59:47PM +1100, Alexey Kardashevskiy wrote: > On 01/22/2016 11:42 AM, David Gibson wrote: > >On Thu, Jan 21, 2016 at 06:39:32PM +1100, Alexey Kardashevskiy wrote: [snip] > >>+ if ((ioba & mask) || (idx + npages > size)) > > > >It doesn't matter for the current callers,

Re: [PATCH kernel v2 5/6] KVM: PPC: Move reusable bits of H_PUT_TCE handler to helpers

2016-02-10 Thread Paul Mackerras
On Thu, Jan 21, 2016 at 06:39:36PM +1100, Alexey Kardashevskiy wrote: > Upcoming multi-tce support (H_PUT_TCE_INDIRECT/H_STUFF_TCE hypercalls) > will validate TCE (not to have unexpected bits) and IO address > (to be within the DMA window boundaries). > > This introduces helpers to validate TCE

Re: [PATCH V2 1/2] powerpc/powernv: new function to access OPAL msglog

2016-02-10 Thread Stewart Smith
Andrew Donnellan writes: > Currently, the OPAL msglog/console buffer is exposed as a sysfs file, with > the sysfs read handler responsible for retrieving the log from the OPAL > buffer. We'd like to be able to use it in xmon as well. > > Refactor the OPAL msglog

Re: [PATCH V2 1/2] powerpc/powernv: new function to access OPAL msglog

2016-02-10 Thread Joel Stanley
On Tue, Feb 9, 2016 at 5:47 PM, Andrew Donnellan wrote: > Currently, the OPAL msglog/console buffer is exposed as a sysfs file, with > the sysfs read handler responsible for retrieving the log from the OPAL > buffer. We'd like to be able to use it in xmon as well. >

[PATCH V3 1/2] powerpc/powernv: new function to access OPAL msglog

2016-02-10 Thread Andrew Donnellan
Currently, the OPAL msglog/console buffer is exposed as a sysfs file, with the sysfs read handler responsible for retrieving the log from the OPAL buffer. We'd like to be able to use it in xmon as well. Refactor the OPAL msglog code to create a new function, opal_msglog_copy(), that copies to an

[PATCH kernel v2] powerpc: Make vmalloc_to_phys() public

2016-02-10 Thread Alexey Kardashevskiy
This makes vmalloc_to_phys() public as there will be another user (KVM in-kernel VFIO acceleration) for it soon. As this new user can be compiled as a module, this exports the symbol. As a little optimization, this changes the helper to call vmalloc_to_pfn() instead of vmalloc_to_page() as the

Re: [PATCH kernel v2 6/6] KVM: PPC: Add support for multiple-TCE hcalls

2016-02-10 Thread Paul Mackerras
On Thu, Jan 21, 2016 at 06:39:37PM +1100, Alexey Kardashevskiy wrote: > This adds real and virtual mode handlers for the H_PUT_TCE_INDIRECT and > H_STUFF_TCE hypercalls for user space emulated devices such as IBMVIO > devices or emulated PCI. These calls allow adding multiple entries > (up to

Re: [PATCH V2 1/2] powerpc/powernv: new function to access OPAL msglog

2016-02-10 Thread Andrew Donnellan
On 11/02/16 18:14, Joel Stanley wrote: Looks like you didn't break it much. Congratulations on being the new memcons maintainer! Argh, I forgot the golden rule of kernel development - if you touch it, you own it... :) There's one issue with your error handling. diff --git

[PATCH V3 2/2] powerpc/xmon: add command to dump OPAL msglog

2016-02-10 Thread Andrew Donnellan
Add the 'do' command to dump the OPAL msglog in xmon. Signed-off-by: Andrew Donnellan --- arch/powerpc/xmon/xmon.c | 60 1 file changed, 60 insertions(+) diff --git a/arch/powerpc/xmon/xmon.c

Re: [PATCH v3 12/18] cxl: Add guest-specific code

2016-02-10 Thread Ian Munsie
Reiterating the comment I made on the internal review, I would at some point like to see an effort to refactor this and reduce the amount of duplicated code between it and the native version, but that can come later once this is in. Acked-by: Ian Munsie Excerpts from

Re: [PATCH v3 13/18] cxl: sysfs support for guests

2016-02-10 Thread Ian Munsie
Acked-by: Ian Munsie ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v3 14/18] cxl: Support to flash a new image on the adapter from a guest

2016-02-10 Thread Ian Munsie
@mpe since this patch introduces a new user API I'd appreciate it if you could give this a bit extra scrutiny. Excerpts from Frederic Barrat's message of 2016-02-07 00:29:01 +1100: > +Starts and controls flashing a new FPGA image. Partial > +reconfiguration is not supported (yet), so the

Re: [PATCH v3 15/18] cxl: Parse device tree and create CAPI device(s) at boot

2016-02-10 Thread Ian Munsie
Acked-by: Ian Munsie ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v3 17/18] cxl: Adapter failure handling

2016-02-10 Thread Ian Munsie
Acked-by: Ian Munsie ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v3 16/18] cxl: Support the cxl kernel API from a guest

2016-02-10 Thread Ian Munsie
> +static int guest_afu_cr_write32(struct cxl_afu *afu, int cr, u64 off, u32 in) > +{ > +/* config record is not writable from guest */ > +return -EIO; Perhaps -EPERM might be a better choice for these three? Acked-by: Ian Munsie

Re: [PATCH v3 18/18] cxl: Add tracepoints around the CAPI hcall

2016-02-10 Thread Ian Munsie
Acked-by: Ian Munsie ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 1/4] powerpc/mm: Clean up error handling for htab_remove_mapping

2016-02-10 Thread Aneesh Kumar K.V
David Gibson writes: > Currently, the only error that htab_remove_mapping() can report is -EINVAL, > if removal of bolted HPTEs isn't implemeted for this platform. We make > a few clean ups to the handling of this: > > * EINVAL isn't really the right code - there's

Re: [PATCH 2/4] powerpc/mm: Handle removing maybe-present bolted HPTEs

2016-02-10 Thread Aneesh Kumar K.V
David Gibson writes: > At the moment the hpte_removebolted callback in ppc_md returns void and > will BUG_ON() if the hpte it's asked to remove doesn't exist in the first > place. This is awkward for the case of cleaning up a mapping which was > partially made

Re: [PATCH 4/4] powerpc/mm: Split hash page table sizing heuristic into a helper

2016-02-10 Thread Aneesh Kumar K.V
David Gibson writes: > htab_get_table_size() either retrieve the size of the hash page table (HPT) > from the device tree - if the HPT size is determined by firmware - or > uses a heuristic to determine a good size based on RAM size if the kernel > is responsible for

Re: [PATCH v3 11/18] cxl: Separate bare-metal fields in adapter and AFU data structures

2016-02-10 Thread Ian Munsie
> @@ -825,6 +826,14 @@ static int pci_init_afu(struct cxl *adapter, int slice, > struct pci_dev *dev) > if (!afu) > return -ENOMEM; > > +afu->native = kzalloc(sizeof(struct cxl_afu_native), GFP_KERNEL); > +if (!afu->native) { > +kfree(afu); > +return

powerpc/86xx: Use config fragments approach

2016-02-10 Thread Alessio Igor Bogani
Signed-off-by: Alessio Igor Bogani --- arch/powerpc/Makefile| 10 + arch/powerpc/configs/86xx-32bit.config | 4 + arch/powerpc/configs/86xx-hw.config | 106 + arch/powerpc/configs/86xx-smp.config

Re: [PATCH v3 10/18] cxl: New hcalls to support CAPI adapters

2016-02-10 Thread Ian Munsie
> +#define H_CONTROL_CA_FUNCTION_RESET 1 /* perform a reset */ > +#define H_CONTROL_CA_FUNCTION_SUSPEND_PROCESS 2 /* suspend a process > from being executed */ > +#define H_CONTROL_CA_FUNCTION_RESUME_PROCESS 3 /* resume a process > to be executed */ > +#define

Re: [v3, 1/9] selftests/powerpc: Test the preservation of FPU and VMX regs across syscall

2016-02-10 Thread Michael Ellerman
[offlist] On Thu, 2016-21-01 at 00:55:41 UTC, Cyril Bur wrote: > Test that the non volatile floating point and Altivec registers get > correctly preserved across the fork() syscall. > > fork() works nicely for this purpose, the registers should be the same for > both parent and child ... >

Re: [PATCH 3/4] powerpc/mm: Clean up memory hotplug failure paths

2016-02-10 Thread Aneesh Kumar K.V
David Gibson writes: > This makes a number of cleanups to handling of mapping failures during > memory hotplug on Power: > > For errors creating the linear mapping for the hot-added region: > * This is now reported with EFAULT which is more appropriate than the >

Re: [RFC PATCH kernel] powerpc/ioda: Set "read" permission when "write" is set

2016-02-10 Thread Douglas Miller
Tested-by: Douglas Miller On 01/11/2016 10:40 PM, Alexey Kardashevskiy wrote: Quite often drivers set only "write" permission assuming that this includes "read" permission as well and this works on plenty platforms. However IODA2 is strict about this and produces

Re: powerpc/86xx: Use config fragments approach

2016-02-10 Thread Scott Wood
On Wed, 2016-02-10 at 10:22 +0100, Alessio Igor Bogani wrote: > Signed-off-by: Alessio Igor Bogani > --- > arch/powerpc/Makefile| 10 + > arch/powerpc/configs/86xx-32bit.config | 4 + > arch/powerpc/configs/86xx-hw.config

[PATCH v2 1/7] ibmvscsi: Correct values for several viosrp_crq_format enums

2016-02-10 Thread Tyrel Datwyler
The enum values for VIOSRP_LINUX_FORMAT and VIOSRP_INLINE_FORMAT are off by one. They are currently defined as 0x06 and 0x07 respetively. These values are defined in PAPR correctly as 0x05 and 0x06. This inconsistency has gone unnoticed as neither enum is currently used. The possible future

[PATCH v2 2/7] ibmvscsi: Add and use enums for valid CRQ header values

2016-02-10 Thread Tyrel Datwyler
The PAPR defines four valid header values for the first byte of a CRQ message. Namely, an unused/empty message (0x00), a valid command/response entry (0x80), a valid initialization entry (0xC0), and a valid transport event (0xFF). Further, initialization responses have two formats namely

[PATCH v2 5/7] ibmvscsi: Remove unsupported host config MAD

2016-02-10 Thread Tyrel Datwyler
A VIOSRP_HOST_CONFIG_TYPE management datagram (MAD) has existed in the code for some time. From what information I've gathered from Brian King this was likely implemented on the host side in a SLES 9 based VIOS, which is no longer supported anywhere. Further, it is not defined in PAPR or supported

[PATCH v2 6/7] ibmvscsi: Add endian conversions to sysfs attribute show functions

2016-02-10 Thread Tyrel Datwyler
The values returned by the show functions for the host os_type, mad_version, and partition_number attributes get their values directly from the madapter_info struct whose associated fields are __be32 typed. Added endian conversion to ensure these values are sane on LE platforms. Signed-off-by:

[PATCH v2 0/7] ibmvscsi code cleanup

2016-02-10 Thread Tyrel Datwyler
Fixed up a couple spots that were out of line with the PAPR in regards to its defined VSCSI protocol. Did away with some magic numbers directly in the code. Fixed a minor endian issue. -- v2 changes: -Renamed CRQ header enums and added enums for INIT formats -Check that crq->valid !=

[PATCH v2 3/7] ibmvscsi: Replace magic values in set_adpater_info() with defines

2016-02-10 Thread Tyrel Datwyler
Add defines for mad version and mad os_type, and replace the magic numbers in set_adapter_info() accordingly. Signed-off-by: Tyrel Datwyler --- drivers/scsi/ibmvscsi/ibmvscsi.c | 8 drivers/scsi/ibmvscsi/viosrp.h | 3 +++ 2 files changed, 7 insertions(+), 4

[PATCH v2 4/7] ibmvscsi: Use of_root to access OF device tree root node

2016-02-10 Thread Tyrel Datwyler
The root node of the OF device tree is exported as of_root. No need to look up the root by path name. Instead just get a reference directly via of_root. Signed-off-by: Tyrel Datwyler Reviewed-by: Johannes Thumshirn ---

[PATCH v2 7/7] ibmvscsi: use H_CLOSED instead of magic number

2016-02-10 Thread Tyrel Datwyler
In a couple places the magic value of 2 is used to check the return code of hypercalls. This translates to H_CLOSED. Signed-off-by: Tyrel Datwyler --- drivers/scsi/ibmvscsi/ibmvscsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git