[PATCH 00/13] powerpc: "paca->soft_enabled" based local atomic operation implementation

2016-09-15 Thread Madhavan Srinivasan
Local atomic operations are fast and highly reentrant per CPU counters. Used for percpu variable updates. Local atomic operations only guarantee variable modification atomicity wrt the CPU which owns the data and these needs to be executed in a preemption safe way. Here is the design of the

[PATCH 04/13] powerpc: Use soft_enabled_set api to update paca->soft_enabled

2016-09-15 Thread Madhavan Srinivasan
Force use of soft_enabled_set() wrapper to update paca-soft_enabled wherever possisble. Also add a new wrapper function, soft_enabled_set_return(), added to force the paca->soft_enabled updates. Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/hw_irq.h

[PATCH 10/13] powerpc: Add "bitmask" paramater to MASKABLE_* macros

2016-09-15 Thread Madhavan Srinivasan
Make it explicit the interrupt masking supported by a gievn interrupt handler. Patch correspondingly extends the MASKABLE_* macros with an addition's parameter. "bitmask" parameter is passed to SOFTEN_TEST macro to decide on masking the interrupt. Signed-off-by: Madhavan Srinivasan

[PATCH 11/13] powerpc: Add support to mask perf interrupts and replay them

2016-09-15 Thread Madhavan Srinivasan
To support masking of the PMI interrupts, couple of new interrupt handler macros are added MASKABLE_EXCEPTION_PSERIES_OOL and MASKABLE_RELON_EXCEPTION_PSERIES_OOL. Couple of new irq #defs "PACA_IRQ_PMI" and "SOFTEN_VALUE_0xf0*" added to use in the exception code to check for PMI interrupts. In

[PATCH 05/13] powerpc: Add soft_enabled manipulation functions

2016-09-15 Thread Madhavan Srinivasan
Add new soft_enabled_* manipulation function and implement arch_local_* using the soft_enabled_* wrappers. Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/hw_irq.h | 32 ++-- 1 file changed, 14 insertions(+), 18 deletions(-)

[PATCH 01/13] powerpc: Add #defs for paca->soft_enabled flags

2016-09-15 Thread Madhavan Srinivasan
Two #defs IRQ_DISABLE_LEVEL_NONE and IRQ_DISABLE_LEVEL_LINUX are added to be used when updating paca->soft_enabled. Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/hw_irq.h | 6 ++ 1 file changed, 6 insertions(+) diff --git

[PATCH 07/13] powerpc: Avoid using EXCEPTION_PROLOG_1 macro in MASKABLE_*

2016-09-15 Thread Madhavan Srinivasan
Currently we use both EXCEPTION_PROLOG_1 and __EXCEPTION_PROLOG_1 in the MASKABLE_* macros. As a cleanup, this patch makes MASKABLE_* to use only __EXCEPTION_PROLOG_1. There is not logic change. Signed-off-by: Madhavan Srinivasan ---

[PATCH 02/13] powerpc: Cleanup to use IRQ_DISABLE_MASK_* macros for paca->soft_enabled update

2016-09-15 Thread Madhavan Srinivasan
Replace the hardcoded values used when updating paca->soft_enabled with IRQ_DISABLE_MASK_* #def. No logic change. Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/exception-64s.h | 2 +- arch/powerpc/include/asm/hw_irq.h| 15 ---

[PATCH 06/13] powerpc: reverse the soft_enable logic

2016-09-15 Thread Madhavan Srinivasan
"paca->soft_enabled" is used as a flag to mask some of interrupts. Currently supported flags values and their details: soft_enabledMSR[EE] 0 0 Disabled (PMI and HMI not masked) 1 1 Enabled "paca->soft_enabled" is initialized to 1 to make the

[PATCH 13/13] powerpc: rewrite local_t using soft_irq

2016-09-15 Thread Madhavan Srinivasan
Local atomic operations are fast and highly reentrant per CPU counters. Used for percpu variable updates. Local atomic operations only guarantee variable modification atomicity wrt the CPU which owns the data and these needs to be executed in a preemption safe way. Here is the design of this

