Re: [PATCH v3 36/52] zsmalloc: Fix CPU hotplug callback registration

2014-03-13 Thread Minchan Kim
On Tue, Mar 11, 2014 at 02:09:59AM +0530, Srivatsa S. Bhat wrote: > Subsystems that want to register CPU hotplug callbacks, as well as perform > initialization for the CPUs that are already online, often do it as shown > below: > > get_online_cpus(); > > for_each_online_cpu(cpu) >

[PATCH] powerpc: ratelimit users spamming kernel log buffer

2014-03-13 Thread Michael Neuling
The facility unavailable exception can be triggered from userspace by accessing PMU registers when EBB is not enabled. This causes the included pr_err() to run, hence spamming the kernel log buffer. This avoids this by rate limiting these messages. Signed-off-by: Michael Neuling --- We can bike

Re: [PATCH v3 10/52] arm, kvm: Fix CPU hotplug callback registration

2014-03-13 Thread Srivatsa S. Bhat
On 03/13/2014 04:51 AM, Christoffer Dall wrote: > On Tue, Mar 11, 2014 at 02:05:38AM +0530, Srivatsa S. Bhat wrote: >> Subsystems that want to register CPU hotplug callbacks, as well as perform >> initialization for the CPUs that are already online, often do it as shown >> below: >> >> get_onl

[PATCH 20/20] powerpc/perf: Fix handling of L3 events with bank == 1

2014-03-13 Thread Michael Ellerman
Currently we reject events which have the L3 bank == 1, such as 0x84918F, because the cache field is non-zero. However that is incorrect, because although the bank is non-zero, the value we would write into MMCRC is zero, and so we can count the event. So fix the check to ignore the bank sele

[PATCH 19/20] powerpc/perf/hv_{gpci, 24x7}: Add documentation of device attributes

2014-03-13 Thread Michael Ellerman
From: Cody P Schafer gpci and 24x7 expose some device specific attributes. Add some documentation for them. Signed-off-by: Cody P Schafer Signed-off-by: Michael Ellerman --- .../testing/sysfs-bus-event_source-devices-hv_24x7 | 23 .../testing/sysfs-bus-event_source-devices-hv_gpc

[PATCH 18/20] powerpc/perf: Add kconfig option for hypervisor provided counters

2014-03-13 Thread Michael Ellerman
From: Cody P Schafer The commit adds a Kconfig option which allows the hv_gpci and hv_24x7 PMUs, added in the preceeding commits, to be built. Signed-off-by: Cody P Schafer Signed-off-by: Michael Ellerman --- arch/powerpc/perf/Makefile | 2 ++ arch/powerpc/platforms/pseries/Kconf

[PATCH 17/20] powerpc/perf: Add support for the hv 24x7 interface

2014-03-13 Thread Michael Ellerman
From: Cody P Schafer This provides a basic interface between hv_24x7 and perf. Similar to the one provided for gpci, it lacks transaction support and does not list any events. Example usage via perf tool: perf stat -e 'hv_24x7/domain=2,offset=8,starting_index=0,lpar=0x/' -r 0 -

[PATCH 16/20] powerpc/perf: Add support for the hv gpci (get performance counter info) interface

2014-03-13 Thread Michael Ellerman
From: Cody P Schafer This provides a basic link between perf and hv_gpci. Notably, it does not yet support transactions and does not list any events (they can still be manually composed). Example usage via perf tool: perf stat -e 'hv_gpci/counter_info_version=3,offset=0,length=8,second

[PATCH 15/20] powerpc/perf: Add macros for defining event fields & formats

2014-03-13 Thread Michael Ellerman
From: Cody P Schafer Add two macros which generate functions to extract the relevent bits from event->attr.config{,1,2}. EVENT_DEFINE_RANGE() defines an accessor for a range of bits in the event, as well as a "max" function that gives the maximum value of the field based on the bit width. EVENT

[PATCH 14/20] powerpc/perf: Add a shared interface to get gpci version and capabilities

2014-03-13 Thread Michael Ellerman
From: Cody P Schafer This exposes a simple way to grab the firmware provided collect_priveliged, ga, expanded, and lab capability bits. All of these bits come in from the same gpci request, so we've exposed all of them. Only the collect_priveliged bit is really used by the hv-gpci/hv-24x7 code,

[PATCH 13/20] powerpc/perf: Add 24x7 interface headers

