Re: [PATCH 2/2] PCI: pciehp: Convert pciehp to be builtin only, not modular

2015-05-28 Thread Benjamin Herrenschmidt
On Thu, 2015-05-28 at 15:08 -0700, Yinghai Lu wrote:
 On Wed, May 27, 2015 at 6:30 PM, Rafael J. Wysocki r...@rjwysocki.net wrote:
  On Wednesday, May 27, 2015 02:31:49 PM Bjorn Helgaas wrote:
  For debug you can always use pcie_ports=compat and that will disable
  pciehp too.
 
 That will disable AER at the same time, right?.

For ppc machines under either our hypervisor or running bare metal with
our EEH-enabled bridges, both generic AER and hotplug code are going to
interfere.

EEH subsumes AER, and we have firmware interfaces to do hotplug that
know more than what the generic code can know about (such as on-board
GPIOs that can control PERST, it's not always via the hotplug registers
or hotplug from top-level slots which isn't the same as hotplug from
switch slots on our platforms).

So basically, at this point, we must not have the PCIe port drivers at
all, just just interfere.

We should replace that with the appropriate hooks for the platform to
disable selected functions (hotplug and AER) from the generic port
drivers.

Cheers,
Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 2/2] PCI: pciehp: Convert pciehp to be builtin only, not modular

2015-05-28 Thread Yinghai Lu
On Wed, May 27, 2015 at 6:30 PM, Rafael J. Wysocki r...@rjwysocki.net wrote:
 On Wednesday, May 27, 2015 02:31:49 PM Bjorn Helgaas wrote:
 For debug you can always use pcie_ports=compat and that will disable
 pciehp too.

That will disable AER at the same time, right?.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH V2] drivers/mtd: add powernv flash MTD abstraction driver

2015-05-28 Thread Neelesh Gupta



On 05/28/2015 06:36 PM, Cyril Bur wrote:

Powerpc powernv platforms allow access to certain system flash devices
through a firmwarwe interface. This change adds an mtd driver for these
flash devices.

Minor updates from Jeremy Kerr and Joel Stanley.

Signed-off-by: Cyril Bur cyril...@gmail.com
Signed-off-by: Joel Stanley j...@jms.id.au
Signed-off-by: Jeremy Kerr j...@ozlabs.org
---
V2: Address Brian Norris' review
 Fix typos
 Change from NAND flash type to NOR flash type
 Correctness tweaks
---
  drivers/mtd/devices/Kconfig |   8 +
  drivers/mtd/devices/Makefile|   1 +
  drivers/mtd/devices/powernv_flash.c | 286 
  3 files changed, 295 insertions(+)
  create mode 100644 drivers/mtd/devices/powernv_flash.c

diff --git a/drivers/mtd/devices/Kconfig b/drivers/mtd/devices/Kconfig
index c49d0b1..a8cc237 100644
--- a/drivers/mtd/devices/Kconfig
+++ b/drivers/mtd/devices/Kconfig
@@ -195,6 +195,14 @@ config MTD_BLOCK2MTD
  Testing MTD users (eg JFFS2) on large media and media that might
  be removed during a write (using the floppy drive).
  
+config MTD_POWERNV_FLASH

+   tristate powernv flash MTD driver
+   depends on PPC_POWERNV
+   help
+ This provides an MTD device to access NVRAM on powernv OPAL


NVRAM ? or to access FLASH device ?


+ platforms from Linux. This device abstracts away the
+ firmware interface for NVRAM access.
+
  comment Disk-On-Chip Device Drivers
  
  config MTD_DOCG3

diff --git a/drivers/mtd/devices/Makefile b/drivers/mtd/devices/Makefile
index f0b0e61..7912d3a 100644
--- a/drivers/mtd/devices/Makefile
+++ b/drivers/mtd/devices/Makefile
@@ -16,6 +16,7 @@ obj-$(CONFIG_MTD_SPEAR_SMI)   += spear_smi.o
  obj-$(CONFIG_MTD_SST25L)  += sst25l.o
  obj-$(CONFIG_MTD_BCM47XXSFLASH)   += bcm47xxsflash.o
  obj-$(CONFIG_MTD_ST_SPI_FSM)+= st_spi_fsm.o
+obj-$(CONFIG_MTD_POWERNV_FLASH)+= powernv_flash.o
  
  
  CFLAGS_docg3.o			+= -I$(src)

diff --git a/drivers/mtd/devices/powernv_flash.c 
b/drivers/mtd/devices/powernv_flash.c
new file mode 100644
index 000..f619e4a
--- /dev/null
+++ b/drivers/mtd/devices/powernv_flash.c
@@ -0,0 +1,286 @@
+/*
+ * OPAL PNOR flash MTD abstraction
+ *
+ * IBM 2015
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include linux/kernel.h
+#include linux/module.h
+#include linux/errno.h
+#include linux/of.h
+#include linux/of_address.h
+#include linux/platform_device.h
+#include linux/string.h
+#include linux/slab.h
+#include linux/mtd/mtd.h
+#include linux/mtd/partitions.h
+
+#include linux/debugfs.h
+#include linux/seq_file.h
+
+#include asm/opal.h
+
+
+/*
+ * This driver creates the a Linux MTD abstraction for platform PNOR flash
+ * backed by OPAL calls
+ */
+
+struct powernv_flash {
+   struct mtd_info mtd;
+   uint64_tid;


'id' should be u32


+};
+
+enum flash_op {
+   FLASH_OP_READ,
+   FLASH_OP_WRITE,
+   FLASH_OP_ERASE,
+};
+
+static int powernv_flash_async_op(struct mtd_info *mtd, enum flash_op op,
+   loff_t offset, size_t len, size_t *retlen, u_char *buf)
+{
+   struct powernv_flash *info = (struct powernv_flash *)mtd-priv;
+   struct device *dev = mtd-dev;
+   int token;
+   struct opal_msg msg;
+   int rc;
+
+   dev_dbg(dev, %s(op=%d, offset=0x%llx, len=%zu)\n,
+   __func__, op, offset, len);
+
+   token = opal_async_get_token_interruptible();
+   if (token  0) {
+   dev_err(dev, Failed to get an async token\n);
+   return -ENOMEM;


ENOMEM is not correct code here.. 'token' itself has the right one in 
case of

failure. To be more precise,
if (token  0) {
if (token != -ERESTARTSYS)
dev_err(dev, Failed to get an async token\n);

return token;
}


+   }
+
+   switch (op) {
+   case FLASH_OP_READ:
+   rc = opal_flash_read(info-id, offset, __pa(buf), len, token);
+   break;
+   case FLASH_OP_WRITE:
+   rc = opal_flash_write(info-id, offset, __pa(buf), len, token);
+   break;
+   case FLASH_OP_ERASE:
+   rc = opal_flash_erase(info-id, offset, len, token);
+   break;
+   default:
+   BUG_ON(1);
+   }
+
+   if (rc != OPAL_ASYNC_COMPLETION) {
+   dev_err(dev, opal_flash_async_op(op=%d) failed (rc %d)\n,
+   op, rc);


release the token, opal_async_release_token();


+

Re: [PATCH 09/10] perf, tools: Add a --no-desc flag to perf list

2015-05-28 Thread Andi Kleen
On Thu, May 28, 2015 at 02:39:14PM +0200, Jiri Olsa wrote:
 On Wed, May 27, 2015 at 02:23:28PM -0700, Sukadev Bhattiprolu wrote:
  From: Andi Kleen a...@linux.intel.com
  
  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.
 
 I might not be typical user, but the first thing I tried to
 explore was 'perf list -v' ;-)
 
 would it be better to have just the list with event names for:
$ perf list
 
 and with descriptions for:
$ perf list -v
 
 not sure we already discussed this..

It was discussed last time. I think it's better to have descriptions
by default. Far more user friendly.

One thing we could in theory do with -v is to switch between Brief and Public
Description (the later is often more verbose). Would need some changes
to the alias code to have two descriptions though.

-Andi


-- 
a...@linux.intel.com -- Speaking for myself only
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 2/3] fbuffer: introduce the invert-region helper

2015-05-28 Thread Thomas Huth
On Thu, 28 May 2015 15:13:19 +0200
Greg Kurz gk...@linux.vnet.ibm.com wrote:

 The inner loop in fb8-toggle-cursor can be implemented with hv-logical-memop
 in board-qemu and get an incredible performance boost.
 
 Let's introduce a per-board helper:
 - board-js2x: slow RB based, taken from current fb8-toggle-cursor
 - board-qemu: faster hv-logical-memop based
 
 With standard graphical settings on board-qemu, we go from 512 hcall
 invocations per character down to 16.
 
 Suggested-by: Thomas Huth th...@redhat.com
 Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com
 ---
  board-js2x/slof/helper.fs |4 
  board-qemu/slof/helper.fs |3 +++
  slof/fs/fbuffer.fs|2 +-
  3 files changed, 8 insertions(+), 1 deletion(-)
 
 diff --git a/board-js2x/slof/helper.fs b/board-js2x/slof/helper.fs
 index 34d60da..918fdc4 100644
 --- a/board-js2x/slof/helper.fs
 +++ b/board-js2x/slof/helper.fs
 @@ -26,3 +26,7 @@
 s ,  $cat
 bdate2human $cat encode-string THEN
  ;
 +
 +: invert-region ( addr len -- )
 +   0 ?DO dup dup rb@ -1 xor swap rb! 1+ LOOP drop
 +;
 diff --git a/board-qemu/slof/helper.fs b/board-qemu/slof/helper.fs
 index 96da498..da676c7 100644
 --- a/board-qemu/slof/helper.fs
 +++ b/board-qemu/slof/helper.fs
 @@ -33,3 +33,6 @@
swap -
  ;
  
 +: invert-region ( addr len -- )
 +   over swap 0 swap 1 hv-logical-memop drop
 +;
 diff --git a/slof/fs/fbuffer.fs b/slof/fs/fbuffer.fs
 index faae6a9..deeba6b 100644
 --- a/slof/fs/fbuffer.fs
 +++ b/slof/fs/fbuffer.fs
 @@ -99,7 +99,7 @@ CREATE bitmap-buffer 400 4 * allot
  : fb8-toggle-cursor ( -- )
   line# fb8-line2addr column# fb8-columns2bytes +
   char-height 0 ?DO
 - dup char-width screen-depth * 0 ?DO dup dup rb@ -1 xor swap rb! 
 1+ LOOP drop
 + dup char-width screen-depth * invert-region
   screen-width screen-depth * +
   LOOP drop
  ;

Reviewed-by: Thomas Huth th...@redhat.com

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 3/3] fbuffer: introduce the invert-region-x helper

2015-05-28 Thread Thomas Huth
On Thu, 28 May 2015 15:13:24 +0200
Greg Kurz gk...@linux.vnet.ibm.com wrote:

 This patch simply moves the slow RX based logic from fb8-invert-screen
 to board-js2x helpers and implement a fast hv-logical-memop based helper
 for board-qemu. And we can drop hcall-invert-screen !
 
 Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com
 ---
  board-js2x/slof/helper.fs   |5 +
  board-qemu/slof/helper.fs   |4 
  board-qemu/slof/pci-device_1234_.fs |   10 +-
  slof/fs/fbuffer.fs  |4 +---
  4 files changed, 11 insertions(+), 12 deletions(-)
 
 diff --git a/board-js2x/slof/helper.fs b/board-js2x/slof/helper.fs
 index 918fdc4..ea2d584 100644
 --- a/board-js2x/slof/helper.fs
 +++ b/board-js2x/slof/helper.fs
 @@ -30,3 +30,8 @@
  : invert-region ( addr len -- )
 0 ?DO dup dup rb@ -1 xor swap rb! 1+ LOOP drop
  ;
 +
 +

Maybe remove one of the two empty lines?

 +: invert-region-x ( addr len -- )
 +   /x / 0 ?DO dup dup rx@ -1 xor swap rx! xa1+ LOOP drop
 +;
 diff --git a/board-qemu/slof/helper.fs b/board-qemu/slof/helper.fs
 index da676c7..c807bc6 100644
 --- a/board-qemu/slof/helper.fs
 +++ b/board-qemu/slof/helper.fs
 @@ -36,3 +36,7 @@
  : invert-region ( addr len -- )
 over swap 0 swap 1 hv-logical-memop drop
  ;
 +
 +: invert-region-x ( addr len -- )
 +   over swap /x / 3 swap 1 hv-logical-memop drop
 +;
 diff --git a/board-qemu/slof/pci-device_1234_.fs 
 b/board-qemu/slof/pci-device_1234_.fs
 index a5c3584..26b0623 100644
 --- a/board-qemu/slof/pci-device_1234_.fs
 +++ b/board-qemu/slof/pci-device_1234_.fs
 @@ -188,16 +188,9 @@ a CONSTANT VBE_DISPI_INDEX_NB
  : display-remove ( -- ) 
  ;
  
 -: hcall-invert-screen ( -- )
 -frame-buffer-adr frame-buffer-adr 3
 -screen-height screen-width * screen-depth * /x /
 -1 hv-logical-memop
 -drop
 -;
 -
  : hcall-blink-screen ( -- )
  \ 32 msec delay for visually noticing the blink
 -hcall-invert-screen 20 ms hcall-invert-screen
 +invert-screen 20 ms invert-screen
  ;
  
  : display-install ( -- )
 @@ -211,7 +204,6 @@ a CONSTANT VBE_DISPI_INDEX_NB
  disp-width char-width / disp-height char-height /
  disp-depth 7 + 8 /  ( width height #lines #cols 
 depth )
  fb-install
 - ['] hcall-invert-screen to invert-screen
   ['] hcall-blink-screen to blink-screen
   true to is-installed?
  THEN
 diff --git a/slof/fs/fbuffer.fs b/slof/fs/fbuffer.fs
 index deeba6b..fcdd2fa 100644
 --- a/slof/fs/fbuffer.fs
 +++ b/slof/fs/fbuffer.fs
 @@ -170,9 +170,7 @@ CREATE bitmap-buffer 400 4 * allot
  ;
  
  : fb8-invert-screen ( -- )
 - frame-buffer-adr screen-height screen-width * screen-depth * 2dup /x / 
 0 ?DO
 - dup rx@ -1 xor over rx! xa1+
 - LOOP 3drop
 + frame-buffer-adr screen-height screen-width * screen-depth * 
 invert-region-x
  ;
  
  : fb8-blink-screen ( -- ) fb8-invert-screen fb8-invert-screen ;

Reviewed-by: Thomas Huth th...@redhat.com
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [2/4] powerpc/fsl-booke: Add T1023RDB FMan device tree

2015-05-28 Thread Scott Wood
On Wed, May 20, 2015 at 03:41:38PM +0300, Madalin Bucur wrote:
 diff --git a/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi 
 b/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi
 index 48c1690..a6eb7ae 100644
 --- a/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi
 +++ b/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi
 @@ -344,6 +344,14 @@
   reg = 0xe 0xe00;
   fsl,has-rstcr;
   fsl,liodn-bits = 12;
 +
 + fm0clk: fm0-clk-mux {
 + #clock-cells = 0;
 + compatible = fsl,fman-clk-mux;
 + clocks = pll0 1;
 + clock-names = pll0-div2;
 + clock-output-names = fm0-clk;
 + };
   };

NACK as previously discussed.

 diff --git a/arch/powerpc/boot/dts/t1023rdb.dts 
 b/arch/powerpc/boot/dts/t1023rdb.dts
 index 571e070..146d30d 100644
 --- a/arch/powerpc/boot/dts/t1023rdb.dts
 +++ b/arch/powerpc/boot/dts/t1023rdb.dts
 @@ -128,6 +128,46 @@
   i2c@118100 {
   };
  
 + fman@40 {
 + fm1mac1: ethernet@e {
 + phy-handle = sgmii_rtk_phy2;
 + phy-connection-type = sgmii;
 + sleep = rcpm 0x8000;
 + };

Get rid of this sleep stuff.  It's an unfinished thing that nothing uses
but people have copied all over the place.  The binding for it only
covers pmc nodes compatible with mpc8349, mpc8536, and mpc8548.  The
right way to handle this is with a clocks property.

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [v2,1/2] powerpc/mpc8xxx: Change EDAC for FSL SoC

2015-05-28 Thread Scott Wood
On Thu, May 07, 2015 at 05:41:37PM +0800, songwenbin wrote:
 From: York Sun york...@freescale.com
 
 Remove mpc83xx and mpc85xx as dependency.
 
 Signed-off-by: York Sun york...@freescale.com
 Signed-off-by: songwenbin wenbin.s...@freescale.com
 ---
  drivers/edac/Kconfig | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

These patches need to be sent to the EDAC list and maintainer.

 diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig
 index cb59619..ad07d4f 100644
 --- a/drivers/edac/Kconfig
 +++ b/drivers/edac/Kconfig
 @@ -262,10 +262,10 @@ config EDAC_SBRIDGE
  
  config EDAC_MPC85XX
   tristate Freescale MPC83xx / MPC85xx
 - depends on EDAC_MM_EDAC  FSL_SOC  (PPC_83xx || PPC_85xx)
 + depends on EDAC_MM_EDAC  FSL_SOC
   help
 Support for error detection and correction on the Freescale
 -   MPC8349, MPC8560, MPC8540, MPC8548
 +   MPC8349, MPC8560, MPC8540, MPC8548, T4240

Why T4240?  We're not really going to list every mpc85xx/QorIQ PPC chip
here, are we?

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 2/3] powerpc/mm: Limit the max memory we can support

2015-05-28 Thread Aneesh Kumar K.V
We need to limit the max memory based on Linux page table format.
For example, with 4K page size we can't support 64TB memory based
on the existing pte format. Add checks to limit memory based
on pte size.

Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com
---
 arch/powerpc/kernel/prom.c | 22 +++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 308c5e15676b..a0108ddde01c 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -698,9 +698,25 @@ void __init early_init_devtree(void *params)
 #endif
reserve_crashkernel();
early_reserve_mem();
-
-   /* Ensure that total memory size is page-aligned. */
-   limit = ALIGN(memory_limit ?: memblock_phys_mem_size(), PAGE_SIZE);
+   /*
+* if not specified limit the memory based on the pfn count that
+* we can fit in pte_t. Also ensure that total memory size is
+* page-aligned.
+*/
+   if (!memory_limit) {
+   int bit_count;
+   phys_addr_t pte_mem_limit;
+
+   BUILD_BUG_ON(sizeof(pte_basic_t)  8);
+   bit_count = (sizeof(pte_basic_t) * 8) - PTE_RPN_SHIFT + 
PAGE_SHIFT;
+   pte_mem_limit = ~0ULL  (64 - bit_count);
+   limit = memblock_phys_mem_size();
+   if (limit  pte_mem_limit)
+   limit = pte_mem_limit;
+   } else
+   limit = memory_limit;
+
+   limit = ALIGN(limit, PAGE_SIZE);
memblock_enforce_memory_limit(limit);
 
memblock_allow_resize();
-- 
2.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [1/4, v4] powerpc/fsl-booke: Add device tree support for T1024/T1023 SoC

2015-05-28 Thread Scott Wood
On Wed, Apr 15, 2015 at 11:48:08AM +0800, Shengzhou Liu wrote:
 + };
 +/include/ qoriq-i2c-0.dtsi
 +/include/ qoriq-i2c-1.dtsi
 +/include/ qoriq-duart-0.dtsi
 +/include/ qoriq-duart-1.dtsi
 +/include/ qoriq-gpio-0.dtsi
 +/include/ qoriq-gpio-1.dtsi
 +/include/ qoriq-gpio-2.dtsi
 +/include/ qoriq-gpio-3.dtsi
 +/include/ qoriq-usb2-mph-0.dtsi
 + usb0: usb@21 {
 + compatible = fsl-usb2-mph-v2.5, fsl-usb2-mph;
 + fsl,iommu-parent = pamu0;
 + fsl,liodn-reg = guts 0x520; /* USB1LIODNR */
 + phy_type = utmi;
 + port0;
 + };
 +/include/ qoriq-usb2-dr-0.dtsi
 + usb1: usb@211000 {
 + compatible = fsl-usb2-dr-v2.5, fsl-usb2-dr;
 + fsl,iommu-parent = pamu0;
 + fsl,liodn-reg = guts 0x524; /* USB2LIODNR */
 + dr_mode = host;
 + phy_type = utmi;
 + };
 +/include/ qoriq-sata2-0.dtsi
 +sata@22 {
 + fsl,iommu-parent = pamu0;
 + fsl,liodn-reg = guts 0x550; /* SATA1LIODNR */
 +};
 +
 +/include/ qoriq-sec5.0-0.dtsi
 +};