[PATCH 08/13] powerpc: Add new _EXCEPTION_PROLOG_1 macro

2016-09-15 Thread Madhavan Srinivasan
To support addition of "bitmask" to MASKABLE_* macros, factor out the EXCPETION_PROLOG_1 macro. Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/exception-64s.h | 30 ++ 1 file changed, 26 insertions(+), 4 deletions(-) diff

[PATCH 03/13] powerpc: move set_soft_enabled() and rename

2016-09-15 Thread Madhavan Srinivasan
Move set_soft_enabled() from powerpc/kernel/irq.c to asm/hw_irq.c. and rename it soft_enabled_set(). THis way paca->soft_enabled updates can be forced. Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/hw_irq.h | 6 ++ arch/powerpc/kernel/irq.c

[PATCH 09/13] powerpc: Introduce new mask bit for soft_enabled

2016-09-15 Thread Madhavan Srinivasan
Currently soft_enabled is used as the flag to determine the interrupt state. Patch extends the soft_enabled to be used as a mask instead of a flag. Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/exception-64s.h | 4 ++--

[PATCH 12/13] powerpc: Add a Kconfig and a functions to set new soft_enabled mask

2016-09-15 Thread Madhavan Srinivasan
New Kconfig is added "CONFIG_IRQ_DEBUG_SUPPORT" to add warn_on to alert the invalid transitions. Have also moved the code under the CONFIG_TRACE_IRQFLAGS in arch_local_irq_restore() to new Kconfig as suggested. To support disabling and enabling of irq with PMI, set of new

Re: [PATCH v2 1/3] drivers/of: recognize status property of dt memory nodes

2016-09-15 Thread Rob Herring
On Wed, Sep 14, 2016 at 3:06 PM, Reza Arbab wrote: > Respect the standard dt "status" property when scanning memory nodes in > early_init_dt_scan_memory(), so that if the property is present and not > "okay", no memory will be added. > > The use case at hand is

Re: [PATHC v2 0/9] ima: carry the measurement list across kexec

2016-09-15 Thread Mimi Zohar
Hi Andrew, On Wed, 2016-08-31 at 18:38 -0400, Mimi Zohar wrote: > On Wed, 2016-08-31 at 13:50 -0700, Andrew Morton wrote: > > On Tue, 30 Aug 2016 18:40:02 -0400 Mimi Zohar > > wrote: > > > > > The TPM PCRs are only reset on a hard reboot. In order to validate a > > >

Re: [PATCH v5 1/5] kexec_file: Include the purgatory segment in the kexec image checksum.

2016-09-15 Thread Thiago Jung Bauermann
Hello Stephen, Am Donnerstag, 15 September 2016, 11:43:08 schrieb Stephen Rothwell: > Hi Thiago, > > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > > index 2a1f0ce7c59a..dcd1679f3005 100644 > > --- a/arch/x86/Kconfig > > +++ b/arch/x86/Kconfig > > @@ -1792,6 +1792,11 @@ config SECCOMP > >

[PATCH] powerpc/64s: exception optimise MSR handling

2016-09-15 Thread Nicholas Piggin
mtmsrd with L=1 only affects MSR_EE and MSR_RI bits, and we always know what state those bits are, so the kernel MSR does not need to be loaded when modifying them. mtmsrd is often in the critical execution path, so avoiding dependency on even L1 load is noticable. On a POWER8 this saves about 3

[PATCH v4 3/9] ima: maintain memory size needed for serializing the measurement list

2016-09-15 Thread Mimi Zohar
In preparation for serializing the binary_runtime_measurements, this patch maintains the amount of memory required. Changelog v3: - include the ima_kexec_hdr size in the binary_runtime_measurement size. Signed-off-by: Mimi Zohar --- security/integrity/ima/Kconfig

[PATCH v4 9/9] ima: platform-independent hash value

2016-09-15 Thread Mimi Zohar
From: Andreas Steffen For remote attestion it is important for the ima measurement values to be platform-independent. Therefore integer fields to be hashed must be converted to canonical format. Changelog: - Define canonical format as little endian (Mimi)

