[PATCHi v2] ibmveth: Add function to enable live MAC address changes

2015-02-27 Thread Thomas Falcon
Add a function that will enable changing the MAC address
of an ibmveth interface while it is still running.

Signed-off-by: Thomas Falcon tlfal...@linux.vnet.ibm.com
---
v2:
   If h_change_logical_lan_mac fails, dev-dev_addr will not be changed.

 drivers/net/ethernet/ibm/ibmveth.c | 25 -
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ibm/ibmveth.c 
b/drivers/net/ethernet/ibm/ibmveth.c
index 21978cc..b6ac676 100644
--- a/drivers/net/ethernet/ibm/ibmveth.c
+++ b/drivers/net/ethernet/ibm/ibmveth.c
@@ -1327,6 +1327,29 @@ static unsigned long ibmveth_get_desired_dma(struct 
vio_dev *vdev)
return ret;
 }
 
+static int ibmveth_set_mac_addr(struct net_device *dev, void *p)
+{
+   struct ibmveth_adapter *adapter = netdev_priv(dev);
+   struct sockaddr *addr = p;
+   u64 mac_address;
+   int rc;
+
+   if (!is_valid_ether_addr(addr-sa_data))
+   return -EADDRNOTAVAIL;
+
+   mac_address = ibmveth_encode_mac_addr(addr-sa_data);
+   rc = h_change_logical_lan_mac(adapter-vdev-unit_address, mac_address);
+   if (rc) {
+   netdev_err(adapter-netdev, h_change_logical_lan_mac failed 
+  with rc=%d\n, rc);
+   return rc;
+   }
+
+   ether_addr_copy(dev-dev_addr, addr-sa_data);
+
+   return 0;
+}
+
 static const struct net_device_ops ibmveth_netdev_ops = {
.ndo_open   = ibmveth_open,
.ndo_stop   = ibmveth_close,
@@ -1337,7 +1360,7 @@ static const struct net_device_ops ibmveth_netdev_ops = {
.ndo_fix_features   = ibmveth_fix_features,
.ndo_set_features   = ibmveth_set_features,
.ndo_validate_addr  = eth_validate_addr,
-   .ndo_set_mac_address= eth_mac_addr,
+   .ndo_set_mac_address= ibmveth_set_mac_addr,
 #ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller= ibmveth_poll_controller,
 #endif
-- 
1.8.3.1

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

[PATCH 2/3] powerpc/pseries: Little endian fixes for post mobility device tree update

2015-02-27 Thread Tyrel Datwyler
We currently use the device tree update code in the kernel after resuming
from a suspend operation to re-sync the kernels view of the device tree with
that of the hypervisor. The code as it stands is not endian safe as it relies
on parsing buffers returned by RTAS calls that thusly contains data in big
endian format.

This patch annotates variables and structure members with __be types as well
as performing necessary byte swaps to cpu endian for data that needs to be
parsed.

Signed-off-by: Tyrel Datwyler tyr...@linux.vnet.ibm.com
---
 arch/powerpc/platforms/pseries/mobility.c | 36 ---
 1 file changed, 19 insertions(+), 17 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/mobility.c 
b/arch/powerpc/platforms/pseries/mobility.c
index 29e4f04..0b1f70e 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -25,10 +25,10 @@
 static struct kobject *mobility_kobj;
 
 struct update_props_workarea {
-   u32 phandle;
-   u32 state;
-   u64 reserved;
-   u32 nprops;
+   __be32 phandle;
+   __be32 state;
+   __be64 reserved;
+   __be32 nprops;
 } __packed;
 
 #define NODE_ACTION_MASK   0xff00
@@ -127,7 +127,7 @@ static int update_dt_property(struct device_node *dn, 
struct property **prop,
return 0;
 }
 
-static int update_dt_node(u32 phandle, s32 scope)
+static int update_dt_node(__be32 phandle, s32 scope)
 {
struct update_props_workarea *upwa;
struct device_node *dn;
@@ -136,6 +136,7 @@ static int update_dt_node(u32 phandle, s32 scope)
char *prop_data;
char *rtas_buf;
int update_properties_token;
+   u32 nprops;
u32 vd;
 
update_properties_token = rtas_token(ibm,update-properties);
@@ -162,6 +163,7 @@ static int update_dt_node(u32 phandle, s32 scope)
break;
 
prop_data = rtas_buf + sizeof(*upwa);
+   nprops = be32_to_cpu(upwa-nprops);
 
/* On the first call to ibm,update-properties for a node the
 * the first property value descriptor contains an empty
@@ -170,17 +172,17 @@ static int update_dt_node(u32 phandle, s32 scope)
 */
if (*prop_data == 0) {
prop_data++;
-   vd = *(u32 *)prop_data;
+   vd = be32_to_cpu(*(__be32 *)prop_data);
prop_data += vd + sizeof(vd);
-   upwa-nprops--;
+   nprops--;
}
 
-   for (i = 0; i  upwa-nprops; i++) {
+   for (i = 0; i  nprops; i++) {
char *prop_name;
 
prop_name = prop_data;
prop_data += strlen(prop_name) + 1;
-   vd = *(u32 *)prop_data;
+   vd = be32_to_cpu(*(__be32 *)prop_data);
prop_data += sizeof(vd);
 
switch (vd) {
@@ -212,7 +214,7 @@ static int update_dt_node(u32 phandle, s32 scope)
return 0;
 }
 
-static int add_dt_node(u32 parent_phandle, u32 drc_index)
+static int add_dt_node(__be32 parent_phandle, __be32 drc_index)
 {
struct device_node *dn;
struct device_node *parent_dn;
@@ -237,7 +239,7 @@ static int add_dt_node(u32 parent_phandle, u32 drc_index)
 int pseries_devicetree_update(s32 scope)
 {
char *rtas_buf;
-   u32 *data;
+   __be32 *data;
int update_nodes_token;
int rc;
 
@@ -254,17 +256,17 @@ int pseries_devicetree_update(s32 scope)
if (rc  rc != 1)
break;
 
-   data = (u32 *)rtas_buf + 4;
-   while (*data  NODE_ACTION_MASK) {
+   data = (__be32 *)rtas_buf + 4;
+   while (be32_to_cpu(*data)  NODE_ACTION_MASK) {
int i;
-   u32 action = *data  NODE_ACTION_MASK;
-   int node_count = *data  NODE_COUNT_MASK;
+   u32 action = be32_to_cpu(*data)  NODE_ACTION_MASK;
+   u32 node_count = be32_to_cpu(*data)  NODE_COUNT_MASK;
 
data++;
 
for (i = 0; i  node_count; i++) {
-   u32 phandle = *data++;
-   u32 drc_index;
+   __be32 phandle = *data++;
+   __be32 drc_index;
 
switch (action) {
case DELETE_DT_NODE:
-- 
1.7.12.2

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

[PATCH 0/3] powerpc/pseries: Fixes and cleanup of suspend/migration code

2015-02-27 Thread Tyrel Datwyler
This patchset simplifies the usage of rtas_ibm_suspend_me() by removing an
extraneous function parameter, fixes device tree updating on little endian
platforms, and adds a mechanism for informing drmgr that the kernel is cabable 
of
performing the whole migration including device tree update itself.

Tyrel Datwyler (3):
  powerpc/pseries: Simplify check for suspendability during
suspend/migration
  powerpc/pseries: Little endian fixes for post mobility device tree
update
  powerpc/pseries: Expose post-migration in kernel device tree update
to drmgr

 arch/powerpc/include/asm/rtas.h   |  2 +-
 arch/powerpc/kernel/rtas.c| 15 -
 arch/powerpc/platforms/pseries/mobility.c | 55 ++-
 3 files changed, 40 insertions(+), 32 deletions(-)

-- 
1.7.12.2

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

[PATCH 1/3] powerpc/pseries: Simplify check for suspendability during suspend/migration

2015-02-27 Thread Tyrel Datwyler
During suspend/migration operation we must wait for the VASI state reported
by the hypervisor to become Suspending prior to making the ibm,suspend-me
RTAS call. Calling routines to rtas_ibm_supend_me() pass a vasi_state variable
that exposes the VASI state to the caller. This is unnecessary as the caller
only really cares about the following three conditions; if there is an error
we should bailout, success indicating we have suspended and woken back up so
proceed to device tree updated, or we are not suspendable yet so try calling
rtas_ibm_suspend_me again shortly.

This patch removes the extraneous vasi_state variable and simply uses the
return code to communicate how to proceed. We either succeed, fail, or get
-EAGAIN in which case we sleep for a second before trying to call
rtas_ibm_suspend_me again.

Signed-off-by: Tyrel Datwyler tyr...@linux.vnet.ibm.com
---
 arch/powerpc/include/asm/rtas.h   |  2 +-
 arch/powerpc/kernel/rtas.c| 15 +++
 arch/powerpc/platforms/pseries/mobility.c |  8 +++-
 3 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index 2e23e92..fc85eb0 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -327,7 +327,7 @@ extern int rtas_suspend_cpu(struct rtas_suspend_me_data 
*data);
 extern int rtas_suspend_last_cpu(struct rtas_suspend_me_data *data);
 extern int rtas_online_cpus_mask(cpumask_var_t cpus);
 extern int rtas_offline_cpus_mask(cpumask_var_t cpus);
-extern int rtas_ibm_suspend_me(u64 handle, int *vasi_return);
+extern int rtas_ibm_suspend_me(u64 handle);
 
 struct rtc_time;
 extern unsigned long rtas_get_boot_time(void);
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 21c45a2..603b928 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -897,7 +897,7 @@ int rtas_offline_cpus_mask(cpumask_var_t cpus)
 }
 EXPORT_SYMBOL(rtas_offline_cpus_mask);
 
-int rtas_ibm_suspend_me(u64 handle, int *vasi_return)
+int rtas_ibm_suspend_me(u64 handle)
 {
long state;
long rc;
@@ -919,13 +919,11 @@ int rtas_ibm_suspend_me(u64 handle, int *vasi_return)
printk(KERN_ERR rtas_ibm_suspend_me: vasi_state returned 
%ld\n,rc);
return rc;
} else if (state == H_VASI_ENABLED) {
-   *vasi_return = RTAS_NOT_SUSPENDABLE;
-   return 0;
+   return -EAGAIN;
} else if (state != H_VASI_SUSPENDING) {
printk(KERN_ERR rtas_ibm_suspend_me: vasi_state returned state 
%ld\n,
   state);
-   *vasi_return = -1;
-   return 0;
+   return -EIO;
}
 
if (!alloc_cpumask_var(offline_mask, GFP_TEMPORARY))
@@ -1060,9 +1058,10 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
int vasi_rc = 0;
u64 handle = ((u64)be32_to_cpu(args.args[0])  32)
  | be32_to_cpu(args.args[1]);
-   rc = rtas_ibm_suspend_me(handle, vasi_rc);
-   args.rets[0] = cpu_to_be32(vasi_rc);
-   if (rc)
+   rc = rtas_ibm_suspend_me(handle);
+   if (rc == -EAGAIN)
+   args.rets[0] = cpu_to_be32(RTAS_NOT_SUSPENDABLE);
+   else if (rc)
return rc;
goto copy_return;
}
diff --git a/arch/powerpc/platforms/pseries/mobility.c 
b/arch/powerpc/platforms/pseries/mobility.c
index 90cf3dc..29e4f04 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -325,15 +325,13 @@ static ssize_t migrate_store(struct class *class, struct 
class_attribute *attr,
return rc;
 
do {
-   rc = rtas_ibm_suspend_me(streamid, vasi_rc);
-   if (!rc  vasi_rc == RTAS_NOT_SUSPENDABLE)
+   rc = rtas_ibm_suspend_me(streamid);
+   if (rc == -EAGAIN)
ssleep(1);
-   } while (!rc  vasi_rc == RTAS_NOT_SUSPENDABLE);
+   } while (rc == -EAGAIN);
 
if (rc)
return rc;
-   if (vasi_rc)
-   return vasi_rc;
 
post_mobility_fixup();
return count;
-- 
1.7.12.2

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

[PATCH 3/3] powerpc/pseries: Expose post-migration in kernel device tree update to drmgr

2015-02-27 Thread Tyrel Datwyler
Traditionally after a migration operation drmgr has coordinated the device tree
update with the kernel in userspace via the ugly /proc/ppc64/ofdt interface. 
This
can be better done fully in the kernel where support already exists. Currently,
drmgr makes a faux ibm,suspend-me RTAS call which we intercept in the kernel so
that we can check VASI state for suspendability. After the LPAR resumes and
returns to drmgr that is followed by the necessary update-nodes and
update-properties RTAS calls which are parsed and communitated back to the 
kernel
through /proc/ppc64/ofdt for the device tree update. The drmgr tool should
instead initiate the migration using the already existing
/sysfs/kernel/mobility/migration entry that performs all this work in the 
kernel.

This patch adds a show function to the sysfs migration attribute that returns
1 to indicate the kernel will perform the device tree update after a migration
operation and that drmgr should initiated the migration through the sysfs
migration attribute.

Signed-off-by: Tyrel Datwyler tyr...@linux.vnet.ibm.com
---
 arch/powerpc/platforms/pseries/mobility.c | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/pseries/mobility.c 
b/arch/powerpc/platforms/pseries/mobility.c
index 0b1f70e..a689f74 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -40,6 +40,9 @@ struct update_props_workarea {
 
 #define MIGRATION_SCOPE(1)
 
+#define USER_DT_UPDATE  0
+#define KERN_DT_UPDATE  1
+
 static int mobility_rtas_call(int token, char *buf, s32 scope)
 {
int rc;
@@ -339,7 +342,13 @@ static ssize_t migrate_store(struct class *class, struct 
class_attribute *attr,
return count;
 }
 
-static CLASS_ATTR(migration, S_IWUSR, NULL, migrate_store);
+static ssize_t migrate_show(struct class *class, struct class_attribute *attr,
+   char *buf)
+{
+   return sprintf(buf, %d\n, KERN_DT_UPDATE);
+}
+
+static CLASS_ATTR(migration, S_IWUSR | S_IRUGO, migrate_show, migrate_store);
 
 static int __init mobility_sysfs_init(void)
 {
-- 
1.7.12.2

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

Re: [PATCH] seccomp: switch to using asm-generic for seccomp.h

2015-02-27 Thread Stephen Rothwell
Hi Kees,

On Fri, 27 Feb 2015 16:52:29 -0800 Kees Cook keesc...@chromium.org wrote:

 diff --git a/arch/arm/include/asm/seccomp.h b/arch/arm/include/asm/seccomp.h
 index 52b156b341f5..66ca6a30bf5c 100644
 --- a/arch/arm/include/asm/seccomp.h
 +++ b/arch/arm/include/asm/seccomp.h
 @@ -1,11 +1 @@
 -#ifndef _ASM_ARM_SECCOMP_H
 -#define _ASM_ARM_SECCOMP_H
 -
 -#include linux/unistd.h
 -
 -#define __NR_seccomp_read __NR_read
 -#define __NR_seccomp_write __NR_write
 -#define __NR_seccomp_exit __NR_exit
 -#define __NR_seccomp_sigreturn __NR_rt_sigreturn
 -
 -#endif /* _ASM_ARM_SECCOMP_H */
 +#include asm-generic/seccomp.h

I think that these cases (where you replace the file by a stub that
just include asm-generic/seccomp.h) can be replaced by removing the
file completely and adding

generic-y = seccomp.h

to ARCH/include/asm/Kbuild

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpIk__jP4F6y.pgp
Description: OpenPGP digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] seccomp: switch to using asm-generic for seccomp.h

2015-02-27 Thread Kees Cook
On Fri, Feb 27, 2015 at 5:36 PM, Stephen Rothwell s...@canb.auug.org.au wrote:
 Hi Kees,

 On Fri, 27 Feb 2015 16:52:29 -0800 Kees Cook keesc...@chromium.org wrote:

 diff --git a/arch/arm/include/asm/seccomp.h b/arch/arm/include/asm/seccomp.h
 index 52b156b341f5..66ca6a30bf5c 100644
 --- a/arch/arm/include/asm/seccomp.h
 +++ b/arch/arm/include/asm/seccomp.h
 @@ -1,11 +1 @@
 -#ifndef _ASM_ARM_SECCOMP_H
 -#define _ASM_ARM_SECCOMP_H
 -
 -#include linux/unistd.h
 -
 -#define __NR_seccomp_read __NR_read
 -#define __NR_seccomp_write __NR_write
 -#define __NR_seccomp_exit __NR_exit
 -#define __NR_seccomp_sigreturn __NR_rt_sigreturn
 -
 -#endif /* _ASM_ARM_SECCOMP_H */
 +#include asm-generic/seccomp.h

 I think that these cases (where you replace the file by a stub that
 just include asm-generic/seccomp.h) can be replaced by removing the
 file completely and adding

 generic-y = seccomp.h

 to ARCH/include/asm/Kbuild

Ah-ha! I thought total removal was possible, but I lacked the Kbuild
piece. There are a lot of arch/ headers that are just the one line.
Maybe I should send a another patch to clean up those?

-Kees

-- 
Kees Cook
Chrome OS Security
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] clk: ppc-corenet: Add support for the FMD clock

2015-02-27 Thread Kumar Gala

On Jan 20, 2015, at 6:03 AM, Igal.Liberman igal.liber...@freescale.com wrote:

 From: Igal Liberman igal.liber...@freescale.com

Really should have some commit text

 
 Signed-off-by: Igal Liberman igal.liber...@freescale.com
 
 This patch is based on https://patchwork.ozlabs.org/patch/430966/

This belongs below the ---

 ---
 drivers/clk/clk-ppc-corenet.c |  250 +
 1 file changed, 250 insertions(+)

Any reason clk maintainers aren’t CC’d?

 diff --git a/drivers/clk/clk-ppc-corenet.c b/drivers/clk/clk-ppc-corenet.c
 index ff425e1..dcde0e6 100644
 --- a/drivers/clk/clk-ppc-corenet.c
 +++ b/drivers/clk/clk-ppc-corenet.c
 @@ -18,6 +18,7 @@
 #include linux/of_platform.h
 #include linux/of.h
 #include linux/slab.h
 +#include asm/fsl_guts.h
 
 struct cmux_clk {
   struct clk_hw hw;
 @@ -144,6 +145,254 @@ err_name:
   kfree(parent_names);
 }
 
 +/* Table for matching compatible strings, for device tree
 + * guts node, for QorIQ SOCs.
 + * fsl,qoriq-device-config-2.0 corresponds to T4  B4
 + * SOCs. For the older SOCs fsl,qoriq-device-config-1.0
 + * string would be used.
 + */
 +
 +static const struct of_device_id guts_device_ids[] = {
 + { .compatible = fsl,qoriq-device-config-1.0, },
 + { .compatible = fsl,qoriq-device-config-2.0, },
 +};
 +
 +/* P2, P3, P4, P5 */
 +#define FM1_CLK_SEL_SHIFT30
 +#define FM1_CLK_SEL  BIT(FM1_CLK_SEL_SHIFT)
 +#define FM2_CLK_SEL_SHIFT29
 +#define FM2_CLK_SEL  BIT(FM2_CLK_SEL_SHIFT)
 +#define HWA_ASYNC_DIV_SHIFT  26
 +#define HWA_ASYNC_DIVBIT(HWA_ASYNC_DIV_SHIFT)
 +
 +/* B4, T2 */
 +#define HWA_CGA_M1_CLK_SEL_SHIFT 29
 +#define HWA_CGA_M1_CLK_SEL   (BIT(HWA_CGA_M1_CLK_SEL_SHIFT + 2) |\
 +  BIT(HWA_CGA_M1_CLK_SEL_SHIFT + 1) |\
 +  BIT(HWA_CGA_M1_CLK_SEL_SHIFT))
 +
 +/* T4240 */
 +#define HWA_CGB_M1_CLK_SEL_SHIFT 26
 +#define HWA_CGB_M1_CLK_SEL   (BIT(HWA_CGB_M1_CLK_SEL_SHIFT + 2) |\
 +  BIT(HWA_CGB_M1_CLK_SEL_SHIFT + 1) |\
 +  BIT(HWA_CGB_M1_CLK_SEL_SHIFT))
 +#define HWA_CGB_M2_CLK_SEL_SHIFT 3
 +#define HWA_CGB_M2_CLK_SEL   (BIT(HWA_CGB_M2_CLK_SEL_SHIFT + 2) |\
 +  BIT(HWA_CGB_M2_CLK_SEL_SHIFT + 1) |\
 +  BIT(HWA_CGB_M2_CLK_SEL_SHIFT))
 +
 +static u8 get_fm_clk_parent(struct clk_hw *hw)
 +{
 + struct ccsr_guts __iomem *guts_regs = NULL;
 + struct device_node *guts;
 + uint32_t reg = 0;
 + int clk_src = 0;
 + int fm_clk_select = -EINVAL;
 + int fm_id = 0;
 +
 + guts = of_find_matching_node(NULL, guts_device_ids);
 + if (!guts) {
 + pr_err(could not find GUTS node\n);
 + return -EINVAL;
 + }
 +
 + guts_regs = of_iomap(guts, 0);
 + of_node_put(guts);
 + if (!guts_regs) {
 + pr_err(ioremap of GUTS node failed\n);
 + return -EINVAL;
 + }

Have you guys looked at using drivers/mfd/syscon.c for GUTS access.

 +
 + if (!strcmp(__clk_get_name(hw-clk), fm1-clk))
 + fm_id = 1;
 +
 + /* The FM clock provider is SoC dependent and it's determened by the
 +  * reset configuration word (RCW). We need to map the RCW options to
 +  * the order of the providers in the device tree.
 +  * This code makes assumptions about the clock provider order:
 +  * In the P family:
 +  *  0 - platform clock/2
 +  *  1 - PLLx /2
 +  *  2 - PLLx /4 (if possible).
 +  * In B/T family:
 +  *  The same order in which the clock providers are described in
 +  *  the Reference Manual, starting from 0.
 +  *
 +  * In a case of only one possible provider, the index is 0.
 +  */

Does it make sense to do all this parsing every time get_fm_clk_parent, why not 
do it during the init function once?

 +
 + if (of_device_is_compatible(guts, fsl,p1023-guts) ||
 + of_device_is_compatible(guts, fsl,t1040-device-config))
 + /* P1023 and T1040 have only one optional clock source */
 + fm_clk_select = 0;
 + else if (of_device_is_compatible(guts, fsl,p2041-device-config) ||
 +  of_device_is_compatible(guts, fsl,p3041-device-config) ||
 +  of_device_is_compatible(guts, fsl,p4080-device-config)) {
 + /* Read RCW*/
 + reg = in_be32(guts_regs-rcwsr[7]);
 +
 + /* Check bit 225 or bit 226 (FM2, P4080)
 +  * 0 - The clock source is Platform PLL /2
 +  * 1 - The clock source is PLL2 /2 (P2, P3) or PLL3 /2 (P4)
 +  *
 +  * Bit 225 represents FM1, Bit 226 represents FM2
 +  */
 + if (fm_id == 0)
 + fm_clk_select = (reg  FM1_CLK_SEL) 
 +

Re: [PATCH v2] powerpc: re-enable dynticks

2015-02-27 Thread Paul Clarke
It appears the discussion wrapped up on this, favorably.  Is there 
anything else I need to do to get this merged?


Regards,
PC

On 02/20/2015 11:18 PM, Paul E. McKenney wrote:

On Fri, Feb 20, 2015 at 11:13:33AM -0600, Paul Clarke wrote:


implement arch_irq_work_has_interrupt() for powerpc

(resending because I messed up the e-mail addresses)

Commit 9b01f5bf3 introduced a dependency on IRQ work self-IPIs for
full dynamic ticks to be enabled, by expecting architectures to
implement a suitable arch_irq_work_has_interrupt() routine.

Several arches have implemented this routine, including x86
(3010279f) and arm (09f6edd4), but powerpc was omitted.

This patch implements this routine for powerpc.

The symptom, at boot (on powerpc arch systems) with nohz_full=CPU
list is displayed:
 NO_HZ: Can't run full dynticks because arch doesn't support irq
work self-IPIs

after this patch:
 NO_HZ: Full dynticks CPUs: CPU list.

Tested against 3.19.

v2: changed return 1 to return true, per Michael Ellerman

CC: Frederic Weisbecker fweis...@gmail.com
CC: Paul E. McKenney paul...@linux.vnet.ibm.com
Signed-off-by: Paul A. Clarke p...@us.ibm.com


Reviewed-by: Paul E. McKenney paul...@linux.vnet.ibm.com


diff --git a/arch/powerpc/include/asm/irq_work.h
b/arch/powerpc/include/asm/irq_work.h
new file mode 100644
index 000..99cc0aa
--- /dev/null
+++ b/arch/powerpc/include/asm/irq_work.h
@@ -0,0 +1,11 @@
+#ifndef _ASM_IRQ_WORK_H
+#define _ASM_IRQ_WORK_H
+
+#include asm/processor.h
+
+static inline bool arch_irq_work_has_interrupt(void)
+{
+return true;
+}
+
+#endif /* _ASM_IRQ_WORK_H */


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



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

Re: [PATCH 2/5] crypto: talitos: Remove MD5_BLOCK_SIZE

2015-02-27 Thread Horia Geantă
On 2/20/2015 6:21 PM, Martin Hicks wrote:
 This is properly defined in the md5 header file.
 ---

Signed-off-by tag is missing.

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

Re: [PATCH 0/2] powerpc/kvm: Enable running guests on RT Linux

2015-02-27 Thread Paolo Bonzini


On 27/02/2015 02:05, Scott Wood wrote:
 Obviously leaving it in a buggy state is not what we want -- but I lean
 towards a short term fix of putting depends on !PREEMPT_RT on the
 in-kernel MPIC emulation (which is itself just an optimization -- you
 can still use KVM without it).  This way people don't enable it with RT
 without being aware of the issue, and there's more of an incentive to
 fix it properly.

That would indeed work for me.

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

[v5 2/2] powerpc/corenet: Enable muxing MDIO buses via FPGA

2015-02-27 Thread Emil Medve
From: Shruti Kanetkar kanetkar.shr...@gmail.com

Signed-off-by: Andy Fleming aflem...@gmail.com
Signed-off-by: Shaohui Xie shaohui@freescale.com
Signed-off-by: Shruti Kanetkar kanetkar.shr...@gmail.com
Signed-off-by: Emil Medve emilian.me...@freescale.com
---

v5: Remove 'Change-Id'

v4: Add 'Signed-off-by'

v3: Spearated from the FMan MDIO dt/binding patchset 
http://patchwork.ozlabs.org/patch/370873
Also supersedes http://patchwork.ozlabs.org/patch/423348
Update via 'savedefconfig'
Auto-probe devices on 'fsl,fpga-qixis'

 arch/powerpc/configs/corenet32_smp_defconfig  | 1 +
 arch/powerpc/configs/corenet64_smp_defconfig  | 1 +
 arch/powerpc/platforms/85xx/corenet_generic.c | 6 ++
 3 files changed, 8 insertions(+)

diff --git a/arch/powerpc/configs/corenet32_smp_defconfig 
b/arch/powerpc/configs/corenet32_smp_defconfig
index 44e53a4..5242355 100644
--- a/arch/powerpc/configs/corenet32_smp_defconfig
+++ b/arch/powerpc/configs/corenet32_smp_defconfig
@@ -100,6 +100,7 @@ CONFIG_AT803X_PHY=y
 CONFIG_VITESSE_PHY=y
 CONFIG_FIXED_PHY=y
 CONFIG_MDIO_BUS_MUX_GPIO=y
+CONFIG_MDIO_BUS_MUX_MMIOREG=y
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
diff --git a/arch/powerpc/configs/corenet64_smp_defconfig 
b/arch/powerpc/configs/corenet64_smp_defconfig
index 724e579..c1cb6e9 100644
--- a/arch/powerpc/configs/corenet64_smp_defconfig
+++ b/arch/powerpc/configs/corenet64_smp_defconfig
@@ -86,6 +86,7 @@ CONFIG_E1000E=y
 CONFIG_VITESSE_PHY=y
 CONFIG_FIXED_PHY=y
 CONFIG_MDIO_BUS_MUX_GPIO=y
+CONFIG_MDIO_BUS_MUX_MMIOREG=y
 CONFIG_INPUT_FF_MEMLESS=m
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c 
b/arch/powerpc/platforms/85xx/corenet_generic.c
index 0804b10..63bef30 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -91,6 +91,12 @@ static const struct of_device_id of_device_ids[] = {
.compatible = mdio-mux-gpio
},
{
+   .compatible = fsl,fpga-ngpixis
+   },
+   {
+   .compatible = fsl,fpga-qixis
+   },
+   {
.compatible = fsl,srio,
},
{
-- 
2.3.0
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 2/2] crypto: talitos: Add AES-XTS Support

2015-02-27 Thread Horia Geantă
On 2/20/2015 7:00 PM, Martin Hicks wrote:
 The newer talitos hardware has support for AES in XTS mode.
 
 Signed-off-by: Martin Hicks m...@bork.org
 ---

checkpatch complains about formatting, please check.

  drivers/crypto/talitos.c |   33 +
  drivers/crypto/talitos.h |1 +
  2 files changed, 34 insertions(+)
 
 diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
 index 6b2a19a..38cbde1 100644
 --- a/drivers/crypto/talitos.c
 +++ b/drivers/crypto/talitos.c
 @@ -40,9 +40,11 @@
  #include linux/spinlock.h
  #include linux/rtnetlink.h
  #include linux/slab.h
 +#include linux/device-mapper.h
  
  #include crypto/algapi.h
  #include crypto/aes.h
 +#include crypto/xts.h
  #include crypto/des.h
  #include crypto/sha.h
  #include crypto/md5.h
 @@ -1464,9 +1466,22 @@ static struct talitos_edesc 
 *ablkcipher_edesc_alloc(struct ablkcipher_request *
   areq, bool encrypt)
  {
   struct crypto_ablkcipher *cipher = crypto_ablkcipher_reqtfm(areq);
 + struct crypto_tfm *tfm = (struct crypto_tfm *)cipher;
   struct talitos_ctx *ctx = crypto_ablkcipher_ctx(cipher);
   unsigned int ivsize = crypto_ablkcipher_ivsize(cipher);
  
 + /*
 +  * AES-XTS uses the first two AES Context registers for:
 +  *
 +  * Register 1:   Sector Number (Little Endian)
 +  * Register 2:   Sector Size   (Big Endian)
 +  *
 +  * Whereas AES-CBC uses registers 1/2 as a 16-byte IV.
 +  */
 + if (!strcmp(crypto_tfm_alg_name(tfm),xts(aes)))

I guess it would be better to use ctx-desc_hdr_template instead of
string comparison.

 + /* Fixed sized sector */
 + *((u64 *)areq-info + 1) = cpu_to_be64((1SECTOR_SHIFT));
 +
   return talitos_edesc_alloc(ctx-dev, NULL, areq-src, areq-dst,
  areq-info, 0, areq-nbytes, 0, ivsize, 0,
  areq-base.flags, areq-base, encrypt);
 @@ -2192,6 +2207,24 @@ static struct talitos_alg_template driver_algs[] = {
DESC_HDR_MODE0_DEU_CBC |
DESC_HDR_MODE0_DEU_3DES,
   },
 + {   .type = CRYPTO_ALG_TYPE_ABLKCIPHER,
 + .alg.crypto = {
 + .cra_name = xts(aes),
 + .cra_driver_name = xts-aes-talitos,
 + .cra_blocksize = XTS_BLOCK_SIZE,
 + .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER |
 + CRYPTO_ALG_ASYNC,
 + .cra_ablkcipher = {
 + .min_keysize = AES_MIN_KEY_SIZE * 2,
 + .max_keysize = AES_MAX_KEY_SIZE * 2,
 + .ivsize = XTS_BLOCK_SIZE,
 + }
 + },
 + .desc_hdr_template = DESC_HDR_TYPE_COMMON_NONSNOOP_NO_AFEU |
 + DESC_HDR_SEL0_AESU |
 + DESC_HDR_MODE0_AESU_XTS,
 + },
 +
   /* AHASH algorithms. */
   {   .type = CRYPTO_ALG_TYPE_AHASH,
   .alg.hash = {
 diff --git a/drivers/crypto/talitos.h b/drivers/crypto/talitos.h
 index a6f73e2..735da82 100644
 --- a/drivers/crypto/talitos.h
 +++ b/drivers/crypto/talitos.h
 @@ -316,6 +316,7 @@ extern int talitos_submit(struct device *dev, int ch, 
 struct talitos_edesc *edes
  /* primary execution unit mode (MODE0) and derivatives */
  #define  DESC_HDR_MODE0_ENCRYPT  cpu_to_be32(0x0010)
  #define  DESC_HDR_MODE0_AESU_CBC cpu_to_be32(0x0020)
 +#define  DESC_HDR_MODE0_AESU_XTS cpu_to_be32(0x0420)
  #define  DESC_HDR_MODE0_DEU_CBC  cpu_to_be32(0x0040)
  #define  DESC_HDR_MODE0_DEU_3DES cpu_to_be32(0x0020)
  #define  DESC_HDR_MODE0_MDEU_CONTcpu_to_be32(0x0800)
 


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

[v7 1/2] powerpc/mpc85xx: Add FSL QorIQ DPAA BMan support to device tree(s)

2015-02-27 Thread Emil Medve
From: Kumar Gala ga...@kernel.crashing.org

Signed-off-by: Kumar Gala ga...@kernel.crashing.org
Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
Signed-off-by: Hai-Ying Wang haiying.w...@freescale.com
Signed-off-by: Chunhe Lan chunhe@freescale.com
Signed-off-by: Poonam Aggrwal poonam.aggr...@freescale.com
[Emil Medve: Sync with the upstream binding]
Signed-off-by: Emil Medve emilian.me...@freescale.com
---

v7: Remove 'Change-Id'

v6: Rebase

 arch/powerpc/boot/dts/b4qds.dtsi|  17 +-
 arch/powerpc/boot/dts/fsl/b4860si-post.dtsi |  60 ++-
 arch/powerpc/boot/dts/fsl/b4si-post.dtsi|  89 +-
 arch/powerpc/boot/dts/fsl/p1023si-post.dtsi |  37 +++-
 arch/powerpc/boot/dts/fsl/p2041si-post.dtsi |  11 +-
 arch/powerpc/boot/dts/fsl/p3041si-post.dtsi |  11 +-
 arch/powerpc/boot/dts/fsl/p4080si-post.dtsi |  11 +-
 arch/powerpc/boot/dts/fsl/p5020si-post.dtsi |  11 +-
 arch/powerpc/boot/dts/fsl/p5040si-post.dtsi |  11 +-
 arch/powerpc/boot/dts/fsl/t1040si-post.dtsi |  65 ++-
 arch/powerpc/boot/dts/fsl/t2081si-post.dtsi | 105 ++-
 arch/powerpc/boot/dts/fsl/t4240si-post.dtsi | 265 +++-
 arch/powerpc/boot/dts/kmcoge4.dts   |  15 ++
 arch/powerpc/boot/dts/oca4080.dts   |  15 ++
 arch/powerpc/boot/dts/p1023rdb.dts  |  18 +-
 arch/powerpc/boot/dts/p2041rdb.dts  |  17 +-
 arch/powerpc/boot/dts/p3041ds.dts   |  17 +-
 arch/powerpc/boot/dts/p4080ds.dts   |  17 +-
 arch/powerpc/boot/dts/p5020ds.dts   |  17 +-
 arch/powerpc/boot/dts/p5040ds.dts   |  17 +-
 arch/powerpc/boot/dts/t104xqds.dtsi |  17 +-
 arch/powerpc/boot/dts/t104xrdb.dtsi |  14 ++
 arch/powerpc/boot/dts/t208xqds.dtsi |  17 +-
 arch/powerpc/boot/dts/t208xrdb.dtsi |  15 ++
 arch/powerpc/boot/dts/t4240qds.dts  |  17 +-
 arch/powerpc/boot/dts/t4240rdb.dts  |  15 ++
 26 files changed, 899 insertions(+), 22 deletions(-)

diff --git a/arch/powerpc/boot/dts/b4qds.dtsi b/arch/powerpc/boot/dts/b4qds.dtsi
index e5bde0b..24ed80d 100644
--- a/arch/powerpc/boot/dts/b4qds.dtsi
+++ b/arch/powerpc/boot/dts/b4qds.dtsi
@@ -1,7 +1,7 @@
 /*
  * B4420DS Device Tree Source
  *
- * Copyright 2012 Freescale Semiconductor, Inc.
+ * Copyright 2012 - 2014 Freescale Semiconductor, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -97,10 +97,25 @@
device_type = memory;
};
 
+   reserved-memory {
+   #address-cells = 2;
+   #size-cells = 2;
+   ranges;
+
+   bman_fbpr: bman-fbpr {
+   size = 0 0x100;
+   alignment = 0 0x100;
+   };
+   };
+
dcsr: dcsr@f {
ranges = 0x 0xf 0x 0x01052000;
};
 
+   bportals: bman-portals@ff400 {
+   ranges = 0x0 0xf 0xf400 0x200;
+   };
+
soc: soc@ffe00 {
ranges = 0x 0xf 0xfe00 0x100;
reg = 0xf 0xfe00 0 0x1000;
diff --git a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi 
b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
index d0a5cde..68b9a05 100644
--- a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
@@ -1,7 +1,7 @@
 /*
  * B4860 Silicon/SoC Device Tree Source (post include)
  *
- * Copyright 2012 Freescale Semiconductor Inc.
+ * Copyright 2012 - 2014 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -109,6 +109,64 @@
};
 };
 
+bportals {
+   bman-portal@38000 {
+   compatible = fsl,bman-portal;
+   reg = 0x38000 0x4000, 0x100e000 0x1000;
+   interrupts = 133 2 0 0;
+   };
+   bman-portal@3c000 {
+   compatible = fsl,bman-portal;
+   reg = 0x3c000 0x4000, 0x100f000 0x1000;
+   interrupts = 135 2 0 0;
+   };
+   bman-portal@4 {
+   compatible = fsl,bman-portal;
+   reg = 0x4 0x4000, 0x101 0x1000;
+   interrupts = 137 2 0 0;
+   };
+   bman-portal@44000 {
+   compatible = fsl,bman-portal;
+   reg = 0x44000 0x4000, 0x1011000 0x1000;
+   interrupts = 139 2 0 0;
+   };
+   bman-portal@48000 {
+   compatible = fsl,bman-portal;
+   reg = 0x48000 0x4000, 0x1012000 0x1000;
+   interrupts = 141 2 0 0;
+   };
+   bman-portal@4c000 {
+   compatible = fsl,bman-portal;
+   reg = 0x4c000 0x4000, 0x1013000 0x1000;
+   interrupts = 143 2 0 0;
+   };
+   bman-portal@5 {
+   compatible = fsl,bman-portal;
+   

[v5 1/2] powerpc/corenet: Enable muxing MDIO buses via GPIO

2015-02-27 Thread Emil Medve
From: Andy Fleming aflem...@gmail.com

Signed-off-by: Andy Fleming aflem...@gmail.com
Signed-off-by: Shaohui Xie shaohui@freescale.com
Signed-off-by: Shruti Kanetkar kanetkar.shr...@gmail.com
Signed-off-by: Emil Medve emilian.me...@freescale.com
---

v5: Remove 'Change-Id'

v4: Add 'Signed-off-by'

v3: Spearated from the FMan MDIO dt/binding patchset 
http://patchwork.ozlabs.org/patch/370871
Also supersedes http://patchwork.ozlabs.org/patch/423350
Update via 'savedefconfig'

 arch/powerpc/configs/corenet32_smp_defconfig  | 1 +
 arch/powerpc/configs/corenet64_smp_defconfig  | 1 +
 arch/powerpc/platforms/85xx/corenet_generic.c | 3 +++
 3 files changed, 5 insertions(+)

diff --git a/arch/powerpc/configs/corenet32_smp_defconfig 
b/arch/powerpc/configs/corenet32_smp_defconfig
index ca7957b..44e53a4 100644
--- a/arch/powerpc/configs/corenet32_smp_defconfig
+++ b/arch/powerpc/configs/corenet32_smp_defconfig
@@ -99,6 +99,7 @@ CONFIG_E1000E=y
 CONFIG_AT803X_PHY=y
 CONFIG_VITESSE_PHY=y
 CONFIG_FIXED_PHY=y
+CONFIG_MDIO_BUS_MUX_GPIO=y
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
diff --git a/arch/powerpc/configs/corenet64_smp_defconfig 
b/arch/powerpc/configs/corenet64_smp_defconfig
index 04737aa..724e579 100644
--- a/arch/powerpc/configs/corenet64_smp_defconfig
+++ b/arch/powerpc/configs/corenet64_smp_defconfig
@@ -85,6 +85,7 @@ CONFIG_FSL_XGMAC_MDIO=y
 CONFIG_E1000E=y
 CONFIG_VITESSE_PHY=y
 CONFIG_FIXED_PHY=y
+CONFIG_MDIO_BUS_MUX_GPIO=y
 CONFIG_INPUT_FF_MEMLESS=m
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c 
b/arch/powerpc/platforms/85xx/corenet_generic.c
index 1f309cc..0804b10 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -88,6 +88,9 @@ static const struct of_device_id of_device_ids[] = {
.compatible = simple-bus
},
{
+   .compatible = mdio-mux-gpio
+   },
+   {
.compatible = fsl,srio,
},
{
-- 
2.3.0
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[v7 2/2] powerpc/mpc85xx: Add FSL QorIQ DPAA QMan support to device tree(s)

2015-02-27 Thread Emil Medve
From: Kumar Gala ga...@kernel.crashing.org

Signed-off-by: Kumar Gala ga...@kernel.crashing.org
Signed-off-by: Geoff Thorpe geoff.tho...@freescale.com
Signed-off-by: Hai-Ying Wang haiying.w...@freescale.com
Signed-off-by: Chunhe Lan chunhe@freescale.com
Signed-off-by: Poonam Aggrwal poonam.aggr...@freescale.com
[Emil Medve: Sync with the upstream binding]
Signed-off-by: Emil Medve emilian.me...@freescale.com
---

v7: Remove 'Change-Id'

v6: Rebase

 arch/powerpc/boot/dts/b4qds.dtsi|  12 ++
 arch/powerpc/boot/dts/fsl/b4860si-post.dtsi |  69 ++
 arch/powerpc/boot/dts/fsl/b4si-post.dtsi| 106 ++
 arch/powerpc/boot/dts/fsl/p1023si-post.dtsi |  43 
 arch/powerpc/boot/dts/fsl/p2041si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/p3041si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/p4080si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/p5020si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/p5040si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/t1040si-post.dtsi |  78 +++
 arch/powerpc/boot/dts/fsl/t2081si-post.dtsi | 126 +++
 arch/powerpc/boot/dts/fsl/t4240si-post.dtsi | 318 
 arch/powerpc/boot/dts/kmcoge4.dts   |  12 ++
 arch/powerpc/boot/dts/oca4080.dts   |  12 ++
 arch/powerpc/boot/dts/p1023rdb.dts  |  12 ++
 arch/powerpc/boot/dts/p2041rdb.dts  |  12 ++
 arch/powerpc/boot/dts/p3041ds.dts   |  12 ++
 arch/powerpc/boot/dts/p4080ds.dts   |  12 ++
 arch/powerpc/boot/dts/p5020ds.dts   |  12 ++
 arch/powerpc/boot/dts/p5040ds.dts   |  12 ++
 arch/powerpc/boot/dts/t104xqds.dtsi |  12 ++
 arch/powerpc/boot/dts/t104xrdb.dtsi |  12 ++
 arch/powerpc/boot/dts/t208xqds.dtsi |  12 ++
 arch/powerpc/boot/dts/t208xrdb.dtsi |  12 ++
 arch/powerpc/boot/dts/t4240qds.dts  |  12 ++
 arch/powerpc/boot/dts/t4240rdb.dts  |  12 ++
 26 files changed, 985 insertions(+)

diff --git a/arch/powerpc/boot/dts/b4qds.dtsi b/arch/powerpc/boot/dts/b4qds.dtsi
index 24ed80d..559d006 100644
--- a/arch/powerpc/boot/dts/b4qds.dtsi
+++ b/arch/powerpc/boot/dts/b4qds.dtsi
@@ -106,6 +106,14 @@
size = 0 0x100;
alignment = 0 0x100;
};
+   qman_fqd: qman-fqd {
+   size = 0 0x40;
+   alignment = 0 0x40;
+   };
+   qman_pfdr: qman-pfdr {
+   size = 0 0x200;
+   alignment = 0 0x200;
+   };
};
 
dcsr: dcsr@f {
@@ -116,6 +124,10 @@
ranges = 0x0 0xf 0xf400 0x200;
};
 
+   qportals: qman-portals@ff600 {
+   ranges = 0x0 0xf 0xf600 0x200;
+   };
+
soc: soc@ffe00 {
ranges = 0x 0xf 0xfe00 0x100;
reg = 0xf 0xfe00 0 0x1000;
diff --git a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi 
b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
index 68b9a05..02ccde6 100644
--- a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
@@ -167,6 +167,75 @@
};
 };
 
+qportals {
+   qportal14: qman-portal@38000 {
+   compatible = fsl,qman-portal;
+   reg = 0x38000 0x4000, 0x100e000 0x1000;
+   interrupts = 132 0x2 0 0;
+   fsl,qman-channel-id = 0xe;
+   };
+   qportal15: qman-portal@3c000 {
+   compatible = fsl,qman-portal;
+   reg = 0x3c000 0x4000, 0x100f000 0x1000;
+   interrupts = 134 0x2 0 0;
+   fsl,qman-channel-id = 0xf;
+   };
+   qportal16: qman-portal@4 {
+   compatible = fsl,qman-portal;
+   reg = 0x4 0x4000, 0x101 0x1000;
+   interrupts = 136 0x2 0 0;
+   fsl,qman-channel-id = 0x10;
+   };
+   qportal17: qman-portal@44000 {
+   compatible = fsl,qman-portal;
+   reg = 0x44000 0x4000, 0x1011000 0x1000;
+   interrupts = 138 0x2 0 0;
+   fsl,qman-channel-id = 0x11;
+   };
+   qportal18: qman-portal@48000 {
+   compatible = fsl,qman-portal;
+   reg = 0x48000 0x4000, 0x1012000 0x1000;
+   interrupts = 140 0x2 0 0;
+   fsl,qman-channel-id = 0x12;
+   };
+   qportal19: qman-portal@4c000 {
+   compatible = fsl,qman-portal;
+   reg = 0x4c000 0x4000, 0x1013000 0x1000;
+   interrupts = 142 0x2 0 0;
+   fsl,qman-channel-id = 0x13;
+   };
+   qportal20: qman-portal@5 {
+   compatible = fsl,qman-portal;
+   reg = 0x5 0x4000, 0x1014000 0x1000;
+   interrupts = 144 0x2 0 0;
+   fsl,qman-channel-id = 0x14;
+   };
+   qportal21: qman-portal@54000 {
+   compatible = 

Re: [PATCH v4 0/3] powerpc: Enable seccomp filter support

2015-02-27 Thread Benjamin Herrenschmidt
On Fri, 2015-02-27 at 09:28 +0200, Purcareata Bogdan wrote:
 Ping?

What is the ping for ?

Ben.

 On 18.02.2015 10:16, Bogdan Purcareata wrote:
  Add the missing pieces in order to enable SECCOMP_FILTER on PowerPC
  architectures, and enable this support.
 
  Testing has been pursued using libseccomp with the latest ppc support 
  patches
  [1][2], on Freescale platforms for both ppc and ppc64. Support on ppc64le 
  has
  also been tested, courtesy of Mike Strosaker.
 
  [1] https://groups.google.com/forum/#!topic/libseccomp/oz42LfMDsxg
  [2] https://groups.google.com/forum/#!topic/libseccomp/TQWfCt_nD7c
 
  v4:
  - rebased on top of 3.19
 
  v3:
  - keep setting ENOSYS in syscall entry assembly when syscall tracing is 
  disabled
 
  v2:
  - move setting ENOSYS from syscall entry assembly to do_syscall_trace_enter
 
  Bogdan Purcareata (3):
 powerpc: Don't force ENOSYS as error on syscall fail
 powerpc: Relax secure computing on syscall entry trace
 powerpc: Enable HAVE_ARCH_SECCOMP_FILTER
 
arch/powerpc/Kconfig   | 1 +
arch/powerpc/kernel/entry_32.S | 7 ++-
arch/powerpc/kernel/entry_64.S | 5 +++--
arch/powerpc/kernel/ptrace.c   | 8 ++--
4 files changed, 16 insertions(+), 5 deletions(-)
 


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

[PATCH v1 2/2] perf/kvm: perf-kvm-stat to report syscalls

2015-02-27 Thread Hemant Kumar
Some of the kvm_hv exits are due to hcalls. So, this patch adds necessary
support to display the number of hcalls grouped according to their type
(H_IPI, H_CONFER, etc) with perf kvm stat report --event=syscall.

The patch defines the reasons in kvm_trace_symbol_hcall. It adds
kvm_hv:kvm_hcall_enter tracepoint to be recorded when
perf kvm stat record is invoked. It defines the handler functions to
handle a kvm_hcall_enter event sample from the samples recorded in
perf.data.guest.

To reuse the pSeries hypervisor opcodes, they codes are removed from
arch/powerpc/include/asm/hvcall.h and added to a new .h file in
arch/powerpc/include/uapi/asm/hcall_codes.h.
Also the hcall_code to hcall_reason string mapping is removed from
arch/powerpc/kvm/trace_hv.h to a new file
arch/powerpc/include/uapi/asm/trace_hcall.h
so that perf in the userspace can use them.

A sample output :
# pgrep qemu
19378
60515

# ./perf kvm stat record -a
^C[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 4.153 MB perf.data.guest (39624 samples) ]

# ./perf kvm stat report -p 60515 --event=syscall


Analyze events for pid(s) 60515, all VCPUs:

   SYSCALL-EVENTSamples  Samples% Time%Min TimeMax Time 
Avg time

H_VIO_SIGNAL   103438.44%15.77%  0.36us  1.59us 
 0.44us ( +-   0.66% )
  H_SEND_CRQ65224.24%10.97%  0.39us  1.84us 
 0.49us ( +-   1.20% )
   H_IPI52319.44%62.05%  1.35us 19.70us 
 3.44us ( +-   2.88% )
 H_PUT_TERM_CHAR41115.28% 8.03%  0.38us  3.77us 
 0.57us ( +-   1.61% )
 H_GET_TERM_CHAR 50 1.86% 0.99%  0.40us  0.98us 
 0.57us ( +-   3.37% )
   H_EOI 20 0.74% 2.19%  2.22us  4.72us 
 3.17us ( +-   5.96% )

Total Samples:2690, Total events handled time:2896.94us.

Signed-off-by: Hemant Kumar hem...@linux.vnet.ibm.com
---
 arch/powerpc/include/asm/hvcall.h   |  120 --
 arch/powerpc/include/uapi/asm/hcall_codes.h |  123 +++
 arch/powerpc/include/uapi/asm/kvm_perf.h|4 +
 arch/powerpc/include/uapi/asm/trace_hcall.h |  122 +++
 arch/powerpc/kvm/trace_hv.h |  117 --
 tools/perf/arch/powerpc/util/kvm-stat.c |   61 +
 6 files changed, 313 insertions(+), 234 deletions(-)
 create mode 100644 arch/powerpc/include/uapi/asm/hcall_codes.h
 create mode 100644 arch/powerpc/include/uapi/asm/trace_hcall.h

diff --git a/arch/powerpc/include/asm/hvcall.h 
b/arch/powerpc/include/asm/hvcall.h
index 85bc8c0..f810466 100644
--- a/arch/powerpc/include/asm/hvcall.h
+++ b/arch/powerpc/include/asm/hvcall.h
@@ -155,124 +155,8 @@
 /* Each control block has to be on a 4K boundary */
 #define H_CB_ALIGNMENT  4096
 
-/* pSeries hypervisor opcodes */
-#define H_REMOVE   0x04
-#define H_ENTER0x08
-#define H_READ 0x0c
-#define H_CLEAR_MOD0x10
-#define H_CLEAR_REF0x14
-#define H_PROTECT  0x18
-#define H_GET_TCE  0x1c
-#define H_PUT_TCE  0x20
-#define H_SET_SPRG00x24
-#define H_SET_DABR 0x28
-#define H_PAGE_INIT0x2c
-#define H_SET_ASR  0x30
-#define H_ASR_ON   0x34
-#define H_ASR_OFF  0x38
-#define H_LOGICAL_CI_LOAD  0x3c
-#define H_LOGICAL_CI_STORE 0x40
-#define H_LOGICAL_CACHE_LOAD   0x44
-#define H_LOGICAL_CACHE_STORE  0x48
-#define H_LOGICAL_ICBI 0x4c
-#define H_LOGICAL_DCBF 0x50
-#define H_GET_TERM_CHAR0x54
-#define H_PUT_TERM_CHAR0x58
-#define H_REAL_TO_LOGICAL  0x5c
-#define H_HYPERVISOR_DATA  0x60
-#define H_EOI  0x64
-#define H_CPPR 0x68
-#define H_IPI  0x6c
-#define H_IPOLL0x70
-#define H_XIRR 0x74
-#define H_PERFMON  0x7c
-#define H_MIGRATE_DMA  0x78
-#define H_REGISTER_VPA 0xDC
-#define H_CEDE 0xE0
-#define H_CONFER   0xE4
-#define H_PROD 0xE8
-#define H_GET_PPP  0xEC
-#define H_SET_PPP  0xF0
-#define H_PURR 0xF4
-#define H_PIC  0xF8
-#define H_REG_CRQ  0xFC
-#define H_FREE_CRQ 0x100
-#define H_VIO_SIGNAL   0x104
-#define H_SEND_CRQ 0x108
-#define H_COPY_RDMA0x110
-#define H_REGISTER_LOGICAL_LAN 0x114
-#define H_FREE_LOGICAL_LAN 0x118
-#define H_ADD_LOGICAL_LAN_BUFFER 0x11C
-#define H_SEND_LOGICAL_LAN 0x120
-#define H_BULK_REMOVE  0x124
-#define H_MULTICAST_CTRL   0x130
-#define H_SET_XDABR0x134
-#define H_STUFF_TCE0x138
-#define H_PUT_TCE_INDIRECT 0x13C
-#define 

[PATCH v1 0/2] perf/kvm: perf-kvm-stat on powerpc

2015-02-27 Thread Hemant Kumar
perf kvm stat record/report which can be used to analyze KVM related statistics
isn't enabled on powerpc. This patchset enables perf kvm stat on powerpc.
The first patch enables perf kvm stat record and report to report kvm exits.

record enables recording of the tracepoints: kvm_hv:kvm_guest_enter and
kvm_hv:kvm_guest_exit in the first patch and kvm_hv:kvm_hcall_enter and
kvm_hv:kvm_hcall_exit in the second patch.

This command can be used to record kvm events on the host:
# perf kvm stat record -a

To report the kvm guest related exit events, use:
# perf kvm stat report
or
# perf kvm stat report --event=vmexit

This should show the exit events along with the exit reasons.

The second patch in this series adds support to show the hcall events too with:
# perf kvm stat report --event=syscall

---

Hemant Kumar (1):
  perf/kvm: perf-kvm-stat to report syscalls

Srikar Dronamraju (1):
  perf/kvm: Enable perf-kvm-stat record/report on powerpc


 arch/powerpc/include/asm/hvcall.h|  120 -
 arch/powerpc/include/uapi/asm/hcall_codes.h  |  123 ++
 arch/powerpc/include/uapi/asm/kvm_perf.h |   19 
 arch/powerpc/include/uapi/asm/trace_book3s.h |   33 +++
 arch/powerpc/include/uapi/asm/trace_hcall.h  |  122 ++
 arch/powerpc/kvm/trace_book3s.h  |   32 ---
 arch/powerpc/kvm/trace_hv.h  |  119 -
 arch/powerpc/kvm/trace_pr.h  |2 
 tools/perf/arch/powerpc/Makefile |1 
 tools/perf/arch/powerpc/util/Build   |1 
 tools/perf/arch/powerpc/util/kvm-stat.c  |   94 
 11 files changed, 398 insertions(+), 268 deletions(-)
 create mode 100644 arch/powerpc/include/uapi/asm/hcall_codes.h
 create mode 100644 arch/powerpc/include/uapi/asm/kvm_perf.h
 create mode 100644 arch/powerpc/include/uapi/asm/trace_book3s.h
 create mode 100644 arch/powerpc/include/uapi/asm/trace_hcall.h
 delete mode 100644 arch/powerpc/kvm/trace_book3s.h
 create mode 100644 tools/perf/arch/powerpc/util/kvm-stat.c

--

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

[PATCH v1 1/2] perf/kvm: Enable perf-kvm-stat record/report on powerpc

2015-02-27 Thread Hemant Kumar
From: Srikar Dronamraju sri...@linux.vnet.ibm.com

perf kvm stat record/report isn't supported on powerpc.
This patch enables perf to record kvm events (kvm_hv:kvm_guest_entry and exit)
and to display the stats related to the events.
When perf kvm stat record -a is invoked, the kvm_hv related tracepoints
kvm_hv:kvm_guest_enter (defined as KVM_ENTRY_TRACE) and kvm_hv:kvm_guest_exit
(defined as KVM_EXIT_TRACE) are enabled. All these data are dumped to
perf.data.guest file.
After recording, use perf kvm stat report to view the vm exit related
stats which shows how many times, the VM exited from guest to host/hypervisor 
mode.
All these exits are grouped as per their reasons to exit. The exit reasons
are defined in kvm_trace_symbol_exit.

The reasons related to kvm_exits, hcalls, etc were previously defined in
arch/powerpc/kvm/trace_book3s.h. To reuse all the reasons defined there, this 
patch
moves the exit_reasons arch/powerpc/include/uapi/asm/trace_book3s.h.

This patch defines the tracepoint events kvm_hv:kvm_guest_exit and
kvm_hv:kvm_guest_enter to be sampled and registers the exit events' 
operations.

Here is a sample o/p:

# pgrep qemu
19378
60515

# perf kvm stat record -a
^C[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 4.153 MB perf.data.guest (39624 samples) ]

# perf kvm stat report -p 60515


Analyze events for pid(s) 60515, all VCPUs:

 VM-EXITSamples  Samples% Time%Min TimeMax Time 
Avg time

  H_DATA_STORAGE   500635.30% 0.13%  1.94us 49.46us 
12.37us ( +-   0.52% )
  HV_DECREMENTER   445731.43% 0.02%  0.72us 16.14us 
 1.91us ( +-   0.96% )
 SYSCALL   269018.97% 0.10%  2.84us528.24us 
18.29us ( +-   3.75% )
  RETURN_TO_HOST   178912.61%99.76%  1.58us 672791.91us  
27470.23us ( +-   3.00% )
EXTERNAL240 1.69% 0.00%  0.69us 10.67us 
 1.33us ( +-   5.34% )

Total Samples:14182, Total events handled time:49264158.30us.

Signed-off-by: Srikar Dronamraju sri...@linux.vnet.ibm.com
Signed-off-by: Hemant Kumar hem...@linux.vnet.ibm.com
---
 arch/powerpc/include/uapi/asm/kvm_perf.h |   15 
 arch/powerpc/include/uapi/asm/trace_book3s.h |   33 ++
 arch/powerpc/kvm/trace_book3s.h  |   32 -
 arch/powerpc/kvm/trace_hv.h  |2 +-
 arch/powerpc/kvm/trace_pr.h  |2 +-
 tools/perf/arch/powerpc/Makefile |1 +
 tools/perf/arch/powerpc/util/Build   |1 +
 tools/perf/arch/powerpc/util/kvm-stat.c  |   33 ++
 8 files changed, 85 insertions(+), 34 deletions(-)
 create mode 100644 arch/powerpc/include/uapi/asm/kvm_perf.h
 create mode 100644 arch/powerpc/include/uapi/asm/trace_book3s.h
 delete mode 100644 arch/powerpc/kvm/trace_book3s.h
 create mode 100644 tools/perf/arch/powerpc/util/kvm-stat.c

diff --git a/arch/powerpc/include/uapi/asm/kvm_perf.h 
b/arch/powerpc/include/uapi/asm/kvm_perf.h
new file mode 100644
index 000..30fa670
--- /dev/null
+++ b/arch/powerpc/include/uapi/asm/kvm_perf.h
@@ -0,0 +1,15 @@
+#ifndef _ASM_POWERPC_KVM_PERF_H
+#define _ASM_POWERPC_KVM_PERF_H
+
+#include asm/trace_book3s.h
+#include asm/kvm.h
+
+#define DECODE_STR_LEN 20
+
+#define VCPU_ID vcpu_id
+
+#define KVM_ENTRY_TRACE kvm_hv:kvm_guest_enter
+#define KVM_EXIT_TRACE kvm_hv:kvm_guest_exit
+#define KVM_EXIT_REASON trap
+
+#endif /* _ASM_POWERPC_KVM_PERF_H */
diff --git a/arch/powerpc/include/uapi/asm/trace_book3s.h 
b/arch/powerpc/include/uapi/asm/trace_book3s.h
new file mode 100644
index 000..1e79e0e
--- /dev/null
+++ b/arch/powerpc/include/uapi/asm/trace_book3s.h
@@ -0,0 +1,33 @@
+#if !defined(_TRACE_KVM_BOOK3S_H)
+#define _TRACE_KVM_BOOK3S_H
+
+/*
+ * Common defines used by the trace macros in trace_pr.h and trace_hv.h
+ */
+
+#define kvm_trace_symbol_exit  \
+   {0x0, RETURN_TO_HOST},\
+   {0x100, SYSTEM_RESET},\
+   {0x200, MACHINE_CHECK},   \
+   {0x300, DATA_STORAGE},\
+   {0x380, DATA_SEGMENT},\
+   {0x400, INST_STORAGE},\
+   {0x480, INST_SEGMENT},\
+   {0x500, EXTERNAL},\
+   {0x501, EXTERNAL_LEVEL},  \
+   {0x502, EXTERNAL_HV}, \
+   {0x600, ALIGNMENT},   \
+   {0x700, PROGRAM}, \
+   {0x800, FP_UNAVAIL},  \
+   {0x900, DECREMENTER}, \
+   {0x980, HV_DECREMENTER},  \
+   

[PATCH] powerpc: Fix trivial typo in comment

2015-02-27 Thread Yannick Guerrini
Change 'Kenrel' to 'Kernel'

Signed-off-by: Yannick Guerrini yguerr...@tomshardware.fr
---
 arch/powerpc/include/asm/smu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/smu.h b/arch/powerpc/include/asm/smu.h
index 6e909f3..37d2da6 100644
--- a/arch/powerpc/include/asm/smu.h
+++ b/arch/powerpc/include/asm/smu.h
@@ -478,7 +478,7 @@ extern unsigned long smu_cmdbuf_abs;
 
 
 /*
- * Kenrel asynchronous i2c interface
+ * Kernel asynchronous i2c interface
  */
 
 #define SMU_I2C_READ_MAX   0x1d
-- 
1.9.5.msysgit.0

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

[PATCH] seccomp: switch to using asm-generic for seccomp.h

2015-02-27 Thread Kees Cook
Most architectures don't need to do anything special for the strict
seccomp syscall entries. Remove the redundant headers and reduce the
others.

Signed-off-by: Kees Cook keesc...@chromium.org
---
 arch/arm/include/asm/seccomp.h  | 12 +---
 arch/microblaze/include/asm/seccomp.h   | 17 +
 arch/mips/include/asm/seccomp.h |  7 ++-
 arch/parisc/include/asm/seccomp.h   | 17 +
 arch/powerpc/include/asm/seccomp.h  |  1 +
 arch/powerpc/include/uapi/asm/Kbuild|  1 -
 arch/powerpc/include/uapi/asm/seccomp.h | 16 
 arch/s390/include/asm/seccomp.h | 17 +
 arch/sh/include/asm/seccomp.h   | 11 +--
 arch/sparc/include/asm/seccomp.h| 16 +---
 arch/x86/include/asm/seccomp.h  | 21 ++---
 arch/x86/include/asm/seccomp_32.h   | 11 ---
 arch/x86/include/asm/seccomp_64.h   | 17 -
 13 files changed, 27 insertions(+), 137 deletions(-)
 create mode 100644 arch/powerpc/include/asm/seccomp.h
 delete mode 100644 arch/powerpc/include/uapi/asm/seccomp.h
 delete mode 100644 arch/x86/include/asm/seccomp_32.h
 delete mode 100644 arch/x86/include/asm/seccomp_64.h

diff --git a/arch/arm/include/asm/seccomp.h b/arch/arm/include/asm/seccomp.h
index 52b156b341f5..66ca6a30bf5c 100644
--- a/arch/arm/include/asm/seccomp.h
+++ b/arch/arm/include/asm/seccomp.h
@@ -1,11 +1 @@
-#ifndef _ASM_ARM_SECCOMP_H
-#define _ASM_ARM_SECCOMP_H
-
-#include linux/unistd.h
-
-#define __NR_seccomp_read __NR_read
-#define __NR_seccomp_write __NR_write
-#define __NR_seccomp_exit __NR_exit
-#define __NR_seccomp_sigreturn __NR_rt_sigreturn
-
-#endif /* _ASM_ARM_SECCOMP_H */
+#include asm-generic/seccomp.h
diff --git a/arch/microblaze/include/asm/seccomp.h 
b/arch/microblaze/include/asm/seccomp.h
index 0d912758a0d7..66ca6a30bf5c 100644
--- a/arch/microblaze/include/asm/seccomp.h
+++ b/arch/microblaze/include/asm/seccomp.h
@@ -1,16 +1 @@
-#ifndef _ASM_MICROBLAZE_SECCOMP_H
-#define _ASM_MICROBLAZE_SECCOMP_H
-
-#include linux/unistd.h
-
-#define __NR_seccomp_read  __NR_read
-#define __NR_seccomp_write __NR_write
-#define __NR_seccomp_exit  __NR_exit
-#define __NR_seccomp_sigreturn __NR_sigreturn
-
-#define __NR_seccomp_read_32   __NR_read
-#define __NR_seccomp_write_32  __NR_write
-#define __NR_seccomp_exit_32   __NR_exit
-#define __NR_seccomp_sigreturn_32  __NR_sigreturn
-
-#endif /* _ASM_MICROBLAZE_SECCOMP_H */
+#include asm-generic/seccomp.h
diff --git a/arch/mips/include/asm/seccomp.h b/arch/mips/include/asm/seccomp.h
index f29c75cf83c6..1d8a2e2c75c1 100644
--- a/arch/mips/include/asm/seccomp.h
+++ b/arch/mips/include/asm/seccomp.h
@@ -2,11 +2,6 @@
 
 #include linux/unistd.h
 
-#define __NR_seccomp_read __NR_read
-#define __NR_seccomp_write __NR_write
-#define __NR_seccomp_exit __NR_exit
-#define __NR_seccomp_sigreturn __NR_rt_sigreturn
-
 /*
  * Kludge alert:
  *
@@ -29,4 +24,6 @@
 
 #endif /* CONFIG_MIPS32_O32 */
 
+#include asm-generic/seccomp.h
+
 #endif /* __ASM_SECCOMP_H */
diff --git a/arch/parisc/include/asm/seccomp.h 
b/arch/parisc/include/asm/seccomp.h
index 015f7887aa29..66ca6a30bf5c 100644
--- a/arch/parisc/include/asm/seccomp.h
+++ b/arch/parisc/include/asm/seccomp.h
@@ -1,16 +1 @@
-#ifndef _ASM_PARISC_SECCOMP_H
-#define _ASM_PARISC_SECCOMP_H
-
-#include linux/unistd.h
-
-#define __NR_seccomp_read __NR_read
-#define __NR_seccomp_write __NR_write
-#define __NR_seccomp_exit __NR_exit
-#define __NR_seccomp_sigreturn __NR_rt_sigreturn
-
-#define __NR_seccomp_read_32 __NR_read
-#define __NR_seccomp_write_32 __NR_write
-#define __NR_seccomp_exit_32 __NR_exit
-#define __NR_seccomp_sigreturn_32 __NR_rt_sigreturn
-
-#endif /* _ASM_PARISC_SECCOMP_H */
+#include asm-generic/seccomp.h
diff --git a/arch/powerpc/include/asm/seccomp.h 
b/arch/powerpc/include/asm/seccomp.h
new file mode 100644
index ..66ca6a30bf5c
--- /dev/null
+++ b/arch/powerpc/include/asm/seccomp.h
@@ -0,0 +1 @@
+#include asm-generic/seccomp.h
diff --git a/arch/powerpc/include/uapi/asm/Kbuild 
b/arch/powerpc/include/uapi/asm/Kbuild
index 7a3f795ac218..79c4068be278 100644
--- a/arch/powerpc/include/uapi/asm/Kbuild
+++ b/arch/powerpc/include/uapi/asm/Kbuild
@@ -25,7 +25,6 @@ header-y += posix_types.h
 header-y += ps3fb.h
 header-y += ptrace.h
 header-y += resource.h
-header-y += seccomp.h
 header-y += sembuf.h
 header-y += setup.h
 header-y += shmbuf.h
diff --git a/arch/powerpc/include/uapi/asm/seccomp.h 
b/arch/powerpc/include/uapi/asm/seccomp.h
deleted file mode 100644
index 00c1d9133cfe..
--- a/arch/powerpc/include/uapi/asm/seccomp.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef _ASM_POWERPC_SECCOMP_H
-#define _ASM_POWERPC_SECCOMP_H
-
-#include linux/unistd.h
-
-#define __NR_seccomp_read __NR_read
-#define __NR_seccomp_write __NR_write
-#define __NR_seccomp_exit __NR_exit
-#define __NR_seccomp_sigreturn 

Re: [v2,1/3] crypto: ppc/sha256 - assembler

2015-02-27 Thread Herbert Xu
On Fri, Jan 30, 2015 at 03:39:23PM +0100, Markus Stockhausen wrote:
 This is the assembler code for SHA256 implementation with
 the SIMD SPE instruction set. Although being only a 32 bit
 architecture GPRs are extended to 64 bit presenting two
 32 bit values. With the enhanced instruction set we can
 operate on them in parallel. That helps reducing the time
 to calculate W16-W64. For increasing performance even more 
 the assembler function can compute hashes for more than 
 one 64 byte input block. That saves a lot of register
 saving/restoring
 
 The state of the used SPE registers is preserved via the 
 stack so we can run from interrupt context. There might 
 be the case that we interrupt ourselves and push sensitive 
 data from another context onto our stack. Clear this area
 in the stack afterwards to avoid information leakage.
 
 The code is endian independant.
 
 Signed-off-by: Markus Stockhausen stockhau...@collogia.de

All applied.  Thanks!
-- 
Email: Herbert Xu herb...@gondor.apana.org.au
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] ppc: mm: free memory after creating kmem cache

2015-02-27 Thread yanjiang.jin
From: Yanjiang Jin yanjiang@windriver.com

kmem_cache_create()-kmem_cache_create_memcg()-kstrdup() allocates new space
and copy name's content, so it is safe to free name memory after
calling kmem_cache_create(). Else kmemleak would report the below warning:

unreferenced object 0xc000f9002160 (size 16):
  comm swapper/0, pid 0, jiffies 4294892296 (age 1386.640s)
  hex dump (first 16 bytes):
70 67 74 61 62 6c 65 2d 32 5e 39 00 de ad be ef  pgtable-2^9.
  backtrace:
[c04e03ec] .kvasprintf+0x5c/0xa0
[c04e045c] .kasprintf+0x2c/0x50
[c002e36c] .pgtable_cache_add+0xac/0x100
[c002e3e4] .pgtable_cache_init+0x24/0x80
[c0c6c67c] .start_kernel+0x228/0x4c8
[c594] .start_here_common+0x24/0x90

Signed-off-by: Yanjiang Jin yanjiang@windriver.com
---
 arch/powerpc/mm/init_64.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index a90b9c4..fe0631f 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -129,6 +129,7 @@ void pgtable_cache_add(unsigned shift, void (*ctor)(void *))
align = max_t(unsigned long, align, minalign);
name = kasprintf(GFP_KERNEL, pgtable-2^%d, shift);
new = kmem_cache_create(name, table_size, align, 0, ctor);
+   kfree(name);
pgtable_cache[shift - 1] = new;
pr_debug(Allocated pgtable cache for order %d\n, shift);
 }
-- 
1.9.1

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

Re: [PATCH] ibmveth: Add function to enable live MAC address changes

2015-02-27 Thread David Miller
From: Thomas Falcon tlfal...@linux.vnet.ibm.com
Date: Wed, 25 Feb 2015 18:34:24 -0600

 Add a function that will enable changing the MAC address
 of an ibmveth interface while it is still running.
 
 Signed-off-by: Thomas Falcon tlfal...@linux.vnet.ibm.com
 ---
  drivers/net/ethernet/ibm/ibmveth.c | 20 +++-
  1 file changed, 19 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/net/ethernet/ibm/ibmveth.c 
 b/drivers/net/ethernet/ibm/ibmveth.c
 index 21978cc..6e44357 100644
 --- a/drivers/net/ethernet/ibm/ibmveth.c
 +++ b/drivers/net/ethernet/ibm/ibmveth.c
 @@ -1327,6 +1327,24 @@ static unsigned long ibmveth_get_desired_dma(struct 
 vio_dev *vdev)
   return ret;
  }
  
 +static int ibmveth_set_mac_addr(struct net_device *dev, void *p)
 +{
 + struct ibmveth_adapter *adapter = netdev_priv(dev);
 + struct sockaddr *addr = p;
 + u64 mac_address;
 + int rc;
 +
 + if (!is_valid_ether_addr(addr-sa_data))
 + return -EADDRNOTAVAIL;
 +
 + ether_addr_copy(dev-dev_addr, addr-sa_data);
 +
 + mac_address = ibmveth_encode_mac_addr(dev-dev_addr);
 + rc = h_change_logical_lan_mac(adapter-vdev-unit_address, mac_address);

As others have said, if this hypervisor call fails you must not change
dev-dev_addr.  It must always be in sync with the hardware.

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