Whitespace here is a mess -- fixed while applying.

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [v2] powerpc/mpc85xx: Add DPAA Ethernet QMan support to the device tree(s)

2015-05-28 Thread Scott Wood
On Wed, May 20, 2015 at 03:29:35PM +0300, Madalin Bucur wrote:
 From: Emil Medve emilian.me...@freescale.com
 
 Signed-off-by: Emil Medve emilian.me...@freescale.com

What does DPAA Ethernet QMan support mean?  Is it ethernet support or
qman support?  In any case the subject is too long.

 +/* These stubs are required to alloc qbman drivers to determine what ranges 
 of
 + * resources are available for dynamic allocation, primarily because there 
 are
 + * some legacy a priori assumptions in certain subsystems (eg. networking)
 + * that certain resources are reserved for their use. When those drivers 
 (and in
 + * some cases, their corresponding device-tree nodes) are updated to 
 dynamically
 + * allocate their resources, then *all* resources can be managed by the
 + * allocators and there may be no further need to define these stubs.

I thought we were doing full dynamic resource allocation for the upstream
driver and device tree binding.

 + * - Even for memory-backed resources that are software determined (FQIDs), 
 this
 + *   information may only be configured and available on the control-plane
 + *   partition that manages the device, so in AMP or hypervised scenarios 
 there
 + *   may still be need to a way to provide allocation ranges. Ie. for O/S
 + *   instances that don't know how many resources are available to hardware, 
 and
 + *   possibly even for O/S instances that do know how many are available but
 + *   that should not own all of them.

Partial device assignment under virtualization needs special handling for
any device; no need to have a big block comment about it here.

 + */
 +
 +qportals {
 + qman-fqids@0 {
 + compatible = fsl,fqid-range;
 + fsl,fqid-range = 256 256;
 + };
 + qman-fqids@1 {
 + compatible = fsl,fqid-range;
 + fsl,fqid-range = 32768 32768;
 + };
 + qman-pools@0 {
 + compatible = fsl,pool-channel-range;
 + fsl,pool-channel-range = 0x21 0xf;
 + };
 + qman-cgrids@0 {
 + compatible = fsl,cgrid-range;
 + fsl,cgrid-range = 0 256;
 + };
 +};

Where is the binding for this stuff?

 +/* The comments in qoriq-dpaa-res1.dtsi apply here too so will not be 
 repeated.
 + * This alternative file is to support p1023 which does not have the same
 + * resource ranges as other SoCs to date. */

Then put p1023 in the name instead of res2 (or if the 2 really means
something, explain).

 +/* These stubs are required to alloc qbman drivers to determine what ranges 
 of
 + * resources are available for dynamic allocation, primarily because there 
 are
 + * some legacy a priori assumptions in certain subsystems (eg. networking)
 + * that certain resources are reserved for their use. When those drivers 
 (and in
 + * some cases, their corresponding device-tree nodes) are updated to 
 dynamically
 + * allocate their resources, then *all* resources can be managed by the
 + * allocators and there may be no further need to define these stubs.
 + *
 + * A couple of qualifiers to the above statement though:
 + *
 + * - Some resource ranges are hardware-specific, rather than being defined by
 + *   software memory allocation choices. Eg. the number of available BPIDs is
 + *   baked into silicon and so will probably always need to be expressed in 
 the
 + *   device-tree, though in that case it will express all BPIDs, not just 
 those
 + *   available for dynamic allocation.
 + *
 + * - Even for memory-backed resources that are software determined (FQIDs), 
 this
 + *   information may only be configured and available on the control-plane
 + *   partition that manages the device, so in AMP or hypervised scenarios 
 there
 + *   may still be need to a way to provide allocation ranges. Ie. for O/S
 + *   instances that don't know how many resources are available to hardware, 
 and
 + *   possibly even for O/S instances that do know how many are available but
 + *   that should not own all of them.

Why is all this repeated here?

If explanation is needed about what the nodes are here for, put it in the
binding document.

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: powerpc/fsl: Add FMan Port 10G compatibles

2015-05-28 Thread Scott Wood
On Mon, May 25, 2015 at 04:30:46PM +0300, Igal.Liberman wrote:
 From: Igal Liberman igal.liber...@freescale.com
 
 This patch adds two boolean properties to FMan Port.
 FMan has 3 types of ports:
   - 1G ports
   By default, all ports support 1G rate
   - 10G Ports
   Port which use 10G hardware, and configured as 10G
   - 10G Best effort ports
   Ports which use 1G hardware, configured as 10G, in this case,
   the rate is not guaranteed.
 The new properties help to distinguish the different type of ports.
 
 Signed-off-by: Igal Liberman igal.liber...@freescale.com
 ---
  .../devicetree/bindings/powerpc/fsl/fman.txt   |   13 +
  1 file changed, 13 insertions(+)
 
 diff --git a/Documentation/devicetree/bindings/powerpc/fsl/fman.txt 
 b/Documentation/devicetree/bindings/powerpc/fsl/fman.txt
 index edda55f..76a7cba 100644
 --- a/Documentation/devicetree/bindings/powerpc/fsl/fman.txt
 +++ b/Documentation/devicetree/bindings/powerpc/fsl/fman.txt
 @@ -189,6 +189,19 @@ PROPERTIES
   Definition: There is one reg region describing the port
   configuration registers.
  
 +- 10G-support
 + Usage: optional
 + Value type: boolean
 + Definition: The default port rate is 1G.
 + If this property exists, the port is configured as 10G port.

fsl,fman-10g-port

s/is configured as 10G port/is a 10G port/

 +- best-effort-port
 + Usage: optional
 + Value type: boolean
 + Definition: Can be defined only if 10G-support is set.
 + This property marks a best-effort 10G port (1G hardware
 + configured as 10G, 10G rate is not guaranteed).

fsl,fman-best-effort-port

s/1G hardware configured as 10G/10G port that may not be capable of line
rate/ or something along those lines.

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 03/15] powerpc: use device_initcall for registering rtc devices

2015-05-28 Thread Paul Gortmaker
Currently these two RTC devices are in core platform code
where it is not possible for them to be modular.  It will
never be modular, so using module_init as an alias for
__initcall can be somewhat misleading.

Fix this up now, so that we can relocate module_init from
init.h into module.h in the future.  If we don't do this, we'd
have to add module.h to obviously non-modular code, and that
would be a worse thing.

Note that direct use of __initcall is discouraged, vs. one
of the priority categorized subgroups.  As __initcall gets
mapped onto device_initcall, our use of device_initcall
directly in this change means that the runtime impact is
zero -- they will remain at level 6 in initcall ordering.

Cc: Benjamin Herrenschmidt b...@kernel.crashing.org
Cc: Paul Mackerras pau...@samba.org
Cc: Geoff Levand ge...@infradead.org
Acked-by: Geoff Levand ge...@infradead.org
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker paul.gortma...@windriver.com
---
 arch/powerpc/kernel/time.c| 2 +-
 arch/powerpc/platforms/ps3/time.c | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 56f44848b044..43922509a483 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -1124,4 +1124,4 @@ static int __init rtc_init(void)
return PTR_ERR_OR_ZERO(pdev);
 }
 
-module_init(rtc_init);
+device_initcall(rtc_init);
diff --git a/arch/powerpc/platforms/ps3/time.c 
b/arch/powerpc/platforms/ps3/time.c
index ce73ce865613..791c6142c4a7 100644
--- a/arch/powerpc/platforms/ps3/time.c
+++ b/arch/powerpc/platforms/ps3/time.c
@@ -92,5 +92,4 @@ static int __init ps3_rtc_init(void)
 
return PTR_ERR_OR_ZERO(pdev);
 }
-
-module_init(ps3_rtc_init);
+device_initcall(ps3_rtc_init);
-- 
2.2.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [2/4,v3] powerpc/fsl-booke: Add T1024 QDS board support

2015-05-28 Thread Scott Wood
On Thu, Apr 09, 2015 at 04:07:43PM +0800, Shengzhou Liu wrote:
 + flash@2 {
 + #address-cells = 1;
 + #size-cells = 1;
 + compatible = eon,en25s64;   /* 8MB */
 + reg = 2;
 + spi-max-frequency = 1000;
 + };

AFAICT the vendor is phyton, not eon.

 + eeprom@50 {
 + compatible = at24,24c512;
 + reg = 0x50;
 + };
 +
 + eeprom@51 {
 + compatible = at24,24c02;
 + reg = 0x51;
 + };
 +
 + eeprom@57 {
 + compatible = at24,24c02;
 + reg = 0x57;
 + };

The vendor is atmel, not at24.

I'll fix when applying, but please be careful with compatible strings
next time.  Also, please document compatible strings and vendor prefixes
when checkpatch complains, unless it's a situation where checkpatch isn't
recognizing a pattern compatible (e.g.  fsl,soc-whatever or
fsl,whatever-version).

This patch also had too long lines in the commit message (and really, you
don't need to describe the board in such detail).  I'll remove that
section of the changelog when applying.

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 04/15] powerpc: don't use module_init in non-modular 83xx suspend code

2015-05-28 Thread Paul Gortmaker
The suspend.o is built for SUSPEND -- which is bool, and hence
this code is either present or absent.  It will never be modular,
so using module_init as an alias for __initcall can be somewhat
misleading.

Fix this up now, so that we can relocate module_init from
init.h into module.h in the future.  If we don't do this, we'd
have to add module.h to obviously non-modular code, and that
would be a worse thing.

Note that direct use of __initcall is discouraged, vs. one
of the priority categorized subgroups.  As __initcall gets
mapped onto device_initcall, our use of device_initcall
directly in this change means that the runtime impact is
zero -- it will remain at level 6 in initcall ordering.

Cc: Scott Wood scottw...@freescale.com
Cc: Benjamin Herrenschmidt b...@kernel.crashing.org
Cc: Paul Mackerras pau...@samba.org
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker paul.gortma...@windriver.com
---
 arch/powerpc/platforms/83xx/suspend.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/suspend.c 
b/arch/powerpc/platforms/83xx/suspend.c
index c9adbfb65006..fcbea4b51a78 100644
--- a/arch/powerpc/platforms/83xx/suspend.c
+++ b/arch/powerpc/platforms/83xx/suspend.c
@@ -445,5 +445,4 @@ static int pmc_init(void)
 {
return platform_driver_register(pmc_driver);
 }
-
-module_init(pmc_init);
+device_initcall(pmc_init);
-- 
2.2.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [4/4,v3] powerpc/fsl-booke: Add T1023 RDB board support

2015-05-28 Thread Scott Wood
On Thu, Apr 09, 2015 at 04:07:45PM +0800, Shengzhou Liu wrote:
 + i2c@118000 {
 + eeprom@50 {
 + compatible = stm,m24256;
 + reg = 0x50;
 + };

Vendor prefix is st, not stm -- see
Documentation/devicetree/bindings/vendor-prefixes.txt

I'll fix when applying.

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 00/15] Replace module_init with device_initcall in non modules

2015-05-28 Thread Paul Gortmaker
This series of commits converts non-modular code that is using
the module_init() call to hook itself into the system to instead
use device_initcall().

The conversion is a runtime no-op, since module_init actually
becomes __initcall in the non-modular case, and that in turn gets
mapped onto device_initcall.

We fix this up now, so that we can relocate module_init from
init.h into module.h in a future series.

The files changed here are just limited to those that would
otherwise have to add module.h to obviously non-modular code, since
we don't want to do that.

This work is factored out from what was a previously larger series[1] so
that there is a common theme and lower patch count to ease review.

Paul.

[1] https://marc.info/?l=linux-kernelm=139033951228828

---