Re: [PATCH v2 1/3] drivers/of: recognize status property of dt memory nodes

2016-09-15 Thread Reza Arbab
On Thu, Sep 15, 2016 at 08:43:08AM -0500, Rob Herring wrote: On Wed, Sep 14, 2016 at 3:06 PM, Reza Arbab wrote: + status = of_get_flat_dt_prop(node, "status", NULL); + add_memory = !status || !strcmp(status, "okay"); Move this into it's own function to

Re: [PATCH 13/13] powerpc: rewrite local_t using soft_irq

2016-09-15 Thread kbuild test robot
Hi Madhavan, [auto build test ERROR on v4.8-rc6] [cannot apply to powerpc/next kvm-ppc/kvm-ppc-next mpe/next next-20160915] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] [Suggest to use git(>=2.9.0) format-patch --base= (or --base=a

Re: + powerpc-add-purgatory-for-kexec_file_load-implementation-fix.patch added to -mm tree

2016-09-15 Thread Thiago Jung Bauermann
Hello Andrew and Stephen, Am Dienstag, 06 September 2016, 12:17:09 schrieb a...@linux-foundation.org: > The patch titled > Subject: powerpc-add-purgatory-for-kexec_file_load-implementation-fix > has been added to the -mm tree. Its filename is >

[PATCH] powerpc: do not use kprobe section to exempt exception handlers

2016-09-15 Thread Nicholas Piggin
Use the blacklist macros instead. This allows the linker to move exception handler functions close to callers and avoids trampolines in larger kernels. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/asm-prototypes.h | 6 +++---

[PATCH v21 10/19] perf, tools, jevents: Add support for long descriptions

2016-09-15 Thread Sukadev Bhattiprolu
Implement support in jevents to parse long descriptions for events that may have them in the JSON files. A follow on patch will make this long description available to user through the 'perf list' command. Signed-off-by: Andi Kleen Signed-off-by: Sukadev Bhattiprolu

[PATCH v21 18/19] perf, tools, pmu-events: Add Skylake frontend MSR support

2016-09-15 Thread Sukadev Bhattiprolu
From: Andi Kleen Add support for the "frontend" extra MSR on Skylake in the JSON conversion. Signed-off-by: Andi Kleen Acked-by: Ingo Molnar --- tools/perf/pmu-events/jevents.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH v21 01/19] perf, tools: Add jsmn `jasmine' JSON parser

2016-09-15 Thread Sukadev Bhattiprolu
From: Andi Kleen I need a JSON parser. This adds the simplest JSON parser I could find -- Serge Zaitsev's jsmn `jasmine' -- to the perf library. I merely converted it to (mostly) Linux style and added support for non 0 terminated input. The parser is quite straight forward

[PATCH v21 08/19] perf, tools: Add a --no-desc flag to perf list

2016-09-15 Thread Sukadev Bhattiprolu
From: Andi Kleen Add a --no-desc flag to perf list to not print the event descriptions that were earlier added for JSON events. This may be useful to get a less crowded listing. It's still default to print descriptions as that is the more useful default for most users.

[PATCH v21 09/19] perf, tools: Add override support for event list CPUID

2016-09-15 Thread Sukadev Bhattiprolu
From: Andi Kleen Add a PERF_CPUID variable to override the CPUID of the current CPU (within the current architecture). This is useful for testing, so that all event lists can be tested on a single system. Signed-off-by: Andi Kleen Signed-off-by:

[PATCH v21 11/19] perf, tools: Add alias support for long descriptions

2016-09-15 Thread Sukadev Bhattiprolu
Previously we were dropping the useful longer descriptions that some events have in the event list completely. Now that jevents provides support for longer descriptions (see previous patch), add support for parsing the long descriptions Signed-off-by: Andi Kleen

[PATCH v21 12/19] perf, tools: Support long descriptions with perf list

2016-09-15 Thread Sukadev Bhattiprolu
Previously we were dropping the useful longer descriptions that some events have in the event list completely. This patch makes them appear with perf list. Old perf list: baclears: baclears.all [Counts the number of baclears] vs new: perf list -v: ... baclears: baclears.all

[PATCH v21 14/19] perf, tools, jevents: Handle header line in mapfile

2016-09-15 Thread Sukadev Bhattiprolu
From: Andi Kleen To work with existing mapfiles, assume that the first line in 'mapfile.csv' is a header line and skip over it. Signed-off-by: Andi Kleen Signed-off-by: Sukadev Bhattiprolu Acked-by: Jiri Olsa

[PATCH v21 13/19] perf, tools: Add support for event list topics

2016-09-15 Thread Sukadev Bhattiprolu
From: Andi Kleen Add support to group the output of perf list by the Topic field in the JSON file. Example output: % perf list ... Cache: l1d.replacement [L1D data line replacements] l1d_pend_miss.pending [L1D miss oustandings duration in cycles]

Re: powerpc/powernv: Fix the state of root PE

2016-09-15 Thread Michael Ellerman
On Tue, 2016-13-09 at 06:40:24 UTC, Gavin Shan wrote: > The PE for root bus (root PE) can be removed because of PCI hot > remove in EEH recovery path for fenced PHB error. We need update > @phb->root_pe_populated accordingly so that the root PE can be > populated again in forthcoming PCI hot add

Re: powerpc/powernv/pci: Fix missed TCE invalidations that should fallback to OPAL

2016-09-15 Thread Michael Ellerman
On Thu, 2016-15-09 at 08:39:34 UTC, Michael Ellerman wrote: > In commit f0228c413011 ("powerpc/powernv/pci: Fallback to OPAL for TCE > invalidations"), we added logic to fallback to OPAL for doing TCE > invalidations if we can't do it in Linux. > > Ben sent a v2 of the patch, containing these

[PATCH v21 02/19] perf, tools, jevents: Program to convert JSON file to C style file

2016-09-15 Thread Sukadev Bhattiprolu
From: Andi Kleen This is a modified version of an earlier patch by Andi Kleen. We expect architectures to create JSON files describing the performance monitoring (PMU) events that each CPU model/family of the architecture supports. Following is an example of the JSON file

[PATCH v21 03/19] perf, tools: Use pmu_events table to create aliases

2016-09-15 Thread Sukadev Bhattiprolu
At run time (when 'perf' is starting up), locate the specific table of PMU events that corresponds to the current CPU. Using that table, create aliases for the each of the PMU events in the CPU. The use these aliases to parse the user specified perf event. In short this would allow the user to

[PATCH v21 16/19] perf, tools: Make alias matching case-insensitive

2016-09-15 Thread Sukadev Bhattiprolu
From: Andi Kleen Make alias matching the events parser case-insensitive. This is useful with the JSON events. perf uses lower case events, but the CPU manuals generally use upper case event names. The JSON files use lower case by default too. But if we search case

[PATCH v21 00/20] perf, tools: Add support for PMU events in JSON format

2016-09-15 Thread Sukadev Bhattiprolu
CPUs support a large number of performance monitoring events (PMU events) and often these events are very specific to an architecture/model of the CPU. To use most of these PMU events with perf, we currently have to identify them by their raw codes: perf stat -e r100f2 sleep 1 This

[PATCH v21 06/19] perf, tools: Support alias descriptions

2016-09-15 Thread Sukadev Bhattiprolu
From: Andi Kleen Add support to print alias descriptions in perf list, which are taken from the generated event files. The sorting code is changed to put the events with descriptions at the end. The descriptions are printed as possibly multiple word wrapped lines. Example

[PATCH v21 07/19] perf, tools: Query terminal width and use in perf list

2016-09-15 Thread Sukadev Bhattiprolu
From: Andi Kleen Automatically adapt the now wider and word wrapped perf list output to wider terminals. This requires querying the terminal before the auto pager takes over, and exporting this information from the pager subsystem. Signed-off-by: Andi Kleen

[PATCH v21 17/19] perf, tools, pmu-events: Fix fixed counters on Intel

2016-09-15 Thread Sukadev Bhattiprolu
From: Andi Kleen The JSON event lists use a different encoding for fixed counters than perf for instructions and cycles (ref-cycles is ok) This lead to some common events like inst_retired.any or cpu_clk_unhalted.thread not counting, when specified with their JSON name.

Re: [V2] powerpc/Kconfig: Update config option based on page size.

2016-09-15 Thread Michael Ellerman
santhosh writes: >> Michael Ellerman writes: >> >>> On Fri, 2016-19-02 at 05:38:47 UTC, Rashmica Gupta wrote: Currently on PPC64 changing kernel pagesize from 4K to 64K leaves FORCE_MAX_ZONEORDER set to 13 - which produces a compile

Re: powerpc/powernv: Detach from PE on releasing PCI device

2016-09-15 Thread Michael Ellerman
On Tue, 2016-06-09 at 06:34:01 UTC, Gavin Shan wrote: > The PCI hotplug can be part of EEH error recovery. The @pdn and > the device's PE number aren't removed and added afterwords. The > PE number in @pdn should be set to an invalid one. Otherwise, the > PE's device count is decreased on removing

[PATCH v21 04/19] perf, tools: Support CPU ID matching for Powerpc

2016-09-15 Thread Sukadev Bhattiprolu
Implement code that returns the generic CPU ID string for Powerpc. This will be used to identify the specific table of PMU events to parse/compare user specified events against. Signed-off-by: Sukadev Bhattiprolu Acked-by: Jiri Olsa Acked-by: Ingo

[PATCH v21 15/19] perf, tools: Add README for info on parsing JSON/map files

2016-09-15 Thread Sukadev Bhattiprolu
Signed-off-by: Sukadev Bhattiprolu Acked-by: Jiri Olsa Acked-by: Ingo Molnar --- Changelog[v21] - Update README to reflect the Topics.json directory tree layout. --- tools/perf/pmu-events/README | 148

[PATCH v21 05/19] perf, tools: Support CPU id matching for x86 v2

2016-09-15 Thread Sukadev Bhattiprolu
From: Andi Kleen Implement the code to match CPU types to mapfile types for x86 based on CPUID. This extends an existing similar function, but changes it to use the x86 mapfile cpu description. This allows to resolve event lists generated by jevents. Signed-off-by: Andi

[PATCH v21 19/19] perf, tools: Allow period= in perf stat CPU event descriptions.

2016-09-15 Thread Sukadev Bhattiprolu
This avoids the JSON PMU events parser having to know whether its aliases are for perf stat or perf record. Signed-off-by: Andi Kleen Signed-off-by: Sukadev Bhattiprolu Acked-by: Ingo Molnar --- tools/perf/util/parse-events.c

Re: [PATCH 3/3] Cyrus: create a defconfig

2016-09-15 Thread Andy Fleming
> On Sep 12, 2016, at 18:54, Scott Wood wrote: > >> On 09/10/2016 05:12 PM, Andy Fleming wrote: >> >> >> On Tuesday, September 6, 2016, Scott Wood > > wrote: >> >>>On 09/06/2016 02:12 PM, Andy Fleming wrote: >>> This

Re: [PATCH 2/3] corenet: Support gpio power/reset for corenet

2016-09-15 Thread Andy Fleming
> On Sep 12, 2016, at 23:47, Scott Wood wrote: > >> On 09/10/2016 05:05 PM, Andy Fleming wrote: >> >> >> On Tuesday, September 6, 2016, Scott Wood > > wrote: >> >>>On 09/06/2016 02:12 PM, Andy Fleming wrote: >>> Boards

[PATCH v4 0/9] ima: carry the measurement list across kexec

2016-09-15 Thread Mimi Zohar
The TPM PCRs are only reset on a hard reboot. In order to validate a TPM's quote after a soft reboot (eg. kexec -e), the IMA measurement list of the running kernel must be saved and then restored on the subsequent boot, possibly of a different architecture. The existing securityfs

[PATCH v4 7/9] ima: support restoring multiple template formats

2016-09-15 Thread Mimi Zohar
The configured IMA measurement list template format can be replaced at runtime on the boot command line, including a custom template format. This patch adds support for restoring a measuremement list containing multiple builtin/custom template formats. Signed-off-by: Mimi Zohar

[PATCH v4 8/9] ima: define a canonical binary_runtime_measurements list format

2016-09-15 Thread Mimi Zohar
The IMA binary_runtime_measurements list is currently in platform native format. To allow restoring a measurement list carried across kexec with a different endianness than the targeted kernel, this patch defines little-endian as the canonical format. For big endian systems wanting to

[PATCH v4 2/9] ima: permit duplicate measurement list entries

2016-09-15 Thread Mimi Zohar
Measurements carried across kexec need to be added to the IMA measurement list, but should not prevent measurements of the newly booted kernel from being added to the measurement list. This patch adds support for allowing duplicate measurements. The "boot_aggregate" measurement entry is the

[PATCH v4 5/9] ima: on soft reboot, save the measurement list

2016-09-15 Thread Mimi Zohar
From: Thiago Jung Bauermann This patch uses the kexec buffer passing mechanism to pass the serialized IMA binary_runtime_measurements to the next kernel. Changelog v4: - Revert the skip_checksum change. Instead calculate the checksum with the measurement list

[PATCH v4 4/9] ima: serialize the binary_runtime_measurements

2016-09-15 Thread Mimi Zohar
The TPM PCRs are only reset on a hard reboot. In order to validate a TPM's quote after a soft reboot (eg. kexec -e), the IMA measurement list of the running kernel must be saved and restored on boot. This patch serializes the IMA measurement list in the binary_runtime_measurements format.

[PATCH][RFC] powerpc/64: exception exit do not reload SRR[01] if unchanged

2016-09-15 Thread Nicholas Piggin
This is not ready yet, but it's a proof of concept for the approach to speed up exception exit: avoid the mtspr instructions if the yare not required. This saves 20 cycles per call on a getppid syscall microbenchmark, so it seems worth looking into. A few issues to be solved. Firstly, realmode

[PATCH v4 6/9] ima: store the builtin/custom template definitions in a list

2016-09-15 Thread Mimi Zohar
The builtin and single custom templates are currently stored in an array. In preparation for being able to restore a measurement list containing multiple builtin/custom templates, this patch stores the builtin and custom templates as a linked list. This will permit defining more than one custom

[PATCH] powerpc/powernv/pci: Fix missed TCE invalidations that should fallback to OPAL

2016-09-15 Thread Michael Ellerman
In commit f0228c413011 ("powerpc/powernv/pci: Fallback to OPAL for TCE invalidations"), we added logic to fallback to OPAL for doing TCE invalidations if we can't do it in Linux. Ben sent a v2 of the patch, containing these additional call sites, but I had already applied v1 and didn't notice. So

[PATCH] powerpc/64s: optimise syscall entry for virtual, relocatable case

2016-09-15 Thread Nicholas Piggin
The mflr r10 instruction was left over saving of lr when the code used lr to branch to system_call_entry from the exception handler. That was changed by 6a404806d to use the count register. The value is never used now, so mflr can be removed, and r10 can be used for storage rather than spilling to

Re: Linux 4.8: Reported regressions as of Sunday, 2016-08-28

2016-09-15 Thread Pavel Machek
Hi! > Hi! Here is my second regression report for Linux 4.8. It lists 11 > regressions. 5 of them are new; 5 mentioned in the last report two > weeks ago got fixed. > > FWIW: A small detail: I did not include "Regression - SATA disks behind > USB ones on v4.8-rc1, breaking boot. [Re: Who

[PATCH v4 1/9] ima: on soft reboot, restore the measurement list

2016-09-15 Thread Mimi Zohar
The TPM PCRs are only reset on a hard reboot. In order to validate a TPM's quote after a soft reboot (eg. kexec -e), the IMA measurement list of the running kernel must be saved and restored on boot. This patch restores the measurement list. Changelog v2: - redefined ima_kexec_hdr to use types