2014-03-13 Thread Michael Ellerman
From: Cody P Schafer 24x7 (also called hv_24x7 or H_24X7) is an interface to obtain performance counters from the hypervisor. These counters do not have a fixed format/possition and are instead documented in a "24x7 Catalog", which is provided by the hypervisor (that interface is also documented

[PATCH 12/20] powerpc/perf: Add hv_gpci interface header

2014-03-13 Thread Michael Ellerman
From: Cody P Schafer "H_GetPerformanceCounterInfo" (refered to as hv_gpci or just gpci from here on) is an interface to retrieve specific performance counters and other data from the hypervisor. All outputs have a fixed format. This header only describes the portions of the interface that we plan

[PATCH 11/20] powerpc: Add hvcalls for 24x7 and gpci (Get Performance Counter Info)

2014-03-13 Thread Michael Ellerman
From: Cody P Schafer Signed-off-by: Cody P Schafer Signed-off-by: Michael Ellerman --- arch/powerpc/include/asm/hvcall.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h index d8b600b..5dbbb29 100644 --- a/arch/powe

[PATCH 10/20] sysfs: create bin_attributes under the requested group

2014-03-13 Thread Michael Ellerman
From: Cody P Schafer bin_attributes created/updated in create_files() (such as those listed via (struct device).attribute_groups) were not placed under the specified group, and instead appeared in the base kobj directory. Fix this by making bin_attributes use creating code similar to normal attr

[PATCH 09/20] powerpc/perf: Enable BHRB access for EBB events

2014-03-13 Thread Michael Ellerman
The previous commit added constraint and register handling to allow processes using EBB (Event Based Branches) to request access to the BHRB (Branch History Rolling Buffer). With that in place we can allow processes using EBB to access the BHRB. This is achieved by setting BHRBA in MMCR0 when we e

[PATCH 08/20] powerpc/perf: Add BHRB constraint and IFM MMCRA handling for EBB

2014-03-13 Thread Michael Ellerman
We want a way for users of EBB (Event Based Branches) to also access the BHRB (Branch History Rolling Buffer). EBB does not interoperate with our existing BHRB support, which is wired into the generic Linux branch stack sampling support. To support EBB & BHRB we add three new bits to the event cod

[PATCH 07/20] powerpc/perf: Avoid mutating event in power8_get_constraint()

2014-03-13 Thread Michael Ellerman
We only need to mask the EBB bit out of the event for the check of the special PMC 5 & 6 events. So use a local to do it just for that code, rather than changing the event value for the life of the function. While we're there move the set of mask and value after all the checks. Signed-off-by: Mic

[PATCH 06/20] powerpc/perf: Clean up the EBB hash defines a little

2014-03-13 Thread Michael Ellerman
Rather than using PERF_EVENT_CONFIG_EBB_SHIFT everywhere, add an EVENT_EBB_SHIFT like every other event and use that. Signed-off-by: Michael Ellerman --- arch/powerpc/perf/power8-pmu.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/perf/power8-pmu.c b/arc

[PATCH 05/20] powerpc/perf: Reject EBB events which specify a sample_type

2014-03-13 Thread Michael Ellerman
Although we already block EBB events which request sampling using sample_period, technically it's possible for an event to set sample_type but not sample_period. Nothing terrible will happen if an EBB event does specify sample_type, but it signals a major confusion on the part of userspace, and so

[PATCH 04/20] powerpc/perf: Add lost exception workaround

2014-03-13 Thread Michael Ellerman
Some power8 revisions have a hardware bug where we can lose a PMU exception, this commit adds a workaround to detect the bad condition and rectify the situation. See the comment in the commit for a full description. Signed-off-by: Michael Ellerman --- arch/powerpc/include/asm/reg.h | 2 + ar

[PATCH 03/20] powerpc: Add a cpu feature CPU_FTR_PMAO_BUG

2014-03-13 Thread Michael Ellerman
Some power8 revisions have a hardware bug where we can lose a Performance Monitor (PMU) exception under certain circumstances. We will be adding a workaround for this case, see the next commit for details. The observed behaviour is that writing PMAO doesn't cause an exception as we would expect, h

[PATCH 02/20] powerpc/perf: Define perf_event_print_debug() to print PMU register values

2014-03-13 Thread Michael Ellerman
From: Anshuman Khandual Currently the sysrq ShowRegs command does not print any PMU registers as we have an empty definition for perf_event_print_debug(). This patch defines perf_event_print_debug() to print various PMU registers. Example output: CPU: 0 PMU registers, ppmu = POWER7 n_counters =

[PATCH 01/20] powerpc/perf: Make some new raw event codes available in sysfs

2014-03-13 Thread Michael Ellerman
From: Anshuman Khandual This patchset adds some missing event list for POWER7 PMU raw events which are exported through sysfs interface. Also updates the ABI documentation to add all the sysfs exported raw events. Signed-off-by: Anshuman Khandual Signed-off-by: Michael Ellerman --- .../testin

powerpc/perf: patches for 3.15

2014-03-13 Thread Michael Ellerman
Hi folks, This is the series of patches I have in my git tree to send to Ben. https://github.com/mpe/powerpc-merge These have all been to the list previously as-is, except for some of Cody's which I've modified slightly to avoid depending on other peoples' trees. The patch to fs/sysfs/group.c h

Re: how do I increase default kernel stack size for my MPC8548 board?

2014-03-13 Thread Scott Wood
On Tue, 2014-03-11 at 07:19 -0700, perth1415 wrote: > Looks like I found the issue :-) The stack size for init task needs to be > updated too. Right now it's by default set to 8K for PPC32. > > In arch/powerpc/kernel/vmlinux.lds.S - > === > /* The initial task and kernel stack */ > #ifdef CONF