Cc: Benjamin Herrenschmidt b...@kernel.crashing.org
Cc: Chris Zankel ch...@zankel.net
Cc: David Howells dhowe...@redhat.com
Cc: Fenghua Yu fenghua...@intel.com
Cc: Geoff Levand ge...@infradead.org
Cc: Helge Deller del...@gmx.de
Cc: H. Peter Anvin h...@zytor.com
Cc: Ingo Molnar mi...@redhat.com
Cc: Ivan Kokshaysky i...@jurassic.park.msu.ru
Cc: James E.J. Bottomley j...@parisc-linux.org
Cc: Jesper Nilsson jesper.nils...@axis.com
Cc: Koichi Yasutake yasutake.koi...@jp.panasonic.com
Cc: Matt Turner matts...@gmail.com
Cc: Max Filippov jcmvb...@gmail.com
Cc: Mikael Starvik star...@axis.com
Cc: Mike Turquette mturque...@linaro.org
Cc: Paul Mackerras pau...@samba.org
Cc: Paul Mundt let...@linux-sh.org
Cc: Richard Henderson r...@twiddle.net
Cc: Russell King li...@arm.linux.org.uk
Cc: Scott Wood scottw...@freescale.com
Cc: Thomas Gleixner t...@linutronix.de
Cc: Thomas Meyer tho...@m3y3r.de
Cc: Tony Luck tony.l...@intel.com
Cc: linux-al...@vger.kernel.org
Cc: linux-am33-l...@redhat.com
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-cris-ker...@axis.com
Cc: linux-i...@vger.kernel.org
Cc: linux-par...@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux...@vger.kernel.org
Cc: linux-xte...@linux-xtensa.org
Cc: x...@kernel.org

Paul Gortmaker (15):
  x86: don't use module_init in non-modular intel_mid_vrtc.c
  x86: don't use module_init in non-modular devicetree.c code
  powerpc: use device_initcall for registering rtc devices
  powerpc: don't use module_init in non-modular 83xx suspend code
  arm: don't use module_init in non-modular mach-vexpress/spc.c code
  alpha: don't use module_init for non-modular core code
  ia64: don't use module_init for non-modular core kernel/mca.c code
  ia64: don't use module_init in non-modular sim/simscsi.c code
  cris: don't use module_init for non-modular core intmem.c code
  parisc: don't use module_init for non-modular core pdc_cons code
  parisc64: don't use module_init for non-modular core perf code
  mn10300: don't use module_init in non-modular flash.c code
  sh: don't use module_init in non-modular psw.c code
  xtensa: don't use module_init for non-modular core network.c code
  drivers/clk: don't use module_init in clk-nomadik.c which is
non-modular

 arch/alpha/kernel/srmcons.c  |  3 +--
 arch/arm/mach-vexpress/spc.c |  2 +-
 arch/cris/arch-v32/mm/intmem.c   |  3 +--
 arch/ia64/hp/sim/simscsi.c   | 11 +--
 arch/ia64/sn/kernel/mca.c|  3 +--
 arch/mn10300/unit-asb2303/flash.c|  3 +--
 arch/parisc/kernel/pdc_cons.c|  3 +--
 arch/parisc/kernel/perf.c|  3 +--
 arch/powerpc/kernel/time.c   |  2 +-
 arch/powerpc/platforms/83xx/suspend.c|  3 +--
 arch/powerpc/platforms/ps3/time.c|  3 +--
 arch/sh/boards/mach-landisk/psw.c|  2 +-
 arch/x86/kernel/devicetree.c |  2 +-
 arch/x86/platform/intel-mid/intel_mid_vrtc.c |  3 +--
 arch/xtensa/platforms/iss/network.c  |  4 +---
 drivers/clk/clk-nomadik.c|  3 +--
 16 files changed, 16 insertions(+), 37 deletions(-)

-- 
2.2.1
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 3/3] powerpc/mm: Change the swap encoding in pte.

2015-05-28 Thread Aneesh Kumar K.V
Current swap encoding in pte can't support large pfns
above 4TB. Change the swap encoding such that we put
the swap type in the PTE bits. Also add build checks
to make sure we don't overlap with HPTEFLAGS.

Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com
---
 arch/powerpc/include/asm/pgtable-ppc64.h | 26 +-
 arch/powerpc/include/asm/pte-book3e.h|  1 +
 arch/powerpc/include/asm/pte-hash64.h|  1 +
 3 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h 
b/arch/powerpc/include/asm/pgtable-ppc64.h
index 43e6ad424c7f..954ae1201e42 100644
--- a/arch/powerpc/include/asm/pgtable-ppc64.h
+++ b/arch/powerpc/include/asm/pgtable-ppc64.h
@@ -347,11 +347,27 @@ static inline void __ptep_set_access_flags(pte_t *ptep, 
pte_t entry)
pr_err(%s:%d: bad pgd %08lx.\n, __FILE__, __LINE__, pgd_val(e))
 
 /* Encode and de-code a swap entry */
-#define __swp_type(entry)  (((entry).val  1)  0x3f)
-#define __swp_offset(entry)((entry).val  8)
-#define __swp_entry(type, offset) ((swp_entry_t){((type) 1)|((offset)8)})
-#define __pte_to_swp_entry(pte)((swp_entry_t){pte_val(pte)  
PTE_RPN_SHIFT})
-#define __swp_entry_to_pte(x)  ((pte_t) { (x).val  PTE_RPN_SHIFT })
+#define MAX_SWAPFILES_CHECK() do { \
+   BUILD_BUG_ON(MAX_SWAPFILES_SHIFT  SWP_TYPE_BITS); \
+   /*  \
+* Don't have overlapping bits with _PAGE_HPTEFLAGS \
+* We filter HPTEFLAGS on set_pte.  \
+*/ \
+   BUILD_BUG_ON(_PAGE_HPTEFLAGS  (0x1f  _PAGE_BIT_SWAP_TYPE)); \
+   } while (0)
+/*
+ * on pte we don't need handle RADIX_TREE_EXCEPTIONAL_SHIFT;
+ */
+#define SWP_TYPE_BITS 5
+#define __swp_type(x)  (((x).val  _PAGE_BIT_SWAP_TYPE) \
+((1UL  SWP_TYPE_BITS) - 1))
+#define __swp_offset(x)((x).val  PTE_RPN_SHIFT)
+#define __swp_entry(type, offset)  ((swp_entry_t) { \
+   ((type)  _PAGE_BIT_SWAP_TYPE) \
+   | ((offset)  PTE_RPN_SHIFT) })
+
+#define __pte_to_swp_entry(pte)((swp_entry_t) { pte_val((pte)) 
})
+#define __swp_entry_to_pte(x)  __pte((x).val)
 
 void pgtable_cache_add(unsigned shift, void (*ctor)(void *));
 void pgtable_cache_init(void);
diff --git a/arch/powerpc/include/asm/pte-book3e.h 
b/arch/powerpc/include/asm/pte-book3e.h
index 91a704952ca1..8d8473278d91 100644
--- a/arch/powerpc/include/asm/pte-book3e.h
+++ b/arch/powerpc/include/asm/pte-book3e.h
@@ -11,6 +11,7 @@
 /* Architected bits */
 #define _PAGE_PRESENT  0x01 /* software: pte contains a translation */
 #define _PAGE_SW1  0x02
+#define _PAGE_BIT_SWAP_TYPE2
 #define _PAGE_BAP_SR   0x04
 #define _PAGE_BAP_UR   0x08
 #define _PAGE_BAP_SW   0x10
diff --git a/arch/powerpc/include/asm/pte-hash64.h 
b/arch/powerpc/include/asm/pte-hash64.h
index fc852f7e7b3a..ef612c160da7 100644
--- a/arch/powerpc/include/asm/pte-hash64.h
+++ b/arch/powerpc/include/asm/pte-hash64.h
@@ -16,6 +16,7 @@
  */
 #define _PAGE_PRESENT  0x0001 /* software: pte contains a translation 
*/
 #define _PAGE_USER 0x0002 /* matches one of the PP bits */
+#define _PAGE_BIT_SWAP_TYPE2
 #define _PAGE_EXEC 0x0004 /* No execute on POWER4 and newer (we 
invert) */
 #define _PAGE_GUARDED  0x0008
 /* We can derive Memory coherence from _PAGE_NO_CACHE */
-- 
2.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 3/3 v3] powerpc/powernv: Add opal-prd channel

2015-05-28 Thread Jeremy Kerr
This change adds a char device to access the PRD (processor runtime
diagnostics) channel to OPAL firmware.

Includes contributions from Vaidyanathan Srinivasan, Neelesh Gupta 
Vishal Kulkarni.

Signed-off-by: Neelesh Gupta neele...@linux.vnet.ibm.com
Signed-off-by: Jeremy Kerr j...@ozlabs.org
Acked-by: Stewart Smith stew...@linux.vnet.ibm.com

-- 

v3:
 - Add versioning description and reserved fields in opal_prd_info
   for future expansion

 - Fix node leak in opal_prd_range_is_valid

 - Explain open()  probe() semantics

 - Fix miscdev_register error path

---
 arch/powerpc/include/asm/opal-api.h|   21 
 arch/powerpc/include/asm/opal.h|1 
 arch/powerpc/include/uapi/asm/opal-prd.h   |   58 ++
 arch/powerpc/platforms/powernv/Kconfig |7 
 arch/powerpc/platforms/powernv/Makefile|1 
 arch/powerpc/platforms/powernv/opal-prd.c  |  451 +
 arch/powerpc/platforms/powernv/opal-wrappers.S |1 
 arch/powerpc/platforms/powernv/opal.c  |4 
 8 files changed, 542 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/opal-api.h 
b/arch/powerpc/include/asm/opal-api.h
index 0321a90..2407f12 100644
--- a/arch/powerpc/include/asm/opal-api.h
+++ b/arch/powerpc/include/asm/opal-api.h
@@ -153,7 +153,8 @@
 #define OPAL_FLASH_READ110
 #define OPAL_FLASH_WRITE   111
 #define OPAL_FLASH_ERASE   112
-#define OPAL_LAST  112
+#define OPAL_PRD_MSG   113
+#define OPAL_LAST  113
 
 /* Device tree flags */
 
@@ -352,6 +353,7 @@ enum opal_msg_type {
OPAL_MSG_SHUTDOWN,  /* params[0] = 1 reboot, 0 shutdown */
OPAL_MSG_HMI_EVT,
OPAL_MSG_DPO,
+   OPAL_MSG_PRD,
OPAL_MSG_TYPE_MAX,
 };
 
@@ -674,6 +676,23 @@ typedef struct oppanel_line {
__be64 line_len;
 } oppanel_line_t;
 
+enum opal_prd_msg_type {
+   OPAL_PRD_MSG_TYPE_INIT = 0, /* HBRT -- OPAL */
+   OPAL_PRD_MSG_TYPE_FINI, /* HBRT/kernel -- OPAL */
+   OPAL_PRD_MSG_TYPE_ATTN, /* HBRT -- OPAL */
+   OPAL_PRD_MSG_TYPE_ATTN_ACK, /* HBRT -- OPAL */
+   OPAL_PRD_MSG_TYPE_OCC_ERROR,/* HBRT -- OPAL */
+   OPAL_PRD_MSG_TYPE_OCC_RESET,/* HBRT -- OPAL */
+};
+
+struct opal_prd_msg_header {
+   uint8_t type;
+   uint8_t pad[1];
+   __be16  size;
+};
+
+struct opal_prd_msg;
+
 /*
  * SG entries
  *
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index 042af1a..93704af 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -193,6 +193,7 @@ int64_t opal_ipmi_recv(uint64_t interface, struct 
opal_ipmi_msg *msg,
uint64_t *msg_len);
 int64_t opal_i2c_request(uint64_t async_token, uint32_t bus_id,
 struct opal_i2c_request *oreq);
+int64_t opal_prd_msg(struct opal_prd_msg *msg);
 
 int64_t opal_flash_read(uint64_t id, uint64_t offset, uint64_t buf,
uint64_t size, uint64_t token);
diff --git a/arch/powerpc/include/uapi/asm/opal-prd.h 
b/arch/powerpc/include/uapi/asm/opal-prd.h
new file mode 100644
index 000..319ff4a
--- /dev/null
+++ b/arch/powerpc/include/uapi/asm/opal-prd.h
@@ -0,0 +1,58 @@
+/*
+ * OPAL Runtime Diagnostics interface driver
+ * Supported on POWERNV platform
+ *
+ * (C) Copyright IBM 2015
+ *
+ * Author: Vaidyanathan Srinivasan svaidy at linux.vnet.ibm.com
+ * Author: Jeremy Kerr j...@ozlabs.org
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef _UAPI_ASM_POWERPC_OPAL_PRD_H_
+#define _UAPI_ASM_POWERPC_OPAL_PRD_H_
+
+#include linux/types.h
+
+/**
+ * The version of the kernel interface of the PRD system. This describes the
+ * interface available for the /dev/opal-prd device. The actual PRD message
+ * layout and content is private to the firmware -- userspace interface, so
+ * is not covered by this versioning.
+ *
+ * Future interface versions are backwards-compatible; if a later kernel
+ * version is encountered, functionality provided in earlier versions
+ * will work.
+ */
+#define OPAL_PRD_KERNEL_VERSION1
+
+#define OPAL_PRD_GET_INFO  _IOR('o', 0x01, struct opal_prd_info)
+#define OPAL_PRD_SCOM_READ _IOR('o', 0x02, struct opal_prd_scom)
+#define OPAL_PRD_SCOM_WRITE_IOW('o', 0x03, struct opal_prd_scom)
+
+#ifndef __ASSEMBLY__
+
+struct opal_prd_info {
+   

Re: [PATCH 2/3] fbuffer: introduce the invert-region helper

2015-05-28 Thread Nikunj A Dadhania
Greg Kurz gk...@linux.vnet.ibm.com writes:

 The inner loop in fb8-toggle-cursor can be implemented with hv-logical-memop
 in board-qemu and get an incredible performance boost.

 Let's introduce a per-board helper:
 - board-js2x: slow RB based, taken from current fb8-toggle-cursor
 - board-qemu: faster hv-logical-memop based

 With standard graphical settings on board-qemu, we go from 512 hcall
 invocations per character down to 16.

 Suggested-by: Thomas Huth th...@redhat.com
 Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com

Reviewed-by: Nikunj A Dadhania nik...@linux.vnet.ibm.com

 ---
  board-js2x/slof/helper.fs |4 
  board-qemu/slof/helper.fs |3 +++
  slof/fs/fbuffer.fs|2 +-
  3 files changed, 8 insertions(+), 1 deletion(-)

 diff --git a/board-js2x/slof/helper.fs b/board-js2x/slof/helper.fs
 index 34d60da..918fdc4 100644
 --- a/board-js2x/slof/helper.fs
 +++ b/board-js2x/slof/helper.fs
 @@ -26,3 +26,7 @@
 s ,  $cat
 bdate2human $cat encode-string THEN
  ;
 +
 +: invert-region ( addr len -- )
 +   0 ?DO dup dup rb@ -1 xor swap rb! 1+ LOOP drop
 +;
 diff --git a/board-qemu/slof/helper.fs b/board-qemu/slof/helper.fs
 index 96da498..da676c7 100644
 --- a/board-qemu/slof/helper.fs
 +++ b/board-qemu/slof/helper.fs
 @@ -33,3 +33,6 @@
swap -
  ;

 +: invert-region ( addr len -- )
 +   over swap 0 swap 1 hv-logical-memop drop
 +;
 diff --git a/slof/fs/fbuffer.fs b/slof/fs/fbuffer.fs
 index faae6a9..deeba6b 100644
 --- a/slof/fs/fbuffer.fs
 +++ b/slof/fs/fbuffer.fs
 @@ -99,7 +99,7 @@ CREATE bitmap-buffer 400 4 * allot
  : fb8-toggle-cursor ( -- )
   line# fb8-line2addr column# fb8-columns2bytes +
   char-height 0 ?DO
 - dup char-width screen-depth * 0 ?DO dup dup rb@ -1 xor swap rb! 
 1+ LOOP drop
 + dup char-width screen-depth * invert-region
   screen-width screen-depth * +
   LOOP drop
  ;

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 0/3] fbuffer: performance improvement + code cleanup

2015-05-28 Thread Alexey Kardashevskiy

On 05/28/2015 11:13 PM, Greg Kurz wrote:

If booted in frame buffer mode, board-qemu currently calls hv-logical-load
and hv-logical-store for every pixel when enabling or disabling the cursor.
This is suboptimal when writing one char at a time to the console since
terminal-write always toggles the cursor. And this is precisely what grub
is doing when the user wants to edit a menu entry... the result is an
incredibly slow and barely usable interface.

This series introduces per-board helpers to be used by the frame buffer
code, so that board-qemu may have its own accelarated implementation:

- the first patch is preliminary cleanup, before moving code out to helpers.

- the second patch introduces a helper to invert a memory region byte-per-byte:
   this fixes the unbearable slowliness of grub editing mode.

- the third patch introduces a similar helper with a a quad-word pace: it
   doesn't bring any speed improvement since board-qemu already uses
   hv-logical-memop, but it allows to unify hcall-invert-screen and
   fb8-invert-screen again.

Please comment.


Thanks, I'll remove that extra line in 3/3 and push these today.




---

