[PATCH 14/46] powerpc/configs: Drop no longer needed CONFIG_CRYPTO_NULL in g5 / c2k

2017-08-22 Thread Michael Ellerman
Since commit 3491244c6298 ("crypto: echainiv - Set Kconfig default to
m") we no longer need to set CONFIG_CRYPTO_NULL in our defconfigs.

Signed-off-by: Michael Ellerman 
---
 arch/powerpc/configs/c2k_defconfig | 1 -
 arch/powerpc/configs/g5_defconfig  | 1 -
 2 files changed, 2 deletions(-)

diff --git a/arch/powerpc/configs/c2k_defconfig 
b/arch/powerpc/configs/c2k_defconfig
index 5419d3eb852a..d23507223ab4 100644
--- a/arch/powerpc/configs/c2k_defconfig
+++ b/arch/powerpc/configs/c2k_defconfig
@@ -389,7 +389,6 @@ CONFIG_SECURITY_NETWORK=y
 CONFIG_SECURITY_SELINUX=y
 CONFIG_SECURITY_SELINUX_BOOTPARAM=y
 CONFIG_SECURITY_SELINUX_DISABLE=y
-CONFIG_CRYPTO_NULL=m
 CONFIG_CRYPTO_HMAC=y
 CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_SHA1=y
diff --git a/arch/powerpc/configs/g5_defconfig 
b/arch/powerpc/configs/g5_defconfig
index 75f97c20f171..e084fa548d73 100644
--- a/arch/powerpc/configs/g5_defconfig
+++ b/arch/powerpc/configs/g5_defconfig
@@ -258,7 +258,6 @@ CONFIG_DEBUG_MUTEXES=y
 CONFIG_LATENCYTOP=y
 CONFIG_BOOTX_TEXT=y
 CONFIG_PPC_EARLY_DEBUG=y
-CONFIG_CRYPTO_NULL=m
 CONFIG_CRYPTO_TEST=m
 CONFIG_CRYPTO_PCBC=m
 CONFIG_CRYPTO_HMAC=y
-- 
2.7.4



[PATCH 13/46] powerpc/configs: Drop no longer needed CONFIG_CRYPTO_NULL

2017-08-22 Thread Michael Ellerman
Since commit 00b9cfa3ff38 ("mac80111: Add GCMP and GCMP-256 ciphers")
we no longer need to set CONFIG_CRYPTO_NULL in our defconfigs.

Signed-off-by: Michael Ellerman 
---
 arch/powerpc/configs/pmac32_defconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/powerpc/configs/pmac32_defconfig 
b/arch/powerpc/configs/pmac32_defconfig
index d97b6f66af01..ed0a0bb6a271 100644
--- a/arch/powerpc/configs/pmac32_defconfig
+++ b/arch/powerpc/configs/pmac32_defconfig
@@ -309,7 +309,6 @@ CONFIG_XMON=y
 CONFIG_XMON_DEFAULT=y
 CONFIG_BOOTX_TEXT=y
 CONFIG_PPC_EARLY_DEBUG=y
-CONFIG_CRYPTO_NULL=m
 CONFIG_CRYPTO_PCBC=m
 CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_SHA512=m
-- 
2.7.4



[PATCH 12/46] powerpc/configs: Drop no longer needed CONFIG_CRYPTO_SHA256

2017-08-22 Thread Michael Ellerman
Since commit 826775bbf38f ("crypto: drbg - Add select on sha256") we
no longer need to set CONFIG_CRYPTO_SHA256 in our defconfigs.

Signed-off-by: Michael Ellerman 
---
 arch/powerpc/configs/44x/eiger_defconfig   | 1 -
 arch/powerpc/configs/44x/redwood_defconfig | 1 -
 arch/powerpc/configs/mpc83xx_defconfig | 1 -
 arch/powerpc/configs/pasemi_defconfig  | 1 -
 4 files changed, 4 deletions(-)

diff --git a/arch/powerpc/configs/44x/eiger_defconfig 
b/arch/powerpc/configs/44x/eiger_defconfig
index 6b6404501ae0..f6dc23fef683 100644
--- a/arch/powerpc/configs/44x/eiger_defconfig
+++ b/arch/powerpc/configs/44x/eiger_defconfig
@@ -91,7 +91,6 @@ CONFIG_CRYPTO_XCBC=y
 CONFIG_CRYPTO_MD4=y
 CONFIG_CRYPTO_MD5=y
 CONFIG_CRYPTO_SHA1=y
-CONFIG_CRYPTO_SHA256=y
 CONFIG_CRYPTO_SHA512=y
 CONFIG_CRYPTO_ARC4=y
 CONFIG_CRYPTO_BLOWFISH=y
diff --git a/arch/powerpc/configs/44x/redwood_defconfig 
b/arch/powerpc/configs/44x/redwood_defconfig
index 91eefcf1720f..918cfb63f0c8 100644
--- a/arch/powerpc/configs/44x/redwood_defconfig
+++ b/arch/powerpc/configs/44x/redwood_defconfig
@@ -90,7 +90,6 @@ CONFIG_CRYPTO_XCBC=y
 CONFIG_CRYPTO_MD4=y
 CONFIG_CRYPTO_MD5=y
 CONFIG_CRYPTO_SHA1=y
-CONFIG_CRYPTO_SHA256=y
 CONFIG_CRYPTO_SHA512=y
 CONFIG_CRYPTO_ARC4=y
 CONFIG_CRYPTO_BLOWFISH=y
diff --git a/arch/powerpc/configs/mpc83xx_defconfig 
b/arch/powerpc/configs/mpc83xx_defconfig
index 661e398950ee..c50d97ca622b 100644
--- a/arch/powerpc/configs/mpc83xx_defconfig
+++ b/arch/powerpc/configs/mpc83xx_defconfig
@@ -108,6 +108,5 @@ CONFIG_ROOT_NFS=y
 CONFIG_CRC_T10DIF=y
 CONFIG_CRYPTO_ECB=m
 CONFIG_CRYPTO_PCBC=m
-CONFIG_CRYPTO_SHA256=y
 CONFIG_CRYPTO_SHA512=y
 CONFIG_CRYPTO_DEV_TALITOS=y
diff --git a/arch/powerpc/configs/pasemi_defconfig 
b/arch/powerpc/configs/pasemi_defconfig
index 699efb67078f..9d43214a4de4 100644
--- a/arch/powerpc/configs/pasemi_defconfig
+++ b/arch/powerpc/configs/pasemi_defconfig
@@ -173,6 +173,5 @@ CONFIG_DETECT_HUNG_TASK=y
 CONFIG_XMON=y
 CONFIG_XMON_DEFAULT=y
 CONFIG_CRYPTO_MD4=y
-CONFIG_CRYPTO_SHA256=y
 CONFIG_CRYPTO_SHA512=y
 CONFIG_CRYPTO_BLOWFISH=y
-- 
2.7.4



[PATCH 11/46] powerpc/configs: Drop no longer needed CONFIG_CRYPTO_ECB

2017-08-22 Thread Michael Ellerman
Since commit 12cb3a1c4184 ("crypto: xts - Add ECB dependency") we no
longer need to set CONFIG_CRYPTO_ECB in our defconfigs.

Signed-off-by: Michael Ellerman 
---
 arch/powerpc/configs/44x/eiger_defconfig   | 1 -
 arch/powerpc/configs/44x/redwood_defconfig | 1 -
 2 files changed, 2 deletions(-)

diff --git a/arch/powerpc/configs/44x/eiger_defconfig 
b/arch/powerpc/configs/44x/eiger_defconfig
index 362e82485dd0..6b6404501ae0 100644
--- a/arch/powerpc/configs/44x/eiger_defconfig
+++ b/arch/powerpc/configs/44x/eiger_defconfig
@@ -84,7 +84,6 @@ CONFIG_CRYPTO_CCM=y
 CONFIG_CRYPTO_GCM=y
 CONFIG_CRYPTO_CBC=y
 CONFIG_CRYPTO_CTS=y
-CONFIG_CRYPTO_ECB=y
 CONFIG_CRYPTO_LRW=y
 CONFIG_CRYPTO_PCBC=y
 CONFIG_CRYPTO_XTS=y
diff --git a/arch/powerpc/configs/44x/redwood_defconfig 
b/arch/powerpc/configs/44x/redwood_defconfig
index cd14df8159d6..91eefcf1720f 100644
--- a/arch/powerpc/configs/44x/redwood_defconfig
+++ b/arch/powerpc/configs/44x/redwood_defconfig
@@ -83,7 +83,6 @@ CONFIG_CRYPTO_CCM=y
 CONFIG_CRYPTO_GCM=y
 CONFIG_CRYPTO_CBC=y
 CONFIG_CRYPTO_CTS=y
-CONFIG_CRYPTO_ECB=y
 CONFIG_CRYPTO_LRW=y
 CONFIG_CRYPTO_PCBC=y
 CONFIG_CRYPTO_XTS=y
-- 
2.7.4



[PATCH 10/46] powerpc/configs: Drop no longer needed CONFIG_CRYPTO_HMAC

2017-08-22 Thread Michael Ellerman
Since commit 401e4238f35c ("crypto: rng - Make DRBG the default RNG")
we no longer need to set CONFIG_CRYPTO_HMAC in our defconfigs.

Signed-off-by: Michael Ellerman 
---
 arch/powerpc/configs/44x/eiger_defconfig   | 1 -
 arch/powerpc/configs/44x/redwood_defconfig | 1 -
 2 files changed, 2 deletions(-)

diff --git a/arch/powerpc/configs/44x/eiger_defconfig 
b/arch/powerpc/configs/44x/eiger_defconfig
index 0c4f41795d56..362e82485dd0 100644
--- a/arch/powerpc/configs/44x/eiger_defconfig
+++ b/arch/powerpc/configs/44x/eiger_defconfig
@@ -88,7 +88,6 @@ CONFIG_CRYPTO_ECB=y
 CONFIG_CRYPTO_LRW=y
 CONFIG_CRYPTO_PCBC=y
 CONFIG_CRYPTO_XTS=y
-CONFIG_CRYPTO_HMAC=y
 CONFIG_CRYPTO_XCBC=y
 CONFIG_CRYPTO_MD4=y
 CONFIG_CRYPTO_MD5=y
diff --git a/arch/powerpc/configs/44x/redwood_defconfig 
b/arch/powerpc/configs/44x/redwood_defconfig
index 209063695115..cd14df8159d6 100644
--- a/arch/powerpc/configs/44x/redwood_defconfig
+++ b/arch/powerpc/configs/44x/redwood_defconfig
@@ -87,7 +87,6 @@ CONFIG_CRYPTO_ECB=y
 CONFIG_CRYPTO_LRW=y
 CONFIG_CRYPTO_PCBC=y
 CONFIG_CRYPTO_XTS=y
-CONFIG_CRYPTO_HMAC=y
 CONFIG_CRYPTO_XCBC=y
 CONFIG_CRYPTO_MD4=y
 CONFIG_CRYPTO_MD5=y
-- 
2.7.4



[PATCH 09/46] powerpc/configs: Drop no longer needed CONFIG_CRYPTO_DEV_VMX_ENCRYPT

2017-08-22 Thread Michael Ellerman
Since commit ccf5c442a1b8 ("crypto: vmx - Convert to CPU feature based
module autoloading") we no longer need to set
CONFIG_CRYPTO_DEV_VMX_ENCRYPT in our defconfigs.

Signed-off-by: Michael Ellerman 
---
 arch/powerpc/configs/powernv_defconfig | 1 -
 arch/powerpc/configs/ppc64_defconfig   | 1 -
 arch/powerpc/configs/pseries_defconfig | 1 -
 3 files changed, 3 deletions(-)

diff --git a/arch/powerpc/configs/powernv_defconfig 
b/arch/powerpc/configs/powernv_defconfig
index 7aa095a0bec6..d4ee4abf461d 100644
--- a/arch/powerpc/configs/powernv_defconfig
+++ b/arch/powerpc/configs/powernv_defconfig
@@ -322,7 +322,6 @@ CONFIG_CRYPTO_TWOFISH=m
 CONFIG_CRYPTO_LZO=m
 CONFIG_CRYPTO_DEV_NX=y
 CONFIG_CRYPTO_DEV_VMX=y
-CONFIG_CRYPTO_DEV_VMX_ENCRYPT=m
 CONFIG_VIRTUALIZATION=y
 CONFIG_KVM_BOOK3S_64=m
 CONFIG_KVM_BOOK3S_64_HV=m
diff --git a/arch/powerpc/configs/ppc64_defconfig 
b/arch/powerpc/configs/ppc64_defconfig
index f00e08b2857d..7b1d17d85169 100644
--- a/arch/powerpc/configs/ppc64_defconfig
+++ b/arch/powerpc/configs/ppc64_defconfig
@@ -359,7 +359,6 @@ CONFIG_CRYPTO_LZO=m
 CONFIG_CRYPTO_DEV_NX=y
 CONFIG_CRYPTO_DEV_NX_ENCRYPT=m
 CONFIG_CRYPTO_DEV_VMX=y
-CONFIG_CRYPTO_DEV_VMX_ENCRYPT=m
 CONFIG_VIRTUALIZATION=y
 CONFIG_KVM_BOOK3S_64=m
 CONFIG_KVM_BOOK3S_64_HV=m
diff --git a/arch/powerpc/configs/pseries_defconfig 
b/arch/powerpc/configs/pseries_defconfig
index e89bbd133aaf..47dcef819697 100644
--- a/arch/powerpc/configs/pseries_defconfig
+++ b/arch/powerpc/configs/pseries_defconfig
@@ -323,7 +323,6 @@ CONFIG_CRYPTO_LZO=m
 CONFIG_CRYPTO_DEV_NX=y
 CONFIG_CRYPTO_DEV_NX_ENCRYPT=m
 CONFIG_CRYPTO_DEV_VMX=y
-CONFIG_CRYPTO_DEV_VMX_ENCRYPT=m
 CONFIG_VIRTUALIZATION=y
 CONFIG_KVM_BOOK3S_64=m
 CONFIG_KVM_BOOK3S_64_HV=m
-- 
2.7.4



[PATCH 08/46] powerpc/configs: Update for CONFIG_NF_CT_PROTO_(SCTP|UDPLITE)=y

2017-08-22 Thread Michael Ellerman
In commit a85406afeb3e ("netfilter: conntrack: built-in support for
SCTP"), NF_CT_PROTO_SCTP switched from tristate to bool and became
default y. Similarly in commit 9b91c96c5d1f ("netfilter: conntrack:
built-in support for UDPlite"), NF_CT_PROTO_UDPLITE switched from
tristate to bool and became default y.

We had a few configs which set them to =m, which is no longer valid.
We don't need to change them to =y because both symbols are default y
and are enabled automatically based on the other symbols in the
affected defconfigs.

Signed-off-by: Michael Ellerman 
---
 arch/powerpc/configs/linkstation_defconfig | 1 -
 arch/powerpc/configs/mvme5100_defconfig| 1 -
 arch/powerpc/configs/ppc6xx_defconfig  | 1 -
 3 files changed, 3 deletions(-)

diff --git a/arch/powerpc/configs/linkstation_defconfig 
b/arch/powerpc/configs/linkstation_defconfig
index 8f5cd4d0e80b..477794c41d50 100644
--- a/arch/powerpc/configs/linkstation_defconfig
+++ b/arch/powerpc/configs/linkstation_defconfig
@@ -26,7 +26,6 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_IPV6 is not set
 CONFIG_NETFILTER=y
 CONFIG_NF_CONNTRACK=m
-CONFIG_NF_CT_PROTO_SCTP=m
 CONFIG_NF_CONNTRACK_AMANDA=m
 CONFIG_NF_CONNTRACK_FTP=m
 CONFIG_NF_CONNTRACK_H323=m
diff --git a/arch/powerpc/configs/mvme5100_defconfig 
b/arch/powerpc/configs/mvme5100_defconfig
index 960a30c1d0c8..63e38c7220f1 100644
--- a/arch/powerpc/configs/mvme5100_defconfig
+++ b/arch/powerpc/configs/mvme5100_defconfig
@@ -35,7 +35,6 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_IPV6 is not set
 CONFIG_NETFILTER=y
 CONFIG_NF_CONNTRACK=m
-CONFIG_NF_CT_PROTO_SCTP=m
 CONFIG_NF_CONNTRACK_AMANDA=m
 CONFIG_NF_CONNTRACK_FTP=m
 CONFIG_NF_CONNTRACK_H323=m
diff --git a/arch/powerpc/configs/ppc6xx_defconfig 
b/arch/powerpc/configs/ppc6xx_defconfig
index 5d8fa80d7add..bad3e04163d0 100644
--- a/arch/powerpc/configs/ppc6xx_defconfig
+++ b/arch/powerpc/configs/ppc6xx_defconfig
@@ -140,7 +140,6 @@ CONFIG_NETFILTER=y
 CONFIG_NF_CONNTRACK=m
 CONFIG_NF_CONNTRACK_SECMARK=y
 CONFIG_NF_CONNTRACK_EVENTS=y
-CONFIG_NF_CT_PROTO_UDPLITE=m
 CONFIG_NF_CONNTRACK_AMANDA=m
 CONFIG_NF_CONNTRACK_FTP=m
 CONFIG_NF_CONNTRACK_H323=m
-- 
2.7.4



[PATCH 06/46] powerpc/configs: Update for CONFIG_DEBUG_FS being selected via CONFIG_RCU_TRACE

2017-08-22 Thread Michael Ellerman
In commit 961518259b3b ("rcu: Enable RCU tracepoints by default to aid
in debugging"), CONFIG_RCU_TRACE was made default y (if CONFIG_TREE_RCU=y,
which it is for some of our configs).

That in turn causes CONFIG_TREE_RCU_TRACE to be enabled, which selects
CONFIG_DEBUG_FS. The end result is that CONFIG_DEBUG_FS is forced on,
meaning we don't have to enable it in some of our configs.

Signed-off-by: Michael Ellerman 
---
 arch/powerpc/configs/44x/akebono_defconfig| 1 -
 arch/powerpc/configs/44x/currituck_defconfig  | 1 -
 arch/powerpc/configs/44x/fsp2_defconfig   | 1 -
 arch/powerpc/configs/44x/iss476-smp_defconfig | 1 -
 arch/powerpc/configs/cell_defconfig   | 1 -
 arch/powerpc/configs/g5_defconfig | 1 -
 arch/powerpc/configs/pasemi_defconfig | 1 -
 arch/powerpc/configs/pmac32_defconfig | 1 -
 arch/powerpc/configs/ps3_defconfig| 1 -
 9 files changed, 9 deletions(-)

diff --git a/arch/powerpc/configs/44x/akebono_defconfig 
b/arch/powerpc/configs/44x/akebono_defconfig
index 040876e26070..9fcd361607e2 100644
--- a/arch/powerpc/configs/44x/akebono_defconfig
+++ b/arch/powerpc/configs/44x/akebono_defconfig
@@ -123,7 +123,6 @@ CONFIG_NLS_DEFAULT="n"
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_DEBUG_INFO=y
-CONFIG_DEBUG_FS=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DETECT_HUNG_TASK=y
 CONFIG_XMON=y
diff --git a/arch/powerpc/configs/44x/currituck_defconfig 
b/arch/powerpc/configs/44x/currituck_defconfig
index 7edface641ee..5f1df5fe4453 100644
--- a/arch/powerpc/configs/44x/currituck_defconfig
+++ b/arch/powerpc/configs/44x/currituck_defconfig
@@ -81,7 +81,6 @@ CONFIG_NFS_V3_ACL=y
 CONFIG_NFS_V4=y
 CONFIG_NLS_DEFAULT="n"
 CONFIG_DEBUG_INFO=y
-CONFIG_DEBUG_FS=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DETECT_HUNG_TASK=y
 CONFIG_XMON=y
diff --git a/arch/powerpc/configs/44x/fsp2_defconfig 
b/arch/powerpc/configs/44x/fsp2_defconfig
index e8e6a6999852..92edf76929c4 100644
--- a/arch/powerpc/configs/44x/fsp2_defconfig
+++ b/arch/powerpc/configs/44x/fsp2_defconfig
@@ -115,7 +115,6 @@ CONFIG_PRINTK_TIME=y
 CONFIG_MESSAGE_LOGLEVEL_DEFAULT=3
 CONFIG_DYNAMIC_DEBUG=y
 CONFIG_DEBUG_INFO=y
-CONFIG_DEBUG_FS=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DETECT_HUNG_TASK=y
 CONFIG_CRYPTO_CBC=y
diff --git a/arch/powerpc/configs/44x/iss476-smp_defconfig 
b/arch/powerpc/configs/44x/iss476-smp_defconfig
index a6a2621e4a73..d24bfa6ecd62 100644
--- a/arch/powerpc/configs/44x/iss476-smp_defconfig
+++ b/arch/powerpc/configs/44x/iss476-smp_defconfig
@@ -63,7 +63,6 @@ CONFIG_TMPFS=y
 CONFIG_CRAMFS=y
 # CONFIG_NETWORK_FILESYSTEMS is not set
 CONFIG_DEBUG_INFO=y
-CONFIG_DEBUG_FS=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DETECT_HUNG_TASK=y
 CONFIG_PPC_EARLY_DEBUG=y
diff --git a/arch/powerpc/configs/cell_defconfig 
b/arch/powerpc/configs/cell_defconfig
index e4229603eb85..65299b2846bb 100644
--- a/arch/powerpc/configs/cell_defconfig
+++ b/arch/powerpc/configs/cell_defconfig
@@ -205,7 +205,6 @@ CONFIG_NLS_ISO8859_13=m
 CONFIG_NLS_ISO8859_14=m
 CONFIG_NLS_ISO8859_15=m
 # CONFIG_ENABLE_MUST_CHECK is not set
-CONFIG_DEBUG_FS=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
 CONFIG_DEBUG_MUTEXES=y
diff --git a/arch/powerpc/configs/g5_defconfig 
b/arch/powerpc/configs/g5_defconfig
index 7d225ccd986f..75f97c20f171 100644
--- a/arch/powerpc/configs/g5_defconfig
+++ b/arch/powerpc/configs/g5_defconfig
@@ -252,7 +252,6 @@ CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_ISO8859_15=y
 CONFIG_NLS_UTF8=y
 CONFIG_CRC_T10DIF=y
-CONFIG_DEBUG_FS=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
 CONFIG_DEBUG_MUTEXES=y
diff --git a/arch/powerpc/configs/pasemi_defconfig 
b/arch/powerpc/configs/pasemi_defconfig
index e8fd46f5d923..699efb67078f 100644
--- a/arch/powerpc/configs/pasemi_defconfig
+++ b/arch/powerpc/configs/pasemi_defconfig
@@ -166,7 +166,6 @@ CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_CRC_CCITT=y
 CONFIG_PRINTK_TIME=y
-CONFIG_DEBUG_FS=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
 CONFIG_DETECT_HUNG_TASK=y
diff --git a/arch/powerpc/configs/pmac32_defconfig 
b/arch/powerpc/configs/pmac32_defconfig
index e1c88327be3b..d97b6f66af01 100644
--- a/arch/powerpc/configs/pmac32_defconfig
+++ b/arch/powerpc/configs/pmac32_defconfig
@@ -301,7 +301,6 @@ CONFIG_NLS_CODEPAGE_437=m
 CONFIG_NLS_ISO8859_1=m
 CONFIG_CRC_T10DIF=y
 CONFIG_LIBCRC32C=m
-CONFIG_DEBUG_FS=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
 CONFIG_DETECT_HUNG_TASK=y
diff --git a/arch/powerpc/configs/ps3_defconfig 
b/arch/powerpc/configs/ps3_defconfig
index 378382683180..2efa025bf483 100644
--- a/arch/powerpc/configs/ps3_defconfig
+++ b/arch/powerpc/configs/ps3_defconfig
@@ -159,7 +159,6 @@ CONFIG_NLS_ISO8859_1=y
 CONFIG_CRC_CCITT=m
 CONFIG_CRC_T10DIF=y
 CONFIG_DEBUG_INFO=y
-CONFIG_DEBUG_FS=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_MEMORY_INIT=y
 CONFIG_DEBUG_STACKOVERFLOW=y
-- 
2.7.4



[PATCH 07/46] powerpc/configs: Update for CONFIG_FIXED_PHY being selected by CONFIG_OF_MDIO

2017-08-22 Thread Michael Ellerman
In commit a5e4bd991362 ("of_mdio: select fixed phy support
unconditionally"), CONFIG_OF_MDIO began selecting CONFIG_FIXED_PHY.

That means we no longer need to set it some of our defconfigs.

Signed-off-by: Michael Ellerman 
---
 arch/powerpc/configs/52xx/tqm5200_defconfig | 1 -
 arch/powerpc/configs/83xx/mpc8313_rdb_defconfig | 1 -
 arch/powerpc/configs/83xx/mpc834x_itx_defconfig | 1 -
 arch/powerpc/configs/83xx/mpc837x_rdb_defconfig | 1 -
 arch/powerpc/configs/mgcoge_defconfig   | 1 -
 arch/powerpc/configs/mpc512x_defconfig  | 1 -
 arch/powerpc/configs/mpc5200_defconfig  | 1 -
 arch/powerpc/configs/mpc83xx_defconfig  | 1 -
 arch/powerpc/configs/mpc866_ads_defconfig   | 1 -
 arch/powerpc/configs/tqm8xx_defconfig   | 1 -
 10 files changed, 10 deletions(-)

diff --git a/arch/powerpc/configs/52xx/tqm5200_defconfig 
b/arch/powerpc/configs/52xx/tqm5200_defconfig
index 47f458f40657..0777e6efd22d 100644
--- a/arch/powerpc/configs/52xx/tqm5200_defconfig
+++ b/arch/powerpc/configs/52xx/tqm5200_defconfig
@@ -48,7 +48,6 @@ CONFIG_PATA_PLATFORM=y
 CONFIG_NETDEVICES=y
 CONFIG_FEC_MPC52xx=y
 CONFIG_LXT_PHY=y
-CONFIG_FIXED_PHY=y
 CONFIG_SERIAL_MPC52xx=y
 CONFIG_SERIAL_MPC52xx_CONSOLE=y
 CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=115200
diff --git a/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig 
b/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig
index b68d80e6af95..45e7146e2ea3 100644
--- a/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig
+++ b/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig
@@ -48,7 +48,6 @@ CONFIG_NETDEVICES=y
 CONFIG_GIANFAR=y
 CONFIG_E100=y
 CONFIG_CICADA_PHY=y
-CONFIG_FIXED_PHY=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/83xx/mpc834x_itx_defconfig 
b/arch/powerpc/configs/83xx/mpc834x_itx_defconfig
index 294eeba5b01d..37f4d93b3f81 100644
--- a/arch/powerpc/configs/83xx/mpc834x_itx_defconfig
+++ b/arch/powerpc/configs/83xx/mpc834x_itx_defconfig
@@ -49,7 +49,6 @@ CONFIG_MD_RAID1=y
 CONFIG_NETDEVICES=y
 CONFIG_GIANFAR=y
 CONFIG_CICADA_PHY=y
-CONFIG_FIXED_PHY=y
 # CONFIG_INPUT is not set
 # CONFIG_SERIO is not set
 # CONFIG_VT is not set
diff --git a/arch/powerpc/configs/83xx/mpc837x_rdb_defconfig 
b/arch/powerpc/configs/83xx/mpc837x_rdb_defconfig
index 4faf753b5b9a..2ebc6c6bf888 100644
--- a/arch/powerpc/configs/83xx/mpc837x_rdb_defconfig
+++ b/arch/powerpc/configs/83xx/mpc837x_rdb_defconfig
@@ -42,7 +42,6 @@ CONFIG_MD_RAID456=y
 CONFIG_NETDEVICES=y
 CONFIG_GIANFAR=y
 CONFIG_MARVELL_PHY=y
-CONFIG_FIXED_PHY=y
 CONFIG_INPUT_FF_MEMLESS=m
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
diff --git a/arch/powerpc/configs/mgcoge_defconfig 
b/arch/powerpc/configs/mgcoge_defconfig
index 64628f794589..5d5f08e5b8d9 100644
--- a/arch/powerpc/configs/mgcoge_defconfig
+++ b/arch/powerpc/configs/mgcoge_defconfig
@@ -46,7 +46,6 @@ CONFIG_BLK_DEV_RAM=y
 CONFIG_NETDEVICES=y
 CONFIG_FS_ENET=y
 CONFIG_FS_ENET_MDIO_FCC=y
-CONFIG_FIXED_PHY=y
 # CONFIG_WLAN is not set
 # CONFIG_INPUT is not set
 # CONFIG_SERIO is not set
diff --git a/arch/powerpc/configs/mpc512x_defconfig 
b/arch/powerpc/configs/mpc512x_defconfig
index 731c5ab16d47..10be5773ad5d 100644
--- a/arch/powerpc/configs/mpc512x_defconfig
+++ b/arch/powerpc/configs/mpc512x_defconfig
@@ -76,7 +76,6 @@ CONFIG_REALTEK_PHY=y
 CONFIG_SMSC_PHY=y
 CONFIG_STE10XP=y
 CONFIG_VITESSE_PHY=y
-CONFIG_FIXED_PHY=y
 # CONFIG_WLAN is not set
 CONFIG_INPUT_EVDEV=y
 CONFIG_SERIAL_MPC52xx=y
diff --git a/arch/powerpc/configs/mpc5200_defconfig 
b/arch/powerpc/configs/mpc5200_defconfig
index e4543aa21f60..faa3d5789db8 100644
--- a/arch/powerpc/configs/mpc5200_defconfig
+++ b/arch/powerpc/configs/mpc5200_defconfig
@@ -50,7 +50,6 @@ CONFIG_NETDEVICES=y
 CONFIG_FEC_MPC52xx=y
 CONFIG_AMD_PHY=y
 CONFIG_LXT_PHY=y
-CONFIG_FIXED_PHY=y
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_SERIO is not set
diff --git a/arch/powerpc/configs/mpc83xx_defconfig 
b/arch/powerpc/configs/mpc83xx_defconfig
index 52d83b35de43..661e398950ee 100644
--- a/arch/powerpc/configs/mpc83xx_defconfig
+++ b/arch/powerpc/configs/mpc83xx_defconfig
@@ -63,7 +63,6 @@ CONFIG_DAVICOM_PHY=y
 CONFIG_ICPLUS_PHY=y
 CONFIG_MARVELL_PHY=y
 CONFIG_VITESSE_PHY=y
-CONFIG_FIXED_PHY=y
 CONFIG_INPUT_FF_MEMLESS=m
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
diff --git a/arch/powerpc/configs/mpc866_ads_defconfig 
b/arch/powerpc/configs/mpc866_ads_defconfig
index fc73cce353ec..f1f176c29fa3 100644
--- a/arch/powerpc/configs/mpc866_ads_defconfig
+++ b/arch/powerpc/configs/mpc866_ads_defconfig
@@ -29,7 +29,6 @@ CONFIG_SYN_COOKIES=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_NETDEVICES=y
 CONFIG_FS_ENET=y
-CONFIG_FIXED_PHY=y
 # CONFIG_VT is not set
 # CONFIG_LEGACY_PTYS is not set
 CONFIG_SERIAL_CPM=y
diff --git a/arch/powerpc/configs/tqm8xx_defconfig 
b/arch/powerpc/configs/tqm8xx_defconfig
index 0397b9f3c384..cd72193fac0a 

[PATCH 04/46] powerpc/configs: Drop no longer needed CONFIG_FHANDLE

2017-08-22 Thread Michael Ellerman
Since commit f76be61755c5 ("Make CONFIG_FHANDLE default y") we no
longer need to set CONFIG_FHANDLE in our defconfigs.

Signed-off-by: Michael Ellerman 
---
 arch/powerpc/configs/cell_defconfig| 1 -
 arch/powerpc/configs/g5_defconfig  | 1 -
 arch/powerpc/configs/maple_defconfig   | 1 -
 arch/powerpc/configs/pasemi_defconfig  | 1 -
 arch/powerpc/configs/powernv_defconfig | 1 -
 arch/powerpc/configs/ppc64_defconfig   | 1 -
 arch/powerpc/configs/ppc64e_defconfig  | 1 -
 arch/powerpc/configs/ps3_defconfig | 1 -
 arch/powerpc/configs/pseries_defconfig | 1 -
 9 files changed, 9 deletions(-)

diff --git a/arch/powerpc/configs/cell_defconfig 
b/arch/powerpc/configs/cell_defconfig
index 2950aa97878b..e4229603eb85 100644
--- a/arch/powerpc/configs/cell_defconfig
+++ b/arch/powerpc/configs/cell_defconfig
@@ -4,7 +4,6 @@ CONFIG_ALTIVEC=y
 CONFIG_SMP=y
 CONFIG_NR_CPUS=4
 CONFIG_SYSVIPC=y
-CONFIG_FHANDLE=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_IKCONFIG=y
diff --git a/arch/powerpc/configs/g5_defconfig 
b/arch/powerpc/configs/g5_defconfig
index 6e957e98b108..7d225ccd986f 100644
--- a/arch/powerpc/configs/g5_defconfig
+++ b/arch/powerpc/configs/g5_defconfig
@@ -4,7 +4,6 @@ CONFIG_SMP=y
 CONFIG_NR_CPUS=4
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
-CONFIG_FHANDLE=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_IKCONFIG=y
diff --git a/arch/powerpc/configs/maple_defconfig 
b/arch/powerpc/configs/maple_defconfig
index 0ebd376d8829..078cdb427fc9 100644
--- a/arch/powerpc/configs/maple_defconfig
+++ b/arch/powerpc/configs/maple_defconfig
@@ -3,7 +3,6 @@ CONFIG_SMP=y
 CONFIG_NR_CPUS=4
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
-CONFIG_FHANDLE=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_IKCONFIG=y
diff --git a/arch/powerpc/configs/pasemi_defconfig 
b/arch/powerpc/configs/pasemi_defconfig
index 2168d76764e9..e8fd46f5d923 100644
--- a/arch/powerpc/configs/pasemi_defconfig
+++ b/arch/powerpc/configs/pasemi_defconfig
@@ -3,7 +3,6 @@ CONFIG_ALTIVEC=y
 CONFIG_SMP=y
 CONFIG_NR_CPUS=2
 CONFIG_SYSVIPC=y
-CONFIG_FHANDLE=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_BLK_DEV_INITRD=y
diff --git a/arch/powerpc/configs/powernv_defconfig 
b/arch/powerpc/configs/powernv_defconfig
index 28de9139e914..7aa095a0bec6 100644
--- a/arch/powerpc/configs/powernv_defconfig
+++ b/arch/powerpc/configs/powernv_defconfig
@@ -4,7 +4,6 @@ CONFIG_NR_CPUS=2048
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
-CONFIG_FHANDLE=y
 CONFIG_AUDIT=y
 CONFIG_IRQ_DOMAIN_DEBUG=y
 CONFIG_NO_HZ=y
diff --git a/arch/powerpc/configs/ppc64_defconfig 
b/arch/powerpc/configs/ppc64_defconfig
index c97fcbded986..f00e08b2857d 100644
--- a/arch/powerpc/configs/ppc64_defconfig
+++ b/arch/powerpc/configs/ppc64_defconfig
@@ -2,7 +2,6 @@ CONFIG_PPC64=y
 CONFIG_SMP=y
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
-CONFIG_FHANDLE=y
 CONFIG_IRQ_DOMAIN_DEBUG=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
diff --git a/arch/powerpc/configs/ppc64e_defconfig 
b/arch/powerpc/configs/ppc64e_defconfig
index 7f34b3546092..1f5e0b107083 100644
--- a/arch/powerpc/configs/ppc64e_defconfig
+++ b/arch/powerpc/configs/ppc64e_defconfig
@@ -3,7 +3,6 @@ CONFIG_PPC_BOOK3E_64=y
 CONFIG_SMP=y
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
-CONFIG_FHANDLE=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_TASKSTATS=y
diff --git a/arch/powerpc/configs/ps3_defconfig 
b/arch/powerpc/configs/ps3_defconfig
index 240f39670794..378382683180 100644
--- a/arch/powerpc/configs/ps3_defconfig
+++ b/arch/powerpc/configs/ps3_defconfig
@@ -5,7 +5,6 @@ CONFIG_SMP=y
 CONFIG_NR_CPUS=2
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
-CONFIG_FHANDLE=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
diff --git a/arch/powerpc/configs/pseries_defconfig 
b/arch/powerpc/configs/pseries_defconfig
index 75707d669afc..e89bbd133aaf 100644
--- a/arch/powerpc/configs/pseries_defconfig
+++ b/arch/powerpc/configs/pseries_defconfig
@@ -3,7 +3,6 @@ CONFIG_SMP=y
 CONFIG_NR_CPUS=2048
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
-CONFIG_FHANDLE=y
 CONFIG_AUDIT=y
 CONFIG_AUDITSYSCALL=y
 CONFIG_IRQ_DOMAIN_DEBUG=y
-- 
2.7.4



[PATCH 05/46] powerpc/configs: Drop no longer needed CONFIG_DEVKMEM

2017-08-22 Thread Michael Ellerman
Since commit e334cd69fa65 ("Move CONFIG_DEVKMEM default to n") we no
longer need to set CONFIG_DEVKMEM in our defconfigs.

Signed-off-by: Michael Ellerman 
---
 arch/powerpc/configs/40x/klondike_defconfig | 1 -
 arch/powerpc/configs/83xx/kmeter1_defconfig | 1 -
 arch/powerpc/configs/83xx/mpc836x_rdk_defconfig | 1 -
 arch/powerpc/configs/gamecube_defconfig | 1 -
 arch/powerpc/configs/mpc512x_defconfig  | 1 -
 arch/powerpc/configs/ppc6xx_defconfig   | 1 -
 arch/powerpc/configs/wii_defconfig  | 1 -
 7 files changed, 7 deletions(-)

diff --git a/arch/powerpc/configs/40x/klondike_defconfig 
b/arch/powerpc/configs/40x/klondike_defconfig
index 28adb782ec51..caab658d1da1 100644
--- a/arch/powerpc/configs/40x/klondike_defconfig
+++ b/arch/powerpc/configs/40x/klondike_defconfig
@@ -26,7 +26,6 @@ CONFIG_SCSI_SAS_ATTRS=y
 # CONFIG_VT is not set
 # CONFIG_UNIX98_PTYS is not set
 # CONFIG_LEGACY_PTYS is not set
-# CONFIG_DEVKMEM is not set
 # CONFIG_HW_RANDOM is not set
 # CONFIG_HWMON is not set
 # CONFIG_USB_SUPPORT is not set
diff --git a/arch/powerpc/configs/83xx/kmeter1_defconfig 
b/arch/powerpc/configs/83xx/kmeter1_defconfig
index 9547dcdd6489..d21b5cb365f2 100644
--- a/arch/powerpc/configs/83xx/kmeter1_defconfig
+++ b/arch/powerpc/configs/83xx/kmeter1_defconfig
@@ -55,7 +55,6 @@ CONFIG_HDLC=y
 # CONFIG_INPUT is not set
 # CONFIG_SERIO is not set
 # CONFIG_VT is not set
-# CONFIG_DEVKMEM is not set
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_HW_RANDOM=y
diff --git a/arch/powerpc/configs/83xx/mpc836x_rdk_defconfig 
b/arch/powerpc/configs/83xx/mpc836x_rdk_defconfig
index a5986208248b..141fe30737f6 100644
--- a/arch/powerpc/configs/83xx/mpc836x_rdk_defconfig
+++ b/arch/powerpc/configs/83xx/mpc836x_rdk_defconfig
@@ -42,7 +42,6 @@ CONFIG_BROADCOM_PHY=y
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_SERIO is not set
-# CONFIG_DEVKMEM is not set
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_QE=y
diff --git a/arch/powerpc/configs/gamecube_defconfig 
b/arch/powerpc/configs/gamecube_defconfig
index c0eec4a5df4e..b877a6b660a1 100644
--- a/arch/powerpc/configs/gamecube_defconfig
+++ b/arch/powerpc/configs/gamecube_defconfig
@@ -54,7 +54,6 @@ CONFIG_INPUT_JOYSTICK=y
 # CONFIG_SERIO_I8042 is not set
 # CONFIG_SERIO_SERPORT is not set
 CONFIG_LEGACY_PTY_COUNT=64
-# CONFIG_DEVKMEM is not set
 # CONFIG_HW_RANDOM is not set
 # CONFIG_HWMON is not set
 CONFIG_FB=y
diff --git a/arch/powerpc/configs/mpc512x_defconfig 
b/arch/powerpc/configs/mpc512x_defconfig
index dbb61ded3849..731c5ab16d47 100644
--- a/arch/powerpc/configs/mpc512x_defconfig
+++ b/arch/powerpc/configs/mpc512x_defconfig
@@ -79,7 +79,6 @@ CONFIG_VITESSE_PHY=y
 CONFIG_FIXED_PHY=y
 # CONFIG_WLAN is not set
 CONFIG_INPUT_EVDEV=y
-# CONFIG_DEVKMEM is not set
 CONFIG_SERIAL_MPC52xx=y
 CONFIG_SERIAL_MPC52xx_CONSOLE=y
 CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=115200
diff --git a/arch/powerpc/configs/ppc6xx_defconfig 
b/arch/powerpc/configs/ppc6xx_defconfig
index c55b7016326c..5d8fa80d7add 100644
--- a/arch/powerpc/configs/ppc6xx_defconfig
+++ b/arch/powerpc/configs/ppc6xx_defconfig
@@ -645,7 +645,6 @@ CONFIG_SYNCLINKMP=m
 CONFIG_SYNCLINK_GT=m
 CONFIG_NOZOMI=m
 CONFIG_N_HDLC=m
-# CONFIG_DEVKMEM is not set
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_CS=m
diff --git a/arch/powerpc/configs/wii_defconfig 
b/arch/powerpc/configs/wii_defconfig
index 600e71c1125b..aef41b17a8bc 100644
--- a/arch/powerpc/configs/wii_defconfig
+++ b/arch/powerpc/configs/wii_defconfig
@@ -65,7 +65,6 @@ CONFIG_INPUT_UINPUT=y
 # CONFIG_SERIO_I8042 is not set
 # CONFIG_SERIO_SERPORT is not set
 CONFIG_LEGACY_PTY_COUNT=64
-# CONFIG_DEVKMEM is not set
 # CONFIG_HW_RANDOM is not set
 CONFIG_NVRAM=y
 CONFIG_I2C=y
-- 
2.7.4



[PATCH 02/46] powerpc/configs: Drop unneeded CONFIG_CRYPTO_ANSI_CPRNG

2017-08-22 Thread Michael Ellerman
Since commit 401e4238f35c ("crypto: rng - Make DRBG the default RNG") we no 
longer need to set CONFIG_CRYPTO_ANSI_CPRNG in our defconfigs.

Signed-off-by: Michael Ellerman 
---
 arch/powerpc/configs/40x/acadia_defconfig | 1 -
 arch/powerpc/configs/40x/ep405_defconfig  | 1 -
 arch/powerpc/configs/40x/kilauea_defconfig| 1 -
 arch/powerpc/configs/40x/makalu_defconfig | 1 -
 arch/powerpc/configs/40x/obs600_defconfig | 1 -
 arch/powerpc/configs/40x/virtex_defconfig | 1 -
 arch/powerpc/configs/40x/walnut_defconfig | 1 -
 arch/powerpc/configs/44x/akebono_defconfig| 1 -
 arch/powerpc/configs/44x/bamboo_defconfig | 1 -
 arch/powerpc/configs/44x/currituck_defconfig  | 1 -
 arch/powerpc/configs/44x/ebony_defconfig  | 1 -
 arch/powerpc/configs/44x/eiger_defconfig  | 1 -
 arch/powerpc/configs/44x/icon_defconfig   | 1 -
 arch/powerpc/configs/44x/iss476-smp_defconfig | 1 -
 arch/powerpc/configs/44x/katmai_defconfig | 1 -
 arch/powerpc/configs/44x/rainier_defconfig| 1 -
 arch/powerpc/configs/44x/redwood_defconfig| 1 -
 arch/powerpc/configs/44x/sequoia_defconfig| 1 -
 arch/powerpc/configs/44x/taishan_defconfig| 1 -
 arch/powerpc/configs/44x/virtex5_defconfig| 1 -
 arch/powerpc/configs/44x/warp_defconfig   | 1 -
 arch/powerpc/configs/52xx/cm5200_defconfig| 1 -
 arch/powerpc/configs/52xx/lite5200b_defconfig | 1 -
 arch/powerpc/configs/52xx/motionpro_defconfig | 1 -
 arch/powerpc/configs/52xx/tqm5200_defconfig   | 1 -
 arch/powerpc/configs/83xx/asp8347_defconfig   | 1 -
 arch/powerpc/configs/83xx/mpc8313_rdb_defconfig   | 1 -
 arch/powerpc/configs/83xx/mpc8315_rdb_defconfig   | 1 -
 arch/powerpc/configs/83xx/mpc832x_mds_defconfig   | 1 -
 arch/powerpc/configs/83xx/mpc832x_rdb_defconfig   | 1 -
 arch/powerpc/configs/83xx/mpc834x_itx_defconfig   | 1 -
 arch/powerpc/configs/83xx/mpc834x_itxgp_defconfig | 1 -
 arch/powerpc/configs/83xx/mpc834x_mds_defconfig   | 1 -
 arch/powerpc/configs/83xx/mpc836x_mds_defconfig   | 1 -
 arch/powerpc/configs/83xx/mpc836x_rdk_defconfig   | 1 -
 arch/powerpc/configs/83xx/mpc837x_mds_defconfig   | 1 -
 arch/powerpc/configs/83xx/mpc837x_rdb_defconfig   | 1 -
 arch/powerpc/configs/83xx/sbc834x_defconfig   | 1 -
 arch/powerpc/configs/85xx/ge_imp3a_defconfig  | 1 -
 arch/powerpc/configs/85xx/ksi8560_defconfig   | 1 -
 arch/powerpc/configs/85xx/mpc8540_ads_defconfig   | 1 -
 arch/powerpc/configs/85xx/mpc8560_ads_defconfig   | 1 -
 arch/powerpc/configs/85xx/mpc85xx_cds_defconfig   | 1 -
 arch/powerpc/configs/85xx/sbc8548_defconfig   | 1 -
 arch/powerpc/configs/85xx/socrates_defconfig  | 1 -
 arch/powerpc/configs/85xx/stx_gp3_defconfig   | 1 -
 arch/powerpc/configs/85xx/tqm8540_defconfig   | 1 -
 arch/powerpc/configs/85xx/tqm8541_defconfig   | 1 -
 arch/powerpc/configs/85xx/tqm8548_defconfig   | 1 -
 arch/powerpc/configs/85xx/tqm8555_defconfig   | 1 -
 arch/powerpc/configs/85xx/tqm8560_defconfig   | 1 -
 arch/powerpc/configs/85xx/xes_mpc85xx_defconfig   | 1 -
 arch/powerpc/configs/amigaone_defconfig   | 1 -
 arch/powerpc/configs/c2k_defconfig| 1 -
 arch/powerpc/configs/chrp32_defconfig | 1 -
 arch/powerpc/configs/ep8248e_defconfig| 1 -
 arch/powerpc/configs/g5_defconfig | 1 -
 arch/powerpc/configs/linkstation_defconfig| 1 -
 arch/powerpc/configs/maple_defconfig  | 1 -
 arch/powerpc/configs/mgcoge_defconfig | 1 -
 arch/powerpc/configs/mpc512x_defconfig| 1 -
 arch/powerpc/configs/mpc5200_defconfig| 1 -
 arch/powerpc/configs/mpc7448_hpc2_defconfig   | 1 -
 arch/powerpc/configs/mpc8272_ads_defconfig| 1 -
 arch/powerpc/configs/mpc83xx_defconfig| 1 -
 arch/powerpc/configs/mpc866_ads_defconfig | 1 -
 arch/powerpc/configs/mvme5100_defconfig   | 1 -
 arch/powerpc/configs/pasemi_defconfig | 1 -
 arch/powerpc/configs/pmac32_defconfig | 1 -
 arch/powerpc/configs/ppc40x_defconfig | 1 -
 arch/powerpc/configs/ppc44x_defconfig | 1 -
 arch/powerpc/configs/ppc64_defconfig  | 1 -
 arch/powerpc/configs/ppc64e_defconfig | 1 -
 arch/powerpc/configs/ppc6xx_defconfig | 1 -
 arch/powerpc/configs/pq2fads_defconfig| 1 -
 arch/powerpc/configs/pseries_defconfig| 1 -
 arch/powerpc/configs/wii_defconfig| 1 -
 77 files changed, 77 deletions(-)

diff --git a/arch/powerpc/configs/40x/acadia_defconfig 
b/arch/powerpc/configs/40x/acadia_defconfig
index 3438ed99c088..e57344c3b0d7 100644
--- a/arch/powerpc/configs/40x/acadia_defconfig
+++ b/arch/powerpc/configs/40x/acadia_defconfig
@@ -64,4 +64,3 @@ CONFIG_CRYPTO_ECB=y
 CONFIG_CRYPTO_PCBC=y
 CONFIG_CRYPTO_MD5=y
 CONFIG_CRYPTO_DES=y
-# CONFIG_CRYPTO_ANSI_CPRNG is not 

[PATCH 03/46] powerpc/configs: Explicitly drop CONFIG_INPUT_MOUSEDEV

2017-08-22 Thread Michael Ellerman
In commit 73d8ef76006b ("Input: mousedev - stop offering PS/2 to userspace by
default") (Jan 2017), CONFIG_INPUT_MOUSEDEV was switched from default y to
default n, with the explanation:

  Evdev interface has been available for many years and by now everyone
  is switched to using it, so let's stop offering /dev/input/mouseN
  and /dev/psaux by default.

We had a number of configs which had it enabled, but going by the above
explanation probably don't need it enabled anymore.

So drop the last remnants of it from our defconfigs.

Signed-off-by: Michael Ellerman 
---
 arch/powerpc/configs/44x/icon_defconfig  | 2 --
 arch/powerpc/configs/85xx/socrates_defconfig | 2 --
 arch/powerpc/configs/85xx/stx_gp3_defconfig  | 2 --
 arch/powerpc/configs/c2k_defconfig   | 1 -
 arch/powerpc/configs/cell_defconfig  | 1 -
 arch/powerpc/configs/g5_defconfig| 1 -
 arch/powerpc/configs/linkstation_defconfig   | 1 -
 arch/powerpc/configs/maple_defconfig | 3 ---
 arch/powerpc/configs/mpc512x_defconfig   | 1 -
 arch/powerpc/configs/mvme5100_defconfig  | 1 -
 arch/powerpc/configs/powernv_defconfig   | 1 -
 arch/powerpc/configs/ppc64_defconfig | 1 -
 arch/powerpc/configs/ppc64e_defconfig| 1 -
 arch/powerpc/configs/ppc6xx_defconfig| 1 -
 arch/powerpc/configs/ps3_defconfig   | 1 -
 arch/powerpc/configs/pseries_defconfig   | 1 -
 arch/powerpc/configs/wii_defconfig   | 3 ---
 17 files changed, 24 deletions(-)

diff --git a/arch/powerpc/configs/44x/icon_defconfig 
b/arch/powerpc/configs/44x/icon_defconfig
index 87bd812a57c5..4453a4590b1a 100644
--- a/arch/powerpc/configs/44x/icon_defconfig
+++ b/arch/powerpc/configs/44x/icon_defconfig
@@ -47,8 +47,6 @@ CONFIG_FUSION_LOGGING=y
 CONFIG_NETDEVICES=y
 CONFIG_IBM_EMAC=y
 # CONFIG_WLAN is not set
-CONFIG_INPUT_MOUSEDEV_SCREEN_X=640
-CONFIG_INPUT_MOUSEDEV_SCREEN_Y=480
 # CONFIG_MOUSE_PS2_ALPS is not set
 # CONFIG_MOUSE_PS2_LOGIPS2PP is not set
 # CONFIG_MOUSE_PS2_SYNAPTICS is not set
diff --git a/arch/powerpc/configs/85xx/socrates_defconfig 
b/arch/powerpc/configs/85xx/socrates_defconfig
index 46b479001805..6106fadbbd8b 100644
--- a/arch/powerpc/configs/85xx/socrates_defconfig
+++ b/arch/powerpc/configs/85xx/socrates_defconfig
@@ -42,8 +42,6 @@ CONFIG_BLK_DEV_SD=y
 CONFIG_NETDEVICES=y
 CONFIG_GIANFAR=y
 CONFIG_MARVELL_PHY=y
-CONFIG_INPUT_MOUSEDEV_SCREEN_X=800
-CONFIG_INPUT_MOUSEDEV_SCREEN_Y=480
 CONFIG_INPUT_EVDEV=y
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
diff --git a/arch/powerpc/configs/85xx/stx_gp3_defconfig 
b/arch/powerpc/configs/85xx/stx_gp3_defconfig
index 9edba010d1bc..5b9cc01b9098 100644
--- a/arch/powerpc/configs/85xx/stx_gp3_defconfig
+++ b/arch/powerpc/configs/85xx/stx_gp3_defconfig
@@ -39,8 +39,6 @@ CONFIG_SCSI_CONSTANTS=y
 CONFIG_NETDEVICES=y
 CONFIG_GIANFAR=y
 CONFIG_MARVELL_PHY=y
-CONFIG_INPUT_MOUSEDEV_SCREEN_X=1280
-CONFIG_INPUT_MOUSEDEV_SCREEN_Y=1024
 CONFIG_INPUT_JOYDEV=m
 CONFIG_INPUT_EVDEV=m
 # CONFIG_VT is not set
diff --git a/arch/powerpc/configs/c2k_defconfig 
b/arch/powerpc/configs/c2k_defconfig
index 8c954a7b2e5b..5419d3eb852a 100644
--- a/arch/powerpc/configs/c2k_defconfig
+++ b/arch/powerpc/configs/c2k_defconfig
@@ -197,7 +197,6 @@ CONFIG_TUN=m
 # CONFIG_ATM_DRIVERS is not set
 CONFIG_MV643XX_ETH=y
 CONFIG_VITESSE_PHY=y
-# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
 CONFIG_INPUT_EVDEV=y
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
diff --git a/arch/powerpc/configs/cell_defconfig 
b/arch/powerpc/configs/cell_defconfig
index 708a538484a6..2950aa97878b 100644
--- a/arch/powerpc/configs/cell_defconfig
+++ b/arch/powerpc/configs/cell_defconfig
@@ -142,7 +142,6 @@ CONFIG_SKY2=m
 CONFIG_GELIC_NET=m
 CONFIG_GELIC_WIRELESS=y
 CONFIG_SPIDER_NET=y
-# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_SERIO_I8042 is not set
diff --git a/arch/powerpc/configs/g5_defconfig 
b/arch/powerpc/configs/g5_defconfig
index cda8afa485a5..6e957e98b108 100644
--- a/arch/powerpc/configs/g5_defconfig
+++ b/arch/powerpc/configs/g5_defconfig
@@ -116,7 +116,6 @@ CONFIG_USB_USBNET=m
 # CONFIG_USB_NET_NET1080 is not set
 # CONFIG_USB_NET_CDC_SUBSET is not set
 # CONFIG_USB_NET_ZAURUS is not set
-# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
 CONFIG_INPUT_JOYDEV=m
 CONFIG_INPUT_EVDEV=y
 # CONFIG_KEYBOARD_ATKBD is not set
diff --git a/arch/powerpc/configs/linkstation_defconfig 
b/arch/powerpc/configs/linkstation_defconfig
index 5c78ee9f5d6a..8f5cd4d0e80b 100644
--- a/arch/powerpc/configs/linkstation_defconfig
+++ b/arch/powerpc/configs/linkstation_defconfig
@@ -79,7 +79,6 @@ CONFIG_NET_TULIP=y
 CONFIG_TULIP=y
 CONFIG_TULIP_MMIO=y
 CONFIG_R8169=y
-# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
 CONFIG_INPUT_EVDEV=m
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
diff --git a/arch/powerpc/configs/maple_defconfig 
b/arch/powerpc/configs/maple_defconfig
index 

[PATCH 01/46] powerpc/configs: Update for symbol movement only

2017-08-22 Thread Michael Ellerman
Update defconfigs for symbols that have moved around, without their
value changing.

Signed-off-by: Michael Ellerman 
---
 arch/powerpc/configs/40x/virtex_defconfig   |  2 +-
 arch/powerpc/configs/44x/virtex5_defconfig  |  2 +-
 arch/powerpc/configs/52xx/lite5200b_defconfig   |  2 +-
 arch/powerpc/configs/52xx/motionpro_defconfig   | 14 ++--
 arch/powerpc/configs/83xx/mpc832x_mds_defconfig |  2 +-
 arch/powerpc/configs/83xx/mpc832x_rdb_defconfig |  4 ++--
 arch/powerpc/configs/83xx/mpc836x_mds_defconfig |  2 +-
 arch/powerpc/configs/83xx/mpc836x_rdk_defconfig |  2 +-
 arch/powerpc/configs/83xx/mpc837x_mds_defconfig |  2 +-
 arch/powerpc/configs/83xx/mpc837x_rdb_defconfig |  2 +-
 arch/powerpc/configs/83xx/sbc834x_defconfig |  2 +-
 arch/powerpc/configs/85xx/ge_imp3a_defconfig|  2 +-
 arch/powerpc/configs/85xx/ksi8560_defconfig |  2 +-
 arch/powerpc/configs/85xx/mpc8540_ads_defconfig |  2 +-
 arch/powerpc/configs/85xx/mpc8560_ads_defconfig |  4 ++--
 arch/powerpc/configs/85xx/mpc85xx_cds_defconfig |  2 +-
 arch/powerpc/configs/85xx/sbc8548_defconfig |  2 +-
 arch/powerpc/configs/85xx/tqm8540_defconfig |  2 +-
 arch/powerpc/configs/85xx/tqm8541_defconfig |  2 +-
 arch/powerpc/configs/85xx/tqm8555_defconfig |  2 +-
 arch/powerpc/configs/85xx/tqm8560_defconfig |  2 +-
 arch/powerpc/configs/85xx/xes_mpc85xx_defconfig |  2 +-
 arch/powerpc/configs/adder875_defconfig |  2 +-
 arch/powerpc/configs/cell_defconfig |  2 +-
 arch/powerpc/configs/chrp32_defconfig   |  2 +-
 arch/powerpc/configs/ep88xc_defconfig   |  2 +-
 arch/powerpc/configs/g5_defconfig   |  6 ++---
 arch/powerpc/configs/holly_defconfig|  2 +-
 arch/powerpc/configs/maple_defconfig|  4 ++--
 arch/powerpc/configs/mpc512x_defconfig  | 24 ++--
 arch/powerpc/configs/mpc7448_hpc2_defconfig |  2 +-
 arch/powerpc/configs/mpc83xx_defconfig  |  6 ++---
 arch/powerpc/configs/mpc866_ads_defconfig   |  2 +-
 arch/powerpc/configs/mpc86xx_basic_defconfig| 12 +-
 arch/powerpc/configs/mpc885_ads_defconfig   |  2 +-
 arch/powerpc/configs/pmac32_defconfig   |  4 ++--
 arch/powerpc/configs/powernv_defconfig  |  6 ++---
 arch/powerpc/configs/ppc40x_defconfig   |  2 +-
 arch/powerpc/configs/ppc44x_defconfig   |  2 +-
 arch/powerpc/configs/ppc64_defconfig| 24 ++--
 arch/powerpc/configs/ppc64e_defconfig   |  6 ++---
 arch/powerpc/configs/ppc6xx_defconfig   | 24 ++--
 arch/powerpc/configs/pseries_defconfig  | 30 -
 arch/powerpc/configs/tqm8xx_defconfig   |  2 +-
 44 files changed, 114 insertions(+), 114 deletions(-)

diff --git a/arch/powerpc/configs/40x/virtex_defconfig 
b/arch/powerpc/configs/40x/virtex_defconfig
index 65dc084a154c..a7f4119a0231 100644
--- a/arch/powerpc/configs/40x/virtex_defconfig
+++ b/arch/powerpc/configs/40x/virtex_defconfig
@@ -41,9 +41,9 @@ CONFIG_NETDEVICES=y
 CONFIG_SERIO_XILINX_XPS_PS2=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_OF_PLATFORM=y
 CONFIG_SERIAL_UARTLITE=y
 CONFIG_SERIAL_UARTLITE_CONSOLE=y
-CONFIG_SERIAL_OF_PLATFORM=y
 CONFIG_XILINX_HWICAP=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_SYSFS=y
diff --git a/arch/powerpc/configs/44x/virtex5_defconfig 
b/arch/powerpc/configs/44x/virtex5_defconfig
index ce052064bcbb..902d4b1e6732 100644
--- a/arch/powerpc/configs/44x/virtex5_defconfig
+++ b/arch/powerpc/configs/44x/virtex5_defconfig
@@ -40,9 +40,9 @@ CONFIG_NETDEVICES=y
 CONFIG_SERIO_XILINX_XPS_PS2=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_OF_PLATFORM=y
 CONFIG_SERIAL_UARTLITE=y
 CONFIG_SERIAL_UARTLITE_CONSOLE=y
-CONFIG_SERIAL_OF_PLATFORM=y
 CONFIG_XILINX_HWICAP=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_SYSFS=y
diff --git a/arch/powerpc/configs/52xx/lite5200b_defconfig 
b/arch/powerpc/configs/52xx/lite5200b_defconfig
index 9493b02ac660..94dd48d77b74 100644
--- a/arch/powerpc/configs/52xx/lite5200b_defconfig
+++ b/arch/powerpc/configs/52xx/lite5200b_defconfig
@@ -14,6 +14,7 @@ CONFIG_PPC_MPC52xx=y
 CONFIG_PPC_MPC5200_SIMPLE=y
 CONFIG_PPC_LITE5200=y
 # CONFIG_PPC_PMAC is not set
+CONFIG_GEN_RTC=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -44,7 +45,6 @@ CONFIG_SERIAL_MPC52xx=y
 CONFIG_SERIAL_MPC52xx_CONSOLE=y
 CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=115200
 # CONFIG_HW_RANDOM is not set
-CONFIG_GEN_RTC=y
 CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_MPC=y
diff --git a/arch/powerpc/configs/52xx/motionpro_defconfig 
b/arch/powerpc/configs/52xx/motionpro_defconfig
index fe8126bc1655..f97c3b0b8061 100644
--- a/arch/powerpc/configs/52xx/motionpro_defconfig
+++ b/arch/powerpc/configs/52xx/motionpro_defconfig
@@ -41,16 +41,16 @@ CONFIG_ATA=y
 CONFIG_PATA_MPC52xx=y
 CONFIG_NETDEVICES=y
 CONFIG_FEC_MPC52xx=y
-CONFIG_MARVELL_PHY=y
+CONFIG_MDIO_BITBANG=y
+CONFIG_BROADCOM_PHY=y

[PATCH 00/46] Update powerpc defconfigs

2017-08-22 Thread Michael Ellerman
Our defconfigs have gotten quite out of date.

This is the result of a semi-automated script to update the saved defconfigs,
and only drop options that are no longer necessary / removed etc. And reinstate
those that we still want but have been dropped due to Kconfig changes.

This gets us back to everything being clean vs savedefconfig as of v4.13-rc6.

I'm not sure yet if I'll put this in next soonish, or wait until later, but
here it is any way.

cheers

Michael Ellerman (46):
  powerpc/configs: Update for symbol movement only
  powerpc/configs: Drop unneeded CONFIG_CRYPTO_ANSI_CPRNG
  powerpc/configs: Explicitly drop CONFIG_INPUT_MOUSEDEV
  powerpc/configs: Drop no longer needed CONFIG_FHANDLE
  powerpc/configs: Drop no longer needed CONFIG_DEVKMEM
  powerpc/configs: Update for CONFIG_DEBUG_FS being selected via
CONFIG_RCU_TRACE
  powerpc/configs: Update for CONFIG_FIXED_PHY being selected by
CONFIG_OF_MDIO
  powerpc/configs: Update for CONFIG_NF_CT_PROTO_(SCTP|UDPLITE)=y
  powerpc/configs: Drop no longer needed CONFIG_CRYPTO_DEV_VMX_ENCRYPT
  powerpc/configs: Drop no longer needed CONFIG_CRYPTO_HMAC
  powerpc/configs: Drop no longer needed CONFIG_CRYPTO_ECB
  powerpc/configs: Drop no longer needed CONFIG_CRYPTO_SHA256
  powerpc/configs: Drop no longer needed CONFIG_CRYPTO_NULL
  powerpc/configs: Drop no longer needed CONFIG_CRYPTO_NULL in g5 / c2k
  powerpc/configs: Drop no longer needed CONFIG_CRYPTO_GCM
  powerpc/configs: Drop no longer needed
CONFIG_DEVPTS_MULTIPLE_INSTANCES
  powerpc/configs: Drop unnecessary
CONFIG_NUMA_BALANCING_DEFAULT_ENABLED
  powerpc/configs: Drop unnecessary CONFIG_UPROBE_EVENT
  powerpc/configs: Drop no longer needed CONFIG_SMP for
pseries/ppc64/powernv
  powerpc/configs: Drop no longer needed PCI_MSI on powernv
  powerpc/configs: Drop unnecessary CONFIG_POWERNV_OP_PANEL
  powerpc/configs: Drop MEMORY_HOTREMOVE from ppc64/cell
  powerpc/configs: Drop CONFIG_SERIAL_TXX9_* from cell/ppc64
  powerpc/configs: Drop no longer needed CONFIG_AUDITSYSCALL
  powerpc/configs: Add CONFIG_RAS now required for CONFIG_EDAC
  powerpc/configs: Drop no longer needed CONFIG_IPV6
  powerpc/configs: Drop no longer needed CONFIG_SCSI
  powerpc/configs: Drop unnecessary CONFIG_EDAC from ppc64e
  powerpc/configs: Drop no longer needed CONFIG_LIBCRC32C
  powerpc/configs: Turn CONFIG_R128 back in pmac32_defconfig
  powerpc/configs: Drop removed CONFIG_LOGFS
  powerpc/configs: Update for CONFIG_INPUT_MOUSEDEV=n
  powerpc/configs: Update for CONFIG_SND changes
  powerpc/configs/mpc5200: Drop no longer needed CONFIG_FB
  powerpc/configs/6xx: Turn CONFIG_DRM_RADEON back on
  powerpc/configs/6xx: Drop no longer needed CONFIG_TIMER_STATS
  powerpc/configs/6xx: Clean up duplicate CONFIG_EXT4 values
  powerpc/configs/6xx: Drop removed CONFIG_BLK_DEV_HD
  powerpc/configs/6xx: Drop no longer needed
CONFIG_NF_CONNTRACK_PROC_COMPAT
  powerpc/configs/6xx: Reinstate CONFIG_CPU_FREQ_STAT
  powerpc/configs/6xx: Drop no longer needed
CONFIG_NETFILTER_XT_MATCH_SOCKET
  powerpc/configs/6xx: Drop no longer needed CONFIG_BT_HCIUART_H4
  powerpc/configs/6xx: Switch CONFIG_USB_EHCI_FSL to =m
  powerpc/configs/c2k: Switch CONFIG_GEN_RTC from =m to =y
  powerpc/configs/6xx: Drop no longer selectable CONFIG_BT_HCIUART_LL
  powerpc/configs/6xx: Drop removed CONFIG_USB_LED

 arch/powerpc/configs/40x/acadia_defconfig |  1 -
 arch/powerpc/configs/40x/ep405_defconfig  |  1 -
 arch/powerpc/configs/40x/kilauea_defconfig|  1 -
 arch/powerpc/configs/40x/klondike_defconfig   |  1 -
 arch/powerpc/configs/40x/makalu_defconfig |  1 -
 arch/powerpc/configs/40x/obs600_defconfig |  1 -
 arch/powerpc/configs/40x/virtex_defconfig |  3 +-
 arch/powerpc/configs/40x/walnut_defconfig |  1 -
 arch/powerpc/configs/44x/akebono_defconfig|  2 -
 arch/powerpc/configs/44x/bamboo_defconfig |  1 -
 arch/powerpc/configs/44x/currituck_defconfig  |  2 -
 arch/powerpc/configs/44x/ebony_defconfig  |  1 -
 arch/powerpc/configs/44x/eiger_defconfig  |  4 --
 arch/powerpc/configs/44x/fsp2_defconfig   |  1 -
 arch/powerpc/configs/44x/icon_defconfig   |  3 --
 arch/powerpc/configs/44x/iss476-smp_defconfig |  2 -
 arch/powerpc/configs/44x/katmai_defconfig |  1 -
 arch/powerpc/configs/44x/rainier_defconfig|  1 -
 arch/powerpc/configs/44x/redwood_defconfig|  4 --
 arch/powerpc/configs/44x/sequoia_defconfig|  1 -
 arch/powerpc/configs/44x/taishan_defconfig|  1 -
 arch/powerpc/configs/44x/virtex5_defconfig|  3 +-
 arch/powerpc/configs/44x/warp_defconfig   |  1 -
 arch/powerpc/configs/52xx/cm5200_defconfig|  1 -
 arch/powerpc/configs/52xx/lite5200b_defconfig |  3 +-
 arch/powerpc/configs/52xx/motionpro_defconfig | 15 +++
 arch/powerpc/configs/52xx/tqm5200_defconfig   |  2 -
 arch/powerpc/configs/83xx/asp8347_defconfig   |  2 -
 

RE: [PATCH v2 1/6] fsl/fman: enable FMan Keygen

2017-08-22 Thread Madalin-cristian Bucur
> -Original Message-
> From: David Miller [mailto:da...@davemloft.net]
> Sent: Wednesday, August 23, 2017 7:47 AM
> To: Madalin-cristian Bucur 
> Cc: net...@vger.kernel.org; linuxppc-dev@lists.ozlabs.org; linux-
> ker...@vger.kernel.org
> Subject: Re: [PATCH v2 1/6] fsl/fman: enable FMan Keygen
> 
> From: Madalin-cristian Bucur 
> Date: Wed, 23 Aug 2017 04:36:56 +
> 
> > The struct fman is only visible in the fman file, the fman port
> > module uses struct fman as an opaque pointer, thus this export.
> 
> Don't use that programming model.
> 
> Export the datastructure properly to it's users.
> 
> This abstraction scheme is so wasteful and costly.

Normally does not come with this cost, it's this case where one of the
sub-modules needs to call into another that gets things complicated.
I'll move struct fman to the header file.

Thanks,
Madalin


Re: [PATCH v2 1/6] fsl/fman: enable FMan Keygen

2017-08-22 Thread David Miller
From: Madalin-cristian Bucur 
Date: Wed, 23 Aug 2017 04:36:56 +

> The struct fman is only visible in the fman file, the fman port
> module uses struct fman as an opaque pointer, thus this export.

Don't use that programming model.

Export the datastructure properly to it's users.

This abstraction scheme is so wasteful and costly.


RE: [PATCH v2 1/6] fsl/fman: enable FMan Keygen

2017-08-22 Thread Madalin-cristian Bucur
> -Original Message-
> From: netdev-ow...@vger.kernel.org [mailto:netdev-ow...@vger.kernel.org]
> On Behalf Of David Miller
> Sent: Wednesday, August 23, 2017 12:35 AM
> Subject: Re: [PATCH v2 1/6] fsl/fman: enable FMan Keygen
> 
> From: Madalin Bucur 
> Date: Tue, 22 Aug 2017 20:31:01 +0300
> 
> >  /**
> > + * fman_get_keygen
> > + *
> > + * @fman:  A Pointer to FMan device
> > + *
> > + * Get the handle to KeyGen module part of FM driver
> > + *
> > + * Return: Handle to KeyGen
> > + */
> > +struct fman_keygen *fman_get_keygen(struct fman *fman)
> > +{
> > +   return fman->keygen;
> > +}
> > +EXPORT_SYMBOL(fman_get_keygen);
> 
> Please don't do this.
> 
> Just directly derefence the pointer in the source code to
> get the keygen.
> 
> Thank you.

Hi,

The struct fman is only visible in the fman file, the fman port module uses 
struct
fman as an opaque pointer, thus this export.

Madalin


Re:Re: [PATCH] fix memory leak on kvm_vm_ioctl_create_spapr_tce

2017-08-22 Thread Nixiaoming
>On 22.08.2017 17:15, David Hildenbrand wrote:
>> On 22.08.2017 16:28, nixiaoming wrote:
>>> miss kfree(stt) when anon_inode_getfd return fail so add check 
>>> anon_inode_getfd return val, and kfree stt
>>>
>>> Signed-off-by: nixiaoming 
>>> ---
>>>  arch/powerpc/kvm/book3s_64_vio.c | 5 -
>>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/arch/powerpc/kvm/book3s_64_vio.c 
>>> b/arch/powerpc/kvm/book3s_64_vio.c
>>> index a160c14..a0b4459 100644
>>> --- a/arch/powerpc/kvm/book3s_64_vio.c
>>> +++ b/arch/powerpc/kvm/book3s_64_vio.c
>>> @@ -341,8 +341,11 @@ long kvm_vm_ioctl_create_spapr_tce(struct kvm 
>>> *kvm,
>>>  
>>> mutex_unlock(>lock);
>>>  
>>> -   return anon_inode_getfd("kvm-spapr-tce", _spapr_tce_fops,
>>> +   ret = anon_inode_getfd("kvm-spapr-tce", _spapr_tce_fops,
>>> stt, O_RDWR | O_CLOEXEC);
>>> +   if (ret < 0)
>>> +   goto fail;
>>> +   return ret;
>>>  
>>>  fail:
>>> if (stt) {
>>>
>> 
>> 
>> stt has already been added to kvm->arch.spapr_tce_tables, so freeing 
>> it is evil IMHO. I don't know that code, so I don't know if there is 
>> some other place that will make sure that everything in
>> kvm->arch.spapr_tce_tables will properly get freed, even when no 
>> kvm->release
>> function has been called (kvm_spapr_tce_release).
>> 
>
>If it is really not freed, than also kvm_put_kvm(stt->kvm) is missing.
>
>-- 
>
>Thanks,
>
>David
>

if (!stt) return -ENOMEM;
kvm_get_kvm(kvm);
if anon_inode_getfd return -ENOMEM
The user can not determine whether kvm_get_kvm has been called
so need add kvm_pet_kvm when anon_inode_getfd fail

stt has already been added to kvm->arch.spapr_tce_tables,
but if anon_inode_getfd fail, stt is unused val, 
so call list_del_rcu, and  free as quickly as possible

new patch:

---
 arch/powerpc/kvm/book3s_64_vio.c | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kvm/book3s_64_vio.c b/arch/powerpc/kvm/book3s_64_vio.c
index a160c14..e2228f1 100644
--- a/arch/powerpc/kvm/book3s_64_vio.c
+++ b/arch/powerpc/kvm/book3s_64_vio.c
@@ -341,8 +341,16 @@ long kvm_vm_ioctl_create_spapr_tce(struct kvm *kvm,

mutex_unlock(>lock);

-   return anon_inode_getfd("kvm-spapr-tce", _spapr_tce_fops,
+   ret = anon_inode_getfd("kvm-spapr-tce", _spapr_tce_fops,
stt, O_RDWR | O_CLOEXEC);
+   if (ret < 0) {
+   mutex_lock(>lock);
+   list_del_rcu(>list);
+   mutex_unlock(>lock);
+   kvm_put_kvm(kvm);
+   goto fail;
+   }
+   return ret;

 fail:
if (stt) {
-- 
2.11.0.1





[PATCH RFC 7/7] powerpc: Handle opposite-endian processes in emulation code

2017-08-22 Thread Paul Mackerras
This adds code to the load and store emulation code to byte-swap
the data appropriately when the process being emulated is set to
the opposite endianness to that of the kernel.

Signed-off-by: Paul Mackerras 
---
 arch/powerpc/include/asm/sstep.h |   4 +-
 arch/powerpc/lib/sstep.c | 146 ---
 2 files changed, 107 insertions(+), 43 deletions(-)

diff --git a/arch/powerpc/include/asm/sstep.h b/arch/powerpc/include/asm/sstep.h
index 0e5dd23..5a3d3d4 100644
--- a/arch/powerpc/include/asm/sstep.h
+++ b/arch/powerpc/include/asm/sstep.h
@@ -149,6 +149,6 @@ void emulate_update_regs(struct pt_regs *reg, struct 
instruction_op *op);
 extern int emulate_step(struct pt_regs *regs, unsigned int instr);
 
 extern void emulate_vsx_load(struct instruction_op *op, union vsx_reg *reg,
-const void *mem);
+const void *mem, bool cross_endian);
 extern void emulate_vsx_store(struct instruction_op *op, const union vsx_reg 
*reg,
- void *mem);
+ void *mem, bool cross_endian);
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index c05d5c4..6117c36 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -210,6 +210,33 @@ static nokprobe_inline unsigned long byterev_8(unsigned 
long x)
 }
 #endif
 
+static nokprobe_inline void do_byte_reverse(void *ptr, int nb)
+{
+   switch (nb) {
+   case 2:
+   *(u16 *)ptr = byterev_2(*(u16 *)ptr);
+   break;
+   case 4:
+   *(u32 *)ptr = byterev_4(*(u32 *)ptr);
+   break;
+#ifdef __powerpc64__
+   case 8:
+   *(unsigned long *)ptr = byterev_8(*(unsigned long *)ptr);
+   break;
+   case 16: {
+   unsigned long *up = (unsigned long *)ptr;
+   unsigned long tmp;
+   tmp = byterev_8(up[0]);
+   up[0] = byterev_8(up[1]);
+   up[1] = tmp;
+   break;
+   }
+#endif
+   default:
+   WARN_ON_ONCE(1);
+   }
+}
+
 static nokprobe_inline int read_mem_aligned(unsigned long *dest,
unsigned long ea, int nb)
 {
@@ -424,6 +451,11 @@ static int do_fp_load(int rn, unsigned long ea, int nb, 
struct pt_regs *regs)
err = copy_mem_in(u.b, ea, nb);
if (err)
return err;
+   if (unlikely((regs->msr & MSR_LE) != (MSR_KERNEL & MSR_LE))) {
+   do_byte_reverse(u.b, min(nb, 8));
+   if (nb == 16)
+   do_byte_reverse([8], 8);
+   }
preempt_disable();
if (nb == 4)
conv_sp_to_dp(, [0]);
@@ -470,6 +502,11 @@ static int do_fp_store(int rn, unsigned long ea, int nb, 
struct pt_regs *regs)
u.l[1] = current->thread.TS_FPR(rn);
}
preempt_enable();
+   if (unlikely((regs->msr & MSR_LE) != (MSR_KERNEL & MSR_LE))) {
+   do_byte_reverse(u.b, min(nb, 8));
+   if (nb == 16)
+   do_byte_reverse([8], 8);
+   }
return copy_mem_out(u.b, ea, nb);
 }
 NOKPROBE_SYMBOL(do_fp_store);
@@ -493,7 +530,8 @@ static nokprobe_inline int do_vec_load(int rn, unsigned 
long ea,
err = copy_mem_in([ea & 0xf], ea, size);
if (err)
return err;
-
+   if (unlikely((regs->msr & MSR_LE) != (MSR_KERNEL & MSR_LE)))
+   do_byte_reverse([ea & 0xf], size);
preempt_disable();
if (regs->msr & MSR_VEC)
put_vr(rn, );
@@ -522,6 +560,8 @@ static nokprobe_inline int do_vec_store(int rn, unsigned 
long ea,
else
u.v = current->thread.vr_state.vr[rn];
preempt_enable();
+   if (unlikely((regs->msr & MSR_LE) != (MSR_KERNEL & MSR_LE)))
+   do_byte_reverse([ea & 0xf], size);
return copy_mem_out([ea & 0xf], ea, size);
 }
 #endif /* CONFIG_ALTIVEC */
@@ -535,12 +575,15 @@ static nokprobe_inline int emulate_lq(struct pt_regs 
*regs, unsigned long ea,
if (!address_ok(regs, ea, 16))
return -EFAULT;
/* if aligned, should be atomic */
-   if ((ea & 0xf) == 0)
-   return do_lq(ea, >gpr[reg]);
-
-   err = read_mem(>gpr[reg + IS_LE], ea, 8, regs);
-   if (!err)
-   err = read_mem(>gpr[reg + IS_BE], ea + 8, 8, regs);
+   if ((ea & 0xf) == 0) {
+   err = do_lq(ea, >gpr[reg]);
+   } else {
+   err = read_mem(>gpr[reg + IS_LE], ea, 8, regs);
+   if (!err)
+   err = read_mem(>gpr[reg + IS_BE], ea + 8, 8, 
regs);
+   }
+   if (!err && unlikely((regs->msr & MSR_LE) != (MSR_KERNEL & MSR_LE)))
+   do_byte_reverse(>gpr[reg], 16);
return err;
 }
 
@@ -548,68 +591,74 @@ static nokprobe_inline int emulate_stq(struct pt_regs 
*regs, unsigned long ea,
 

[PATCH RFC 6/7] powerpc: Emulate load/store floating double pair instructions

2017-08-22 Thread Paul Mackerras
This adds lfdp[x] and stfdp[x] to the set of instructions that
analyse_instr() and emulate_step() understand.

Signed-off-by: Paul Mackerras 
---
 arch/powerpc/lib/sstep.c | 76 ++--
 1 file changed, 60 insertions(+), 16 deletions(-)

diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index b637496..c05d5c4 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -414,9 +414,9 @@ static int do_fp_load(int rn, unsigned long ea, int nb, 
struct pt_regs *regs)
int err;
union {
float f;
-   double d;
-   unsigned long l;
-   u8 b[sizeof(double)];
+   double d[2];
+   unsigned long l[2];
+   u8 b[2 * sizeof(double)];
} u;
 
if (!address_ok(regs, ea, nb))
@@ -426,11 +426,19 @@ static int do_fp_load(int rn, unsigned long ea, int nb, 
struct pt_regs *regs)
return err;
preempt_disable();
if (nb == 4)
-   conv_sp_to_dp(, );
+   conv_sp_to_dp(, [0]);
if (regs->msr & MSR_FP)
-   put_fpr(rn, );
+   put_fpr(rn, [0]);
else
-   current->thread.TS_FPR(rn) = u.l;
+   current->thread.TS_FPR(rn) = u.l[0];
+   if (nb == 16) {
+   /* lfdp */
+   rn |= 1;
+   if (regs->msr & MSR_FP)
+   put_fpr(rn, [1]);
+   else
+   current->thread.TS_FPR(rn) = u.l[1];
+   }
preempt_enable();
return 0;
 }
@@ -440,20 +448,27 @@ static int do_fp_store(int rn, unsigned long ea, int nb, 
struct pt_regs *regs)
 {
union {
float f;
-   double d;
-   unsigned long l;
-   u8 b[sizeof(double)];
+   double d[2];
+   unsigned long l[2];
+   u8 b[2 * sizeof(double)];
} u;
 
if (!address_ok(regs, ea, nb))
return -EFAULT;
preempt_disable();
if (regs->msr & MSR_FP)
-   get_fpr(rn, );
+   get_fpr(rn, [0]);
else
-   u.l = current->thread.TS_FPR(rn);
+   u.l[0] = current->thread.TS_FPR(rn);
if (nb == 4)
-   conv_dp_to_sp(, );
+   conv_dp_to_sp([0], );
+   if (nb == 16) {
+   rn |= 1;
+   if (regs->msr & MSR_FP)
+   get_fpr(rn, [1]);
+   else
+   u.l[1] = current->thread.TS_FPR(rn);
+   }
preempt_enable();
return copy_mem_out(u.b, ea, nb);
 }
@@ -1837,7 +1852,21 @@ int analyse_instr(struct instruction_op *op, const 
struct pt_regs *regs,
goto fpunavail;
op->type = MKOP(STORE_FP, u, 8);
break;
-#endif
+
+#ifdef __powerpc64__
+   case 791:   /* lfdpx */
+   if (!(regs->msr & MSR_FP))
+   goto fpunavail;
+   op->type = MKOP(LOAD_FP, 0, 16);
+   break;
+
+   case 919:   /* stfdpx */
+   if (!(regs->msr & MSR_FP))
+   goto fpunavail;
+   op->type = MKOP(STORE_FP, 0, 16);
+   break;
+#endif /* __powerpc64 */
+#endif /* CONFIG_PPC_FPU */
 
 #ifdef __powerpc64__
case 660:   /* stdbrx */
@@ -1855,7 +1884,7 @@ int analyse_instr(struct instruction_op *op, const struct 
pt_regs *regs,
op->val = byterev_4(regs->gpr[rd]);
break;
 
-   case 725:
+   case 725:   /* stswi */
if (rb == 0)
rb = 32;/* # bytes to store */
op->type = MKOP(STORE_MULTI, 0, rb);
@@ -2239,9 +2268,16 @@ int analyse_instr(struct instruction_op *op, const 
struct pt_regs *regs,
 #endif
 
 #ifdef CONFIG_VSX
-   case 57:/* lxsd, lxssp */
+   case 57:/* lfdp, lxsd, lxssp */
op->ea = dsform_ea(instr, regs);
switch (instr & 3) {
+   case 0: /* lfdp */
+   if (!(regs->msr & MSR_FP))
+   goto fpunavail;
+   if (rd & 1)
+   break;  /* reg must be even */
+   op->type = MKOP(LOAD_FP, 0, 16);
+   break;
case 2: /* lxsd */
if (!(regs->msr & MSR_VSX))
goto vsxunavail;
@@ -2279,8 +2315,16 @@ int analyse_instr(struct instruction_op *op, const 
struct pt_regs *regs,
 #endif
 
 #ifdef CONFIG_VSX
-   case 61:/* lxv, stxsd, stxssp, stxv */
+   case 61:/* stfdp, lxv, stxsd, stxssp, stxv 

[PATCH RFC 5/7] powerpc: Handle vector element load/stores in emulation code

2017-08-22 Thread Paul Mackerras
This adds code to analyse_instr() and emulate_step() to handle the
vector element loads and stores:

lvebx, lvehx, lvewx, stvebx, stvehx, stvewx.

Signed-off-by: Paul Mackerras 
---
 arch/powerpc/lib/sstep.c | 50 ++--
 1 file changed, 48 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index 5e3afa1..b637496 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -475,7 +475,7 @@ static nokprobe_inline int do_vec_load(int rn, unsigned 
long ea,
return -EFAULT;
/* align to multiple of size */
ea &= ~(size - 1);
-   err = copy_mem_in(u.b, ea, size);
+   err = copy_mem_in([ea & 0xf], ea, size);
if (err)
return err;
 
@@ -507,7 +507,7 @@ static nokprobe_inline int do_vec_store(int rn, unsigned 
long ea,
else
u.v = current->thread.vr_state.vr[rn];
preempt_enable();
-   return copy_mem_out(u.b, ea, size);
+   return copy_mem_out([ea & 0xf], ea, size);
 }
 #endif /* CONFIG_ALTIVEC */
 
@@ -1679,6 +1679,31 @@ int analyse_instr(struct instruction_op *op, const 
struct pt_regs *regs,
break;
 
 #ifdef CONFIG_ALTIVEC
+   /*
+* Note: for the load/store vector element instructions,
+* bits of the EA say which field of the VMX register to use.
+*/
+   case 7: /* lvebx */
+   if (!(regs->msr & MSR_VEC))
+   goto vecunavail;
+   op->type = MKOP(LOAD_VMX, 0, 1);
+   op->element_size = 1;
+   break;
+
+   case 39:/* lvehx */
+   if (!(regs->msr & MSR_VEC))
+   goto vecunavail;
+   op->type = MKOP(LOAD_VMX, 0, 2);
+   op->element_size = 2;
+   break;
+
+   case 71:/* lvewx */
+   if (!(regs->msr & MSR_VEC))
+   goto vecunavail;
+   op->type = MKOP(LOAD_VMX, 0, 4);
+   op->element_size = 4;
+   break;
+
case 103:   /* lvx */
case 359:   /* lvxl */
if (!(regs->msr & MSR_VEC))
@@ -1687,6 +1712,27 @@ int analyse_instr(struct instruction_op *op, const 
struct pt_regs *regs,
op->element_size = 16;
break;
 
+   case 135:   /* stvebx */
+   if (!(regs->msr & MSR_VEC))
+   goto vecunavail;
+   op->type = MKOP(STORE_VMX, 0, 1);
+   op->element_size = 1;
+   break;
+
+   case 167:   /* stvehx */
+   if (!(regs->msr & MSR_VEC))
+   goto vecunavail;
+   op->type = MKOP(STORE_VMX, 0, 2);
+   op->element_size = 2;
+   break;
+
+   case 199:   /* stvewx */
+   if (!(regs->msr & MSR_VEC))
+   goto vecunavail;
+   op->type = MKOP(STORE_VMX, 0, 4);
+   op->element_size = 4;
+   break;
+
case 231:   /* stvx */
case 487:   /* stvxl */
if (!(regs->msr & MSR_VEC))
-- 
2.7.4



[PATCH RFC 4/7] powerpc: Emulate FP/vector/VSX loads/stores correctly when regs not live

2017-08-22 Thread Paul Mackerras
At present, the analyse_instr/emulate_step code checks for the
relevant MSR_FP/VEC/VSX bit being set when a FP/VMX/VSX load
or store is decoded, but doesn't recheck the bit before reading or
writing the relevant FP/VMX/VSX register in emulate_step().

Since we don't have preemption disabled, it is possible that we get
preempted between checking the MSR bit and doing the register access.
If that happened, then the registers would have been saved to the
thread_struct for the current process.  Accesses to the CPU registers
would then potentially read stale values, or write values that would
never be seen by the user process.

Another way that the registers can become non-live is if a page
fault occurs when accessing user memory, and the page fault code
calls a copy routine that wants to use the VMX or VSX registers.

To fix this, the code for all the FP/VMX/VSX loads gets restructured
so that it forms an image in a local variable of the desired register
contents, then disables preemption, checks the MSR bit and either
sets the CPU register or writes the value to the thread struct.
Similarly, the code for stores checks the MSR bit, copies either the
CPU register or the thread struct to a local variable, then reenables
preemption and then copies the register image to memory.

Signed-off-by: Paul Mackerras 
---
 arch/powerpc/include/asm/sstep.h |   1 +
 arch/powerpc/lib/ldstfp.S| 241 +++
 arch/powerpc/lib/sstep.c | 218 ---
 3 files changed, 193 insertions(+), 267 deletions(-)

diff --git a/arch/powerpc/include/asm/sstep.h b/arch/powerpc/include/asm/sstep.h
index 5cdcbc4..0e5dd23 100644
--- a/arch/powerpc/include/asm/sstep.h
+++ b/arch/powerpc/include/asm/sstep.h
@@ -116,6 +116,7 @@ union vsx_reg {
unsigned long d[2];
float   fp[4];
double  dp[2];
+   __vector128 v;
 };
 
 /*
diff --git a/arch/powerpc/lib/ldstfp.S b/arch/powerpc/lib/ldstfp.S
index 0a67374..ce759b5 100644
--- a/arch/powerpc/lib/ldstfp.S
+++ b/arch/powerpc/lib/ldstfp.S
@@ -21,27 +21,19 @@
 
 #define STKFRM (PPC_MIN_STKFRM + 16)
 
-   .macro  inst32  op
-reg = 0
-   .rept   32
-20:\op reg,0,r4
-   b   3f
-   EX_TABLE(20b,99f)
-reg = reg + 1
-   .endr
-   .endm
-
-/* Get the contents of frN into fr0; N is in r3. */
+/* Get the contents of frN into *p; N is in r3 and p is in r4. */
 _GLOBAL(get_fpr)
mflrr0
+   mfmsr   r6
+   ori r7, r6, MSR_FP
+   MTMSRD(r7)
+   isync
rlwinm  r3,r3,3,0xf8
bcl 20,31,1f
-   blr /* fr0 is already in fr0 */
-   nop
-reg = 1
-   .rept   31
-   fmr fr0,reg
-   blr
+reg = 0
+   .rept   32
+   stfdreg, 0(r4)
+   b   2f
 reg = reg + 1
.endr
 1: mflrr5
@@ -49,18 +41,23 @@ reg = reg + 1
mtctr   r5
mtlrr0
bctr
+2: MTMSRD(r6)
+   isync
+   blr
 
-/* Put the contents of fr0 into frN; N is in r3. */
+/* Put the contents of *p into frN; N is in r3 and p is in r4. */
 _GLOBAL(put_fpr)
mflrr0
+   mfmsr   r6
+   ori r7, r6, MSR_FP
+   MTMSRD(r7)
+   isync
rlwinm  r3,r3,3,0xf8
bcl 20,31,1f
-   blr /* fr0 is already in fr0 */
-   nop
-reg = 1
-   .rept   31
-   fmr reg,fr0
-   blr
+reg = 0
+   .rept   32
+   lfd reg, 0(r4)
+   b   2f
 reg = reg + 1
.endr
 1: mflrr5
@@ -68,127 +65,24 @@ reg = reg + 1
mtctr   r5
mtlrr0
bctr
-
-/* Load FP reg N from float at *p.  N is in r3, p in r4. */
-_GLOBAL(do_lfs)
-   PPC_STLU r1,-STKFRM(r1)
-   mflrr0
-   PPC_STL r0,STKFRM+PPC_LR_STKOFF(r1)
-   mfmsr   r6
-   ori r7,r6,MSR_FP
-   cmpwi   cr7,r3,0
-   MTMSRD(r7)
-   isync
-   beq cr7,1f
-   stfdfr0,STKFRM-16(r1)
-1: li  r9,-EFAULT
-2: lfs fr0,0(r4)
-   li  r9,0
-3: bl  put_fpr
-   beq cr7,4f
-   lfd fr0,STKFRM-16(r1)
-4: PPC_LL  r0,STKFRM+PPC_LR_STKOFF(r1)
-   mtlrr0
-   MTMSRD(r6)
-   isync
-   mr  r3,r9
-   addir1,r1,STKFRM
-   blr
-   EX_TABLE(2b,3b)
-
-/* Load FP reg N from double at *p.  N is in r3, p in r4. */
-_GLOBAL(do_lfd)
-   PPC_STLU r1,-STKFRM(r1)
-   mflrr0
-   PPC_STL r0,STKFRM+PPC_LR_STKOFF(r1)
-   mfmsr   r6
-   ori r7,r6,MSR_FP
-   cmpwi   cr7,r3,0
-   MTMSRD(r7)
-   isync
-   beq cr7,1f
-   stfdfr0,STKFRM-16(r1)
-1: li  r9,-EFAULT
-2: lfd fr0,0(r4)
-   li  r9,0
-3: beq cr7,4f
-   bl  put_fpr
-   lfd fr0,STKFRM-16(r1)
-4: PPC_LL  r0,STKFRM+PPC_LR_STKOFF(r1)
-   mtlrr0
-   MTMSRD(r6)
-   isync
-   mr  r3,r9
-   addir1,r1,STKFRM
-   blr
-   EX_TABLE(2b,3b)

[PATCH RFC 3/7] powerpc: Make load/store emulation use larger memory accesses

2017-08-22 Thread Paul Mackerras
At the moment, emulation of loads and stores of up to 8 bytes to
unaligned addresses on a little-endian system uses a sequence of
single-byte loads or stores to memory.  This is rather inefficient,
and the code is hard to follow because it has many ifdefs.
In addition, the Power ISA has requirements on how unaligned accesses
are performed, which are not met by doing all accesses as
sequences of single-byte accesses.

Emulation of VSX loads and stores uses __copy_{to,from}_user,
which means the emulation code has no control on the size of
accesses.

To simplify this, we add new copy_mem_in() and copy_mem_out()
functions for accessing memory.  These use a sequence of the largest
possible aligned accesses, up to 8 bytes (or 4 on 32-bit systems),
to copy memory between a local buffer and user memory.  We then
rewrite {read,write}_mem_unaligned and the VSX load/store
emulation using these new functions.

These new function also simplify the code in do_fp_load() and
do_fp_store() for the unaligned cases.

Signed-off-by: Paul Mackerras 
---
 arch/powerpc/lib/sstep.c | 237 +--
 1 file changed, 106 insertions(+), 131 deletions(-)

diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index becb486..e280ed1 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -194,7 +194,6 @@ static nokprobe_inline unsigned long max_align(unsigned 
long x)
return x & -x;  /* isolates rightmost bit */
 }
 
-
 static nokprobe_inline unsigned long byterev_2(unsigned long x)
 {
return ((x >> 8) & 0xff) | ((x & 0xff) << 8);
@@ -240,56 +239,68 @@ static nokprobe_inline int read_mem_aligned(unsigned long 
*dest,
return err;
 }
 
-static nokprobe_inline int read_mem_unaligned(unsigned long *dest,
-   unsigned long ea, int nb, struct pt_regs *regs)
+/*
+ * Copy from userspace to a buffer, using the largest possible
+ * aligned accesses, up to sizeof(long).
+ */
+static int nokprobe_inline copy_mem_in(u8 *dest, unsigned long ea, int nb)
 {
-   int err;
-   unsigned long x, b, c;
-#ifdef __LITTLE_ENDIAN__
-   int len = nb; /* save a copy of the length for byte reversal */
-#endif
+   int err = 0;
+   int c;
 
-   /* unaligned, do this in pieces */
-   x = 0;
for (; nb > 0; nb -= c) {
-#ifdef __LITTLE_ENDIAN__
-   c = 1;
-#endif
-#ifdef __BIG_ENDIAN__
c = max_align(ea);
-#endif
if (c > nb)
c = max_align(nb);
-   err = read_mem_aligned(, ea, c);
+   switch (c) {
+   case 1:
+   err = __get_user(*dest, (unsigned char __user *) ea);
+   break;
+   case 2:
+   err = __get_user(*(u16 *)dest,
+(unsigned short __user *) ea);
+   break;
+   case 4:
+   err = __get_user(*(u32 *)dest,
+(unsigned int __user *) ea);
+   break;
+#ifdef __powerpc64__
+   case 8:
+   err = __get_user(*(unsigned long *)dest,
+(unsigned long __user *) ea);
+   break;
+#endif
+   }
if (err)
return err;
-   x = (x << (8 * c)) + b;
+   dest += c;
ea += c;
}
-#ifdef __LITTLE_ENDIAN__
-   switch (len) {
-   case 2:
-   *dest = byterev_2(x);
-   break;
-   case 4:
-   *dest = byterev_4(x);
-   break;
-#ifdef __powerpc64__
-   case 8:
-   *dest = byterev_8(x);
-   break;
-#endif
-   }
-#endif
-#ifdef __BIG_ENDIAN__
-   *dest = x;
-#endif
return 0;
 }
 
+static nokprobe_inline int read_mem_unaligned(unsigned long *dest,
+ unsigned long ea, int nb)
+{
+   union {
+   unsigned long ul;
+   u8 b[sizeof(unsigned long)];
+   } u;
+   int i;
+   int err;
+
+   u.ul = 0;
+   i = IS_BE ? sizeof(unsigned long) - nb : 0;
+   err = copy_mem_in([i], ea, nb);
+   if (!err)
+   *dest = u.ul;
+   return err;
+}
+
 /*
  * Read memory at address ea for nb bytes, return 0 for success
- * or -EFAULT if an error occurred.
+ * or -EFAULT if an error occurred.  N.B. nb must be 1, 2, 4 or 8.
+ * If nb < sizeof(long), the result is right-justified on BE systems.
  */
 static int read_mem(unsigned long *dest, unsigned long ea, int nb,
  struct pt_regs *regs)
@@ -298,7 +309,7 @@ static int read_mem(unsigned long *dest, unsigned long ea, 
int nb,
return -EFAULT;
if ((ea & (nb - 1)) == 0)
return read_mem_aligned(dest, ea, nb);
-   

[PATCH RFC 2/7] powerpc: Change analyse_instr so it doesn't modify *regs

2017-08-22 Thread Paul Mackerras
The analyse_instr function currently doesn't just work out what an
instruction does, it also executes those instructions whose effect
is only to update CPU registers that are stored in struct pt_regs.
This is undesirable because optprobes uses analyse_instr to work out
if an instruction could be successfully emulated in future.

This changes analyse_instr so it doesn't modify *regs; instead it
stores information in the instruction_op structure to indicate what
registers (GPRs, CR, XER, LR) would be set and what value they would
be set to.  A companion function called emulate_update_regs() can
then use that information to update a pt_regs struct appropriately.

As a minor cleanup, this replaces inline asm using the cntlzw and
cntlzd instructions with calls to __builtin_clz() and __builtin_clzl().

Signed-off-by: Paul Mackerras 
---
 arch/powerpc/include/asm/sstep.h |  52 +++-
 arch/powerpc/lib/sstep.c | 552 +++
 2 files changed, 371 insertions(+), 233 deletions(-)

diff --git a/arch/powerpc/include/asm/sstep.h b/arch/powerpc/include/asm/sstep.h
index 863e1e4..5cdcbc4 100644
--- a/arch/powerpc/include/asm/sstep.h
+++ b/arch/powerpc/include/asm/sstep.h
@@ -23,9 +23,6 @@ struct pt_regs;
 #define IS_RFID(instr) (((instr) & 0xfc0007fe) == 0x4c24)
 #define IS_RFI(instr)  (((instr) & 0xfc0007fe) == 0x4c64)
 
-/* Emulate instructions that cause a transfer of control. */
-extern int emulate_step(struct pt_regs *regs, unsigned int instr);
-
 enum instruction_type {
COMPUTE,/* arith/logical/CR op, etc. */
LOAD,
@@ -55,11 +52,29 @@ enum instruction_type {
 
 #define INSTR_TYPE_MASK0x1f
 
+/* Compute flags, ORed in with type */
+#define SETREG 0x20
+#define SETCC  0x40
+#define SETXER 0x80
+
+/* Branch flags, ORed in with type */
+#define SETLK  0x20
+#define BRTAKEN0x40
+#define DECCTR 0x80
+
 /* Load/store flags, ORed in with type */
 #define SIGNEXT0x20
 #define UPDATE 0x40/* matches bit in opcode 31 instructions */
 #define BYTEREV0x80
 
+/* Barrier type field, ORed in with type */
+#define BARRIER_MASK   0xe0
+#define BARRIER_SYNC   0x00
+#define BARRIER_ISYNC  0x20
+#define BARRIER_EIEIO  0x40
+#define BARRIER_LWSYNC 0x60
+#define BARRIER_PTESYNC0x80
+
 /* Cacheop values, ORed in with type */
 #define CACHEOP_MASK   0x700
 #define DCBST  0
@@ -90,6 +105,8 @@ struct instruction_op {
int spr;
u8 element_size;/* for VSX/VMX loads/stores */
u8 vsx_flags;
+   u32 ccval;
+   u32 xerval;
 };
 
 union vsx_reg {
@@ -101,8 +118,35 @@ union vsx_reg {
double  dp[2];
 };
 
-extern int analyse_instr(struct instruction_op *op, struct pt_regs *regs,
+/*
+ * Decode an instruction, and return information about it in *op
+ * without changing *regs.
+ *
+ * Return value is 1 if the instruction can be emulated just by
+ * updating *regs with the information in *op, -1 if we need the
+ * GPRs but *regs doesn't contain the full register set, or 0
+ * otherwise.
+ */
+extern int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
 unsigned int instr);
+
+/*
+ * Emulate an instruction that can be executed just by updating
+ * fields in *regs.
+ */
+void emulate_update_regs(struct pt_regs *reg, struct instruction_op *op);
+
+/*
+ * Emulate instructions that cause a transfer of control,
+ * arithmetic/logical instructions, loads and stores,
+ * cache operations and barriers.
+ *
+ * Returns 1 if the instruction was emulated successfully,
+ * 0 if it could not be emulated, or -1 for an instruction that
+ * should not be emulated (rfid, mtmsrd clearing MSR_RI, etc.).
+ */
+extern int emulate_step(struct pt_regs *regs, unsigned int instr);
+
 extern void emulate_vsx_load(struct instruction_op *op, union vsx_reg *reg,
 const void *mem);
 extern void emulate_vsx_store(struct instruction_op *op, const union vsx_reg 
*reg,
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index 6f54812..becb486 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -83,15 +83,17 @@ static nokprobe_inline unsigned long 
truncate_if_32bit(unsigned long msr,
 /*
  * Determine whether a conditional branch instruction would branch.
  */
-static nokprobe_inline int branch_taken(unsigned int instr, struct pt_regs 
*regs)
+static nokprobe_inline int branch_taken(unsigned int instr,
+   const struct pt_regs *regs,
+   struct instruction_op *op)
 {
unsigned int bo = (instr >> 21) & 0x1f;
unsigned int bi;
 
if ((bo & 4) == 0) {
/* decrement counter */
-   --regs->ctr;
-   if (((bo >> 1) & 1) ^ (regs->ctr == 0))
+   op->type |= DECCTR;
+ 

[PATCH RFC 1/7] powerpc: Extend instruction emulation infrastructure

2017-08-22 Thread Paul Mackerras
This extends the instruction emulation infrastructure in sstep.c to
handle all the load and store instructions defined in the Power ISA
v3.0, except for the atomic memory operations, ldmx (which was never
implemented), lfdp/stfdp, and the vector element load/stores.

The instructions added are:

Integer loads and stores: lbarx, lharx, lqarx, stbcx., sthcx., stqcx.,
lq, stq.

VSX loads and stores: lxsiwzx, lxsiwax, stxsiwx, lxvx, lxvl, lxvll,
lxvdsx, lxvwsx, stxvx, stxvl, stxvll, lxsspx, lxsdx, stxsspx, stxsdx,
lxvw4x, lxsibzx, lxvh8x, lxsihzx, lxvb16x, stxvw4x, stxsibx, stxvh8x,
stxsihx, stxvb16x, lxsd, lxssp, lxv, stxsd, stxssp, stxv.

These instructions are handled both in the analyse_instr phase and in
the emulate_step phase.

The code for lxvd2ux and stxvd2ux has been taken out, as those
instructions were never implemented in any processor and have been
taken out of the architecture, and their opcodes have been reused for
other instructions in POWER9 (lxvb16x and stxvb16x).

The emulation for the VSX loads and stores uses helper functions
which don't access registers or memory directly, which can hopefully
be reused by KVM later.

Signed-off-by: Paul Mackerras 
---
 arch/powerpc/include/asm/sstep.h |  20 ++
 arch/powerpc/lib/Makefile|   2 +-
 arch/powerpc/lib/ldstfp.S|  68 ++--
 arch/powerpc/lib/quad.S  |  62 
 arch/powerpc/lib/sstep.c | 688 ---
 5 files changed, 780 insertions(+), 60 deletions(-)
 create mode 100644 arch/powerpc/lib/quad.S

diff --git a/arch/powerpc/include/asm/sstep.h b/arch/powerpc/include/asm/sstep.h
index d3a42cc..863e1e4 100644
--- a/arch/powerpc/include/asm/sstep.h
+++ b/arch/powerpc/include/asm/sstep.h
@@ -68,6 +68,11 @@ enum instruction_type {
 #define DCBT   0x300
 #define ICBI   0x400
 
+/* VSX flags values */
+#define VSX_FPCONV 1   /* do floating point SP/DP conversion */
+#define VSX_SPLAT  2   /* store loaded value into all elements */
+#define VSX_LDLEFT 4   /* load VSX register from left */
+
 /* Size field in type word */
 #define SIZE(n)((n) << 8)
 #define GETSIZE(w) ((w) >> 8)
@@ -83,7 +88,22 @@ struct instruction_op {
int update_reg;
/* For MFSPR */
int spr;
+   u8 element_size;/* for VSX/VMX loads/stores */
+   u8 vsx_flags;
+};
+
+union vsx_reg {
+   u8  b[16];
+   u16 h[8];
+   u32 w[4];
+   unsigned long d[2];
+   float   fp[4];
+   double  dp[2];
 };
 
 extern int analyse_instr(struct instruction_op *op, struct pt_regs *regs,
 unsigned int instr);
+extern void emulate_vsx_load(struct instruction_op *op, union vsx_reg *reg,
+const void *mem);
+extern void emulate_vsx_store(struct instruction_op *op, const union vsx_reg 
*reg,
+ void *mem);
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 3c3146b..7921fed 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -31,7 +31,7 @@ obj64-$(CONFIG_KPROBES_SANITY_TEST) += test_emulate_step.o
 
 obj-y  += checksum_$(BITS).o checksum_wrappers.o
 
-obj-$(CONFIG_PPC_EMULATE_SSTEP)+= sstep.o ldstfp.o
+obj-$(CONFIG_PPC_EMULATE_SSTEP)+= sstep.o ldstfp.o quad.o
 
 obj-$(CONFIG_PPC_LIB_RHEAP) += rheap.o
 
diff --git a/arch/powerpc/lib/ldstfp.S b/arch/powerpc/lib/ldstfp.S
index a58777c..0a67374 100644
--- a/arch/powerpc/lib/ldstfp.S
+++ b/arch/powerpc/lib/ldstfp.S
@@ -178,10 +178,10 @@ _GLOBAL(do_stfd)
EX_TABLE(2b,3b)
 
 #ifdef CONFIG_ALTIVEC
-/* Get the contents of vrN into v0; N is in r3. */
+/* Get the contents of vrN into v0; N is in r3. Doesn't touch r3 or r4. */
 _GLOBAL(get_vr)
mflrr0
-   rlwinm  r3,r3,3,0xf8
+   rlwinm  r6,r3,3,0xf8
bcl 20,31,1f
blr /* v0 is already in v0 */
nop
@@ -192,15 +192,15 @@ reg = 1
 reg = reg + 1
.endr
 1: mflrr5
-   add r5,r3,r5
+   add r5,r6,r5
mtctr   r5
mtlrr0
bctr
 
-/* Put the contents of v0 into vrN; N is in r3. */
+/* Put the contents of v0 into vrN; N is in r3. Doesn't touch r3 or r4. */
 _GLOBAL(put_vr)
mflrr0
-   rlwinm  r3,r3,3,0xf8
+   rlwinm  r6,r3,3,0xf8
bcl 20,31,1f
blr /* v0 is already in v0 */
nop
@@ -211,7 +211,7 @@ reg = 1
 reg = reg + 1
.endr
 1: mflrr5
-   add r5,r3,r5
+   add r5,r6,r5
mtctr   r5
mtlrr0
bctr
@@ -313,7 +313,7 @@ reg = reg + 1
bctr
 
 /* Load VSX reg N from vector doubleword *p.  N is in r3, p in r4. */
-_GLOBAL(do_lxvd2x)
+_GLOBAL(load_vsrn)
PPC_STLU r1,-STKFRM(r1)
mflrr0
PPC_STL r0,STKFRM+PPC_LR_STKOFF(r1)
@@ -325,41 +325,38 @@ _GLOBAL(do_lxvd2x)
isync
beq cr7,1f
   

[PATCH RFC 0/7] powerpc: Beef up single-stepping/instruction emulation infrastructure

2017-08-22 Thread Paul Mackerras
This patch series extends the code in arch/powerpc/lib/sstep.c so that
it handles almost all load and store instructions -- all except the
atomic memory operations (lwat, stwat, etc.).  It also makes sure that
we use the largest possible aligned accesses to access memory and that
we don't access the CPU FP/VMX/VSX registers when they don't contain
user data.

With this, it should be possible to replace the body of the alignment
interrupt handler with a call to emulate_step() or something quite
similar.

Paul.

 arch/powerpc/include/asm/sstep.h |   73 +-
 arch/powerpc/lib/Makefile|2 +-
 arch/powerpc/lib/ldstfp.S|  305 ++-
 arch/powerpc/lib/quad.S  |   62 ++
 arch/powerpc/lib/sstep.c | 1773 +-
 5 files changed, 1564 insertions(+), 651 deletions(-)



Re: linux-next: Tree for Aug 22

2017-08-22 Thread Stephen Rothwell
Hi Paul,

On Wed, 23 Aug 2017 07:57:05 +1000 Stephen Rothwell  
wrote:
>
> On Tue, 22 Aug 2017 12:36:20 -0700 "Paul E. McKenney" 
>  wrote:
> >
> > To complete the thought, if you aren't already using it, I suggest
> > applying Nick's patch:
> > 
> > http://lkml.kernel.org/r/20170822084348.21436-1-npig...@gmail.com  
> 
> OK, I applied that - with a little shoehorning due to commit
> 
>   71acb768f5b3 ("timers: Fix excessive granularity of new timers after a nohz 
> idle")
> 
> from your cru tree.
^^^
(I meant rcu, of course)

I will apply the resulting patch to linux-next (as part of the rcu tree
merge) today - unless you get around to updating your tree before then.

-- 
Cheers,
Stephen Rothwell


Re: [PATCH v2 1/1] Split VGA default device handler out of VGA arbiter

2017-08-22 Thread Bjorn Helgaas
On Mon, Aug 21, 2017 at 11:53:01AM +0100, Lorenzo Pieralisi wrote:
> On Thu, Aug 17, 2017 at 09:30:28PM +1000, Daniel Axtens wrote:
> > A system without PCI legacy resources (e.g. ARM64) may find that no
> > default/boot VGA device has been marked, because the VGA arbiter
> > checks for legacy resource decoding before marking a card as default.
> 
> I do not understand this paragraph, in particular:
> 
> - "A system without PCI legacy resources (e.g. ARM64)". What does this
>   mean ? I take this as "ARM64 does not support IO space"; if a PCI host
>   bridge supports IO space, there is nothing from an architectural
>   point of view that prevents an MMIO based IO space implementation to
>   work on ARM64. It is PCI bridge specific, not arch specific.

This reference to ARM64 is the same thing I stumbled over.  Maybe it
could be written along the lines of:

  The VGA arbiter selects a default VGA device that is enabled and
  reachable via the legacy VGA resources (mem 0xa-0xb, io
  0x3b0-0x3bb, io 0x3c0-0x3df, etc).

  If there is no such device, e.g., because there's no enabled VGA
  device, the host bridge doesn't support access to those legacy
  resources, or a PCI-PCI bridge doesn't have VGA Enable set, a
  platform may select an arbitrary device by calling
  vga_set_default_device().

Then I think this patch changes the previous behavior by allowing the
arbiter to select a device that is enabled and has a driver but may
not be reachable via the legacy VGA resources.

I don't know what all the consequences of that would be, but it does
muddy the VGA arbiter waters a bit.  AIUI, the main reason for the
arbiter is to allow multiple legacy VGA devices by manipulating bridge
VGA Enable bits so only one receives the legacy resources at a time.

These devices that do not need the legacy resources don't need that
special treatment because they don't care about the bridge VGA Enable
bits and several can coexist in the system with no need for VGA
arbitration.

I guess the powerpc fixup_vga() already selects a device that doesn't
need the VGA resources, so we already have that situation.

Bjorn


Re: linux-next: Tree for Aug 22

2017-08-22 Thread Stephen Rothwell
Hi Paul,

On Tue, 22 Aug 2017 12:36:20 -0700 "Paul E. McKenney" 
 wrote:
>
> To complete the thought, if you aren't already using it, I suggest
> applying Nick's patch:
> 
> http://lkml.kernel.org/r/20170822084348.21436-1-npig...@gmail.com

OK, I applied that - with a little shoehorning due to commit

  71acb768f5b3 ("timers: Fix excessive granularity of new timers after a nohz 
idle")

from your cru tree.

my qemu test now boots and shuts down fine.

-- 
Cheers,
Stephen Rothwell


Re: [PATCH v2 1/6] fsl/fman: enable FMan Keygen

2017-08-22 Thread David Miller
From: Madalin Bucur 
Date: Tue, 22 Aug 2017 20:31:01 +0300

>  /**
> + * fman_get_keygen
> + *
> + * @fman:A Pointer to FMan device
> + *
> + * Get the handle to KeyGen module part of FM driver
> + *
> + * Return: Handle to KeyGen
> + */
> +struct fman_keygen *fman_get_keygen(struct fman *fman)
> +{
> + return fman->keygen;
> +}
> +EXPORT_SYMBOL(fman_get_keygen);

Please don't do this.

Just directly derefence the pointer in the source code to
get the keygen.

Thank you.


Re: [PATCH] net: ethernet: freescale: fs_enet: make mdiobb_ops const

2017-08-22 Thread David Miller
From: Bhumika Goyal 
Date: Tue, 22 Aug 2017 13:45:59 +0530

> Make this const as it is only stored in a const field of a
> mdiobb_ctrl structure.
> 
> Signed-off-by: Bhumika Goyal 

Applied.


Re: 32-bit powerpc, aty128fb: vmap allocation for size 135168 failed

2017-08-22 Thread Meelis Roos
> > I think these messages are harmless and expected.  This device has no
> > x86 option ROM but a OpenFirmware one.  This is likely unrelated to the
> > sddm crash.
> 
> Yes, but after these crashes have happened for a while, vmalloc 
> problems appear.
> 
> sddm crash might be related to X server dying under it, or it crashes 
> for it own problems (varying signals and addresses beacuse of some 
> ASLR?) and causes X server restart that triggers another ROM allocation 
> round.

I fount hat there is /proc/vmallocinfo, with contents like this. SO it 
really is lots of pci_map_rom's.

0xf100-0xf10020008192 _mpic_map_mmio.isra.5+0x20/0x44 phys=0x80041000 
ioremap
0xf1002000-0xf1005000   12288 _mpic_map_mmio.isra.5+0x20/0x44 phys=0x80041000 
ioremap
0xf1005000-0xf10070008192 _mpic_map_mmio.isra.5+0x20/0x44 phys=0x8006 
ioremap
0xf1007000-0xf10090008192 _mpic_map_mmio.isra.5+0x20/0x44 phys=0x8005 
ioremap
0xf1009000-0xf100c000   12288 drm_addmap_core+0x584/0x664 [drm] pages=2 vmalloc 
user
0xf100c000-0xf100e0008192 bpf_prog_alloc+0x4c/0xd8 pages=1 vmalloc
0xf100e000-0xf1018192 bpf_prog_alloc+0x4c/0xd8 pages=1 vmalloc
0xf101-0xf1013000   12288 pmac_i2c_init+0x204/0x4f4 phys=0xf8001000 ioremap
0xf1013000-0xf10150008192 pmac_i2c_init+0x204/0x4f4 phys=0x80018000 ioremap
0xf1019000-0xf101b0008192 devm_ioremap+0x58/0xc8 phys=0x8001f000 ioremap
0xf101c000-0xf1021000   20480 aty128_probe+0xe8/0xac8 phys=0x9000 ioremap
0xf1021000-0xf10230008192 devm_ioremap+0x58/0xc8 phys=0x80008000 ioremap
0xf1023000-0xf10250008192 devm_ioremap+0x58/0xc8 phys=0x8002 ioremap
0xf1025000-0xf10270008192 devm_ioremap+0x58/0xc8 phys=0x80008000 ioremap
0xf1027000-0xf102b000   16384 n_tty_open+0x20/0xec pages=3 vmalloc
0xf103-0xf10320008192 devm_ioremap+0x58/0xc8 phys=0x80021000 ioremap
0xf1032000-0xf10340008192 devm_ioremap+0x58/0xc8 phys=0x80008000 ioremap
0xf1034000-0xf10360008192 usb_hcd_pci_probe+0x27c/0x45c phys=0x80081000 
ioremap
0xf1036000-0xf10380008192 usb_hcd_pci_probe+0x27c/0x45c phys=0x8008 
ioremap
0xf1038000-0xf103c000   16384 n_tty_open+0x20/0xec pages=3 vmalloc
0xf103c000-0xf104   16384 unpurged vm_area
0xf104-0xf1061000  135168 pci_map_rom+0x6c/0x138 phys=0x9002 ioremap
0xf106b000-0xf1072000   28672 load_module+0x10e8/0x22b0 pages=6 vmalloc
0xf107e000-0xf1088192 bpf_prog_alloc+0x4c/0xd8 pages=1 vmalloc
0xf108-0xf2081000 16781312 aty128_probe+0x118/0xac8 phys=0x9400 ioremap
0xf20a-0xf20c1000  135168 pci_map_rom+0x6c/0x138 phys=0x9002 ioremap
0xf20e-0xf2101000  135168 pci_map_rom+0x6c/0x138 phys=0x9002 ioremap
0xf212-0xf2141000  135168 pci_map_rom+0x6c/0x138 phys=0x9002 ioremap
0xf216-0xf2181000  135168 pci_map_rom+0x6c/0x138 phys=0x9002 ioremap
0xf21a-0xf21c1000  135168 pci_map_rom+0x6c/0x138 phys=0x9002 ioremap
0xf21c9000-0xf21cb0008192 load_module+0x10e8/0x22b0 pages=1 vmalloc
0xf21e8000-0xf21f7000   61440 load_module+0x10e8/0x22b0 pages=14 vmalloc
0xf2202000-0xf2206000   16384 load_module+0x10e8/0x22b0 pages=3 vmalloc
0xf220d000-0xf221   12288 load_module+0x10e8/0x22b0 pages=2 vmalloc
0xf2228000-0xf2237000   61440 load_module+0x10e8/0x22b0 pages=14 vmalloc
0xf2246000-0xf224c000   24576 load_module+0x10e8/0x22b0 pages=5 vmalloc
0xf226b000-0xf227f000   81920 load_module+0x10e8/0x22b0 pages=19 vmalloc
0xf228-0xf22a1000  135168 pci_map_rom+0x6c/0x138 phys=0x9002 ioremap
0xf22a4000-0xf22b3000   61440 load_module+0x10e8/0x22b0 pages=14 vmalloc
0xf22b8000-0xf22ba0008192 snd_pmac_new+0x890/0xcb4 [snd_powermac] 
phys=0x8001 ioremap
0xf22ba000-0xf22bc0008192 snd_pmac_new+0x8a0/0xcb4 [snd_powermac] 
phys=0x80008000 ioremap
0xf22bc000-0xf22be0008192 snd_pmac_new+0x8b0/0xcb4 [snd_powermac] 
phys=0x80008000 ioremap
0xf22c2000-0xf22c5000   12288 load_module+0x10e8/0x22b0 pages=2 vmalloc
0xf22e-0xf2301000  135168 pci_map_rom+0x6c/0x138 phys=0x9002 ioremap
0xf2329000-0xf232d000   16384 load_module+0x10e8/0x22b0 pages=3 vmalloc
0xf2345000-0xf2349000   16384 load_module+0x10e8/0x22b0 pages=3 vmalloc
0xf2356000-0xf235e000   32768 load_module+0x10e8/0x22b0 pages=7 vmalloc
0xf237c000-0xf237e0008192 pci_probe+0x1ec/0x750 [firewire_ohci] 
phys=0xf500 ioremap
0xf238-0xf2581000 2101248 gem_init_one+0x15c/0x77c [sungem] phys=0xf520 
ioremap
0xf258d000-0xf2597000   40960 load_module+0x10e8/0x22b0 pages=9 vmalloc
0xf2597000-0xf25a2000   45056 ar_context_init+0x16c/0x280 [firewire_ohci] vmap
0xf25a2000-0xf25ad000   45056 ar_context_init+0x16c/0x280 [firewire_ohci] vmap
0xf25b-0xf25b20008192 load_module+0x10e8/0x22b0 pages=1 vmalloc
0xf25bc000-0xf25c4000   32768 load_module+0x10e8/0x22b0 pages=7 vmalloc
0xf25ea000-0xf25ed000   12288 load_module+0x10e8/0x22b0 pages=2 vmalloc
0xf25ef000-0xf263  266240 uninorth_create_gatt_table+0x170/0x29c 
[uninorth_agp]
0xf263-0xf2635000   20480 agp_add_bridge+0x278/0x4fc [agpgart] pages=4 

Re: linux-next: Tree for Aug 22

2017-08-22 Thread Paul E. McKenney
On Tue, Aug 22, 2017 at 12:32:31PM -0700, Paul E. McKenney wrote:
> On Wed, Aug 23, 2017 at 05:12:16AM +1000, Stephen Rothwell wrote:
> > Hi Paul,
> > 
> > On Tue, 22 Aug 2017 11:59:23 -0700 "Paul E. McKenney" 
> >  wrote:
> > >
> > > On Wed, Aug 23, 2017 at 04:14:24AM +1000, Stephen Rothwell wrote:
> > > > Hi all,
> > > > 
> > > > On Wed, 23 Aug 2017 04:11:17 +1000 Stephen Rothwell 
> > > >  wrote:  
> > > > >
> > > > > This tree fails to boot on my qemu test.  2 boot logs attached.
> > > > > 
> > > > > Paul, Nick, is this the same/similar to the other RCU/lockup bug you
> > > > > are chasing.  This is the first time I have seen this failure.
> > > > > 
> > > > > This qemu boot is in full emulation mode if I add --enable-kvm to the
> > > > > qemu command, it does not fail to boot.  (the test just boots and 
> > > > > then shuts down)  
> > > > 
> > > > Boot logs attached this time.  
> > > 
> > > That does not look good!
> > > 
> > > Given that the hard lockup happened during timer lock acquisition, I
> > > have to ask if you built with lockdep...
> > 
> > $ grep LOCKDEP .config
> > CONFIG_LOCKDEP_SUPPORT=y
> > 
> > so, no.  This is just a powerpc pseries_le_defconfig build.
> 
> This is without Nick's recent patch, I am guessing?
> 
> Hmmm...  My testing of that patch omitted lockdep as well.  Rerunning
> on the full set of rcutorture scenarios...

To complete the thought, if you aren't already using it, I suggest
applying Nick's patch:

http://lkml.kernel.org/r/20170822084348.21436-1-npig...@gmail.com

Thanx, Paul



Re: linux-next: Tree for Aug 22

2017-08-22 Thread Paul E. McKenney
On Wed, Aug 23, 2017 at 05:12:16AM +1000, Stephen Rothwell wrote:
> Hi Paul,
> 
> On Tue, 22 Aug 2017 11:59:23 -0700 "Paul E. McKenney" 
>  wrote:
> >
> > On Wed, Aug 23, 2017 at 04:14:24AM +1000, Stephen Rothwell wrote:
> > > Hi all,
> > > 
> > > On Wed, 23 Aug 2017 04:11:17 +1000 Stephen Rothwell 
> > >  wrote:  
> > > >
> > > > This tree fails to boot on my qemu test.  2 boot logs attached.
> > > > 
> > > > Paul, Nick, is this the same/similar to the other RCU/lockup bug you
> > > > are chasing.  This is the first time I have seen this failure.
> > > > 
> > > > This qemu boot is in full emulation mode if I add --enable-kvm to the
> > > > qemu command, it does not fail to boot.  (the test just boots and then 
> > > > shuts down)  
> > > 
> > > Boot logs attached this time.  
> > 
> > That does not look good!
> > 
> > Given that the hard lockup happened during timer lock acquisition, I
> > have to ask if you built with lockdep...
> 
> $ grep LOCKDEP .config
> CONFIG_LOCKDEP_SUPPORT=y
> 
> so, no.  This is just a powerpc pseries_le_defconfig build.

This is without Nick's recent patch, I am guessing?

Hmmm...  My testing of that patch omitted lockdep as well.  Rerunning
on the full set of rcutorture scenarios...

Thanx, Paul



Re: linux-next: Tree for Aug 22

2017-08-22 Thread Stephen Rothwell
Hi Paul,

On Tue, 22 Aug 2017 11:59:23 -0700 "Paul E. McKenney" 
 wrote:
>
> On Wed, Aug 23, 2017 at 04:14:24AM +1000, Stephen Rothwell wrote:
> > Hi all,
> > 
> > On Wed, 23 Aug 2017 04:11:17 +1000 Stephen Rothwell  
> > wrote:  
> > >
> > > This tree fails to boot on my qemu test.  2 boot logs attached.
> > > 
> > > Paul, Nick, is this the same/similar to the other RCU/lockup bug you
> > > are chasing.  This is the first time I have seen this failure.
> > > 
> > > This qemu boot is in full emulation mode if I add --enable-kvm to the
> > > qemu command, it does not fail to boot.  (the test just boots and then 
> > > shuts down)  
> > 
> > Boot logs attached this time.  
> 
> That does not look good!
> 
> Given that the hard lockup happened during timer lock acquisition, I
> have to ask if you built with lockdep...

$ grep LOCKDEP .config
CONFIG_LOCKDEP_SUPPORT=y

so, no.  This is just a powerpc pseries_le_defconfig build.

-- 
Cheers,
Stephen Rothwell


Re: linux-next: Tree for Aug 22

2017-08-22 Thread Paul E. McKenney
On Wed, Aug 23, 2017 at 04:14:24AM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> On Wed, 23 Aug 2017 04:11:17 +1000 Stephen Rothwell  
> wrote:
> >
> > This tree fails to boot on my qemu test.  2 boot logs attached.
> > 
> > Paul, Nick, is this the same/similar to the other RCU/lockup bug you
> > are chasing.  This is the first time I have seen this failure.
> > 
> > This qemu boot is in full emulation mode if I add --enable-kvm to the
> > qemu command, it does not fail to boot.  (the test just boots and then 
> > shuts down)
> 
> Boot logs attached this time.

That does not look good!

Given that the hard lockup happened during timer lock acquisition, I
have to ask if you built with lockdep...

Thanx, Paul

> -- 
> Cheers,
> Stephen Rothwell

> spawn qemu-system-ppc64 -M pseries -m 2G -vga none -nographic -kernel 
> /home/sfr/next/powerpc_pseries_le_defconfig/vmlinux -initrd 
> ./ppc64le-rootfs.cpio.gz
> 
> 
> SLOF[?25l 
> **
> QEMU Starting
>  Build Date = Jan  3 2017 22:22:01
>  FW Version = buildd@ release 20161019
>  Press "s" to enter Open Firmware.
> 
> [?25hCC0100C0120C0140C0200C0201C0220C0240C0260C02E0C0300C0320C0340C0360C0370C0380C0371C0372C0373C0374C03F0C0400C0480C04C0C04D0C0500Populating
>  /vdevice methods
> Populating /vdevice/vty@7100
> Populating /vdevice/nvram@7101
> Populating /vdevice/l-lan@7102
> Populating /vdevice/v-scsi@7103
>SCSI: Looking for devices
>   8200 CD-ROM   : "QEMU QEMU CD-ROM  2.5+"
> C0580C05A0Populating /pci@8002000
> C0600C0640C0690C06A0C06A8C06B0C06B8C06C0C06E0C0700C0800C0880No NVRAM common 
> partition, re-initializing...
> C0890C08A0C08A8C08B0Scanning USB 
> C08C0C08D0Using default console: /vdevice/vty@7100
> C08E0C08E8Detected RAM kernel at 40 (1071618 bytes) C08FF 
>   Welcome to Open Firmware
> 
>   Copyright (c) 2004, 2011 IBM Corporation All rights reserved.
>   This program and the accompanying materials are made available
>   under the terms of the BSD License available at
>   http://www.opensource.org/licenses/bsd-license.php
> 
> Booting from memory...
> OF stdout device is: /vdevice/vty@7100
> Preparing to boot Linux version 4.13.0-rc6 (sfr@colugo-sfr) (gcc version 
> 5.2.1 20151008 (GCC)) #2 SMP Tue Aug 22 18:19:21 AEST 2017
> Detected machine type: 0101
> command line: 
> Max number of cores passed to firmware: 2048 (NR_CPUS = 2048)
> Calling ibm,client-architecture-support... done
> memory layout at init:
>   memory_limit :  (16 MB aligned)
>   alloc_bottom : 0149
>   alloc_top: 3000
>   alloc_top_hi : 8000
>   rmo_top  : 3000
>   ram_top  : 8000
> instantiating rtas at 0x2fff... done
> prom_hold_cpus: skipped
> copying OF device tree...
> Building dt strings...
> Building dt structure...
> Device tree strings 0x016a -> 0x016a09df
> Device tree struct  0x016b -> 0x016c
> Quiescing Open Firmware ...
> Booting Linux via __start() @ 0x0040 ...
> Page sizes from device-tree:
> base_shift=12: shift=12, sllp=0x, avpnm=0x, tlbiel=1, penc=0
> base_shift=12: shift=16, sllp=0x, avpnm=0x, tlbiel=1, penc=7
> base_shift=12: shift=24, sllp=0x, avpnm=0x, tlbiel=1, penc=56
> base_shift=16: shift=16, sllp=0x0110, avpnm=0x, tlbiel=1, penc=1
> base_shift=16: shift=24, sllp=0x0110, avpnm=0x, tlbiel=1, penc=8
> base_shift=24: shift=24, sllp=0x0100, avpnm=0x0001, tlbiel=0, penc=0
> base_shift=34: shift=34, sllp=0x0120, avpnm=0x07ff, tlbiel=0, penc=3
> Using 1TB segments
> Initializing hash mmu with SLB
> Linux version 4.13.0-rc6 (sfr@colugo-sfr) (gcc version 5.2.1 20151008 (GCC)) 
> #2 SMP Tue Aug 22 18:19:21 AEST 2017
> Found initrd at 0xc149:0xc165d70b
> Using pSeries machine description
> bootconsole [udbg0] enabled
> Partition configured for 1 cpus.
> CPU maps initialized for 1 thread per core
>  -> smp_release_cpus()
> spinning_secondaries = 0
>  <- smp_release_cpus()
> -
> ppc64_pft_size= 0x18
> phys_mem_size = 0x8000
> dcache_bsize  = 0x80
> icache_bsize  = 0x80
> cpu_features  = 0x077c7a6c18500249
>   possible= 0x5fff18500649
>   always  = 0x18100040
> cpu_user_features = 0xdc0065c2 0xae00
> mmu_features  = 0x7c006001
> firmware_features = 0x0001405a445f
> htab_hash_mask= 0x1
> -
> numa:   NODE_DATA [mem 0x7ffe2300-0x7ffebfff]
> PCI host bridge /pci@8002000  ranges:
>   IO 0x2000..0x2000 -> 0x
>  MEM 0x20008000..0x2000 -> 0x8000 

Re: linux-next: Tree for Aug 22

2017-08-22 Thread Stephen Rothwell
Hi all,

On Wed, 23 Aug 2017 04:11:17 +1000 Stephen Rothwell  
wrote:
>
> This tree fails to boot on my qemu test.  2 boot logs attached.
> 
> Paul, Nick, is this the same/similar to the other RCU/lockup bug you
> are chasing.  This is the first time I have seen this failure.
> 
> This qemu boot is in full emulation mode if I add --enable-kvm to the
> qemu command, it does not fail to boot.  (the test just boots and then shuts 
> down)

Boot logs attached this time.
-- 
Cheers,
Stephen Rothwell
spawn qemu-system-ppc64 -M pseries -m 2G -vga none -nographic -kernel 
/home/sfr/next/powerpc_pseries_le_defconfig/vmlinux -initrd 
./ppc64le-rootfs.cpio.gz


SLOF[?25l 
**
QEMU Starting
 Build Date = Jan  3 2017 22:22:01
 FW Version = buildd@ release 20161019
 Press "s" to enter Open Firmware.

[?25hC
C0100
C0120
C0140
C0200
C0201
C0220
C0240
C0260
C02E0
C0300
C0320
C0340
C0360
C0370
C0380
C0371
C0372
C0373
C0374
C03F0
C0400
C0480
C04C0
C04D0
C0500
Populating /vdevice methods
Populating /vdevice/vty@7100
Populating /vdevice/nvram@7101
Populating /vdevice/l-lan@7102
Populating /vdevice/v-scsi@7103
   SCSI: Looking for devices
  8200 CD-ROM   : "QEMU QEMU CD-ROM  2.5+"
C0580
C05A0
Populating /pci@8002000
C0600
C0640
C0690
C06A0
C06A8
C06B0
C06B8
C06C0
C06E0
C0700
C0800
C0880
No NVRAM common partition, re-initializing...
C0890
C08A0
C08A8
C08B0
Scanning USB 
C08C0
C08D0
Using default console: /vdevice/vty@7100
C08E0
C08E8
Detected RAM kernel at 40 (1071618 bytes) C08FF
 
  Welcome to Open Firmware

  Copyright (c) 2004, 2011 IBM Corporation All rights reserved.
  This program and the accompanying materials are made available
  under the terms of the BSD License available at
  http://www.opensource.org/licenses/bsd-license.php

Booting from memory...
OF stdout device is: /vdevice/vty@7100
Preparing to boot Linux version 4.13.0-rc6 (sfr@colugo-sfr) (gcc version 5.2.1 
20151008 (GCC)) #2 SMP Tue Aug 22 18:19:21 AEST 2017
Detected machine type: 0101
command line: 
Max number of cores passed to firmware: 2048 (NR_CPUS = 2048)
Calling ibm,client-architecture-support... done
memory layout at init:
  memory_limit :  (16 MB aligned)
  alloc_bottom : 0149
  alloc_top: 3000
  alloc_top_hi : 8000
  rmo_top  : 3000
  ram_top  : 8000
instantiating rtas at 0x2fff... done
prom_hold_cpus: skipped
copying OF device tree...
Building dt strings...
Building dt structure...
Device tree strings 0x016a -> 0x016a09df
Device tree struct  0x016b -> 0x016c
Quiescing Open Firmware ...
Booting Linux via __start() @ 0x0040 ...
Page sizes from device-tree:
base_shift=12: shift=12, sllp=0x, avpnm=0x, tlbiel=1, penc=0
base_shift=12: shift=16, sllp=0x, avpnm=0x, tlbiel=1, penc=7
base_shift=12: shift=24, sllp=0x, avpnm=0x, tlbiel=1, penc=56
base_shift=16: shift=16, sllp=0x0110, avpnm=0x, tlbiel=1, penc=1
base_shift=16: shift=24, sllp=0x0110, avpnm=0x, tlbiel=1, penc=8
base_shift=24: shift=24, sllp=0x0100, avpnm=0x0001, tlbiel=0, penc=0
base_shift=34: shift=34, sllp=0x0120, avpnm=0x07ff, tlbiel=0, penc=3
Using 1TB segments
Initializing hash mmu with SLB
Linux version 4.13.0-rc6 (sfr@colugo-sfr) (gcc version 5.2.1 20151008 (GCC)) #2 
SMP Tue Aug 22 18:19:21 AEST 2017
Found initrd at 0xc149:0xc165d70b
Using pSeries machine description
bootconsole [udbg0] enabled
Partition configured for 1 cpus.
CPU maps initialized for 1 thread per core
 -> smp_release_cpus()
spinning_secondaries = 0
 <- smp_release_cpus()
-
ppc64_pft_size= 0x18
phys_mem_size = 0x8000
dcache_bsize  = 0x80
icache_bsize  = 0x80
cpu_features  = 0x077c7a6c18500249
  possible= 0x5fff18500649
  always  = 0x18100040
cpu_user_features = 0xdc0065c2 0xae00
mmu_features  = 0x7c006001
firmware_features = 0x0001405a445f
htab_hash_mask= 0x1
-
numa:   NODE_DATA [mem 0x7ffe2300-0x7ffebfff]
PCI host bridge /pci@8002000  ranges:
  IO 0x2000..0x2000 -> 0x
 MEM 0x20008000..0x2000 -> 0x8000 
 MEM 0x2100..0x21ff -> 0x2100 
PPC64 nvram contains 65536 bytes
Zone ranges:
  DMA  [mem 0x-0x7fff]
  DMA32empty
  Normal   empty
Movable zone start for each node
Early memory node ranges
  node   0: [mem 0x-0x7fff]
Initmem setup node 0 [mem 0x-0x7fff]
percpu: Embedded 3 pages/cpu @c0007fe0 s158616 r0 d37992 

Re: linux-next: Tree for Aug 22

2017-08-22 Thread Stephen Rothwell
Hi all,

This tree fails to boot on my qemu test.  2 boot logs attached.

Paul, Nick, is this the same/similar to the other RCU/lockup bug you
are chasing.  This is the first time I have seen this failure.

This qemu boot is in full emulation mode if I add --enable-kvm to the
qemu command, it does not fail to boot.  (the test just boots and then shuts 
down)
-- 
Cheers,
Stephen Rothwell


Re: [RFC v6 35/62] powerpc: Deliver SEGV signal on pkey violation

2017-08-22 Thread Ram Pai
On Sat, Aug 19, 2017 at 02:09:58PM -0500, Eric W. Biederman wrote:
> Ram Pai  writes:
> 
> > diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
> > index d4e545d..fe1e7c7 100644
> > --- a/arch/powerpc/kernel/traps.c
> > +++ b/arch/powerpc/kernel/traps.c
> > @@ -20,6 +20,7 @@
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >  #include 
> >  #include 
> >  #include 
> > @@ -247,6 +248,15 @@ void user_single_step_siginfo(struct task_struct *tsk,
> > info->si_addr = (void __user *)regs->nip;
> >  }
> >  
> > +#ifdef CONFIG_PPC64_MEMORY_PROTECTION_KEYS
> > +static void fill_sig_info_pkey(int si_code, siginfo_t *info, unsigned long 
> > addr)
> > +{
> > +   if (si_code != SEGV_PKUERR)
> > +   return;
> 
> Given that SEGV_PKUERR is a signal specific si_code this test is
> insufficient to detect an pkey error.  You also need to check
> that signr == SIGSEGV

true. will make it a more precise check.

Thanks
RP



[PATCH] fix memory leak on kvm_vm_ioctl_create_spapr_tce

2017-08-22 Thread nixiaoming
miss kfree(stt) when anon_inode_getfd return fail
so add check anon_inode_getfd return val, and kfree stt

Signed-off-by: nixiaoming 
---
 arch/powerpc/kvm/book3s_64_vio.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kvm/book3s_64_vio.c b/arch/powerpc/kvm/book3s_64_vio.c
index a160c14..a0b4459 100644
--- a/arch/powerpc/kvm/book3s_64_vio.c
+++ b/arch/powerpc/kvm/book3s_64_vio.c
@@ -341,8 +341,11 @@ long kvm_vm_ioctl_create_spapr_tce(struct kvm *kvm,
 
mutex_unlock(>lock);
 
-   return anon_inode_getfd("kvm-spapr-tce", _spapr_tce_fops,
+   ret = anon_inode_getfd("kvm-spapr-tce", _spapr_tce_fops,
stt, O_RDWR | O_CLOEXEC);
+   if (ret < 0)
+   goto fail;
+   return ret;
 
 fail:
if (stt) {
-- 
2.11.0.1



[PATCH] fix memory leak on kvm_vm_ioctl_get_htab_fd

2017-08-22 Thread nixiaoming
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
but no free when anon_inode_getfd return fail
so, add kfree(ctx) to fix memory leak

Signed-off-by: nixiaoming 
---
 arch/powerpc/kvm/book3s_64_mmu_hv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c 
b/arch/powerpc/kvm/book3s_64_mmu_hv.c
index b42812e..be3d08f 100644
--- a/arch/powerpc/kvm/book3s_64_mmu_hv.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c
@@ -1940,6 +1940,7 @@ int kvm_vm_ioctl_get_htab_fd(struct kvm *kvm, struct 
kvm_get_htab_fd *ghf)
rwflag = (ghf->flags & KVM_GET_HTAB_WRITE) ? O_WRONLY : O_RDONLY;
ret = anon_inode_getfd("kvm-htab", _htab_fops, ctx, rwflag | 
O_CLOEXEC);
if (ret < 0) {
+   kfree(ctx);
kvm_put_kvm(kvm);
return ret;
}
-- 
2.11.0.1



[PATCH v2 6/6] dpaa_eth: check allocation result

2017-08-22 Thread Madalin Bucur
Signed-off-by: Madalin Bucur 
---
 drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c 
b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index 73ca8d7..4225806 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -2561,6 +2561,9 @@ static struct dpaa_bp *dpaa_bp_alloc(struct device *dev)
 
dpaa_bp->bpid = FSL_DPAA_BPID_INV;
dpaa_bp->percpu_count = devm_alloc_percpu(dev, *dpaa_bp->percpu_count);
+   if (!dpaa_bp->percpu_count)
+   return ERR_PTR(-ENOMEM);
+
dpaa_bp->config_count = FSL_DPAA_ETH_MAX_BUF_COUNT;
 
dpaa_bp->seed_cb = dpaa_bp_seed;
-- 
2.1.0



[PATCH v2 5/6] Documentation: networking: add RSS information

2017-08-22 Thread Madalin Bucur
Signed-off-by: Madalin Bucur 
---
 Documentation/networking/dpaa.txt | 68 ++-
 1 file changed, 67 insertions(+), 1 deletion(-)

diff --git a/Documentation/networking/dpaa.txt 
b/Documentation/networking/dpaa.txt
index 76e016d..f88194f 100644
--- a/Documentation/networking/dpaa.txt
+++ b/Documentation/networking/dpaa.txt
@@ -13,6 +13,7 @@ Contents
- Configuring DPAA Ethernet in your kernel
- DPAA Ethernet Frame Processing
- DPAA Ethernet Features
+   - DPAA IRQ Affinity and Receive Side Scaling
- Debugging
 
 DPAA Ethernet Overview
@@ -147,7 +148,10 @@ gradually.
 
 The driver has Rx and Tx checksum offloading for UDP and TCP. Currently the Rx
 checksum offload feature is enabled by default and cannot be controlled through
-ethtool.
+ethtool. Also, rx-flow-hash and rx-hashing was added. The addition of RSS
+provides a big performance boost for the forwarding scenarios, allowing
+different traffic flows received by one interface to be processed by different
+CPUs in parallel.
 
 The driver has support for multiple prioritized Tx traffic classes. Priorities
 range from 0 (lowest) to 3 (highest). These are mapped to HW workqueues with
@@ -166,6 +170,68 @@ classes as follows:
 tc qdisc add dev  root handle 1: \
 mqprio num_tc 4 map 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 hw 1
 
+DPAA IRQ Affinity and Receive Side Scaling
+==
+
+Traffic coming on the DPAA Rx queues or on the DPAA Tx confirmation
+queues is seen by the CPU as ingress traffic on a certain portal.
+The DPAA QMan portal interrupts are affined each to a certain CPU.
+The same portal interrupt services all the QMan portal consumers.
+
+By default the DPAA Ethernet driver enables RSS, making use of the
+DPAA FMan Parser and Keygen blocks to distribute traffic on 128
+hardware frame queues using a hash on IP v4/v6 source and destination
+and L4 source and destination ports, in present in the received frame.
+When RSS is disabled, all traffic received by a certain interface is
+received on the default Rx frame queue. The default DPAA Rx frame
+queues are configured to put the received traffic into a pool channel
+that allows any available CPU portal to dequeue the ingress traffic.
+The default frame queues have the HOLDACTIVE option set, ensuring that
+traffic bursts from a certain queue are serviced by the same CPU.
+This ensures a very low rate of frame reordering. A drawback of this
+is that only one CPU at a time can service the traffic received by a
+certain interface when RSS is not enabled.
+
+To implement RSS, the DPAA Ethernet driver allocates an extra set of
+128 Rx frame queues that are configured to dedicated channels, in a
+round-robin manner. The mapping of the frame queues to CPUs is now
+hardcoded, there is no indirection table to move traffic for a certain
+FQ (hash result) to another CPU. The ingress traffic arriving on one
+of these frame queues will arrive at the same portal and will always
+be processed by the same CPU. This ensures intra-flow order preservation
+and workload distribution for multiple traffic flows.
+
+RSS can be turned off for a certain interface using ethtool, i.e.
+
+   # ethtool -N fm1-mac9 rx-flow-hash tcp4 ""
+
+To turn it back on, one needs to set rx-flow-hash for tcp4/6 or udp4/6:
+
+   # ethtool -N fm1-mac9 rx-flow-hash udp4 sfdn
+
+There is no independent control for individual protocols, any command
+run for one of tcp4|udp4|ah4|esp4|sctp4|tcp6|udp6|ah6|esp6|sctp6 is
+going to control the rx-flow-hashing for all protocols on that interface.
+
+Besides using the FMan Keygen computed hash for spreading traffic on the
+128 Rx FQs, the DPAA Ethernet driver also sets the skb hash value when
+the NETIF_F_RXHASH feature is on (active by default). This can be turned
+on or off through ethtool, i.e.:
+
+   # ethtool -K fm1-mac9 rx-hashing off
+   # ethtool -k fm1-mac9 | grep hash
+   receive-hashing: off
+   # ethtool -K fm1-mac9 rx-hashing on
+   Actual changes:
+   receive-hashing: on
+   # ethtool -k fm1-mac9 | grep hash
+   receive-hashing: on
+
+Please note that Rx hashing depends upon the rx-flow-hashing being on
+for that interface - turning off rx-flow-hashing will also disable the
+rx-hashing (without ethtool reporting it as off as that depends on the
+NETIF_F_RXHASH feature flag).
+
 Debugging
 =
 
-- 
2.1.0



[PATCH v2 4/6] dpaa_eth: add NETIF_F_RXHASH

2017-08-22 Thread Madalin Bucur
Set the skb hash when then FMan Keygen hash result is available.

Signed-off-by: Madalin Bucur 
---
 drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 23 +++---
 drivers/net/ethernet/freescale/dpaa/dpaa_eth.h |  1 +
 drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c |  9 +++--
 drivers/net/ethernet/freescale/fman/fman_port.c| 11 +++
 drivers/net/ethernet/freescale/fman/fman_port.h|  2 ++
 5 files changed, 41 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c 
b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index 6d89e74..73ca8d7 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -236,7 +236,7 @@ static int dpaa_netdev_init(struct net_device *net_dev,
net_dev->max_mtu = dpaa_get_max_mtu();
 
net_dev->hw_features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
-NETIF_F_LLTX);
+NETIF_F_LLTX | NETIF_F_RXHASH);
 
net_dev->hw_features |= NETIF_F_SG | NETIF_F_HIGHDMA;
/* The kernels enables GSO automatically, if we declare NETIF_F_SG.
@@ -2237,12 +2237,13 @@ static enum qman_cb_dqrr_result rx_default_dqrr(struct 
qman_portal *portal,
dma_addr_t addr = qm_fd_addr(fd);
enum qm_fd_format fd_format;
struct net_device *net_dev;
-   u32 fd_status;
+   u32 fd_status, hash_offset;
struct dpaa_bp *dpaa_bp;
struct dpaa_priv *priv;
unsigned int skb_len;
struct sk_buff *skb;
int *count_ptr;
+   void *vaddr;
 
fd_status = be32_to_cpu(fd->status);
fd_format = qm_fd_get_format(fd);
@@ -2288,7 +2289,8 @@ static enum qman_cb_dqrr_result rx_default_dqrr(struct 
qman_portal *portal,
dma_unmap_single(dpaa_bp->dev, addr, dpaa_bp->size, DMA_FROM_DEVICE);
 
/* prefetch the first 64 bytes of the frame or the SGT start */
-   prefetch(phys_to_virt(addr) + qm_fd_get_offset(fd));
+   vaddr = phys_to_virt(addr);
+   prefetch(vaddr + qm_fd_get_offset(fd));
 
fd_format = qm_fd_get_format(fd);
/* The only FD types that we may receive are contig and S/G */
@@ -2309,6 +2311,18 @@ static enum qman_cb_dqrr_result rx_default_dqrr(struct 
qman_portal *portal,
 
skb->protocol = eth_type_trans(skb, net_dev);
 
+   if (net_dev->features & NETIF_F_RXHASH && priv->keygen_in_use &&
+   !fman_port_get_hash_result_offset(priv->mac_dev->port[RX],
+ _offset)) {
+   enum pkt_hash_types type;
+
+   /* if L4 exists, it was used in the hash generation */
+   type = be32_to_cpu(fd->status) & FM_FD_STAT_L4CV ?
+   PKT_HASH_TYPE_L4 : PKT_HASH_TYPE_L3;
+   skb_set_hash(skb, be32_to_cpu(*(u32 *)(vaddr + hash_offset)),
+type);
+   }
+
skb_len = skb->len;
 
if (unlikely(netif_receive_skb(skb) == NET_RX_DROP))
@@ -2774,6 +2788,9 @@ static int dpaa_eth_probe(struct platform_device *pdev)
if (err)
goto init_ports_failed;
 
+   /* Rx traffic distribution based on keygen hashing defaults to on */
+   priv->keygen_in_use = true;
+
priv->percpu_priv = devm_alloc_percpu(dev, *priv->percpu_priv);
if (!priv->percpu_priv) {
dev_err(dev, "devm_alloc_percpu() failed\n");
diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h 
b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h
index 496a12c..bd94220 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h
@@ -159,6 +159,7 @@ struct dpaa_priv {
struct list_head dpaa_fq_list;
 
u8 num_tc;
+   bool keygen_in_use;
u32 msg_enable; /* net_device message level */
 
struct {
diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c 
b/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c
index 965f652..faea674 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c
@@ -402,6 +402,8 @@ static void dpaa_get_strings(struct net_device *net_dev, 
u32 stringset,
 static int dpaa_get_hash_opts(struct net_device *dev,
  struct ethtool_rxnfc *cmd)
 {
+   struct dpaa_priv *priv = netdev_priv(dev);
+
cmd->data = 0;
 
switch (cmd->flow_type) {
@@ -409,7 +411,8 @@ static int dpaa_get_hash_opts(struct net_device *dev,
case TCP_V6_FLOW:
case UDP_V4_FLOW:
case UDP_V6_FLOW:
-   cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
+   if (priv->keygen_in_use)
+   cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
/* Fall through */
case IPV4_FLOW:
case IPV6_FLOW:
@@ -421,7 +424,8 @@ static int dpaa_get_hash_opts(struct net_device *dev,
   

[PATCH v2 1/6] fsl/fman: enable FMan Keygen

2017-08-22 Thread Madalin Bucur
From: Iordache Florinel-R70177 

Add support for the FMan Keygen with a hardcoded scheme to spread
incoming traffic on a FQ range based on source and destination IPs
and ports.

Signed-off-by: Iordache Florinel 
Signed-off-by: Madalin Bucur 
---
 drivers/net/ethernet/freescale/fman/Makefile  |   2 +-
 drivers/net/ethernet/freescale/fman/fman.c|  26 +
 drivers/net/ethernet/freescale/fman/fman.h|   2 +
 drivers/net/ethernet/freescale/fman/fman_keygen.c | 783 ++
 drivers/net/ethernet/freescale/fman/fman_keygen.h |  46 ++
 drivers/net/ethernet/freescale/fman/fman_port.c   |  40 +-
 drivers/net/ethernet/freescale/fman/fman_port.h   |   5 +
 7 files changed, 902 insertions(+), 2 deletions(-)
 create mode 100644 drivers/net/ethernet/freescale/fman/fman_keygen.c
 create mode 100644 drivers/net/ethernet/freescale/fman/fman_keygen.h

diff --git a/drivers/net/ethernet/freescale/fman/Makefile 
b/drivers/net/ethernet/freescale/fman/Makefile
index 6049177..2c38119 100644
--- a/drivers/net/ethernet/freescale/fman/Makefile
+++ b/drivers/net/ethernet/freescale/fman/Makefile
@@ -4,6 +4,6 @@ obj-$(CONFIG_FSL_FMAN) += fsl_fman.o
 obj-$(CONFIG_FSL_FMAN) += fsl_fman_port.o
 obj-$(CONFIG_FSL_FMAN) += fsl_mac.o
 
-fsl_fman-objs  := fman_muram.o fman.o fman_sp.o
+fsl_fman-objs  := fman_muram.o fman.o fman_sp.o fman_keygen.o
 fsl_fman_port-objs := fman_port.o
 fsl_mac-objs:= mac.o fman_dtsec.o fman_memac.o fman_tgec.o
diff --git a/drivers/net/ethernet/freescale/fman/fman.c 
b/drivers/net/ethernet/freescale/fman/fman.c
index e714b8f..491a5ac 100644
--- a/drivers/net/ethernet/freescale/fman/fman.c
+++ b/drivers/net/ethernet/freescale/fman/fman.c
@@ -34,6 +34,7 @@
 
 #include "fman.h"
 #include "fman_muram.h"
+#include "fman_keygen.h"
 
 #include 
 #include 
@@ -56,6 +57,7 @@
 /* Modules registers offsets */
 #define BMI_OFFSET 0x0008
 #define QMI_OFFSET 0x00080400
+#define KG_OFFSET  0x000C1000
 #define DMA_OFFSET 0x000C2000
 #define FPM_OFFSET 0x000C3000
 #define IMEM_OFFSET0x000C4000
@@ -617,6 +619,7 @@ struct fman {
struct fman_qmi_regs __iomem *qmi_regs;
struct fman_dma_regs __iomem *dma_regs;
struct fman_hwp_regs __iomem *hwp_regs;
+   struct fman_kg_regs __iomem *kg_regs;
fman_exceptions_cb *exception_cb;
fman_bus_error_cb *bus_error_cb;
/* Spinlock for FMan use */
@@ -631,6 +634,8 @@ struct fman {
/* Fifo in MURAM */
unsigned long fifo_offset;
size_t fifo_size;
+   /* KeyGen handle */
+   struct fman_keygen *keygen;
 
u32 liodn_base[64];
u32 liodn_offset[64];
@@ -1811,6 +1816,7 @@ static int fman_config(struct fman *fman)
fman->qmi_regs = base_addr + QMI_OFFSET;
fman->dma_regs = base_addr + DMA_OFFSET;
fman->hwp_regs = base_addr + HWP_OFFSET;
+   fman->kg_regs = base_addr + KG_OFFSET;
fman->base_addr = base_addr;
 
spin_lock_init(>spinlock);
@@ -2083,6 +2089,11 @@ static int fman_init(struct fman *fman)
/* Init HW Parser */
hwp_init(fman->hwp_regs);
 
+   /* Init KeyGen */
+   fman->keygen = keygen_init(fman->kg_regs);
+   if (!fman->keygen)
+   return -EINVAL;
+
err = enable(fman, cfg);
if (err != 0)
return err;
@@ -2562,6 +2573,21 @@ int fman_get_rx_extra_headroom(void)
 EXPORT_SYMBOL(fman_get_rx_extra_headroom);
 
 /**
+ * fman_get_keygen
+ *
+ * @fman:  A Pointer to FMan device
+ *
+ * Get the handle to KeyGen module part of FM driver
+ *
+ * Return: Handle to KeyGen
+ */
+struct fman_keygen *fman_get_keygen(struct fman *fman)
+{
+   return fman->keygen;
+}
+EXPORT_SYMBOL(fman_get_keygen);
+
+/**
  * fman_bind
  * @dev:   FMan OF device pointer
  *
diff --git a/drivers/net/ethernet/freescale/fman/fman.h 
b/drivers/net/ethernet/freescale/fman/fman.h
index f53e147..291990e 100644
--- a/drivers/net/ethernet/freescale/fman/fman.h
+++ b/drivers/net/ethernet/freescale/fman/fman.h
@@ -320,6 +320,8 @@ u16 fman_get_max_frm(void);
 
 int fman_get_rx_extra_headroom(void);
 
+struct fman_keygen *fman_get_keygen(struct fman *fman);
+
 struct fman *fman_bind(struct device *dev);
 
 #endif /* __FM_H */
diff --git a/drivers/net/ethernet/freescale/fman/fman_keygen.c 
b/drivers/net/ethernet/freescale/fman/fman_keygen.c
new file mode 100644
index 000..f54da3c
--- /dev/null
+++ b/drivers/net/ethernet/freescale/fman/fman_keygen.c
@@ -0,0 +1,783 @@
+/*
+ * Copyright 2017 NXP
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce 

[PATCH v2 3/6] dpaa_eth: enable Rx hashing control

2017-08-22 Thread Madalin Bucur
Allow ethtool control of the Rx flow hashing. By default RSS is
enabled, this allows to turn it off by bypassing the FMan Keygen
block and sending all traffic on the default Rx frame queue.

Signed-off-by: Madalin Bucur 
---
 drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c | 113 +
 1 file changed, 113 insertions(+)

diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c 
b/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c
index aad825088..965f652 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c
@@ -399,6 +399,117 @@ static void dpaa_get_strings(struct net_device *net_dev, 
u32 stringset,
memcpy(strings, dpaa_stats_global, size);
 }
 
+static int dpaa_get_hash_opts(struct net_device *dev,
+ struct ethtool_rxnfc *cmd)
+{
+   cmd->data = 0;
+
+   switch (cmd->flow_type) {
+   case TCP_V4_FLOW:
+   case TCP_V6_FLOW:
+   case UDP_V4_FLOW:
+   case UDP_V6_FLOW:
+   cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
+   /* Fall through */
+   case IPV4_FLOW:
+   case IPV6_FLOW:
+   case SCTP_V4_FLOW:
+   case SCTP_V6_FLOW:
+   case AH_ESP_V4_FLOW:
+   case AH_ESP_V6_FLOW:
+   case AH_V4_FLOW:
+   case AH_V6_FLOW:
+   case ESP_V4_FLOW:
+   case ESP_V6_FLOW:
+   cmd->data |= RXH_IP_SRC | RXH_IP_DST;
+   break;
+   default:
+   cmd->data = 0;
+   break;
+   }
+
+   return 0;
+}
+
+static int dpaa_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
+ u32 *unused)
+{
+   int ret = -EOPNOTSUPP;
+
+   switch (cmd->cmd) {
+   case ETHTOOL_GRXFH:
+   ret = dpaa_get_hash_opts(dev, cmd);
+   break;
+   default:
+   break;
+   }
+
+   return ret;
+}
+
+static void dpaa_set_hash(struct net_device *net_dev, bool enable)
+{
+   struct mac_device *mac_dev;
+   struct fman_port *rxport;
+   struct dpaa_priv *priv;
+
+   priv = netdev_priv(net_dev);
+   mac_dev = priv->mac_dev;
+   rxport = mac_dev->port[0];
+
+   fman_port_use_kg_hash(rxport, enable);
+}
+
+static int dpaa_set_hash_opts(struct net_device *dev,
+ struct ethtool_rxnfc *nfc)
+{
+   int ret = -EINVAL;
+
+   /* we support hashing on IPv4/v6 src/dest IP and L4 src/dest port */
+   if (nfc->data &
+   ~(RXH_IP_SRC | RXH_IP_DST | RXH_L4_B_0_1 | RXH_L4_B_2_3))
+   return -EINVAL;
+
+   switch (nfc->flow_type) {
+   case TCP_V4_FLOW:
+   case TCP_V6_FLOW:
+   case UDP_V4_FLOW:
+   case UDP_V6_FLOW:
+   case IPV4_FLOW:
+   case IPV6_FLOW:
+   case SCTP_V4_FLOW:
+   case SCTP_V6_FLOW:
+   case AH_ESP_V4_FLOW:
+   case AH_ESP_V6_FLOW:
+   case AH_V4_FLOW:
+   case AH_V6_FLOW:
+   case ESP_V4_FLOW:
+   case ESP_V6_FLOW:
+   dpaa_set_hash(dev, !!nfc->data);
+   ret = 0;
+   break;
+   default:
+   break;
+   }
+
+   return ret;
+}
+
+static int dpaa_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd)
+{
+   int ret = -EOPNOTSUPP;
+
+   switch (cmd->cmd) {
+   case ETHTOOL_SRXFH:
+   ret = dpaa_set_hash_opts(dev, cmd);
+   break;
+   default:
+   break;
+   }
+
+   return ret;
+}
+
 const struct ethtool_ops dpaa_ethtool_ops = {
.get_drvinfo = dpaa_get_drvinfo,
.get_msglevel = dpaa_get_msglevel,
@@ -412,4 +523,6 @@ const struct ethtool_ops dpaa_ethtool_ops = {
.get_strings = dpaa_get_strings,
.get_link_ksettings = dpaa_get_link_ksettings,
.set_link_ksettings = dpaa_set_link_ksettings,
+   .get_rxnfc = dpaa_get_rxnfc,
+   .set_rxnfc = dpaa_set_rxnfc,
 };
-- 
2.1.0



[PATCH v2 2/6] dpaa_eth: use multiple Rx frame queues

2017-08-22 Thread Madalin Bucur
Add a block of 128 Rx frame queues per port. The FMan hardware will
send traffic on one of these queues based on the FMan port Parse
Classify Distribute setup. The hash computed by the FMan Keygen
block will select the Rx FQ.

Signed-off-by: Madalin Bucur 
---
 drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 50 +++---
 drivers/net/ethernet/freescale/dpaa/dpaa_eth.h |  1 +
 .../net/ethernet/freescale/dpaa/dpaa_eth_sysfs.c   |  3 ++
 3 files changed, 47 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c 
b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index c7fa285..6d89e74 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -158,7 +158,7 @@ MODULE_PARM_DESC(tx_timeout, "The Tx timeout in ms");
 #define DPAA_RX_PRIV_DATA_SIZE (u16)(DPAA_TX_PRIV_DATA_SIZE + \
dpaa_rx_extra_headroom)
 
-#define DPAA_ETH_RX_QUEUES 128
+#define DPAA_ETH_PCD_RXQ_NUM   128
 
 #define DPAA_ENQUEUE_RETRIES   10
 
@@ -169,6 +169,7 @@ struct fm_port_fqs {
struct dpaa_fq *tx_errq;
struct dpaa_fq *rx_defq;
struct dpaa_fq *rx_errq;
+   struct dpaa_fq *rx_pcdq;
 };
 
 /* All the dpa bps in use at any moment */
@@ -628,6 +629,7 @@ static inline void dpaa_assign_wq(struct dpaa_fq *fq, int 
idx)
fq->wq = 5;
break;
case FQ_TYPE_RX_DEFAULT:
+   case FQ_TYPE_RX_PCD:
fq->wq = 6;
break;
case FQ_TYPE_TX:
@@ -688,6 +690,7 @@ static int dpaa_alloc_all_fqs(struct device *dev, struct 
list_head *list,
  struct fm_port_fqs *port_fqs)
 {
struct dpaa_fq *dpaa_fq;
+   u32 fq_base, fq_base_aligned, i;
 
dpaa_fq = dpaa_fq_alloc(dev, 0, 1, list, FQ_TYPE_RX_ERROR);
if (!dpaa_fq)
@@ -701,6 +704,26 @@ static int dpaa_alloc_all_fqs(struct device *dev, struct 
list_head *list,
 
port_fqs->rx_defq = _fq[0];
 
+   /* the PCD FQIDs range needs to be aligned for correct operation */
+   if (qman_alloc_fqid_range(_base, 2 * DPAA_ETH_PCD_RXQ_NUM))
+   goto fq_alloc_failed;
+
+   fq_base_aligned = ALIGN(fq_base, DPAA_ETH_PCD_RXQ_NUM);
+
+   for (i = fq_base; i < fq_base_aligned; i++)
+   qman_release_fqid(i);
+
+   for (i = fq_base_aligned + DPAA_ETH_PCD_RXQ_NUM;
+i < (fq_base + 2 * DPAA_ETH_PCD_RXQ_NUM); i++)
+   qman_release_fqid(i);
+
+   dpaa_fq = dpaa_fq_alloc(dev, fq_base_aligned, DPAA_ETH_PCD_RXQ_NUM,
+   list, FQ_TYPE_RX_PCD);
+   if (!dpaa_fq)
+   goto fq_alloc_failed;
+
+   port_fqs->rx_pcdq = _fq[0];
+
if (!dpaa_fq_alloc(dev, 0, DPAA_ETH_TXQ_NUM, list, FQ_TYPE_TX_CONF_MQ))
goto fq_alloc_failed;
 
@@ -870,13 +893,14 @@ static void dpaa_fq_setup(struct dpaa_priv *priv,
  const struct dpaa_fq_cbs *fq_cbs,
  struct fman_port *tx_port)
 {
-   int egress_cnt = 0, conf_cnt = 0, num_portals = 0, cpu;
+   int egress_cnt = 0, conf_cnt = 0, num_portals = 0, portal_cnt = 0, cpu;
const cpumask_t *affine_cpus = qman_affine_cpus();
-   u16 portals[NR_CPUS];
+   u16 channels[NR_CPUS];
struct dpaa_fq *fq;
 
for_each_cpu(cpu, affine_cpus)
-   portals[num_portals++] = qman_affine_channel(cpu);
+   channels[num_portals++] = qman_affine_channel(cpu);
+
if (num_portals == 0)
dev_err(priv->net_dev->dev.parent,
"No Qman software (affine) channels found");
@@ -890,6 +914,12 @@ static void dpaa_fq_setup(struct dpaa_priv *priv,
case FQ_TYPE_RX_ERROR:
dpaa_setup_ingress(priv, fq, _cbs->rx_errq);
break;
+   case FQ_TYPE_RX_PCD:
+   if (!num_portals)
+   continue;
+   dpaa_setup_ingress(priv, fq, _cbs->rx_defq);
+   fq->channel = channels[portal_cnt++ % num_portals];
+   break;
case FQ_TYPE_TX:
dpaa_setup_egress(priv, fq, tx_port,
  _cbs->egress_ern);
@@ -1039,7 +1069,8 @@ static int dpaa_fq_init(struct dpaa_fq *dpaa_fq, bool 
td_enable)
/* Put all the ingress queues in our "ingress CGR". */
if (priv->use_ingress_cgr &&
(dpaa_fq->fq_type == FQ_TYPE_RX_DEFAULT ||
-dpaa_fq->fq_type == FQ_TYPE_RX_ERROR)) {
+dpaa_fq->fq_type == FQ_TYPE_RX_ERROR ||
+dpaa_fq->fq_type == FQ_TYPE_RX_PCD)) {
initfq.we_mask |= cpu_to_be16(QM_INITFQ_WE_CGID);
initfq.fqd.fq_ctrl |= cpu_to_be16(QM_FQCTRL_CGE);

[PATCH v2 0/6] Add RSS to DPAA 1.x Ethernet driver

2017-08-22 Thread Madalin Bucur
This patch set introduces Receive Side Scaling for the DPAA Ethernet
driver. Documentation is updated with details related to the new
feature and limitations that apply.
Added also a small fix.

Change from v1: removed a C++ style comment

Iordache Florinel-R70177 (1):
  fsl/fman: enable FMan Keygen

Madalin Bucur (5):
  dpaa_eth: use multiple Rx frame queues
  dpaa_eth: enable Rx hashing control
  dpaa_eth: add NETIF_F_RXHASH
  Documentation: networking: add RSS information
  dpaa_eth: check allocation result

 Documentation/networking/dpaa.txt  |  68 +-
 drivers/net/ethernet/freescale/dpaa/dpaa_eth.c |  76 +-
 drivers/net/ethernet/freescale/dpaa/dpaa_eth.h |   2 +
 .../net/ethernet/freescale/dpaa/dpaa_eth_sysfs.c   |   3 +
 drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c | 118 
 drivers/net/ethernet/freescale/fman/Makefile   |   2 +-
 drivers/net/ethernet/freescale/fman/fman.c |  26 +
 drivers/net/ethernet/freescale/fman/fman.h |   2 +
 drivers/net/ethernet/freescale/fman/fman_keygen.c  | 783 +
 drivers/net/ethernet/freescale/fman/fman_keygen.h  |  46 ++
 drivers/net/ethernet/freescale/fman/fman_port.c|  51 +-
 drivers/net/ethernet/freescale/fman/fman_port.h|   7 +
 12 files changed, 1171 insertions(+), 13 deletions(-)
 create mode 100644 drivers/net/ethernet/freescale/fman/fman_keygen.c
 create mode 100644 drivers/net/ethernet/freescale/fman/fman_keygen.h

-- 
2.1.0



Re: [PATCH 5/6] powerpc/mm: Optimize detection of thread local mm's

2017-08-22 Thread Benjamin Herrenschmidt
On Tue, 2017-08-22 at 15:18 +0200, Frederic Barrat wrote:
> > Or you could just incrementer my counter. Just make sure you increment
> > it at most once per CXL context and decrement when the context is gone.
> 
> Ah great, I didn't dare messing with your counter, it makes it easier. 
> Arguably what happens on those accelerators is pretty close to an active 
> cpu.
> 
> Once it is merged, I'm going to have to backport your patch (and an 
> update to mine) to the p9-supporting distros. From a quick look, your 
> patch, i.e."[PATCH 5/6] powerpc/mm: Optimize detection of thread local 
> mm's" is completely independent from the rest of the series, right?

We also need the memory barrier fix but yes.

Cheers,
Ben.



Re: [PATCH 1/2] powerpc/workqueue: update list of possible CPUs

2017-08-22 Thread Tejun Heo
Hello, Michael.

On Tue, Aug 22, 2017 at 11:41:41AM +1000, Michael Ellerman wrote:
> > This is something powerpc needs to fix.
> 
> There is no way for us to fix it.

I don't think that's true.  The CPU id used in kernel doesn't have to
match the physical one and arch code should be able to pre-map CPU IDs
to nodes and use the matching one when hotplugging CPUs.  I'm not
saying that's the best way to solve the problem tho.  It could be that
the best way forward is making cpu <-> node mapping dynamic and
properly synchronized.  However, please note that that does mean we
mess up node affinity for things like per-cpu memory which are
allocated before the cpu comes up, so there's some inherent benefits
to keeping the mapping static even if that involves indirection.

> > Workqueue isn't the only one making this assumption. mm as a whole
> > assumes that CPU <-> node mapping is stable regardless of hotplug
> > events.
> 
> At least in this case I don't think the mapping changes, it's just we
> don't know the mapping at boot.
> 
> Currently we have to report possible but not present CPUs as belonging
> to node 0, because otherwise we trip this helpful piece of code:
> 
>   for_each_possible_cpu(cpu) {
>   node = cpu_to_node(cpu);
>   if (WARN_ON(node == NUMA_NO_NODE)) {
>   pr_warn("workqueue: NUMA node mapping not available for 
> cpu%d, disabling NUMA support\n", cpu);
>   /* happens iff arch is bonkers, let's just proceed */
>   return;
>   }
> 
> But if we remove that, we could then accurately report NUMA_NO_NODE at
> boot, and then update the mapping when the CPU is hotplugged.

If you think that making this dynamic is the right way to go, I have
no objection but we should be doing this properly instead of patching
up what seems to be crashing right now.  What synchronization and
notification mechanisms do we need to make cpu <-> node mapping
dynamic?  Do we need any synchronization in memory allocation paths?
If not, why would it be safe?

Thanks.

-- 
tejun


Re: [RFC Part1 PATCH v3 13/17] x86/io: Unroll string I/O when SEV is active

2017-08-22 Thread Borislav Petkov
On Wed, Jul 26, 2017 at 03:07:14PM -0500, Brijesh Singh wrote:
> Are you commenting on amount of code duplication ? If so, I can certainly 
> improve
> and use the similar macro used into header file to generate the functions 
> body.

So the argument about having CONFIG_AMD_MEM_ENCRYPT disabled doesn't
bring a whole lot because distro kernels will all have it enabled.

Optimally, it would be best if when SEV is enabled, we patch those IO
insns but we can't patch at arbitrary times - we just do it once, at
pre-SMP time.

And from looking at the code, we do set sev_enabled very early, as
part of __startup_64() -> sme_enable() so I guess we can make that
set a synthetic X86_FEATURE_ bit and then patch REP IN/OUT* with a
CALL, similar to what we do in arch/x86/include/asm/arch_hweight.h with
POPCNT.

But there you need to pay attention to registers being clobbered, see

  f5967101e9de ("x86/hweight: Get rid of the special calling convention")

Yap, it does sound a bit more complex but if done right, we will be
patching all call sites the same way we patch hweight*() calls and there
should be no change to kernel size...

As always, the devil is in the detail.

-- 
Regards/Gruss,
Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 
(AG Nürnberg)
-- 


Re: 32-bit powerpc, aty128fb: vmap allocation for size 135168 failed

2017-08-22 Thread Meelis Roos
> > Aug 17 23:53:57 pohl kernel: [ 2940.146546] aty128fb :00:10.0: Invalid 
> > PCI ROM header signature: expecting 0xaa55, got 0x
> > Aug 17 23:54:02 pohl kernel: [ 2944.804838] aty128fb :00:10.0: Invalid 
> > PCI ROM header signature: expecting 0xaa55, got 0x1110
> 
> I think these messages are harmless and expected.  This device has no
> x86 option ROM but a OpenFirmware one.  This is likely unrelated to the
> sddm crash.

Yes, but after these crashes have happened for a while, vmalloc 
problems appear.

sddm crash might be related to X server dying under it, or it crashes 
for it own problems (varying signals and addresses beacuse of some 
ASLR?) and causes X server restart that triggers another ROM allocation 
round.

I did read the kernel code and I do not see how the dmesg lines are 
possible without corresponding aty128fb lines about the same ROM 
signature, or why the ROM signature is sometimes 0x and sometimes 
0x1110 instead of x86 ROM signature (that clearly is not there, 
but this is expected).

-- 
Meelis Roos (mr...@linux.ee)


Re: 32-bit powerpc, aty128fb: vmap allocation for size 135168 failed

2017-08-22 Thread Andreas Schwab
On Aug 18 2017, Meelis Roos  wrote:

> Aug 17 23:53:57 pohl kernel: [ 2940.146546] aty128fb :00:10.0: Invalid 
> PCI ROM header signature: expecting 0xaa55, got 0x
> Aug 17 23:54:02 pohl kernel: [ 2944.804838] aty128fb :00:10.0: Invalid 
> PCI ROM header signature: expecting 0xaa55, got 0x1110

I think these messages are harmless and expected.  This device has no
x86 option ROM but a OpenFirmware one.  This is likely unrelated to the
sddm crash.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Re: [PATCH] fix memory leak on kvm_vm_ioctl_get_htab_fd

2017-08-22 Thread Paolo Bonzini
On 22/08/2017 16:18, nixiaoming wrote:
> ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
> but no free when anon_inode_getfd return fail
> so, add kfree(ctx) to fix memory leak
> 
> Signed-off-by: nixiaoming 
> ---
>  arch/powerpc/kvm/book3s_64_mmu_hv.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c 
> b/arch/powerpc/kvm/book3s_64_mmu_hv.c
> index b42812e..be3d08f 100644
> --- a/arch/powerpc/kvm/book3s_64_mmu_hv.c
> +++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c
> @@ -1940,6 +1940,7 @@ int kvm_vm_ioctl_get_htab_fd(struct kvm *kvm, struct 
> kvm_get_htab_fd *ghf)
>   rwflag = (ghf->flags & KVM_GET_HTAB_WRITE) ? O_WRONLY : O_RDONLY;
>   ret = anon_inode_getfd("kvm-htab", _htab_fops, ctx, rwflag | 
> O_CLOEXEC);
>   if (ret < 0) {
> + kfree(ctx);
>   kvm_put_kvm(kvm);
>   return ret;
>   }
> 

Reviewed-by: Paolo Bonzini 


Re: RCU lockup issues when CONFIG_SOFTLOCKUP_DETECTOR=n - any one else seeing this?

2017-08-22 Thread Paul E. McKenney
On Tue, Aug 22, 2017 at 02:21:32PM +0530, Abdul Haleem wrote:
> On Tue, 2017-08-22 at 08:49 +0100, Jonathan Cameron wrote:
> > On Mon, 21 Aug 2017 13:55:04 -0700
> > David Miller  wrote:
> > 
> > > From: Nicholas Piggin 
> > > Date: Tue, 22 Aug 2017 00:19:28 +1000
> > > 
> > > > Thanks here's an updated version with a couple more bugs fixed. If
> > > > you could try testing, that would be much appreciated.  
> > > 
> > > I'm not getting RCU stalls on sparc64 any longer with this patch.
> > > 
> > > I'm really happy you guys were able to figure out what was going
> > > wrong. :-)
> > > 
> > > Feel free to add my Tested-by:
> > > 
> > 
> > Like wise - 16 hours of clean run with the latest
> > 
> > Tested-by: Jonathan Cameron 
> > 
> > Thanks for all the hard work everyone put into this one, great to
> > cross it off the list!
> > 
> > Jonathan
> > 
> 
> No more RCU stalls on PowerPC, system is clean when idle or with some
> test runs.
> 
> Thank you all for your time and efforts in fixing this.
> 
> Reported-and-Tested-by: Abdul Haleem 

I am still seeing failures, but then again I am running rcutorture with
lots of CPU hotplug activity.  So I am probably seeing some other bug,
though it still looks a lot like a lost timer.

Thanx, Paul



Re: [PATCH] fix memory leak on kvm_vm_ioctl_create_spapr_tce

2017-08-22 Thread David Hildenbrand
On 22.08.2017 17:15, David Hildenbrand wrote:
> On 22.08.2017 16:28, nixiaoming wrote:
>> miss kfree(stt) when anon_inode_getfd return fail
>> so add check anon_inode_getfd return val, and kfree stt
>>
>> Signed-off-by: nixiaoming 
>> ---
>>  arch/powerpc/kvm/book3s_64_vio.c | 5 -
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/kvm/book3s_64_vio.c 
>> b/arch/powerpc/kvm/book3s_64_vio.c
>> index a160c14..a0b4459 100644
>> --- a/arch/powerpc/kvm/book3s_64_vio.c
>> +++ b/arch/powerpc/kvm/book3s_64_vio.c
>> @@ -341,8 +341,11 @@ long kvm_vm_ioctl_create_spapr_tce(struct kvm *kvm,
>>  
>>  mutex_unlock(>lock);
>>  
>> -return anon_inode_getfd("kvm-spapr-tce", _spapr_tce_fops,
>> +ret = anon_inode_getfd("kvm-spapr-tce", _spapr_tce_fops,
>>  stt, O_RDWR | O_CLOEXEC);
>> +if (ret < 0)
>> +goto fail;
>> +return ret;
>>  
>>  fail:
>>  if (stt) {
>>
> 
> 
> stt has already been added to kvm->arch.spapr_tce_tables, so freeing it
> is evil IMHO. I don't know that code, so I don't know if there is some
> other place that will make sure that everything in
> kvm->arch.spapr_tce_tables will properly get freed, even when no release
> function has been called (kvm_spapr_tce_release).
> 

If it is really not freed, than also kvm_put_kvm(stt->kvm) is missing.

-- 

Thanks,

David


Re: [PATCH] fix memory leak on kvm_vm_ioctl_create_spapr_tce

2017-08-22 Thread David Hildenbrand
On 22.08.2017 16:28, nixiaoming wrote:
> miss kfree(stt) when anon_inode_getfd return fail
> so add check anon_inode_getfd return val, and kfree stt
> 
> Signed-off-by: nixiaoming 
> ---
>  arch/powerpc/kvm/book3s_64_vio.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/kvm/book3s_64_vio.c 
> b/arch/powerpc/kvm/book3s_64_vio.c
> index a160c14..a0b4459 100644
> --- a/arch/powerpc/kvm/book3s_64_vio.c
> +++ b/arch/powerpc/kvm/book3s_64_vio.c
> @@ -341,8 +341,11 @@ long kvm_vm_ioctl_create_spapr_tce(struct kvm *kvm,
>  
>   mutex_unlock(>lock);
>  
> - return anon_inode_getfd("kvm-spapr-tce", _spapr_tce_fops,
> + ret = anon_inode_getfd("kvm-spapr-tce", _spapr_tce_fops,
>   stt, O_RDWR | O_CLOEXEC);
> + if (ret < 0)
> + goto fail;
> + return ret;
>  
>  fail:
>   if (stt) {
> 


stt has already been added to kvm->arch.spapr_tce_tables, so freeing it
is evil IMHO. I don't know that code, so I don't know if there is some
other place that will make sure that everything in
kvm->arch.spapr_tce_tables will properly get freed, even when no release
function has been called (kvm_spapr_tce_release).
-- 

Thanks,

David


Re: [PATCH 5/6] powerpc/mm: Optimize detection of thread local mm's

2017-08-22 Thread Frederic Barrat



Le 21/08/2017 à 19:35, Benjamin Herrenschmidt a écrit :

On Mon, 2017-08-21 at 19:27 +0200, Frederic Barrat wrote:

Hi Ben,

Le 24/07/2017 à 06:28, Benjamin Herrenschmidt a écrit :

Instead of comparing the whole CPU mask every time, let's
keep a counter of how many bits are set in the mask. Thus
testing for a local mm only requires testing if that counter
is 1 and the current CPU bit is set in the mask.



I'm trying to see if we could merge this patch with what I'm trying to
do to mark a context as requiring global TLBIs.
In http://patchwork.ozlabs.org/patch/796775/
I'm introducing a 'flags' per memory context, using one bit to say if
the context needs global TLBIs.
The 2 could co-exist, just checking... Do you think about using the
actual active_cpus count down the road, or is it just a matter of
knowing if there are more than one active cpus?


Or you could just incrementer my counter. Just make sure you increment
it at most once per CXL context and decrement when the context is gone.


Ah great, I didn't dare messing with your counter, it makes it easier. 
Arguably what happens on those accelerators is pretty close to an active 
cpu.


Once it is merged, I'm going to have to backport your patch (and an 
update to mine) to the p9-supporting distros. From a quick look, your 
patch, i.e."[PATCH 5/6] powerpc/mm: Optimize detection of thread local 
mm's" is completely independent from the rest of the series, right?


  Fred



Re: RCU lockup issues when CONFIG_SOFTLOCKUP_DETECTOR=n - any one else seeing this?

2017-08-22 Thread Abdul Haleem
On Tue, 2017-08-22 at 08:49 +0100, Jonathan Cameron wrote:
> On Mon, 21 Aug 2017 13:55:04 -0700
> David Miller  wrote:
> 
> > From: Nicholas Piggin 
> > Date: Tue, 22 Aug 2017 00:19:28 +1000
> > 
> > > Thanks here's an updated version with a couple more bugs fixed. If
> > > you could try testing, that would be much appreciated.  
> > 
> > I'm not getting RCU stalls on sparc64 any longer with this patch.
> > 
> > I'm really happy you guys were able to figure out what was going
> > wrong. :-)
> > 
> > Feel free to add my Tested-by:
> > 
> 
> Like wise - 16 hours of clean run with the latest
> 
> Tested-by: Jonathan Cameron 
> 
> Thanks for all the hard work everyone put into this one, great to
> cross it off the list!
> 
> Jonathan
> 

No more RCU stalls on PowerPC, system is clean when idle or with some
test runs.

Thank you all for your time and efforts in fixing this.

Reported-and-Tested-by: Abdul Haleem 

-- 
Regard's

Abdul Haleem
IBM Linux Technology Centre





[PATCH] net: ethernet: freescale: fs_enet: make mdiobb_ops const

2017-08-22 Thread Bhumika Goyal
Make this const as it is only stored in a const field of a
mdiobb_ctrl structure.

Signed-off-by: Bhumika Goyal 
---
 drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c 
b/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c
index 1f015ed..c8e5d88 100644
--- a/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c
+++ b/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c
@@ -100,7 +100,7 @@ static inline void mdc(struct mdiobb_ctrl *ctrl, int what)
in_be32(bitbang->dat);
 }
 
-static struct mdiobb_ops bb_ops = {
+static const struct mdiobb_ops bb_ops = {
.owner = THIS_MODULE,
.set_mdc = mdc,
.set_mdio_dir = mdio_dir,
-- 
1.9.1



[PATCH 11/11] crypto: aesni - Use GCM IV size constant

2017-08-22 Thread Corentin Labbe
This patch replace GCM IV size value by their constant name.

Signed-off-by: Corentin Labbe 
---
 arch/x86/crypto/aesni-intel_glue.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/x86/crypto/aesni-intel_glue.c 
b/arch/x86/crypto/aesni-intel_glue.c
index 5c15d6b57329..80664368bf14 100644
--- a/arch/x86/crypto/aesni-intel_glue.c
+++ b/arch/x86/crypto/aesni-intel_glue.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1131,7 +1132,7 @@ static struct aead_alg aesni_aead_algs[] = { {
.setauthsize= common_rfc4106_set_authsize,
.encrypt= helper_rfc4106_encrypt,
.decrypt= helper_rfc4106_decrypt,
-   .ivsize = 8,
+   .ivsize = GCM_RFC4106_IV_SIZE,
.maxauthsize= 16,
.base = {
.cra_name   = "__gcm-aes-aesni",
@@ -1149,7 +1150,7 @@ static struct aead_alg aesni_aead_algs[] = { {
.setauthsize= rfc4106_set_authsize,
.encrypt= rfc4106_encrypt,
.decrypt= rfc4106_decrypt,
-   .ivsize = 8,
+   .ivsize = GCM_RFC4106_IV_SIZE,
.maxauthsize= 16,
.base = {
.cra_name   = "rfc4106(gcm(aes))",
@@ -1165,7 +1166,7 @@ static struct aead_alg aesni_aead_algs[] = { {
.setauthsize= generic_gcmaes_set_authsize,
.encrypt= generic_gcmaes_encrypt,
.decrypt= generic_gcmaes_decrypt,
-   .ivsize = 12,
+   .ivsize = GCM_AES_IV_SIZE,
.maxauthsize= 16,
.base = {
.cra_name   = "gcm(aes)",
-- 
2.13.0



[PATCH 10/11] crypto: gcm - Use GCM IV size constant

2017-08-22 Thread Corentin Labbe
This patch replace GCM IV size value by their constant name.

Signed-off-by: Corentin Labbe 
---
 crypto/gcm.c | 23 ---
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/crypto/gcm.c b/crypto/gcm.c
index 3841b5eafa7e..80cf6cfe082b 100644
--- a/crypto/gcm.c
+++ b/crypto/gcm.c
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include "internal.h"
 #include 
@@ -197,8 +198,8 @@ static void crypto_gcm_init_common(struct aead_request *req)
struct scatterlist *sg;
 
memset(pctx->auth_tag, 0, sizeof(pctx->auth_tag));
-   memcpy(pctx->iv, req->iv, 12);
-   memcpy(pctx->iv + 12, , 4);
+   memcpy(pctx->iv, req->iv, GCM_AES_IV_SIZE);
+   memcpy(pctx->iv + GCM_AES_IV_SIZE, , 4);
 
sg_init_table(pctx->src, 3);
sg_set_buf(pctx->src, pctx->auth_tag, sizeof(pctx->auth_tag));
@@ -695,7 +696,7 @@ static int crypto_gcm_create_common(struct crypto_template 
*tmpl,
inst->alg.base.cra_alignmask = ghash->base.cra_alignmask |
   ctr->base.cra_alignmask;
inst->alg.base.cra_ctxsize = sizeof(struct crypto_gcm_ctx);
-   inst->alg.ivsize = 12;
+   inst->alg.ivsize = GCM_AES_IV_SIZE;
inst->alg.chunksize = crypto_skcipher_alg_chunksize(ctr);
inst->alg.maxauthsize = 16;
inst->alg.init = crypto_gcm_init_tfm;
@@ -832,20 +833,20 @@ static struct aead_request *crypto_rfc4106_crypt(struct 
aead_request *req)
u8 *iv = PTR_ALIGN((u8 *)(subreq + 1) + crypto_aead_reqsize(child),
   crypto_aead_alignmask(child) + 1);
 
-   scatterwalk_map_and_copy(iv + 12, req->src, 0, req->assoclen - 8, 0);
+   scatterwalk_map_and_copy(iv + GCM_AES_IV_SIZE, req->src, 0, 
req->assoclen - 8, 0);
 
memcpy(iv, ctx->nonce, 4);
memcpy(iv + 4, req->iv, 8);
 
sg_init_table(rctx->src, 3);
-   sg_set_buf(rctx->src, iv + 12, req->assoclen - 8);
+   sg_set_buf(rctx->src, iv + GCM_AES_IV_SIZE, req->assoclen - 8);
sg = scatterwalk_ffwd(rctx->src + 1, req->src, req->assoclen);
if (sg != rctx->src + 1)
sg_chain(rctx->src, 2, sg);
 
if (req->src != req->dst) {
sg_init_table(rctx->dst, 3);
-   sg_set_buf(rctx->dst, iv + 12, req->assoclen - 8);
+   sg_set_buf(rctx->dst, iv + GCM_AES_IV_SIZE, req->assoclen - 8);
sg = scatterwalk_ffwd(rctx->dst + 1, req->dst, req->assoclen);
if (sg != rctx->dst + 1)
sg_chain(rctx->dst, 2, sg);
@@ -957,7 +958,7 @@ static int crypto_rfc4106_create(struct crypto_template 
*tmpl,
err = -EINVAL;
 
/* Underlying IV size must be 12. */
-   if (crypto_aead_alg_ivsize(alg) != 12)
+   if (crypto_aead_alg_ivsize(alg) != GCM_AES_IV_SIZE)
goto out_drop_alg;
 
/* Not a stream cipher? */
@@ -980,7 +981,7 @@ static int crypto_rfc4106_create(struct crypto_template 
*tmpl,
 
inst->alg.base.cra_ctxsize = sizeof(struct crypto_rfc4106_ctx);
 
-   inst->alg.ivsize = 8;
+   inst->alg.ivsize = GCM_RFC4106_IV_SIZE;
inst->alg.chunksize = crypto_aead_alg_chunksize(alg);
inst->alg.maxauthsize = crypto_aead_alg_maxauthsize(alg);
 
@@ -1134,7 +1135,7 @@ static int crypto_rfc4543_init_tfm(struct crypto_aead 
*tfm)
tfm,
sizeof(struct crypto_rfc4543_req_ctx) +
ALIGN(crypto_aead_reqsize(aead), crypto_tfm_ctx_alignment()) +
-   align + 12);
+   align + GCM_AES_IV_SIZE);
 
return 0;
 
@@ -1199,7 +1200,7 @@ static int crypto_rfc4543_create(struct crypto_template 
*tmpl,
err = -EINVAL;
 
/* Underlying IV size must be 12. */
-   if (crypto_aead_alg_ivsize(alg) != 12)
+   if (crypto_aead_alg_ivsize(alg) != GCM_AES_IV_SIZE)
goto out_drop_alg;
 
/* Not a stream cipher? */
@@ -1222,7 +1223,7 @@ static int crypto_rfc4543_create(struct crypto_template 
*tmpl,
 
inst->alg.base.cra_ctxsize = sizeof(struct crypto_rfc4543_ctx);
 
-   inst->alg.ivsize = 8;
+   inst->alg.ivsize = GCM_RFC4543_IV_SIZE;
inst->alg.chunksize = crypto_aead_alg_chunksize(alg);
inst->alg.maxauthsize = crypto_aead_alg_maxauthsize(alg);
 
-- 
2.13.0



[PATCH 09/11] crypto: omap - Use GCM IV size constant

2017-08-22 Thread Corentin Labbe
This patch replace GCM IV size value by their constant name.

Signed-off-by: Corentin Labbe 
---
 drivers/crypto/omap-aes-gcm.c | 7 ---
 drivers/crypto/omap-aes.c | 5 +++--
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/crypto/omap-aes-gcm.c b/drivers/crypto/omap-aes-gcm.c
index 7d4f8a4be6d8..9b8f1c752168 100644
--- a/drivers/crypto/omap-aes-gcm.c
+++ b/drivers/crypto/omap-aes-gcm.c
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -311,7 +312,7 @@ static int omap_aes_gcm_crypt(struct aead_request *req, 
unsigned long mode)
int err, assoclen;
 
memset(rctx->auth_tag, 0, sizeof(rctx->auth_tag));
-   memcpy(rctx->iv + 12, , 4);
+   memcpy(rctx->iv + GCM_AES_IV_SIZE, , 4);
 
err = do_encrypt_iv(req, (u32 *)rctx->auth_tag, (u32 *)rctx->iv);
if (err)
@@ -339,7 +340,7 @@ int omap_aes_gcm_encrypt(struct aead_request *req)
 {
struct omap_aes_reqctx *rctx = aead_request_ctx(req);
 
-   memcpy(rctx->iv, req->iv, 12);
+   memcpy(rctx->iv, req->iv, GCM_AES_IV_SIZE);
return omap_aes_gcm_crypt(req, FLAGS_ENCRYPT | FLAGS_GCM);
 }
 
@@ -347,7 +348,7 @@ int omap_aes_gcm_decrypt(struct aead_request *req)
 {
struct omap_aes_reqctx *rctx = aead_request_ctx(req);
 
-   memcpy(rctx->iv, req->iv, 12);
+   memcpy(rctx->iv, req->iv, GCM_AES_IV_SIZE);
return omap_aes_gcm_crypt(req, FLAGS_GCM);
 }
 
diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c
index c376a3ee7c2c..1f3686a1ebfa 100644
--- a/drivers/crypto/omap-aes.c
+++ b/drivers/crypto/omap-aes.c
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -767,7 +768,7 @@ static struct aead_alg algs_aead_gcm[] = {
},
.init   = omap_aes_gcm_cra_init,
.exit   = omap_aes_gcm_cra_exit,
-   .ivsize = 12,
+   .ivsize = GCM_AES_IV_SIZE,
.maxauthsize= AES_BLOCK_SIZE,
.setkey = omap_aes_gcm_setkey,
.encrypt= omap_aes_gcm_encrypt,
@@ -788,7 +789,7 @@ static struct aead_alg algs_aead_gcm[] = {
.init   = omap_aes_gcm_cra_init,
.exit   = omap_aes_gcm_cra_exit,
.maxauthsize= AES_BLOCK_SIZE,
-   .ivsize = 8,
+   .ivsize = GCM_RFC4106_IV_SIZE,
.setkey = omap_aes_4106gcm_setkey,
.encrypt= omap_aes_4106gcm_encrypt,
.decrypt= omap_aes_4106gcm_decrypt,
-- 
2.13.0



[PATCH 08/11] crypto: chelsio - Use GCM IV size constant

2017-08-22 Thread Corentin Labbe
This patch replace GCM IV size value by their constant name.

Signed-off-by: Corentin Labbe 
---
 drivers/crypto/chelsio/chcr_algo.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/chelsio/chcr_algo.c 
b/drivers/crypto/chelsio/chcr_algo.c
index 0e8160701833..936bdd895efa 100644
--- a/drivers/crypto/chelsio/chcr_algo.c
+++ b/drivers/crypto/chelsio/chcr_algo.c
@@ -53,6 +53,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2534,9 +2535,9 @@ static struct sk_buff *create_gcm_wr(struct aead_request 
*req,
if (get_aead_subtype(tfm) ==
CRYPTO_ALG_SUB_TYPE_AEAD_RFC4106) {
memcpy(reqctx->iv, aeadctx->salt, 4);
-   memcpy(reqctx->iv + 4, req->iv, 8);
+   memcpy(reqctx->iv + 4, req->iv, GCM_RFC4106_IV_SIZE);
} else {
-   memcpy(reqctx->iv, req->iv, 12);
+   memcpy(reqctx->iv, req->iv, GCM_AES_IV_SIZE);
}
*((unsigned int *)(reqctx->iv + 12)) = htonl(0x01);
 
@@ -3385,7 +3386,7 @@ static struct chcr_alg_template driver_algs[] = {
sizeof(struct chcr_aead_ctx) +
sizeof(struct chcr_gcm_ctx),
},
-   .ivsize = 12,
+   .ivsize = GCM_AES_IV_SIZE,
.maxauthsize = GHASH_DIGEST_SIZE,
.setkey = chcr_gcm_setkey,
.setauthsize = chcr_gcm_setauthsize,
@@ -3405,7 +3406,7 @@ static struct chcr_alg_template driver_algs[] = {
sizeof(struct chcr_gcm_ctx),
 
},
-   .ivsize = 8,
+   .ivsize = GCM_RFC4106_IV_SIZE,
.maxauthsize= GHASH_DIGEST_SIZE,
.setkey = chcr_gcm_setkey,
.setauthsize= chcr_4106_4309_setauthsize,
-- 
2.13.0



[PATCH 07/11] crypto: mediatek - Use GCM IV size constant

2017-08-22 Thread Corentin Labbe
This patch replace GCM IV size value by their constant name.

Signed-off-by: Corentin Labbe 
---
 drivers/crypto/mediatek/mtk-aes.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/mediatek/mtk-aes.c 
b/drivers/crypto/mediatek/mtk-aes.c
index 9e845e866dec..87e15b624f84 100644
--- a/drivers/crypto/mediatek/mtk-aes.c
+++ b/drivers/crypto/mediatek/mtk-aes.c
@@ -13,6 +13,7 @@
  */
 
 #include 
+#include 
 #include "mtk-platform.h"
 
 #define AES_QUEUE_SIZE 512
@@ -1098,7 +1099,7 @@ static struct aead_alg aes_gcm_alg = {
.decrypt= mtk_aes_gcm_decrypt,
.init   = mtk_aes_gcm_init,
.exit   = mtk_aes_gcm_exit,
-   .ivsize = 12,
+   .ivsize = GCM_AES_IV_SIZE,
.maxauthsize= AES_BLOCK_SIZE,
 
.base = {
-- 
2.13.0



[PATCH 06/11] crypto: bcm - Use GCM IV size constant

2017-08-22 Thread Corentin Labbe
This patch replace GCM IV size value by their constant name.

Signed-off-by: Corentin Labbe 
---
 drivers/crypto/bcm/cipher.c | 8 
 drivers/crypto/bcm/cipher.h | 3 +--
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/crypto/bcm/cipher.c b/drivers/crypto/bcm/cipher.c
index 8685c7e4debd..537a67483aa3 100644
--- a/drivers/crypto/bcm/cipher.c
+++ b/drivers/crypto/bcm/cipher.c
@@ -1367,11 +1367,11 @@ static int handle_aead_req(struct iproc_reqctx_s *rctx)
 * expects AAD to include just SPI and seqno. So
 * subtract off the IV len.
 */
-   aead_parms.assoc_size -= GCM_ESP_IV_SIZE;
+   aead_parms.assoc_size -= GCM_RFC4106_IV_SIZE;
 
if (rctx->is_encrypt) {
aead_parms.return_iv = true;
-   aead_parms.ret_iv_len = GCM_ESP_IV_SIZE;
+   aead_parms.ret_iv_len = GCM_RFC4106_IV_SIZE;
aead_parms.ret_iv_off = GCM_ESP_SALT_SIZE;
}
} else {
@@ -3255,7 +3255,7 @@ static struct iproc_alg_s driver_algs[] = {
.cra_flags = CRYPTO_ALG_NEED_FALLBACK
 },
 .setkey = aead_gcm_esp_setkey,
-.ivsize = GCM_ESP_IV_SIZE,
+.ivsize = GCM_RFC4106_IV_SIZE,
 .maxauthsize = AES_BLOCK_SIZE,
 },
 .cipher_info = {
@@ -3301,7 +3301,7 @@ static struct iproc_alg_s driver_algs[] = {
.cra_flags = CRYPTO_ALG_NEED_FALLBACK
 },
 .setkey = rfc4543_gcm_esp_setkey,
-.ivsize = GCM_ESP_IV_SIZE,
+.ivsize = GCM_RFC4106_IV_SIZE,
 .maxauthsize = AES_BLOCK_SIZE,
 },
 .cipher_info = {
diff --git a/drivers/crypto/bcm/cipher.h b/drivers/crypto/bcm/cipher.h
index 57a55eb2a255..763c425c41ca 100644
--- a/drivers/crypto/bcm/cipher.h
+++ b/drivers/crypto/bcm/cipher.h
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -39,8 +40,6 @@
 #define ARC4_STATE_SIZE 4
 
 #define CCM_AES_IV_SIZE16
-#define GCM_AES_IV_SIZE12
-#define GCM_ESP_IV_SIZE 8
 #define CCM_ESP_IV_SIZE 8
 #define RFC4543_ICV_SIZE   16
 
-- 
2.13.0



[PATCH 04/11] crypto: nx - Use GCM IV size constant

2017-08-22 Thread Corentin Labbe
This patch replace GCM IV size value by their constant name.

Signed-off-by: Corentin Labbe 
---
 drivers/crypto/nx/nx-aes-gcm.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/nx/nx-aes-gcm.c b/drivers/crypto/nx/nx-aes-gcm.c
index abd465f479c4..a810596b97c2 100644
--- a/drivers/crypto/nx/nx-aes-gcm.c
+++ b/drivers/crypto/nx/nx-aes-gcm.c
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -433,7 +434,7 @@ static int gcm_aes_nx_encrypt(struct aead_request *req)
struct nx_gcm_rctx *rctx = aead_request_ctx(req);
char *iv = rctx->iv;
 
-   memcpy(iv, req->iv, 12);
+   memcpy(iv, req->iv, GCM_AES_IV_SIZE);
 
return gcm_aes_nx_crypt(req, 1, req->assoclen);
 }
@@ -443,7 +444,7 @@ static int gcm_aes_nx_decrypt(struct aead_request *req)
struct nx_gcm_rctx *rctx = aead_request_ctx(req);
char *iv = rctx->iv;
 
-   memcpy(iv, req->iv, 12);
+   memcpy(iv, req->iv, GCM_AES_IV_SIZE);
 
return gcm_aes_nx_crypt(req, 0, req->assoclen);
 }
@@ -498,7 +499,7 @@ struct aead_alg nx_gcm_aes_alg = {
},
.init= nx_crypto_ctx_aes_gcm_init,
.exit= nx_crypto_ctx_aead_exit,
-   .ivsize  = 12,
+   .ivsize  = GCM_AES_IV_SIZE,
.maxauthsize = AES_BLOCK_SIZE,
.setkey  = gcm_aes_nx_set_key,
.encrypt = gcm_aes_nx_encrypt,
@@ -516,7 +517,7 @@ struct aead_alg nx_gcm4106_aes_alg = {
},
.init= nx_crypto_ctx_aes_gcm_init,
.exit= nx_crypto_ctx_aead_exit,
-   .ivsize  = 8,
+   .ivsize  = GCM_RFC4106_IV_SIZE,
.maxauthsize = AES_BLOCK_SIZE,
.setkey  = gcm4106_aes_nx_set_key,
.setauthsize = gcm4106_aes_nx_setauthsize,
-- 
2.13.0



[PATCH 05/11] crypto: atmel - Use GCM IV size constant

2017-08-22 Thread Corentin Labbe
This patch replace GCM IV size value by their constant name.

Signed-off-by: Corentin Labbe 
---
 drivers/crypto/atmel-aes.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c
index 29e20c37f3a6..903fd43f23a5 100644
--- a/drivers/crypto/atmel-aes.c
+++ b/drivers/crypto/atmel-aes.c
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1532,7 +1533,7 @@ static int atmel_aes_gcm_start(struct atmel_aes_dev *dd)
if (err)
return atmel_aes_complete(dd, err);
 
-   if (likely(ivsize == 12)) {
+   if (likely(ivsize == GCM_AES_IV_SIZE)) {
memcpy(ctx->j0, iv, ivsize);
ctx->j0[3] = cpu_to_be32(1);
return atmel_aes_gcm_process(dd);
@@ -1820,7 +1821,7 @@ static struct aead_alg aes_gcm_alg = {
.decrypt= atmel_aes_gcm_decrypt,
.init   = atmel_aes_gcm_init,
.exit   = atmel_aes_gcm_exit,
-   .ivsize = 12,
+   .ivsize = GCM_AES_IV_SIZE,
.maxauthsize= AES_BLOCK_SIZE,
 
.base = {
-- 
2.13.0



[PATCH 03/11] crypto: ccp - Use GCM IV size constant

2017-08-22 Thread Corentin Labbe
This patch replace GCM IV size value by their constant name.

Signed-off-by: Corentin Labbe 
---
 drivers/crypto/ccp/ccp-crypto-aes-galois.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/crypto/ccp/ccp-crypto-aes-galois.c 
b/drivers/crypto/ccp/ccp-crypto-aes-galois.c
index 52313524a4dd..ff02b713c6f6 100644
--- a/drivers/crypto/ccp/ccp-crypto-aes-galois.c
+++ b/drivers/crypto/ccp/ccp-crypto-aes-galois.c
@@ -19,13 +19,12 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
 #include "ccp-crypto.h"
 
-#defineAES_GCM_IVSIZE  12
-
 static int ccp_aes_gcm_complete(struct crypto_async_request *async_req, int 
ret)
 {
return ret;
@@ -95,9 +94,9 @@ static int ccp_aes_gcm_crypt(struct aead_request *req, bool 
encrypt)
 */
 
/* Prepare the IV: 12 bytes + an integer (counter) */
-   memcpy(rctx->iv, req->iv, AES_GCM_IVSIZE);
+   memcpy(rctx->iv, req->iv, GCM_AES_IV_SIZE);
for (i = 0; i < 3; i++)
-   rctx->iv[i + AES_GCM_IVSIZE] = 0;
+   rctx->iv[i + GCM_AES_IV_SIZE] = 0;
rctx->iv[AES_BLOCK_SIZE - 1] = 1;
 
/* Set up a scatterlist for the IV */
@@ -160,7 +159,7 @@ static struct aead_alg ccp_aes_gcm_defaults = {
.encrypt = ccp_aes_gcm_encrypt,
.decrypt = ccp_aes_gcm_decrypt,
.init = ccp_aes_gcm_cra_init,
-   .ivsize = AES_GCM_IVSIZE,
+   .ivsize = GCM_AES_IV_SIZE,
.maxauthsize = AES_BLOCK_SIZE,
.base = {
.cra_flags  = CRYPTO_ALG_TYPE_ABLKCIPHER |
-- 
2.13.0



[PATCH 02/11] crypto: caam - Use GCM IV size constant

2017-08-22 Thread Corentin Labbe
This patch replace GCM IV size value by their constant name.

Signed-off-by: Corentin Labbe 
---
 drivers/crypto/caam/caamalg.c | 10 +-
 drivers/crypto/caam/compat.h  |  1 +
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c
index 54f3b375a453..baa8dd52472d 100644
--- a/drivers/crypto/caam/caamalg.c
+++ b/drivers/crypto/caam/caamalg.c
@@ -992,7 +992,7 @@ static void init_gcm_job(struct aead_request *req,
struct caam_ctx *ctx = crypto_aead_ctx(aead);
unsigned int ivsize = crypto_aead_ivsize(aead);
u32 *desc = edesc->hw_desc;
-   bool generic_gcm = (ivsize == 12);
+   bool generic_gcm = (ivsize == GCM_AES_IV_SIZE);
unsigned int last;
 
init_aead_job(req, edesc, all_contig, encrypt);
@@ -1004,7 +1004,7 @@ static void init_gcm_job(struct aead_request *req,
 
/* Read GCM IV */
append_cmd(desc, CMD_FIFO_LOAD | FIFOLD_CLASS_CLASS1 | IMMEDIATE |
-FIFOLD_TYPE_IV | FIFOLD_TYPE_FLUSH1 | 12 | last);
+FIFOLD_TYPE_IV | FIFOLD_TYPE_FLUSH1 | GCM_AES_IV_SIZE 
| last);
/* Append Salt */
if (!generic_gcm)
append_data(desc, ctx->key + ctx->cdata.keylen, 4);
@@ -1953,7 +1953,7 @@ static struct caam_aead_alg driver_aeads[] = {
.setauthsize = rfc4106_setauthsize,
.encrypt = ipsec_gcm_encrypt,
.decrypt = ipsec_gcm_decrypt,
-   .ivsize = 8,
+   .ivsize = GCM_RFC4106_IV_SIZE,
.maxauthsize = AES_BLOCK_SIZE,
},
.caam = {
@@ -1971,7 +1971,7 @@ static struct caam_aead_alg driver_aeads[] = {
.setauthsize = rfc4543_setauthsize,
.encrypt = ipsec_gcm_encrypt,
.decrypt = ipsec_gcm_decrypt,
-   .ivsize = 8,
+   .ivsize = GCM_RFC4543_IV_SIZE,
.maxauthsize = AES_BLOCK_SIZE,
},
.caam = {
@@ -1990,7 +1990,7 @@ static struct caam_aead_alg driver_aeads[] = {
.setauthsize = gcm_setauthsize,
.encrypt = gcm_encrypt,
.decrypt = gcm_decrypt,
-   .ivsize = 12,
+   .ivsize = GCM_AES_IV_SIZE,
.maxauthsize = AES_BLOCK_SIZE,
},
.caam = {
diff --git a/drivers/crypto/caam/compat.h b/drivers/crypto/caam/compat.h
index 7149cd2492e0..5b8d930f3dd8 100644
--- a/drivers/crypto/caam/compat.h
+++ b/drivers/crypto/caam/compat.h
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-- 
2.13.0



[PATCH 01/11] crypto: gcm - add GCM IV size constant

2017-08-22 Thread Corentin Labbe
Many GCM users use directly GCM IV size instead of using some constant.

This patch add all IV size constant used by GCM.

Signed-off-by: Corentin Labbe 
---
 include/crypto/gcm.h | 8 
 1 file changed, 8 insertions(+)
 create mode 100644 include/crypto/gcm.h

diff --git a/include/crypto/gcm.h b/include/crypto/gcm.h
new file mode 100644
index ..c50e057ea17e
--- /dev/null
+++ b/include/crypto/gcm.h
@@ -0,0 +1,8 @@
+#ifndef _CRYPTO_GCM_H
+#define _CRYPTO_GCM_H
+
+#define GCM_AES_IV_SIZE 12
+#define GCM_RFC4106_IV_SIZE 8
+#define GCM_RFC4543_IV_SIZE 8
+
+#endif
-- 
2.13.0



[PATCH 00/11] crypto: gcm - add GCM IV size constant

2017-08-22 Thread Corentin Labbe
Many GCM users use directly GCM IV size instead of using some constant.

This patch add all IV size constant used by GCM and convert drivers for using 
them..

Corentin Labbe (11):
  crypto: gcm - add GCM iv size constant
  crypto: caam - Use GCM IV size constant
  crypto: ccp - Use GCM IV size constant
  crypto: nx - Use GCM IV size constant
  crypto: atmel - Use GCM IV size constant
  crypto: bcm - Use GCM IV size constant
  crypto: mediatek - Use GCM IV size constant
  crypto: chelsio - Use GCM IV size constant
  crypto: omap - Use GCM IV size constant
  crypto: gcm - Use GCM IV size constant
  crypto: aesni - Use GCM IV size constant

 arch/x86/crypto/aesni-intel_glue.c |  7 ---
 crypto/gcm.c   | 23 ---
 drivers/crypto/atmel-aes.c |  5 +++--
 drivers/crypto/bcm/cipher.c|  8 
 drivers/crypto/bcm/cipher.h|  3 +--
 drivers/crypto/caam/caamalg.c  | 10 +-
 drivers/crypto/caam/compat.h   |  1 +
 drivers/crypto/ccp/ccp-crypto-aes-galois.c |  9 -
 drivers/crypto/chelsio/chcr_algo.c |  9 +
 drivers/crypto/mediatek/mtk-aes.c  |  3 ++-
 drivers/crypto/nx/nx-aes-gcm.c |  9 +
 drivers/crypto/omap-aes-gcm.c  |  7 ---
 drivers/crypto/omap-aes.c  |  5 +++--
 include/crypto/gcm.h   |  8 
 14 files changed, 61 insertions(+), 46 deletions(-)
 create mode 100644 include/crypto/gcm.h

-- 
2.13.0



Re: [PATCH resend] timers: Fix excessive granularity of new timers after a nohz idle

2017-08-22 Thread Nicholas Piggin
On Tue, 22 Aug 2017 09:45:46 +0200 (CEST)
Thomas Gleixner  wrote:

> On Tue, 22 Aug 2017, Nicholas Piggin wrote:
> > I would have preferred to get comments from the timer maintainers, but
> > they've been busy or away for the past copule of weeks. Perhaps you
> > would consider carrying it until then?  
> 
> Yes, I was on vacation, but that patch never hit my LKML inbox 

Hmm okay. Well that's fine, we're just getting done testing it here.

> 
> > diff --git a/kernel/time/timer.c b/kernel/time/timer.c
> > index 8f5d1bf18854..dd7be9fe6839 100644
> > --- a/kernel/time/timer.c
> > +++ b/kernel/time/timer.c
> > @@ -203,6 +203,7 @@ struct timer_base {
> > boolmigration_enabled;
> > boolnohz_active;
> > boolis_idle;
> > +   boolwas_idle; /* was it idle since last run/fwded 
> > */  
> 
> Please do not use tail comments. They are a horrible habit and disturb the
> reading flow.

Sure.

> I'm not fond of that name either. Something like forward_clk
> or a similar self explaining name would be appreciated.

Well I actually had that initially (must_forward). But on the other
hand that's less explanatory about the state of the timer base I thought.
Anyway I could go either way and you're going to be looking at this code
more than me in future :)

> 
> > /*
> > @@ -938,6 +945,13 @@ __mod_timer(struct timer_list *timer, unsigned long 
> > expires, bool pending_only)
> >  * same array bucket then just return:
> >  */
> > if (timer_pending(timer)) {
> > +   /*
> > +* The downside of this optimization is that it can result in
> > +* larger granularity than you would get from adding a new
> > +* timer with this expiry. Would a timer flag for networking
> > +* be appropriate, then we can try to keep expiry of general
> > +* timers within ~1/8th of their interval?  
> 
> This really depends on the timer usage type.
> 
> If you use it merily for TCP timeouts or similar things, then this does not
> matter at all because then the timer is the safety net in case something
> goes wrong. If you lose packets on the transport the larger granularity is
> the least of your worries.
> 
> From earlier discussions with the networking folks these timeouts are the
> reason for this optimization because you avoid the expensive
> dequeue/requeue operation if the successful communication is fast.
> 
> If the timer has a short relative expiry and is used for sending packets or
> similar purposes, then it usually sits in the first bucket and has no
> granularity issues anyway. But from staring at trace data provided by
> google and facebook these timer are not rearmed while pending, they fire,
> do networking stuff and then get rearmed.
> 
> So I rather avoid that kind of misleading comment. The first sentence
> surely can stay.

Right. The question was actually there for you to answer, so thanks. I
can certainly understand the use-case and importance of keeping it light.

> Other than that, nice detective work!

Thanks for taking a look (and thanks everyone who's been testing and
hacking on it). Do you want me to re-send with the changes?

Thanks,
Nick


Re: RCU lockup issues when CONFIG_SOFTLOCKUP_DETECTOR=n - any one else seeing this?

2017-08-22 Thread Jonathan Cameron
On Mon, 21 Aug 2017 13:55:04 -0700
David Miller  wrote:

> From: Nicholas Piggin 
> Date: Tue, 22 Aug 2017 00:19:28 +1000
> 
> > Thanks here's an updated version with a couple more bugs fixed. If
> > you could try testing, that would be much appreciated.  
> 
> I'm not getting RCU stalls on sparc64 any longer with this patch.
> 
> I'm really happy you guys were able to figure out what was going
> wrong. :-)
> 
> Feel free to add my Tested-by:
> 

Like wise - 16 hours of clean run with the latest

Tested-by: Jonathan Cameron 

Thanks for all the hard work everyone put into this one, great to
cross it off the list!

Jonathan


Re: [PATCH resend] timers: Fix excessive granularity of new timers after a nohz idle

2017-08-22 Thread Thomas Gleixner
On Tue, 22 Aug 2017, Nicholas Piggin wrote:
> I would have preferred to get comments from the timer maintainers, but
> they've been busy or away for the past copule of weeks. Perhaps you
> would consider carrying it until then?

Yes, I was on vacation, but that patch never hit my LKML inbox 

> diff --git a/kernel/time/timer.c b/kernel/time/timer.c
> index 8f5d1bf18854..dd7be9fe6839 100644
> --- a/kernel/time/timer.c
> +++ b/kernel/time/timer.c
> @@ -203,6 +203,7 @@ struct timer_base {
>   boolmigration_enabled;
>   boolnohz_active;
>   boolis_idle;
> + boolwas_idle; /* was it idle since last run/fwded */

Please do not use tail comments. They are a horrible habit and disturb the
reading flow. I'm not fond of that name either. Something like forward_clk
or a similar self explaining name would be appreciated.

>   /*
> @@ -938,6 +945,13 @@ __mod_timer(struct timer_list *timer, unsigned long 
> expires, bool pending_only)
>* same array bucket then just return:
>*/
>   if (timer_pending(timer)) {
> + /*
> +  * The downside of this optimization is that it can result in
> +  * larger granularity than you would get from adding a new
> +  * timer with this expiry. Would a timer flag for networking
> +  * be appropriate, then we can try to keep expiry of general
> +  * timers within ~1/8th of their interval?

This really depends on the timer usage type.

If you use it merily for TCP timeouts or similar things, then this does not
matter at all because then the timer is the safety net in case something
goes wrong. If you lose packets on the transport the larger granularity is
the least of your worries.

>From earlier discussions with the networking folks these timeouts are the
reason for this optimization because you avoid the expensive
dequeue/requeue operation if the successful communication is fast.

If the timer has a short relative expiry and is used for sending packets or
similar purposes, then it usually sits in the first bucket and has no
granularity issues anyway. But from staring at trace data provided by
google and facebook these timer are not rearmed while pending, they fire,
do networking stuff and then get rearmed.

So I rather avoid that kind of misleading comment. The first sentence
surely can stay.

Other than that, nice detective work!

Thanks,

tglx


Re: [PATCH 2/2] scsi: Preserve retry counter through scsi_prep_fn

2017-08-22 Thread h...@lst.de
On Mon, Aug 21, 2017 at 05:14:00PM -0500, Brian King wrote:
> Save / restore the retry counter in scsi_cmd in scsi_init_command.
> This allows us to go back through scsi_init_command for retries
> and not forget we are doing a retry.

So where will we initialize it to zero now?


Re: [PATCH 1/2] scsi: Move scsi_cmd->jiffies_at_alloc initialization to allocation time

2017-08-22 Thread h...@lst.de
On Mon, Aug 21, 2017 at 05:13:20PM -0500, Brian King wrote:
> Move the initialization of scsi_cmd->jiffies_at_alloc to allocation
> time rather than prep time. Also ensure that jiffies_at_alloc
> is preserved when we go through prep. This lets us send retries
> through prep again and not break the overall retry timer logic
> in scsi_softirq_done.
> 
> Suggested-by: Bart Van Assche 
> Signed-off-by: Brian King 

As far as I can tell this will never set jiffies_at_alloc for the
blk-mq path.


Re: [PATCH 0/2] Allow scsi_prep_fn to occur for retried commands

2017-08-22 Thread Abdul Haleem
On Mon, 2017-08-21 at 17:11 -0500, Brian King wrote:
> The following two patches address the hang issue being observed
> with Bart's patch on powerpc. The first patch moves the initialization
> of jiffies_at_alloc from scsi_init_command to scsi_init_rq, and ensures
> we don't zero jiffies_at_alloc in scsi_init_command. The second patch
> saves / restores the retry counter in scsi_init_command which lets us
> go through scsi_init_command for retries and not forget why we were
> there. 
> 
> These patches have only been boot tested on my Power machine with ipr
> to ensure they fix the issue I was seeing.
> 
> -Brian
> 

Thank you Brian and Bart, for your efforts to fix this bug.

I tested these patches on my PowerPC machine and system booted fine.

[PATCHv2 1/2] scsi: Move scsi_cmd->jiffies_at_alloc initialization to
allocation time
[PATCH 2/2] scsi: Preserve retry counter through scsi_prep_fn

Reported-and-Tested-by: Abdul Haleem 

-- 
Regard's

Abdul Haleem
IBM Linux Technology Centre





Re: 32-bit powerpc, aty128fb: vmap allocation for size 135168 failed

2017-08-22 Thread Michael Ellerman
Meelis Roos  writes:

>> Meelis Roos  writes:
>> 
>> > I was trying 4.13.0-rc5-00075-gac9a40905a61 on my PowerMac G4 with 1G 
>> > RAM and after some time of sddm respawning and X trying to restart, 
>> > dmesg is full of messages about vmap allocation failures.
>> 
>> Did it just start happening? ie. did rc4 work?
>
> It goes back to at least 4.0 - that's the oldest kernel I had laying 
> around precompiled. The messages about ROM signature changed somewehere 
> between 4.0 and 4.7 (4.7 is already like 4.13) but after some time, the 
> same vmalloc errors appear.
>
> Maybe the userspace has changed with more respawning that brings the 
> problem out.
>
> I tried to read the code but I do not understand it yet. The warning 
> seems to come from generic pci_map_rom() checking ROM size, and 
> returning rom pointer to aty128fb (it returns resource size too but that 
> is ignored). aty128fb starts to look at the x86 PCI ROM signature again 
> but does not tell that the signature is missing. How come?

OK thanks. Unfortunately I can't really help on the graphics side of
things. Hopefully someone on Cc has more clues than me.

cheers