[PATCH 10/10] Revert "powerpc/watchdog: Don't enable interrupt on PPC64 BookE"

2014-03-13 Thread Scott Wood
This reverts commit 3978bdb4ed653342b0be66c031bf61b72cc55d60, now that critical interrupts are properly supported on ppc64 booke. Signed-off-by: Scott Wood Cc: Laurentiu Tudor Cc: Wim Van Sebroeck --- drivers/watchdog/booke_wdt.c | 8 1 file changed, 8 deletions(-) diff --git a/drive

[PATCH 09/10] powerpc/booke64: Critical and machine check exception support

2014-03-13 Thread Scott Wood
Add special state saving for critical and machine check exceptions. Most of this code could be used to handle debug exceptions taken from kernel space, but actually doing so is outside the scope of this patch. The various critical and machine check exceptions now point to their real handlers, rat

[PATCH 07/10] powerpc/booke64: Remove ints from EXCEPTION_COMMON

2014-03-13 Thread Scott Wood
The ints parameter was used to optionally insert RECONCILE_IRQ_STATE into EXCEPTION_COMMON. However, since it came at the end of EXCEPTION_COMMON, there was no real benefit for it to be there as opposed to being called separately by the caller of EXCEPTION_COMMON. The ints parameter was causing s

[PATCH 08/10] powerpc/booke64: Add crit/mc/debug support to EXCEPTION_COMMON

2014-03-13 Thread Scott Wood
Use the proper scratch SPRG and PACA region. Introduce level-specific macros to simplify usage and avoid needing to do a bunch of token pasting throughout EXCEPTION_COMMON(). Now that EXCEPTION_COMMON_DBG() is properly using the debug scratch register, there's no more need for the caller to move

[PATCH 06/10] powerpc/booke64: Use SPRG_TLB_EXFRAME on bolted handlers

2014-03-13 Thread Scott Wood
While bolted handlers (including e6500) do not need to deal with a TLB miss recursively causing another TLB miss, nested TLB misses can still happen with crit/mc/debug exceptions -- so we still need to honor SPRG_TLB_EXFRAME. We don't need to spend time modifying it in the TLB miss fastpath, thoug

[PATCH 05/10] powerpc/booke64: Use SPRG7 for VDSO

2014-03-13 Thread Scott Wood
Previously SPRG3 was marked for use by both VDSO and critical interrupts (though critical interrupts were not fully implemented). In commit 8b64a9dfb091f1eca8b7e58da82f1e7d1d5fe0ad ("powerpc/booke64: Use SPRG0/3 scratch for bolted TLB miss & crit int"), Mihai Caraman made an attempt to resolve thi

[PATCH 04/10] powerpc/e6500: Make TLB lock recursive

2014-03-13 Thread Scott Wood
Once special level interrupts are supported, we may take nested TLB misses -- so allow the same thread to acquire the lock recursively. The lock will not be effective against the nested TLB miss handler trying to write the same entry as the interrupted TLB miss handler, but that's also a problem o

[PATCH 03/10] powerpc/booke64: Fix exception numbers

2014-03-13 Thread Scott Wood
altivec_unavailable was commented as 0xf20 but the code uses 0x200. Note that 0xf20 is also used by ap_unavailable. altivec_assist was commented as 0x1700 but the code uses 0x220. critical_input was commented as 0x580 but the code uses 0x100. machine_check was commented and implemented as 0x200,

[PATCH 02/10] powerpc/book3e: store crit/mc/dbg exception thread info

2014-03-13 Thread Scott Wood
From: Tiejun Chen We need to store thread info to these exception thread info like something we already did for PPC32. Signed-off-by: Tiejun Chen Signed-off-by: Scott Wood --- arch/powerpc/kernel/exceptions-64e.S | 22 +++--- 1 file changed, 19 insertions(+), 3 deletions(-) d