Greg Kurz (3):
   fbuffer: simplify address computations in fb8-toggle-cursor
   fbuffer: introduce the invert-region helper
   fbuffer: introduce the invert-region-x helper


  board-js2x/slof/helper.fs   |9 +
  board-qemu/slof/helper.fs   |7 +++
  board-qemu/slof/pci-device_1234_.fs |   10 +-
  slof/fs/fbuffer.fs  |8 +++-
  4 files changed, 20 insertions(+), 14 deletions(-)

--
Greg




--
Alexey
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 1/3] fbuffer: simplify address computations in fb8-toggle-cursor

2015-05-28 Thread Nikunj A Dadhania
Greg Kurz gk...@linux.vnet.ibm.com writes:

 The inner loop deals with a contiguous region. It could easily be replaced
 by faster board specific functions like hv-logical-memop in board-qemu.
 Since hv-logical-memop does not return an address, let's have the enclosing
 loop compute the next line address by itself and drop the confusing
 char-width screen-depth * - address adjustment.

Much better :-)

Reviewed-by: Nikunj A Dadhania nik...@linux.vnet.ibm.com


 Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com
 ---
  slof/fs/fbuffer.fs |4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

 diff --git a/slof/fs/fbuffer.fs b/slof/fs/fbuffer.fs
 index 756f05a..faae6a9 100644
 --- a/slof/fs/fbuffer.fs
 +++ b/slof/fs/fbuffer.fs
 @@ -99,8 +99,8 @@ CREATE bitmap-buffer 400 4 * allot
  : fb8-toggle-cursor ( -- )
   line# fb8-line2addr column# fb8-columns2bytes +
   char-height 0 ?DO
 - char-width screen-depth * 0 ?DO dup dup rb@ -1 xor swap rb! 1+ 
 LOOP
 - screen-width screen-depth * + char-width screen-depth * -
 + dup char-width screen-depth * 0 ?DO dup dup rb@ -1 xor swap rb! 
 1+ LOOP drop
 + screen-width screen-depth * +
   LOOP drop
  ;

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 3/3] fbuffer: introduce the invert-region-x helper

2015-05-28 Thread Nikunj A Dadhania
Greg Kurz gk...@linux.vnet.ibm.com writes:

 This patch simply moves the slow RX based logic from fb8-invert-screen
 to board-js2x helpers and implement a fast hv-logical-memop based helper
 for board-qemu. And we can drop hcall-invert-screen !

 Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com

Apart for the extra lines that Thomas pointed:

Reviewed-by: Nikunj A Dadhania nik...@linux.vnet.ibm.com

 ---
  board-js2x/slof/helper.fs   |5 +
  board-qemu/slof/helper.fs   |4 
  board-qemu/slof/pci-device_1234_.fs |   10 +-
  slof/fs/fbuffer.fs  |4 +---
  4 files changed, 11 insertions(+), 12 deletions(-)

 diff --git a/board-js2x/slof/helper.fs b/board-js2x/slof/helper.fs
 index 918fdc4..ea2d584 100644
 --- a/board-js2x/slof/helper.fs
 +++ b/board-js2x/slof/helper.fs
 @@ -30,3 +30,8 @@
  : invert-region ( addr len -- )
 0 ?DO dup dup rb@ -1 xor swap rb! 1+ LOOP drop
  ;
 +
 +
 +: invert-region-x ( addr len -- )
 +   /x / 0 ?DO dup dup rx@ -1 xor swap rx! xa1+ LOOP drop
 +;
 diff --git a/board-qemu/slof/helper.fs b/board-qemu/slof/helper.fs
 index da676c7..c807bc6 100644
 --- a/board-qemu/slof/helper.fs
 +++ b/board-qemu/slof/helper.fs
 @@ -36,3 +36,7 @@
  : invert-region ( addr len -- )
 over swap 0 swap 1 hv-logical-memop drop
  ;
 +
 +: invert-region-x ( addr len -- )
 +   over swap /x / 3 swap 1 hv-logical-memop drop
 +;
 diff --git a/board-qemu/slof/pci-device_1234_.fs 
 b/board-qemu/slof/pci-device_1234_.fs
 index a5c3584..26b0623 100644
 --- a/board-qemu/slof/pci-device_1234_.fs
 +++ b/board-qemu/slof/pci-device_1234_.fs
 @@ -188,16 +188,9 @@ a CONSTANT VBE_DISPI_INDEX_NB
  : display-remove ( -- ) 
  ;

 -: hcall-invert-screen ( -- )
 -frame-buffer-adr frame-buffer-adr 3
 -screen-height screen-width * screen-depth * /x /
 -1 hv-logical-memop
 -drop
 -;
 -
  : hcall-blink-screen ( -- )
  \ 32 msec delay for visually noticing the blink
 -hcall-invert-screen 20 ms hcall-invert-screen
 +invert-screen 20 ms invert-screen
  ;

  : display-install ( -- )
 @@ -211,7 +204,6 @@ a CONSTANT VBE_DISPI_INDEX_NB
  disp-width char-width / disp-height char-height /
  disp-depth 7 + 8 /  ( width height #lines #cols 
 depth )
  fb-install
 - ['] hcall-invert-screen to invert-screen
   ['] hcall-blink-screen to blink-screen
   true to is-installed?
  THEN
 diff --git a/slof/fs/fbuffer.fs b/slof/fs/fbuffer.fs
 index deeba6b..fcdd2fa 100644
 --- a/slof/fs/fbuffer.fs
 +++ b/slof/fs/fbuffer.fs
 @@ -170,9 +170,7 @@ CREATE bitmap-buffer 400 4 * allot
  ;

  : fb8-invert-screen ( -- )
 - frame-buffer-adr screen-height screen-width * screen-depth * 2dup /x / 
 0 ?DO
 - dup rx@ -1 xor over rx! xa1+
 - LOOP 3drop
 + frame-buffer-adr screen-height screen-width * screen-depth * 
 invert-region-x
  ;

  : fb8-blink-screen ( -- ) fb8-invert-screen fb8-invert-screen ;

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 1/3] powerpc/mm: PTE_RPN_MAX is not used, remove the same

2015-05-28 Thread Aneesh Kumar K.V
Remove the unused #define

Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com
---
 arch/powerpc/include/asm/pte-common.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/powerpc/include/asm/pte-common.h 
b/arch/powerpc/include/asm/pte-common.h
index c5a755ef7011..b7c8d079c121 100644
--- a/arch/powerpc/include/asm/pte-common.h
+++ b/arch/powerpc/include/asm/pte-common.h
@@ -85,10 +85,8 @@ extern unsigned long bad_call_to_PMD_PAGE_SIZE(void);
  * 64-bit PTEs
  */
 #if defined(CONFIG_PPC32)  defined(CONFIG_PTE_64BIT)
-#define PTE_RPN_MAX(1ULL  (64 - PTE_RPN_SHIFT))
 #define PTE_RPN_MASK   (~((1ULLPTE_RPN_SHIFT)-1))
 #else
-#define PTE_RPN_MAX(1UL  (32 - PTE_RPN_SHIFT))
 #define PTE_RPN_MASK   (~((1ULPTE_RPN_SHIFT)-1))
 #endif
 
-- 
2.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 04/10] perf, tools: Handle header line in mapfile

2015-05-28 Thread Sukadev Bhattiprolu
Jiri Olsa [jo...@redhat.com] wrote:
|  if (line[0] == '#' || line[0] == '\n')
|  continue;
|  +   if (!strncmp(line, Family, 6))
|  +   continue;
| 
| I think we should fix mapfiles to put the 'Family' starting
| line as a comment.. the way powerpc mapfile is done

You mean add something like this to the Intel mapfile:

# Power8 entries
004d0100,1,power8.json,core

and drop this patch?

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [alsa-devel] [RFC] sound: ppc: keywest: check if DEQ was already instantiated

2015-05-28 Thread Takashi Iwai
At Tue, 26 May 2015 02:19:34 -0700,
Dan DeVoto wrote:
 
 Hi,
 
 I applied this patch (check if DEQ was already instantiated) on top of 
 sound: ppc: keywest: drop using attach adapter and sound works great.
 Everything works as expected.  Below is my dmesg output.

Very well, shall I merge the patch as is?


thanks,

Takashi

 
 Regards,
 
 Dan
 
 
 On Sat, 5/23/15, Wolfram Sang w...@the-dreams.de wrote:
 
  Due to changes in i2c-powermac, for some Macs the DEQ is instantiated
  now in i2c-powermac while some need the instantiation here in the
  keywest sound driver. The proper fix is to convert this driver to AOA.
  Until then support both ways of instantiation. Before this patch, some
  Macs lost sound because the sound driver failed when instantiating the
  DEQ for the second time.
  
  Signed-off-by: Wolfram Sang w...@the-dreams.de
  ---
  
  Dan, Mark: I hope I found a generic but not too intrusive solution to the
  doubled instantiation problem. Can you please test this patch on top of this
  one sound: ppc: keywest: drop using attach adapter from last time? Check 
  if
  you have sound and send the dmesg output, please. I hope it compiles even,
  couldn't test that this time.
 
 
 ~$ dmesg
 [0.00] Using PowerMac machine description
 [0.00] Total memory = 640MB; using 2048kB for hash table (at c7e0)
 [0.00] Initializing cgroup subsys cpuset
 [0.00] Initializing cgroup subsys cpu
 [0.00] Initializing cgroup subsys cpuacct
 [0.00] Linux version 3.16.7-ckt9-custom4 (root@icebook) (gcc version 
 4.9.2 (Debian 4.9.2-10) ) #5 Mon May 25 23:52:51 PDT 2015
 [0.00] Found initrd at 0xc150:0xc220b000
 [0.00] Found UniNorth memory controller  host bridge @ 0xf800 
 revision: 0xc0
 [0.00] Mapped at 0xff7c
 [0.00] Found a Pangea mac-io controller, rev: 0, mapped at 0xff74
 [0.00] Processor NAP mode on idle enabled.
 [0.00] PowerMac motherboard: iBook 2 rev. 2
 [0.00] via-pmu: Server Mode is disabled
 [0.00] PMU driver v2 initialized for Core99, firmware: 0c
 [0.00] bootconsole [udbg0] enabled
 [0.00] Found UniNorth PCI host bridge at 0xf000. Firmware 
 bus number: 0-0
 [0.00] PCI host bridge /pci@f000  ranges:
 [0.00]  MEM 0xf100..0xf1ff - 
 0xf100 
 [0.00]   IO 0xf000..0xf07f - 
 0x
 [0.00]  MEM 0x9000..0x9fff - 
 0x9000 
 [0.00] Found UniNorth PCI host bridge at 0xf200. Firmware 
 bus number: 0-0
 [0.00] PCI host bridge /pci@f200 (primary) ranges:
 [0.00]  MEM 0xf300..0xf3ff - 
 0xf300 
 [0.00]   IO 0xf200..0xf27f - 
 0x
 [0.00]  MEM 0x8000..0x8fff - 
 0x8000 
 [0.00] Found UniNorth PCI host bridge at 0xf400. Firmware 
 bus number: 0-0
 [0.00] PCI host bridge /pci@f400  ranges:
 [0.00]  MEM 0xf500..0xf5ff - 
 0xf500 
 [0.00]   IO 0xf400..0xf47f - 
 0x
 [0.00] nvram: Checking bank 0...
 [0.00] nvram: gen0=1100, gen1=1101
 [0.00] nvram: Active bank is: 1
 [0.00] nvram: OF partition at 0x410
 [0.00] nvram: XP partition at 0x1020
 [0.00] nvram: NR partition at 0x1120
 [0.00] Top of RAM: 0x2800, Total RAM: 0x2800
 [0.00] Memory hole size: 0MB
 [0.00] Zone ranges:
 [0.00]   DMA  [mem 0x-0x27ff]
 [0.00]   Normal   empty
 [0.00]   HighMem  empty
 [0.00] Movable zone start for each node
 [0.00] Early memory node ranges
 [0.00]   node   0: [mem 0x-0x27ff]
 [0.00] On node 0 totalpages: 163840
 [0.00] free_area_init_node: node 0, pgdat c05ebf0c, node_mem_map 
 c076b000
 [0.00]   DMA zone: 1280 pages used for memmap
 [0.00]   DMA zone: 0 pages reserved
 [0.00]   DMA zone: 163840 pages, LIFO batch:31
 [0.00] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
 [0.00] pcpu-alloc: [0] 0 
 [0.00] Built 1 zonelists in Zone order, mobility grouping on.  Total 
 pages: 162560
 [0.00] Kernel command line: 
 root=UUID=97b477c4-04c2-476e-9225-4eda6ca97833 ro nomodeset video=offb:off 
 video=radeonfb:1024x768-32
 [0.00] PID hash table entries: 4096 (order: 2, 16384 bytes)
 [0.00] Dentry cache hash table entries: 131072 (order: 7, 524288 
 bytes)
 [0.00] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
 [0.00] Sorting __ex_table...
 [0.00] Memory: 626160K/655360K available (4252K kernel code, 320K 
 rwdata, 1268K rodata, 292K init, 1395K bss, 29200K reserved, 0K highmem)
 [

[PATCH] hvc_xen: avoid uninitialized variable warning

2015-05-28 Thread Jan Beulich
Older compilers don't recognize that v can't be used uninitialized;
other code using hvm_get_parameter() zeros the value too, so follow
suit here.

Signed-off-by: Jan Beulich jbeul...@suse.com
---
 drivers/tty/hvc/hvc_xen.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

--- 4.1-rc5/drivers/tty/hvc/hvc_xen.c
+++ 4.1-rc5-xen-unint-warnings/drivers/tty/hvc/hvc_xen.c
@@ -302,7 +302,7 @@ static int xen_initial_domain_console_in
 static void xen_console_update_evtchn(struct xencons_info *info)
 {
if (xen_hvm_domain()) {
-   uint64_t v;
+   uint64_t v = 0;
int err;
 
err = hvm_get_parameter(HVM_PARAM_CONSOLE_EVTCHN, v);



___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] hvc_xen: avoid uninitialized variable warning

2015-05-28 Thread David Vrabel
On 28/05/15 09:28, Jan Beulich wrote:
 Older compilers don't recognize that v can't be used uninitialized;
 other code using hvm_get_parameter() zeros the value too, so follow
 suit here.

Applied to for-linus-4.2, thanks.

David
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH]perf/core: remove newline char in perf_event_sysfs_show

2015-05-28 Thread Peter Zijlstra
On Thu, May 28, 2015 at 02:59:26PM +0530, Madhavan Srinivasan wrote:
 When a event also carries a event.unit file, having newline char
 will make perf userspace tool to print the event name in
 the next line when dumping counter data.

And changing the kernel will break the API (it includes a '\n' now) so
fix the tool.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH]perf/core: remove newline char in perf_event_sysfs_show

2015-05-28 Thread Madhavan Srinivasan
When a event also carries a event.unit file, having newline char
will make perf userspace tool to print the event name in
the next line when dumping counter data.

Cc: Ingo Molnar mi...@kernel.org
Cc: Jiri Olsa jo...@redhat.com
Cc: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com
Cc: Michael Ellerman m...@ellerman.id.au
Signed-off-by: Madhavan Srinivasan ma...@linux.vnet.ibm.com
---
 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 1a3bf48..3b5a372 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -8982,7 +8982,7 @@ ssize_t perf_event_sysfs_show(struct device *dev, struct 
device_attribute *attr,
container_of(attr, struct perf_pmu_events_attr, attr);
 
if (pmu_attr-event_str)
-   return sprintf(page, %s\n, pmu_attr-event_str);
+   return sprintf(page, %s, pmu_attr-event_str);
 
return 0;
 }
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [Cbe-oss-dev] [PATCH] powerpc/cell: Drop cbe-oss-dev mailing list from MAINTAINERS

2015-05-28 Thread Christoph Arenz

 You bet, or hell let's just have *another* party, the cbe-oss-dead
party.

 cheers

Aah.. those were the days -- let's raise our glasses!
Greetings to all who were involved in the project -- hope you are all doing
well!

Kind Regards / Mit freundlichen Grüßen
Christoph Arenz


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 2/4] perf: jevents: Program to convert JSON file to C style file

2015-05-28 Thread Jiri Olsa
On Wed, May 27, 2015 at 11:59:04PM +0900, Namhyung Kim wrote:
 Hi Andi,
 
 On Wed, May 27, 2015 at 11:40 PM, Andi Kleen a...@linux.intel.com wrote:
  So we build tables of all models in the architecture, and choose
  matching one when compiling perf, right?  Can't we do that when
  building the tables?  IOW, why don't we check the VFM and discard
  non-matching tables?  Those non-matching tables are also needed?
 
  We build it for all cpus in an architecture, not all architectures.
  So e.g. for an x86 binary power is not included, and vice versa.
 
 OK.
 
  It always includes all CPUs for a given architecture, so it's possible
  to use the perf binary on other systems than just the one it was
  build on.
 
 So it selects one at run-time not build-time, good.  But I worry about
 the size of the intel tables.  How large are they?  Maybe we can make
 it dynamic-loadable if needed..

just compiled Sukadev's new version with Andi's events list
and stripped binary size is:

[jolsa@krava perf]$ ls -l perf
-rwxrwxr-x 1 jolsa jolsa 2772640 May 28 13:49 perf


while perf on Arnaldo's perf/core is:

[jolsa@krava perf]$ ls -l perf
-rwxrwxr-x 1 jolsa jolsa 2334816 May 28 13:49 perf


seems not that bad

jirka
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 0/10] perf: Add support for PMU events in JSON format

2015-05-28 Thread Jiri Olsa
On Wed, May 27, 2015 at 02:23:19PM -0700, Sukadev Bhattiprolu wrote:

SNIP

 
 At run time, perf identifies the specific events table, based on the model
 of the CPU perf is running on. Perf uses that table to create event aliases
 which would allow the user to specify the event as:
 
   perf stat -e pm_1plus_ppc_cmpl sleep 1
 
 Note:
   - All known events tables for the architecture are included in the
 perf binary.
 
   - Inconsistencies between the JSON files and the mapfile can result
 in build failures in perf (although jevents try to recover from
 some and continue the build by leaving out event aliases).
 
   - For architectures that don't have any JSON files, an empty mapping
 table is created and they should continue to build)
 
 Thanks to input from Andi Kleen, Jiri Olsa, Namhyung Kim and Ingo Molnar.
 
 These patches are available from
 
   g...@github.com:sukadev/linux.git #branch json-v11

could you please also pull in Andi's changes with x86 events?
it seems to be under his tree branch perf/builtin-json-2,
follwing commits:

b68aa7b0d4e4 perf, tools: Add Broadwell V9 event file
1873bf40be27 perf, tools: Add HaswellX V12 event file
dc9a37d4f96c perf, tools: Add Bonnell V1 event file
f8cce1c4abb6 perf, tools: Add Silvermont V8 event file
c92a43e0a6c9 perf, tools: Add Haswell V18 event file
67ac6d3d8e2f perf, tools: Add IvyBridge V14 event file
3777bd7a8bf2 perf, tools: Add IvyTown V16 event file
21f34ff8ddb3 perf, tools: Add Jaketown V17 event file
22b22b279559 perf, tools: Add SandyBridge V11 event file
542c99a4836d perf, tools: Add WestmereEP-DP V1 event file
b2f0315e50b3 perf, tools: Add WestmereEP-SP V1 event file
82601ad46a58 perf, tools: Add WestmereEX V1 event file
a52987f230e0 perf, tools: Add NehalemEP V1 event file
a8fedce09cc1 perf, tools: Add NehalemEX V1 event file

no need to post them ATM.. just to have all stuff
on one place will ease up testing

Andi, you'd be ok with that I guess ;-)

thanks,
jirka
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 0/10] perf: Add support for PMU events in JSON format

2015-05-28 Thread Jiri Olsa
On Wed, May 27, 2015 at 02:23:19PM -0700, Sukadev Bhattiprolu wrote:

SNIP

   - All known events tables for the architecture are included in the
 perf binary.
 
   - Inconsistencies between the JSON files and the mapfile can result
 in build failures in perf (although jevents try to recover from
 some and continue the build by leaving out event aliases).
 
   - For architectures that don't have any JSON files, an empty mapping
 table is created and they should continue to build)
 
 Thanks to input from Andi Kleen, Jiri Olsa, Namhyung Kim and Ingo Molnar.
 
 These patches are available from
 
   g...@github.com:sukadev/linux.git #branch json-v11

found it publicly accessable/clone-able under:
  https://github.com/sukadev/linux.git

jirka
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 1/5] s390/mm: make hugepages_supported a boot time decision

2015-05-28 Thread Dominik Dingel
By dropping support for hugepages on machines which do not have
the hardware feature EDAT1, we fix a potential s390 KVM bug.

The bug would happen if a guest is backed by hugetlbfs (not supported 
currently),
but does not get pagetables with PGSTE.
This would lead to random memory overwrites.

Acked-by: Martin Schwidefsky schwidef...@de.ibm.com
Signed-off-by: Dominik Dingel din...@linux.vnet.ibm.com
---
 arch/s390/include/asm/page.h | 8 
 arch/s390/kernel/setup.c | 2 ++
 arch/s390/mm/pgtable.c   | 2 ++
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/s390/include/asm/page.h b/arch/s390/include/asm/page.h
index 53eacbd..0844b78 100644
--- a/arch/s390/include/asm/page.h
+++ b/arch/s390/include/asm/page.h
@@ -17,7 +17,10 @@
 #define PAGE_DEFAULT_ACC   0
 #define PAGE_DEFAULT_KEY   (PAGE_DEFAULT_ACC  4)
 
-#define HPAGE_SHIFT20
+#include asm/setup.h
+#ifndef __ASSEMBLY__
+
+extern unsigned int HPAGE_SHIFT;
 #define HPAGE_SIZE (1UL  HPAGE_SHIFT)
 #define HPAGE_MASK (~(HPAGE_SIZE - 1))
 #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
@@ -27,9 +30,6 @@
 #define ARCH_HAS_PREPARE_HUGEPAGE
 #define ARCH_HAS_HUGEPAGE_CLEAR_FLUSH
 
-#include asm/setup.h
-#ifndef __ASSEMBLY__
-
 static inline void storage_key_init_range(unsigned long start, unsigned long 
end)
 {
 #if PAGE_DEFAULT_KEY
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index a5ea8bc..9ac282b 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -915,6 +915,8 @@ void __init setup_arch(char **cmdline_p)
 */
setup_hwcaps();
 
+   HPAGE_SHIFT = MACHINE_HAS_HPAGE ? 20 : 0;
+
/*
 * Create kernel page tables and switch to virtual addressing.
 */
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index b2c1542..f76791e 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -36,6 +36,8 @@
 #endif
 
 
+unsigned int HPAGE_SHIFT;
+
 unsigned long *crst_table_alloc(struct mm_struct *mm)
 {
struct page *page = alloc_pages(GFP_KERNEL, ALLOC_ORDER);
-- 
2.3.7

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 2/5] mm/hugetlb: remove unused arch hook prepare/release_hugepage

2015-05-28 Thread Dominik Dingel
With s390 dropping support for emulated hugepages, the last user of
arch_prepare_hugepage and arch_release_hugepage is gone.

Acked-by: Martin Schwidefsky schwidef...@de.ibm.com
Signed-off-by: Dominik Dingel din...@linux.vnet.ibm.com
---
 mm/hugetlb.c | 10 --
 1 file changed, 10 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 290984b..a97958e 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -917,7 +917,6 @@ static void update_and_free_page(struct hstate *h, struct 
page *page)
destroy_compound_gigantic_page(page, huge_page_order(h));
free_gigantic_page(page, huge_page_order(h));
} else {
-   arch_release_hugepage(page);
__free_pages(page, huge_page_order(h));
}
 }
@@ -1102,10 +1101,6 @@ static struct page *alloc_fresh_huge_page_node(struct 
hstate *h, int nid)
__GFP_REPEAT|__GFP_NOWARN,
huge_page_order(h));
if (page) {
-   if (arch_prepare_hugepage(page)) {
-   __free_pages(page, huge_page_order(h));
-   return NULL;
-   }
prep_new_huge_page(h, page, nid);
}
 
@@ -1257,11 +1252,6 @@ static struct page *alloc_buddy_huge_page(struct hstate 
*h, int nid)
htlb_alloc_mask(h)|__GFP_COMP|__GFP_THISNODE|
__GFP_REPEAT|__GFP_NOWARN, huge_page_order(h));
 
-   if (page  arch_prepare_hugepage(page)) {
-   __free_pages(page, huge_page_order(h));
-   page = NULL;
-   }
-
spin_lock(hugetlb_lock);
if (page) {
INIT_LIST_HEAD(page-lru);
-- 
2.3.7

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 03/10] Use pmu_events_map table to create event aliases

2015-05-28 Thread Jiri Olsa
On Wed, May 27, 2015 at 02:23:22PM -0700, Sukadev Bhattiprolu wrote:
 At run time, (i.e when perf is starting up), locate the specific events
 table for the current CPU and create event aliases for each of the events.
 
 Use these aliases to parse user's specified perf event.
 
 Signed-off-by: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com

please prefix the subject with 'perf tools'

SNIP

 +/*
 + * From the pmu_events_map, find the table of PMU events that corresponds
 + * to the current running CPU. Then, add all PMU events from that table
 + * as aliases.
 + */
 +static int pmu_add_cpu_aliases(void *data)
 +{
 + struct list_head *head = (struct list_head *)data;
 + int i;
 + struct pmu_events_map *map;
 + struct pmu_event *pe;
 + char *cpuid;
 +
 + cpuid = get_cpuid_str();
 + if (!cpuid)
 + return 0;
 +
 + i = 0;
 + while (1) {
 + map = pmu_events_map[i++];
 + if (!map-table)
 + return 0;

leaking cpuid

 +
 + if (!strcmp(map-cpuid, cpuid))
 + break;
 + }
 +
 + /*
 +  * Found a matching PMU events table. Create aliases
 +  */
 + i = 0;
 + while (1) {
 + pe = map-table[i++];
 + if (!pe-name)
 + break;
 +
 + /* need type casts to override 'const' */
 + __perf_pmu__new_alias(head, (char *)pe-name, NULL,
 + (char *)pe-desc, (char *)pe-event);
 + }
 +
 + free(cpuid);
 +
 + return 0;
 +}

SNIP
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 0/3] fbuffer: performance improvement + code cleanup

2015-05-28 Thread Greg Kurz
If booted in frame buffer mode, board-qemu currently calls hv-logical-load
and hv-logical-store for every pixel when enabling or disabling the cursor.
This is suboptimal when writing one char at a time to the console since
terminal-write always toggles the cursor. And this is precisely what grub
is doing when the user wants to edit a menu entry... the result is an
incredibly slow and barely usable interface.

This series introduces per-board helpers to be used by the frame buffer
code, so that board-qemu may have its own accelarated implementation:

- the first patch is preliminary cleanup, before moving code out to helpers.

- the second patch introduces a helper to invert a memory region byte-per-byte:
  this fixes the unbearable slowliness of grub editing mode.

- the third patch introduces a similar helper with a a quad-word pace: it
  doesn't bring any speed improvement since board-qemu already uses
  hv-logical-memop, but it allows to unify hcall-invert-screen and
  fb8-invert-screen again.

Please comment.

---

Greg Kurz (3):
  fbuffer: simplify address computations in fb8-toggle-cursor
  fbuffer: introduce the invert-region helper
  fbuffer: introduce the invert-region-x helper


 board-js2x/slof/helper.fs   |9 +
 board-qemu/slof/helper.fs   |7 +++
 board-qemu/slof/pci-device_1234_.fs |   10 +-
 slof/fs/fbuffer.fs  |8 +++-
 4 files changed, 20 insertions(+), 14 deletions(-)

--
Greg

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] cxl: Set up and enable PSL Timebase

2015-05-28 Thread Philippe Bergheaud
This patch configures the PSL Timebase function and enables it,
after the CAPP has been initialized by OPAL. Failures are reported
and ignored.
---
 drivers/misc/cxl/cxl.h |5 +
 drivers/misc/cxl/pci.c |   35 +++
 2 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/cxl/cxl.h b/drivers/misc/cxl/cxl.h
index a1cee47..38a7cf9 100644
--- a/drivers/misc/cxl/cxl.h
+++ b/drivers/misc/cxl/cxl.h
@@ -82,8 +82,10 @@ static const cxl_p1_reg_t CXL_PSL_AFUSEL  = {0x00B0};
 /* 0x00C0:7EFF Implementation dependent area */
 static const cxl_p1_reg_t CXL_PSL_FIR1  = {0x0100};
 static const cxl_p1_reg_t CXL_PSL_FIR2  = {0x0108};
+static const cxl_p1_reg_t CXL_PSL_Timebase  = {0x0110};
 static const cxl_p1_reg_t CXL_PSL_VERSION   = {0x0118};
 static const cxl_p1_reg_t CXL_PSL_RESLCKTO  = {0x0128};
+static const cxl_p1_reg_t CXL_PSL_TB_CTLSTAT = {0x0140};
 static const cxl_p1_reg_t CXL_PSL_FIR_CNTL  = {0x0148};
 static const cxl_p1_reg_t CXL_PSL_DSNDCTL   = {0x0150};
 static const cxl_p1_reg_t CXL_PSL_SNWRALLOC = {0x0158};
@@ -151,6 +153,9 @@ static const cxl_p2n_reg_t CXL_PSL_WED_An = {0x0A0};
 #define CXL_PSL_SPAP_Size_Shift 4
 #define CXL_PSL_SPAP_V0x0001ULL
 
+/** CXL_PSL_Control /
+#define CXL_PSL_Control_tb 0x0001ULL
+
 /** CXL_PSL_DLCNTL */
 #define CXL_PSL_DLCNTL_D (0x1ull  (63-28))
 #define CXL_PSL_DLCNTL_C (0x1ull  (63-29))
diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
index fc938de..afd89cc 100644
--- a/drivers/misc/cxl/pci.c
+++ b/drivers/misc/cxl/pci.c
@@ -360,6 +360,38 @@ static int init_implementation_adapter_regs(struct cxl 
*adapter, struct pci_dev
return 0;
 }
 
+#define TBSYNC_CNT(n) (((u64)n  0x7)  (63-6))
+
+static int cxl_setup_psl_timebase(struct cxl *adapter, struct pci_dev *dev)
+{
+   u64 psl_tb;
+   int delta;
+   unsigned int retry = 0;
+
+   /*
+* Setup PSL Timebase Control and Status register
+* with the recommended Timebase Sync Count value
+*/
+   cxl_p1_write(adapter, CXL_PSL_TB_CTLSTAT, TBSYNC_CNT(2));
+
+   /* Enable PSL Timebase */
+   cxl_p1_write(adapter, CXL_PSL_Control, CXL_PSL_Control_tb);
+   /* Wait until CORE TB and PSL TB difference = 16usecs */
+   do {
+   if (retry++  5) {
+   pr_err(PSL: Timebase sync: giving up!\n);
+   return 1;
+   }
+   psl_tb = cxl_p1_read(adapter, CXL_PSL_Timebase);
+   delta = mftb() - psl_tb;
+   if (delta  0)
+   delta = -delta;
+   } while (cputime_to_usecs(delta)  16);
+
+   dev_info(dev-dev, PSL: Timebase synced\n);
+   return 0;
+}
+
 static int init_implementation_afu_regs(struct cxl_afu *afu)
 {
/* read/write masks for this slice */
@@ -995,6 +1027,9 @@ static struct cxl *cxl_init_adapter(struct pci_dev *dev)
if ((rc = pnv_phb_to_cxl(dev, OPAL_PHB_CAPI_MODE_CAPI)))
goto err3;
 
+   /* Don't care if this one fails: */
+   cxl_setup_psl_timebase(adapter, dev);
+
if ((rc = cxl_register_psl_err_irq(adapter)))
goto err3;
 
-- 
1.7.2.5

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 2/3] fbuffer: introduce the invert-region helper

2015-05-28 Thread Greg Kurz
The inner loop in fb8-toggle-cursor can be implemented with hv-logical-memop
in board-qemu and get an incredible performance boost.

Let's introduce a per-board helper:
- board-js2x: slow RB based, taken from current fb8-toggle-cursor
- board-qemu: faster hv-logical-memop based

With standard graphical settings on board-qemu, we go from 512 hcall
invocations per character down to 16.

Suggested-by: Thomas Huth th...@redhat.com
Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com
---
 board-js2x/slof/helper.fs |4 
 board-qemu/slof/helper.fs |3 +++
 slof/fs/fbuffer.fs|2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/board-js2x/slof/helper.fs b/board-js2x/slof/helper.fs
index 34d60da..918fdc4 100644
--- a/board-js2x/slof/helper.fs
+++ b/board-js2x/slof/helper.fs
@@ -26,3 +26,7 @@
s ,  $cat
bdate2human $cat encode-string THEN
 ;