[PATCH 01/10] powerpc/book3e: initialize crit/mc/dbg kernel stack pointers

2014-03-13 Thread Scott Wood
From: Tiejun Chen We already allocated critical/machine/debug check exceptions, but we also should initialize those associated kernel stack pointers for use by special exceptions in the PACA. Signed-off-by: Tiejun Chen Signed-off-by: Scott Wood --- arch/powerpc/kernel/setup_64.c | 18

[PATCH 00/10] powerpc/booke64: critical and mcheck support

2014-03-13 Thread Scott Wood
This patchset adds the state saving required to safely take critical and machine check exceptions on 64-bit booke, including TLB misses from inside such exceptions. Previously, the kernel simply hung when encountering such an exception. Scott Wood (8): powerpc/booke64: Fix exception numbers p

Re: [PATCH RFC v9 5/6] dma: mpc512x: add device tree binding document

2014-03-13 Thread Mark Rutland
On Wed, Mar 12, 2014 at 11:47:54AM +, Alexander Popov wrote: > From: Gerhard Sittig > > introduce a device tree binding document for the MPC512x DMA controller > > Signed-off-by: Gerhard Sittig > [ a13xp0p0...@gmail.com: turn this into a separate patch ] > --- > .../devicetree/bindings/dma

Re: Bug in reclaim logic with exhausted nodes?

2014-03-13 Thread Nishanth Aravamudan
There might have been an error in my original mail, so resending... On 11.03.2014 [14:06:14 -0700], Nishanth Aravamudan wrote: > We have seen the following situation on a test system: > > 2-node system, each node has 32GB of memory. > > 2 gigantic (16GB) pages reserved at boot-time, both of whic

Re: [RFC PATCH 2/3] topology: support node_numa_mem() for determining the fallback node

2014-03-13 Thread Nishanth Aravamudan
On 24.02.2014 [13:54:35 -0600], Christoph Lameter wrote: > On Mon, 24 Feb 2014, Joonsoo Kim wrote: > > > > It will not common get there because of the tracking. Instead a per cpu > > > object will be used. > > > > get_partial_node() always fails even if there are some partial slab on > > > > memor

Re: Node 0 not necessary for powerpc?

2014-03-13 Thread Nishanth Aravamudan
On 12.03.2014 [08:41:40 -0500], Christoph Lameter wrote: > On Tue, 11 Mar 2014, Nishanth Aravamudan wrote: > > I have a P7 system that has no node0, but a node0 shows up in numactl > > --hardware, which has no cpus and no memory (and no PCI devices): > > Well as you see from the code there has bee

Re: Node 0 not necessary for powerpc?

2014-03-13 Thread Nishanth Aravamudan
On 11.03.2014 [19:02:17 -0700], David Rientjes wrote: > On Tue, 11 Mar 2014, Nishanth Aravamudan wrote: > > > I have a P7 system that has no node0, but a node0 shows up in numactl > > --hardware, which has no cpus and no memory (and no PCI devices): > > > > numactl --hardware > > available: 4 nod

Re: [PATCH v3 32/52] powercap, intel-rapl: Fix CPU hotplug callback registration

2014-03-13 Thread Jacob Pan
On Tue, 11 Mar 2014 02:09:26 +0530 "Srivatsa S. Bhat" wrote: > Subsystems that want to register CPU hotplug callbacks, as well as > perform initialization for the CPUs that are already online, often do > it as shown below: > > get_online_cpus(); > > for_each_online_cpu(cpu) >

Re: [PATCH v3 10/52] arm, kvm: Fix CPU hotplug callback registration

2014-03-13 Thread Christoffer Dall
On Tue, Mar 11, 2014 at 02:05:38AM +0530, Srivatsa S. Bhat wrote: > Subsystems that want to register CPU hotplug callbacks, as well as perform > initialization for the CPUs that are already online, often do it as shown > below: > > get_online_cpus(); > > for_each_online_cpu(cpu) >

[PATCH] powerpc/perf: Fix handling of L3 events with bank == 1

2014-03-13 Thread Michael Ellerman
Currently we reject events which have the L3 bank == 1, such as 0x84918F, because the cache field is non-zero. However that is incorrect, because although the bank is non-zero, the value we would write into MMCRC is zero, and so we can count the event. So fix the check to ignore the bank sele

Re: [PATCH 9/9] powerpc/pm: support deep sleep feature on T1040

2014-03-13 Thread Kevin Hao
On Wed, Mar 12, 2014 at 12:43:05PM -0500, Scott Wood wrote: > > Shouldn't we use "readback, sync" here? The following is quoted form > > t4240RM: > > To guarantee that the results of any sequence of writes to configuration > > registers are in effect, the final configuration register write sho