+
+: invert-region ( addr len -- )
+   0 ?DO dup dup rb@ -1 xor swap rb! 1+ LOOP drop
+;
diff --git a/board-qemu/slof/helper.fs b/board-qemu/slof/helper.fs
index 96da498..da676c7 100644
--- a/board-qemu/slof/helper.fs
+++ b/board-qemu/slof/helper.fs
@@ -33,3 +33,6 @@
   swap -
 ;
 
+: invert-region ( addr len -- )
+   over swap 0 swap 1 hv-logical-memop drop
+;
diff --git a/slof/fs/fbuffer.fs b/slof/fs/fbuffer.fs
index faae6a9..deeba6b 100644
--- a/slof/fs/fbuffer.fs
+++ b/slof/fs/fbuffer.fs
@@ -99,7 +99,7 @@ CREATE bitmap-buffer 400 4 * allot
 : fb8-toggle-cursor ( -- )
line# fb8-line2addr column# fb8-columns2bytes +
char-height 0 ?DO
-   dup char-width screen-depth * 0 ?DO dup dup rb@ -1 xor swap rb! 
1+ LOOP drop
+   dup char-width screen-depth * invert-region
screen-width screen-depth * +
LOOP drop
 ;

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 3/5] mm/hugetlb: remove arch_prepare/release_hugepage from arch headers

2015-05-28 Thread Dominik Dingel
Nobody used these hooks so they were removed from common code,
and can now be removed from the architectures.

Acked-by: Martin Schwidefsky schwidef...@de.ibm.com
Signed-off-by: Dominik Dingel din...@linux.vnet.ibm.com
---
 arch/arm/include/asm/hugetlb.h | 9 -
 arch/arm64/include/asm/hugetlb.h   | 9 -
 arch/ia64/include/asm/hugetlb.h| 9 -
 arch/metag/include/asm/hugetlb.h   | 9 -
 arch/mips/include/asm/hugetlb.h| 9 -
 arch/powerpc/include/asm/hugetlb.h | 9 -
 arch/sh/include/asm/hugetlb.h  | 9 -
 arch/sparc/include/asm/hugetlb.h   | 9 -
 arch/tile/include/asm/hugetlb.h| 9 -
 arch/x86/include/asm/hugetlb.h | 9 -
 10 files changed, 90 deletions(-)

diff --git a/arch/arm/include/asm/hugetlb.h b/arch/arm/include/asm/hugetlb.h
index 31bb7dc..7d26f6c 100644
--- a/arch/arm/include/asm/hugetlb.h
+++ b/arch/arm/include/asm/hugetlb.h
@@ -63,15 +63,6 @@ static inline pte_t huge_pte_wrprotect(pte_t pte)
return pte_wrprotect(pte);
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-   return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
clear_bit(PG_dcache_clean, page-flags);
diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h
index 734c17e..2fd9b14 100644
--- a/arch/arm64/include/asm/hugetlb.h
+++ b/arch/arm64/include/asm/hugetlb.h
@@ -96,15 +96,6 @@ static inline pte_t huge_pte_wrprotect(pte_t pte)
return pte_wrprotect(pte);
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-   return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
clear_bit(PG_dcache_clean, page-flags);
diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h
index ff1377b..ef65f02 100644
--- a/arch/ia64/include/asm/hugetlb.h
+++ b/arch/ia64/include/asm/hugetlb.h
@@ -65,15 +65,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-   return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/metag/include/asm/hugetlb.h b/arch/metag/include/asm/hugetlb.h
index f730b39..905ed42 100644
--- a/arch/metag/include/asm/hugetlb.h
+++ b/arch/metag/include/asm/hugetlb.h
@@ -67,15 +67,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-   return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h
index 4a5bb54..982bc06 100644
--- a/arch/mips/include/asm/hugetlb.h
+++ b/arch/mips/include/asm/hugetlb.h
@@ -110,15 +110,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-   return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/powerpc/include/asm/hugetlb.h 
b/arch/powerpc/include/asm/hugetlb.h
index 4bbd3c8..7eac89b 100644
--- a/arch/powerpc/include/asm/hugetlb.h
+++ b/arch/powerpc/include/asm/hugetlb.h
@@ -168,15 +168,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-   return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h
index b788a9b..ef489a5 100644
--- a/arch/sh/include/asm/hugetlb.h
+++ b/arch/sh/include/asm/hugetlb.h
@@ -79,15 +79,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-   return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
clear_bit(PG_dcache_clean, page-flags);
diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h
index 3130d76..139e711 100644
--- a/arch/sparc/include/asm/hugetlb.h
+++ b/arch/sparc/include/asm/hugetlb.h
@@ -78,15 +78,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-   return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git 

[PATCH 0/5] Remove s390 sw-emulated hugepages and cleanup

2015-05-28 Thread Dominik Dingel
Hi everyone,

there is a potential bug with KVM and hugetlbfs if the hardware does not
support hugepages (EDAT1).
We fix this by making EDAT1 a hard requirement for hugepages and 
therefore removing and simplifying code.

As s390, with the sw-emulated hugepages, was the only user of 
arch_prepare/release_hugepage
I also removed theses calls from common and other architecture code.

Thanks,
Dominik

Dominik Dingel (5):
  s390/mm: make hugepages_supported a boot time decision
  mm/hugetlb: remove unused arch hook prepare/release_hugepage
  mm/hugetlb: remove arch_prepare/release_hugepage from arch headers
  s390/hugetlb: remove dead code for sw emulated huge pages
  s390/mm: forward check for huge pmds to pmd_large()

 arch/arm/include/asm/hugetlb.h |  9 --
 arch/arm64/include/asm/hugetlb.h   |  9 --
 arch/ia64/include/asm/hugetlb.h|  9 --
 arch/metag/include/asm/hugetlb.h   |  9 --
 arch/mips/include/asm/hugetlb.h|  9 --
 arch/powerpc/include/asm/hugetlb.h |  9 --
 arch/s390/include/asm/hugetlb.h|  3 --
 arch/s390/include/asm/page.h   |  8 ++---
 arch/s390/kernel/setup.c   |  2 ++
 arch/s390/mm/hugetlbpage.c | 65 +++---
 arch/s390/mm/pgtable.c |  2 ++
 arch/sh/include/asm/hugetlb.h  |  9 --
 arch/sparc/include/asm/hugetlb.h   |  9 --
 arch/tile/include/asm/hugetlb.h|  9 --
 arch/x86/include/asm/hugetlb.h |  9 --
 mm/hugetlb.c   | 10 --
 16 files changed, 12 insertions(+), 168 deletions(-)

-- 
2.3.7

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 2/4] perf: jevents: Program to convert JSON file to C style file

2015-05-28 Thread Ingo Molnar

* Ingo Molnar mi...@kernel.org wrote:

 
 * Jiri Olsa jo...@redhat.com wrote:
 
  On Wed, May 27, 2015 at 11:59:04PM +0900, Namhyung Kim wrote:
   Hi Andi,
   
   On Wed, May 27, 2015 at 11:40 PM, Andi Kleen a...@linux.intel.com wrote:
So we build tables of all models in the architecture, and choose
matching one when compiling perf, right?  Can't we do that when
building the tables?  IOW, why don't we check the VFM and discard
non-matching tables?  Those non-matching tables are also needed?
   
We build it for all cpus in an architecture, not all architectures.
So e.g. for an x86 binary power is not included, and vice versa.
   
   OK.
   
It always includes all CPUs for a given architecture, so it's possible
to use the perf binary on other systems than just the one it was
build on.
   
   So it selects one at run-time not build-time, good.  But I worry about
   the size of the intel tables.  How large are they?  Maybe we can make
   it dynamic-loadable if needed..
  
  just compiled Sukadev's new version with Andi's events list
  and stripped binary size is:
  
  [jolsa@krava perf]$ ls -l perf
  -rwxrwxr-x 1 jolsa jolsa 2772640 May 28 13:49 perf
  
  
  while perf on Arnaldo's perf/core is:
  
  [jolsa@krava perf]$ ls -l perf
  -rwxrwxr-x 1 jolsa jolsa 2334816 May 28 13:49 perf
  
  seems not that bad
 
 It's not bad at all.
 
 Do you have a Git tree URI where I could take a look at its current state? A 
 tree would be nice that has as many of these patches integrated as possible.

A couple of observations:

1)

The x86 JSON files are unnecessarily large, and for no good reason, for example:

 triton:~/tip/tools/perf/pmu-events/arch/x86 grep -h EdgeDetect * | sort | 
uniq -c
   5534 EdgeDetect: 0,
 57 EdgeDetect: 1,

it's ridiculous to repeat EdgeDetect: 0 more than 5 thousand times, just so 
that in 57 cases we can say '1'. Those lines should be omitted, and the default 
value should be 0.

This would reduce the source code line count of the JSON files by 40% already:

 triton:~/tip/tools/perf/pmu-events/arch/x86 grep ': 0,' * | wc -l
 42127
 triton:~/tip/tools/perf/pmu-events/arch/x86 cat * | wc -l
 103702

And no, I don't care if manufacturers release crappy JSON files - they need to 
be 
fixed/stripped before applied to our source tree.

2)

Also, the JSON files should carry more high levelstructure than they do today. 
Let's take SandyBridge_core.json as an example: it defines 386 events, but they 
are all in a 'flat' hierarchy, which is almost impossible for all but the most 
expert users to overview.

So instead of this flat structure, there should at minimum be broad 
categorization 
of the various parts of the hardware they relate to: whether they relate to the 
branch predictor, memory caches, TLB caches, memory ops, offcore, decoders, 
execution units, FPU ops, etc., etc. - so that they can be queried via 'perf 
list'.

We don't just want the import the unstructured mess that these event files are 
- 
we want to turn them into real structure. We can still keep the messy vendor 
names 
as well, like IDQ.DSB_CYCLES, but we want to impose structure as well.

3)

There should be good 'perf list' visualization for these events: grouping, 
individual names, with a good interface to query details if needed. I.e. it 
should 
be possible to browse and discover events relevant to the CPU the tool is 
executing on.

Thanks,

Ingo
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 1/3] fbuffer: simplify address computations in fb8-toggle-cursor

2015-05-28 Thread Greg Kurz
The inner loop deals with a contiguous region. It could easily be replaced
by faster board specific functions like hv-logical-memop in board-qemu.
Since hv-logical-memop does not return an address, let's have the enclosing
loop compute the next line address by itself and drop the confusing
char-width screen-depth * - address adjustment.

Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com
---
 slof/fs/fbuffer.fs |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/slof/fs/fbuffer.fs b/slof/fs/fbuffer.fs
index 756f05a..faae6a9 100644
--- a/slof/fs/fbuffer.fs
+++ b/slof/fs/fbuffer.fs
@@ -99,8 +99,8 @@ CREATE bitmap-buffer 400 4 * allot
 : fb8-toggle-cursor ( -- )
line# fb8-line2addr column# fb8-columns2bytes +
char-height 0 ?DO
-   char-width screen-depth * 0 ?DO dup dup rb@ -1 xor swap rb! 1+ 
LOOP
-   screen-width screen-depth * + char-width screen-depth * -
+   dup char-width screen-depth * 0 ?DO dup dup rb@ -1 xor swap rb! 
1+ LOOP drop
+   screen-width screen-depth * +
LOOP drop
 ;
 

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] ALSA: aoa: convert bus code to use dev_groups

2015-05-28 Thread Quentin Lambert
You should use dev_groups instead of the dev_attrs field of struct
bus_type. This converts the MDIO bus code to use the correct field.

These modifications were made using Coccinelle.

Signed-off-by: Quentin Lambert lambert.quen...@gmail.com
---
 sound/aoa/soundbus/core.c |3 ++-
 sound/aoa/soundbus/soundbus.h |2 +-
 sound/aoa/soundbus/sysfs.c|   13 -
 3 files changed, 11 insertions(+), 7 deletions(-)

--- a/sound/aoa/soundbus/core.c
+++ b/sound/aoa/soundbus/core.c
@@ -150,6 +150,7 @@ static int soundbus_device_resume(struct
 
 #endif /* CONFIG_PM */
 
+ATTRIBUTE_GROUPS(soundbus_dev);
 static struct bus_type soundbus_bus_type = {
.name   = aoa-soundbus,
.probe  = soundbus_probe,
@@ -160,7 +161,7 @@ static struct bus_type soundbus_bus_type
.suspend= soundbus_device_suspend,
.resume = soundbus_device_resume,
 #endif
-   .dev_attrs  = soundbus_dev_attrs,
+   .dev_groups = soundbus_dev_groups,
 };
 
 int soundbus_add_one(struct soundbus_dev *dev)
--- a/sound/aoa/soundbus/soundbus.h
+++ b/sound/aoa/soundbus/soundbus.h
@@ -199,6 +199,6 @@ struct soundbus_driver {
 extern int soundbus_register_driver(struct soundbus_driver *drv);
 extern void soundbus_unregister_driver(struct soundbus_driver *drv);
 
-extern struct device_attribute soundbus_dev_attrs[];
+extern struct attribute *soundbus_dev_attrs[];
 
 #endif /* __SOUNDBUS_H */
--- a/sound/aoa/soundbus/sysfs.c
+++ b/sound/aoa/soundbus/sysfs.c
@@ -30,13 +30,16 @@ static ssize_t modalias_show(struct devi
 
return length;
 }
+static DEVICE_ATTR_RO(modalias);
 
 soundbus_config_of_attr (name, %s\n);
+static DEVICE_ATTR_RO(name);
 soundbus_config_of_attr (type, %s\n);
+static DEVICE_ATTR_RO(type);
 
-struct device_attribute soundbus_dev_attrs[] = {
-   __ATTR_RO(name),
-   __ATTR_RO(type),
-   __ATTR_RO(modalias),
-   __ATTR_NULL
+struct attribute *soundbus_dev_attrs[] = {
+   dev_attr_name.attr,
+   dev_attr_type.attr,
+   dev_attr_modalias.attr,
+   NULL,
 };
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 02/10] jevents: Program to convert JSON file to C style file

2015-05-28 Thread Jiri Olsa
On Wed, May 27, 2015 at 02:23:21PM -0700, Sukadev Bhattiprolu wrote:

SNIP

  
  $(PERF_IN): $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h FORCE
   $(Q)$(MAKE) $(build)=perf
  
 -$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN)
 - $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(PERF_IN) $(LIBS) -o $@
 +$(JEVENTS_IN): FORCE
 + $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=pmu-events 
 obj=jevents
 +
 +$(JEVENTS): $(JEVENTS_IN)
 + $(QUIET_LINK)$(CC) $(JEVENTS_IN) -o $@
 +
 +$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN)
 + $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(PERF_IN) $(PMU_EVENTS_IN) 
 $(LIBS) -o $@
 +
 +$(PMU_EVENTS_IN): $(JEVENTS) FORCE
 + $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=pmu-events 
 obj=pmu-events

nit.. please move this above perf target, so it's grouped
with the rest of the jevents stuff

jirka

  
  $(GTK_IN): FORCE
   $(Q)$(MAKE) $(build)=gtk
 @@ -306,6 +321,8 @@ perf.spec $(SCRIPTS) \
  ifneq ($(OUTPUT),)
  %.o: $(OUTPUT)%.o
   @echo # Redirected target $@ = $(OUTPUT)$@
 +pmu-events/%.o: $(OUTPUT)pmu-events/%.o
 + @echo # Redirected target $@ = $(OUTPUT)$@
  util/%.o: $(OUTPUT)util/%.o
   @echo # Redirected target $@ = $(OUTPUT)$@
  bench/%.o: $(OUTPUT)bench/%.o


SNIP
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 2/4] perf: jevents: Program to convert JSON file to C style file

2015-05-28 Thread Ingo Molnar

* Jiri Olsa jo...@redhat.com wrote:

 On Wed, May 27, 2015 at 11:59:04PM +0900, Namhyung Kim wrote:
  Hi Andi,
  
  On Wed, May 27, 2015 at 11:40 PM, Andi Kleen a...@linux.intel.com wrote:
   So we build tables of all models in the architecture, and choose
   matching one when compiling perf, right?  Can't we do that when
   building the tables?  IOW, why don't we check the VFM and discard
   non-matching tables?  Those non-matching tables are also needed?
  
   We build it for all cpus in an architecture, not all architectures.
   So e.g. for an x86 binary power is not included, and vice versa.
  
  OK.
  
   It always includes all CPUs for a given architecture, so it's possible
   to use the perf binary on other systems than just the one it was
   build on.
  
  So it selects one at run-time not build-time, good.  But I worry about
  the size of the intel tables.  How large are they?  Maybe we can make
  it dynamic-loadable if needed..
 
 just compiled Sukadev's new version with Andi's events list
 and stripped binary size is:
 
 [jolsa@krava perf]$ ls -l perf
 -rwxrwxr-x 1 jolsa jolsa 2772640 May 28 13:49 perf
 
 
 while perf on Arnaldo's perf/core is:
 
 [jolsa@krava perf]$ ls -l perf
 -rwxrwxr-x 1 jolsa jolsa 2334816 May 28 13:49 perf
 
 seems not that bad

It's not bad at all.

Do you have a Git tree URI where I could take a look at its current state? A 
tree 
would be nice that has as many of these patches integrated as possible.

Thanks,

Ingo
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 5/5] s390/mm: forward check for huge pmds to pmd_large()

2015-05-28 Thread Dominik Dingel
We already do the check in pmd_large, so we can just forward the call.

Acked-by: Martin Schwidefsky schwidef...@de.ibm.com
Signed-off-by: Dominik Dingel din...@linux.vnet.ibm.com
---
 arch/s390/mm/hugetlbpage.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/s390/mm/hugetlbpage.c b/arch/s390/mm/hugetlbpage.c
index 999616b..a4b2f5e 100644
--- a/arch/s390/mm/hugetlbpage.c
+++ b/arch/s390/mm/hugetlbpage.c
@@ -135,10 +135,7 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long 
addr)
 
 int pmd_huge(pmd_t pmd)
 {
-   if (!MACHINE_HAS_HPAGE)
-   return 0;
-
-   return !!(pmd_val(pmd)  _SEGMENT_ENTRY_LARGE);
+   return pmd_large(pmd);
 }
 
 int pud_huge(pud_t pud)
-- 
2.3.7

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 04/10] perf, tools: Handle header line in mapfile

2015-05-28 Thread Jiri Olsa
On Wed, May 27, 2015 at 02:23:23PM -0700, Sukadev Bhattiprolu wrote:
 From: Andi Kleen a...@linux.intel.com
 
 Support a header line in the mapfile.csv, to match the existing
 mapfiles
 
 Signed-off-by: Andi Kleen a...@linux.intel.com
 ---
  tools/perf/pmu-events/jevents.c |2 ++
  1 file changed, 2 insertions(+)
 
 diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
 index 03f7b65..43651cc 100644
 --- a/tools/perf/pmu-events/jevents.c
 +++ b/tools/perf/pmu-events/jevents.c
 @@ -452,6 +452,8 @@ static int process_mapfile(FILE *outfp, char *fpath)
  
   if (line[0] == '#' || line[0] == '\n')
   continue;
 + if (!strncmp(line, Family, 6))
 + continue;

I think we should fix mapfiles to put the 'Family' starting
line as a comment.. the way powerpc mapfile is done

jirka

  
   if (line[strlen(line)-1] != '\n') {
   /* TODO Deal with lines longer than 16K */
 -- 
 1.7.9.5
 
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 02/10] jevents: Program to convert JSON file to C style file

2015-05-28 Thread Jiri Olsa
On Wed, May 27, 2015 at 02:23:21PM -0700, Sukadev Bhattiprolu wrote:

SNIP

  
 diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build
 new file mode 100644
 index 000..7e0c85c
 --- /dev/null
 +++ b/tools/perf/pmu-events/Build
 @@ -0,0 +1,10 @@
 +jevents-y+= json.o jsmn.o jevents.o
 +pmu-events-y += pmu-events.o
 +JSON =  $(shell find pmu-events/arch/$(ARCH) -name '*.json')

you might want to check if there's the directory first,
or if there's a way to tell find to be quiet or ignore that

find: ‘pmu-events/arch/x86’: No such file or directory
  CC   pmu-events/json.o
  CC   pmu-events/jsmn.o
  CC   pmu-events/jevents.o
  LD   pmu-events/jevents-in.o
  LINK pmu-events/jevents
find: ‘pmu-events/arch/x86’: No such file or directory
pmu-events/jevents: Error walking file tree pmu-events/arch/x86
Creating empty pmu_events_map[] table
  CC   pmu-events/pmu-events.o


jirka
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 4/5] s390/hugetlb: remove dead code for sw emulated huge pages

2015-05-28 Thread Dominik Dingel
We now support only hugepages on hardware with EDAT1 support.
So we remove the prepare/release_hugepage hooks and
simplify set_huge_pte_at and huge_ptep_get.

Acked-by: Martin Schwidefsky schwidef...@de.ibm.com
Signed-off-by: Dominik Dingel din...@linux.vnet.ibm.com
---
 arch/s390/include/asm/hugetlb.h |  3 ---
 arch/s390/mm/hugetlbpage.c  | 60 +++--
 2 files changed, 3 insertions(+), 60 deletions(-)

diff --git a/arch/s390/include/asm/hugetlb.h b/arch/s390/include/asm/hugetlb.h
index dfb542a..0130d03 100644
--- a/arch/s390/include/asm/hugetlb.h
+++ b/arch/s390/include/asm/hugetlb.h
@@ -37,9 +37,6 @@ static inline int prepare_hugepage_range(struct file *file,
 
 #define arch_clear_hugepage_flags(page)do { } while (0)
 
-int arch_prepare_hugepage(struct page *page);
-void arch_release_hugepage(struct page *page);
-
 static inline void huge_pte_clear(struct mm_struct *mm, unsigned long addr,
  pte_t *ptep)
 {
diff --git a/arch/s390/mm/hugetlbpage.c b/arch/s390/mm/hugetlbpage.c
index fa6e1bc..999616b 100644
--- a/arch/s390/mm/hugetlbpage.c
+++ b/arch/s390/mm/hugetlbpage.c
@@ -80,31 +80,16 @@ static inline pte_t __pmd_to_pte(pmd_t pmd)
 void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
 pte_t *ptep, pte_t pte)
 {
-   pmd_t pmd;
+   pmd_t pmd = __pte_to_pmd(pte);
 
-   pmd = __pte_to_pmd(pte);
-   if (!MACHINE_HAS_HPAGE) {
-   /* Emulated huge ptes loose the dirty and young bit */
-   pmd_val(pmd) = ~_SEGMENT_ENTRY_ORIGIN;
-   pmd_val(pmd) |= pte_page(pte)[1].index;
-   } else
-   pmd_val(pmd) |= _SEGMENT_ENTRY_LARGE;
+   pmd_val(pmd) |= _SEGMENT_ENTRY_LARGE;
*(pmd_t *) ptep = pmd;
 }
 
 pte_t huge_ptep_get(pte_t *ptep)
 {
-   unsigned long origin;
-   pmd_t pmd;
+   pmd_t pmd = *(pmd_t *) ptep;
 
-   pmd = *(pmd_t *) ptep;
-   if (!MACHINE_HAS_HPAGE  pmd_present(pmd)) {
-   origin = pmd_val(pmd)  _SEGMENT_ENTRY_ORIGIN;
-   pmd_val(pmd) = ~_SEGMENT_ENTRY_ORIGIN;
-   pmd_val(pmd) |= *(unsigned long *) origin;
-   /* Emulated huge ptes are young and dirty by definition */
-   pmd_val(pmd) |= _SEGMENT_ENTRY_YOUNG | _SEGMENT_ENTRY_DIRTY;
-   }
return __pmd_to_pte(pmd);
 }
 
@@ -119,45 +104,6 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
return pte;
 }
 
-int arch_prepare_hugepage(struct page *page)
-{
-   unsigned long addr = page_to_phys(page);
-   pte_t pte;
-   pte_t *ptep;
-   int i;
-
-   if (MACHINE_HAS_HPAGE)
-   return 0;
-
-   ptep = (pte_t *) pte_alloc_one(init_mm, addr);
-   if (!ptep)
-   return -ENOMEM;
-
-   pte_val(pte) = addr;
-   for (i = 0; i  PTRS_PER_PTE; i++) {
-   set_pte_at(init_mm, addr + i * PAGE_SIZE, ptep + i, pte);
-   pte_val(pte) += PAGE_SIZE;
-   }
-   page[1].index = (unsigned long) ptep;
-   return 0;
-}
-
-void arch_release_hugepage(struct page *page)
-{
-   pte_t *ptep;
-
-   if (MACHINE_HAS_HPAGE)
-   return;
-
-   ptep = (pte_t *) page[1].index;
-   if (!ptep)
-   return;
-   clear_table((unsigned long *) ptep, _PAGE_INVALID,
-   PTRS_PER_PTE * sizeof(pte_t));
-   page_table_free(init_mm, (unsigned long *) ptep);
-   page[1].index = 0;
-}
-
 pte_t *huge_pte_alloc(struct mm_struct *mm,
unsigned long addr, unsigned long sz)
 {
-- 
2.3.7

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 0/10] perf: Add support for PMU events in JSON format

2015-05-28 Thread Jiri Olsa
On Thu, May 28, 2015 at 01:42:06PM +0200, Jiri Olsa wrote:

SNIP

  g...@github.com:sukadev/linux.git #branch json-v11
 
 could you please also pull in Andi's changes with x86 events?
 it seems to be under his tree branch perf/builtin-json-2,
 follwing commits:
 
 b68aa7b0d4e4 perf, tools: Add Broadwell V9 event file
 1873bf40be27 perf, tools: Add HaswellX V12 event file
 dc9a37d4f96c perf, tools: Add Bonnell V1 event file
 f8cce1c4abb6 perf, tools: Add Silvermont V8 event file
 c92a43e0a6c9 perf, tools: Add Haswell V18 event file
 67ac6d3d8e2f perf, tools: Add IvyBridge V14 event file
 3777bd7a8bf2 perf, tools: Add IvyTown V16 event file
 21f34ff8ddb3 perf, tools: Add Jaketown V17 event file
 22b22b279559 perf, tools: Add SandyBridge V11 event file
 542c99a4836d perf, tools: Add WestmereEP-DP V1 event file
 b2f0315e50b3 perf, tools: Add WestmereEP-SP V1 event file
 82601ad46a58 perf, tools: Add WestmereEX V1 event file
 a52987f230e0 perf, tools: Add NehalemEP V1 event file
 a8fedce09cc1 perf, tools: Add NehalemEX V1 event file
 
 no need to post them ATM.. just to have all stuff
 on one place will ease up testing
 
 Andi, you'd be ok with that I guess ;-)

also could you please rebase this on latest Arnaldo's perf/core?

thanks,
jirka
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH V2] drivers/mtd: add powernv flash MTD abstraction driver

2015-05-28 Thread Cyril Bur
Powerpc powernv platforms allow access to certain system flash devices
through a firmwarwe interface. This change adds an mtd driver for these
flash devices.

Minor updates from Jeremy Kerr and Joel Stanley.

Signed-off-by: Cyril Bur cyril...@gmail.com
Signed-off-by: Joel Stanley j...@jms.id.au
Signed-off-by: Jeremy Kerr j...@ozlabs.org
---
V2: Address Brian Norris' review
Fix typos
Change from NAND flash type to NOR flash type
Correctness tweaks
---
 drivers/mtd/devices/Kconfig |   8 +
 drivers/mtd/devices/Makefile|   1 +
 drivers/mtd/devices/powernv_flash.c | 286 
 3 files changed, 295 insertions(+)
 create mode 100644 drivers/mtd/devices/powernv_flash.c

diff --git a/drivers/mtd/devices/Kconfig b/drivers/mtd/devices/Kconfig
index c49d0b1..a8cc237 100644
--- a/drivers/mtd/devices/Kconfig
+++ b/drivers/mtd/devices/Kconfig
@@ -195,6 +195,14 @@ config MTD_BLOCK2MTD
  Testing MTD users (eg JFFS2) on large media and media that might
  be removed during a write (using the floppy drive).
 
+config MTD_POWERNV_FLASH
+   tristate powernv flash MTD driver
+   depends on PPC_POWERNV
+   help
+ This provides an MTD device to access NVRAM on powernv OPAL
+ platforms from Linux. This device abstracts away the
+ firmware interface for NVRAM access.
+
 comment Disk-On-Chip Device Drivers
 
 config MTD_DOCG3
diff --git a/drivers/mtd/devices/Makefile b/drivers/mtd/devices/Makefile
index f0b0e61..7912d3a 100644
--- a/drivers/mtd/devices/Makefile
+++ b/drivers/mtd/devices/Makefile
@@ -16,6 +16,7 @@ obj-$(CONFIG_MTD_SPEAR_SMI)   += spear_smi.o
 obj-$(CONFIG_MTD_SST25L)   += sst25l.o
 obj-$(CONFIG_MTD_BCM47XXSFLASH)+= bcm47xxsflash.o
 obj-$(CONFIG_MTD_ST_SPI_FSM)+= st_spi_fsm.o
+obj-$(CONFIG_MTD_POWERNV_FLASH)+= powernv_flash.o
 
 
 CFLAGS_docg3.o += -I$(src)
diff --git a/drivers/mtd/devices/powernv_flash.c 
b/drivers/mtd/devices/powernv_flash.c
new file mode 100644
index 000..f619e4a
--- /dev/null
+++ b/drivers/mtd/devices/powernv_flash.c
@@ -0,0 +1,286 @@
+/*
+ * OPAL PNOR flash MTD abstraction
+ *
+ * IBM 2015
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include linux/kernel.h
+#include linux/module.h
+#include linux/errno.h
+#include linux/of.h
+#include linux/of_address.h
+#include linux/platform_device.h
+#include linux/string.h
+#include linux/slab.h
+#include linux/mtd/mtd.h
+#include linux/mtd/partitions.h
+
+#include linux/debugfs.h
+#include linux/seq_file.h
+
+#include asm/opal.h
+
+
+/*
+ * This driver creates the a Linux MTD abstraction for platform PNOR flash
+ * backed by OPAL calls
+ */
+
+struct powernv_flash {
+   struct mtd_info mtd;
+   uint64_tid;
+};
+
+enum flash_op {
+   FLASH_OP_READ,
+   FLASH_OP_WRITE,
+   FLASH_OP_ERASE,
+};
+
+static int powernv_flash_async_op(struct mtd_info *mtd, enum flash_op op,
+   loff_t offset, size_t len, size_t *retlen, u_char *buf)
+{
+   struct powernv_flash *info = (struct powernv_flash *)mtd-priv;
+   struct device *dev = mtd-dev;
+   int token;
+   struct opal_msg msg;
+   int rc;
+
+   dev_dbg(dev, %s(op=%d, offset=0x%llx, len=%zu)\n,
+   __func__, op, offset, len);
+
+   token = opal_async_get_token_interruptible();
+   if (token  0) {
+   dev_err(dev, Failed to get an async token\n);
+   return -ENOMEM;
+   }
+
+   switch (op) {
+   case FLASH_OP_READ:
+   rc = opal_flash_read(info-id, offset, __pa(buf), len, token);
+   break;
+   case FLASH_OP_WRITE:
+   rc = opal_flash_write(info-id, offset, __pa(buf), len, token);
+   break;
+   case FLASH_OP_ERASE:
+   rc = opal_flash_erase(info-id, offset, len, token);
+   break;
+   default:
+   BUG_ON(1);
+   }
+
+   if (rc != OPAL_ASYNC_COMPLETION) {
+   dev_err(dev, opal_flash_async_op(op=%d) failed (rc %d)\n,
+   op, rc);
+   return -EIO;
+   }
+
+   rc = opal_async_wait_response(token, msg);
+   opal_async_release_token(token);
+   if (rc) {
+   dev_err(dev, opal async wait failed (rc %d)\n, rc);
+   return -EIO;
+   }
+
+   rc = be64_to_cpu(msg.params[1]);
+   if (rc == OPAL_SUCCESS) {
+   rc = 0;
+   if (retlen)
+

[PATCH 3/3] fbuffer: introduce the invert-region-x helper

2015-05-28 Thread Greg Kurz
This patch simply moves the slow RX based logic from fb8-invert-screen
to board-js2x helpers and implement a fast hv-logical-memop based helper
for board-qemu. And we can drop hcall-invert-screen !

Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com
---
 board-js2x/slof/helper.fs   |5 +
 board-qemu/slof/helper.fs   |4 
 board-qemu/slof/pci-device_1234_.fs |   10 +-
 slof/fs/fbuffer.fs  |4 +---
 4 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/board-js2x/slof/helper.fs b/board-js2x/slof/helper.fs
index 918fdc4..ea2d584 100644
--- a/board-js2x/slof/helper.fs
+++ b/board-js2x/slof/helper.fs
@@ -30,3 +30,8 @@
 : invert-region ( addr len -- )
0 ?DO dup dup rb@ -1 xor swap rb! 1+ LOOP drop
 ;
+
+
+: invert-region-x ( addr len -- )
+   /x / 0 ?DO dup dup rx@ -1 xor swap rx! xa1+ LOOP drop
+;
diff --git a/board-qemu/slof/helper.fs b/board-qemu/slof/helper.fs
index da676c7..c807bc6 100644
--- a/board-qemu/slof/helper.fs
+++ b/board-qemu/slof/helper.fs
@@ -36,3 +36,7 @@
 : invert-region ( addr len -- )
over swap 0 swap 1 hv-logical-memop drop
 ;
+
+: invert-region-x ( addr len -- )
+   over swap /x / 3 swap 1 hv-logical-memop drop
+;
diff --git a/board-qemu/slof/pci-device_1234_.fs 
b/board-qemu/slof/pci-device_1234_.fs
index a5c3584..26b0623 100644
--- a/board-qemu/slof/pci-device_1234_.fs
+++ b/board-qemu/slof/pci-device_1234_.fs
@@ -188,16 +188,9 @@ a CONSTANT VBE_DISPI_INDEX_NB
 : display-remove ( -- ) 
 ;
 
-: hcall-invert-screen ( -- )
-frame-buffer-adr frame-buffer-adr 3
-screen-height screen-width * screen-depth * /x /
-1 hv-logical-memop
-drop
-;
-
 : hcall-blink-screen ( -- )
 \ 32 msec delay for visually noticing the blink
-hcall-invert-screen 20 ms hcall-invert-screen
+invert-screen 20 ms invert-screen
 ;
 
 : display-install ( -- )
@@ -211,7 +204,6 @@ a CONSTANT VBE_DISPI_INDEX_NB
 disp-width char-width / disp-height char-height /
 disp-depth 7 + 8 /  ( width height #lines #cols 
depth )
 fb-install
-   ['] hcall-invert-screen to invert-screen
['] hcall-blink-screen to blink-screen
  true to is-installed?
 THEN
diff --git a/slof/fs/fbuffer.fs b/slof/fs/fbuffer.fs
index deeba6b..fcdd2fa 100644
--- a/slof/fs/fbuffer.fs
+++ b/slof/fs/fbuffer.fs
@@ -170,9 +170,7 @@ CREATE bitmap-buffer 400 4 * allot
 ;
 
 : fb8-invert-screen ( -- )
-   frame-buffer-adr screen-height screen-width * screen-depth * 2dup /x / 
0 ?DO
-   dup rx@ -1 xor over rx! xa1+
-   LOOP 3drop
+   frame-buffer-adr screen-height screen-width * screen-depth * 
invert-region-x
 ;
 
 : fb8-blink-screen ( -- ) fb8-invert-screen fb8-invert-screen ;

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] ALSA: aoa: convert bus code to use dev_groups

2015-05-28 Thread Quentin Lambert



On 28/05/2015 15:52, Takashi Iwai wrote:

At Thu, 28 May 2015 14:48:27 +0200,
Quentin Lambert wrote:

You should use dev_groups instead of the dev_attrs field of struct
bus_type. This converts the MDIO bus code to use the correct field.

These modifications were made using Coccinelle.

Signed-off-by: Quentin Lambert lambert.quen...@gmail.com

What's wrong with dev_attrs?
(Not offending, I'm just curious where the preference for dev_groups
  is referred...)


This patch is based on commit 4192c74940e23da727eb02b7b4ee779dde2f670,
its message indicates that dev_attrs is going away.

Quentin

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 3/5] mm/hugetlb: remove arch_prepare/release_hugepage from arch headers

2015-05-28 Thread Ralf Baechle
On Thu, May 28, 2015 at 01:52:35PM +0200, Dominik Dingel wrote:

Acked-by: Ralf Baechle r...@linux-mips.org
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] ALSA: aoa: convert bus code to use dev_groups

2015-05-28 Thread Quentin Lambert



On 28/05/2015 15:52, Takashi Iwai wrote:

At Thu, 28 May 2015 14:48:27 +0200,
Quentin Lambert wrote:

You should use dev_groups instead of the dev_attrs field of struct
bus_type. This converts the MDIO bus code to use the correct field.

These modifications were made using Coccinelle.

Signed-off-by: Quentin Lambert lambert.quen...@gmail.com

What's wrong with dev_attrs?
(Not offending, I'm just curious where the preference for dev_groups
  is referred...)


This patch is based on commit 4192c74940e23da727eb02b7b4ee779dde2f670,
its message indicates that dev_attrs is going away.

Quentin

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] ALSA: aoa: convert bus code to use dev_groups

2015-05-28 Thread Takashi Iwai
At Thu, 28 May 2015 15:59:50 +0200,
Quentin Lambert wrote:
 
 
 
 On 28/05/2015 15:52, Takashi Iwai wrote:
  At Thu, 28 May 2015 14:48:27 +0200,
  Quentin Lambert wrote:
  You should use dev_groups instead of the dev_attrs field of struct
  bus_type. This converts the MDIO bus code to use the correct field.
 
  These modifications were made using Coccinelle.
 
  Signed-off-by: Quentin Lambert lambert.quen...@gmail.com
  What's wrong with dev_attrs?
  (Not offending, I'm just curious where the preference for dev_groups
is referred...)
 
 This patch is based on commit 4192c74940e23da727eb02b7b4ee779dde2f670,
 its message indicates that dev_attrs is going away.

OK, makes sense.  Then please keep such information in the changelog.
BTW, the code in question isn't MDIO at all.

Also, it'd be better to move ATTRIBUTE_GROUPS(soundbus_dev) into
soundbus/sysfs.c, and make it this global instead of
soundbus_dev_attrs[].


Takashi
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] ALSA: aoa: convert bus code to use dev_groups

2015-05-28 Thread Takashi Iwai
At Thu, 28 May 2015 14:48:27 +0200,
Quentin Lambert wrote:
 
 You should use dev_groups instead of the dev_attrs field of struct
 bus_type. This converts the MDIO bus code to use the correct field.
 
 These modifications were made using Coccinelle.
 
 Signed-off-by: Quentin Lambert lambert.quen...@gmail.com

What's wrong with dev_attrs?
(Not offending, I'm just curious where the preference for dev_groups
 is referred...)


thanks,

Takashi

 ---
  sound/aoa/soundbus/core.c |3 ++-
  sound/aoa/soundbus/soundbus.h |2 +-
  sound/aoa/soundbus/sysfs.c|   13 -
  3 files changed, 11 insertions(+), 7 deletions(-)
 
 --- a/sound/aoa/soundbus/core.c
 +++ b/sound/aoa/soundbus/core.c
 @@ -150,6 +150,7 @@ static int soundbus_device_resume(struct
  
  #endif /* CONFIG_PM */
  
 +ATTRIBUTE_GROUPS(soundbus_dev);
  static struct bus_type soundbus_bus_type = {
   .name   = aoa-soundbus,
   .probe  = soundbus_probe,
 @@ -160,7 +161,7 @@ static struct bus_type soundbus_bus_type
   .suspend= soundbus_device_suspend,
   .resume = soundbus_device_resume,
  #endif
 - .dev_attrs  = soundbus_dev_attrs,
 + .dev_groups = soundbus_dev_groups,
  };
  
  int soundbus_add_one(struct soundbus_dev *dev)
 --- a/sound/aoa/soundbus/soundbus.h
 +++ b/sound/aoa/soundbus/soundbus.h
 @@ -199,6 +199,6 @@ struct soundbus_driver {
  extern int soundbus_register_driver(struct soundbus_driver *drv);
  extern void soundbus_unregister_driver(struct soundbus_driver *drv);
  
 -extern struct device_attribute soundbus_dev_attrs[];
 +extern struct attribute *soundbus_dev_attrs[];
  
  #endif /* __SOUNDBUS_H */
 --- a/sound/aoa/soundbus/sysfs.c
 +++ b/sound/aoa/soundbus/sysfs.c
 @@ -30,13 +30,16 @@ static ssize_t modalias_show(struct devi
  
   return length;
  }
 +static DEVICE_ATTR_RO(modalias);
  
  soundbus_config_of_attr (name, %s\n);
 +static DEVICE_ATTR_RO(name);
  soundbus_config_of_attr (type, %s\n);
 +static DEVICE_ATTR_RO(type);
  
 -struct device_attribute soundbus_dev_attrs[] = {
 - __ATTR_RO(name),
 - __ATTR_RO(type),
 - __ATTR_RO(modalias),
 - __ATTR_NULL
 +struct attribute *soundbus_dev_attrs[] = {
 + dev_attr_name.attr,
 + dev_attr_type.attr,
 + dev_attr_modalias.attr,
 + NULL,
  };
 
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 1/3] fbuffer: simplify address computations in fb8-toggle-cursor

2015-05-28 Thread Thomas Huth
On Thu, 28 May 2015 15:13:14 +0200
Greg Kurz gk...@linux.vnet.ibm.com wrote:

 The inner loop deals with a contiguous region. It could easily be replaced
 by faster board specific functions like hv-logical-memop in board-qemu.
 Since hv-logical-memop does not return an address, let's have the enclosing
 loop compute the next line address by itself and drop the confusing
 char-width screen-depth * - address adjustment.
 
 Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com
 ---
  slof/fs/fbuffer.fs |4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/slof/fs/fbuffer.fs b/slof/fs/fbuffer.fs
 index 756f05a..faae6a9 100644
 --- a/slof/fs/fbuffer.fs
 +++ b/slof/fs/fbuffer.fs
 @@ -99,8 +99,8 @@ CREATE bitmap-buffer 400 4 * allot
  : fb8-toggle-cursor ( -- )
   line# fb8-line2addr column# fb8-columns2bytes +
   char-height 0 ?DO
 - char-width screen-depth * 0 ?DO dup dup rb@ -1 xor swap rb! 1+ 
 LOOP
 - screen-width screen-depth * + char-width screen-depth * -
 + dup char-width screen-depth * 0 ?DO dup dup rb@ -1 xor swap rb! 
 1+ LOOP drop
 + screen-width screen-depth * +
   LOOP drop
  ;

Reviewed-by: Thomas Huth th...@redhat.com
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] ALSA: aoa: convert bus code to use dev_groups

2015-05-28 Thread Takashi Iwai
At Thu, 28 May 2015 16:43:12 +0200,
Quentin Lambert wrote:
 
 On 28/05/2015 16:09, Takashi Iwai wrote:
  At Thu, 28 May 2015 15:59:50 +0200,
  Quentin Lambert wrote:
 
 
  On 28/05/2015 15:52, Takashi Iwai wrote:
  At Thu, 28 May 2015 14:48:27 +0200,
  Quentin Lambert wrote:
  You should use dev_groups instead of the dev_attrs field of struct
  bus_type. This converts the MDIO bus code to use the correct field.
 
  These modifications were made using Coccinelle.
 
  Signed-off-by: Quentin Lambert lambert.quen...@gmail.com
  What's wrong with dev_attrs?
  (Not offending, I'm just curious where the preference for dev_groups
 is referred...)
  This patch is based on commit 4192c74940e23da727eb02b7b4ee779dde2f670,
  its message indicates that dev_attrs is going away.
  OK, makes sense.  Then please keep such information in the changelog.
  BTW, the code in question isn't MDIO at all.
 Sorry, about that!
 
  Also, it'd be better to move ATTRIBUTE_GROUPS(soundbus_dev) into
  soundbus/sysfs.c, and make it this global instead of
  soundbus_dev_attrs[].
 Ok, I need to find a nice way to do that because ATTRIBUTE_GROUPS 
 declares the
 structure as static.

Ah, right.  I fell to the same pintfall in the past, too :)

I will send a second version with a better solution.

If it results in an ungly code, it's fine with the original code,
too.  But, maybe with a comment indicating that xxx_dev_attrs[] is
defined in xxx.c.


thanks,

Takashi
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] ALSA: aoa: convert bus code to use dev_groups

2015-05-28 Thread Quentin Lambert

On 28/05/2015 16:09, Takashi Iwai wrote:

At Thu, 28 May 2015 15:59:50 +0200,
Quentin Lambert wrote:



On 28/05/2015 15:52, Takashi Iwai wrote:

At Thu, 28 May 2015 14:48:27 +0200,
Quentin Lambert wrote:

You should use dev_groups instead of the dev_attrs field of struct
bus_type. This converts the MDIO bus code to use the correct field.

These modifications were made using Coccinelle.

Signed-off-by: Quentin Lambert lambert.quen...@gmail.com

What's wrong with dev_attrs?
(Not offending, I'm just curious where the preference for dev_groups
   is referred...)

This patch is based on commit 4192c74940e23da727eb02b7b4ee779dde2f670,
its message indicates that dev_attrs is going away.

OK, makes sense.  Then please keep such information in the changelog.
BTW, the code in question isn't MDIO at all.

Sorry, about that!


Also, it'd be better to move ATTRIBUTE_GROUPS(soundbus_dev) into
soundbus/sysfs.c, and make it this global instead of
soundbus_dev_attrs[].
Ok, I need to find a nice way to do that because ATTRIBUTE_GROUPS 
declares the

structure as static. I will send a second version with a better solution.

Quentin



Takashi


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 09/10] perf, tools: Add a --no-desc flag to perf list

2015-05-28 Thread Jiri Olsa
On Wed, May 27, 2015 at 02:23:28PM -0700, Sukadev Bhattiprolu wrote:
 From: Andi Kleen a...@linux.intel.com
 
 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.

I might not be typical user, but the first thing I tried to
explore was 'perf list -v' ;-)

would it be better to have just the list with event names for:
   $ perf list

and with descriptions for:
   $ perf list -v

not sure we already discussed this..

jirka
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 2/4] perf: jevents: Program to convert JSON file to C style file

2015-05-28 Thread Andi Kleen
 So instead of this flat structure, there should at minimum be broad 
 categorization 
 of the various parts of the hardware they relate to: whether they relate to 
 the 
 branch predictor, memory caches, TLB caches, memory ops, offcore, decoders, 
 execution units, FPU ops, etc., etc. - so that they can be queried via 'perf 
 list'.

The categorization is generally on the stem name, which already works fine with
the existing perf list wildcard support. So for example you only want 
branches. 

perf list br*
...
  br_inst_exec.all_branches 
   [Speculative and retired branches]
  br_inst_exec.all_conditional  
   [Speculative and retired macro-conditional branches]
  br_inst_exec.all_direct_jmp   
   [Speculative and retired macro-unconditional branches excluding calls 
and indirects]
  br_inst_exec.all_direct_near_call 
   [Speculative and retired direct near calls]
  br_inst_exec.all_indirect_jump_non_call_ret   
   [Speculative and retired indirect branches excluding calls and returns]
  br_inst_exec.all_indirect_near_return 
   [Speculative and retired indirect return branches]
...

Or mid level cache events:

perf list l2*
...
  l2_l1d_wb_rqsts.all   
   [Not rejected writebacks from L1D to L2 cache lines in any state]
  l2_l1d_wb_rqsts.hit_e 
   [Not rejected writebacks from L1D to L2 cache lines in E state]
  l2_l1d_wb_rqsts.hit_m 
   [Not rejected writebacks from L1D to L2 cache lines in M state]
  l2_l1d_wb_rqsts.miss  
   [Count the number of modified Lines evicted from L1 and missed L2. 
(Non-rejected WBs from the DCU.)]
  l2_lines_in.all   
   [L2 cache lines filling L2]
...

There are some exceptions, but generally it works this way.

The stem could be put into a separate header, but it would seem redundant to 
me. 

 We don't just want the import the unstructured mess that these event files 
 are - 
 we want to turn them into real structure. We can still keep the messy vendor 
 names 
 as well, like IDQ.DSB_CYCLES, but we want to impose structure as well.

The vendor names directly map to the micro architecture, which is whole
point of the events. IDQ is a part of the CPU, and is described in the 
CPU manuals. One of the main motivations for adding event lists is to make
perf match to that documentation.

 
 3)
 
 There should be good 'perf list' visualization for these events: grouping, 
 individual names, with a good interface to query details if needed. I.e. it 
 should 
 be possible to browse and discover events relevant to the CPU the tool is 
 executing on.

I suppose we could change perf list to give the stem names as section headers
to make the long list a bit more readable.

Generally you need to have some knowledge of the micro architecture to use
these events. There is no way around that.

-Andi
-- 
a...@linux.intel.com -- Speaking for myself only
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev