[PATCH V2] powerpc/TM: Disable/Enable TM looking at the ibm, pa-features device tree entry

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE4355d

5 messages, 3 authors, 2014-11-13 · open the first message on its own page

[PATCH V2] powerpc/TM: Disable/Enable TM looking at the ibm, pa-features device tree entry

From: Aneesh Kumar K.V <hidden>
Date: 2014-11-02 14:33:03

Runtime disable transactional memory feature looking at pa-features
device tree entry. We need to do this so that we can run a kernel
built with TM config in PR mode. For PR guest we provide a device
tree entry with TM feature disabled in pa-features

Signed-off-by: Aneesh Kumar K.V <redacted>
---
Changes from V1:
* rebase to latest linus

 arch/powerpc/kernel/prom.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 099f27e6d1b0..3e22930f15d1 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -160,6 +160,11 @@ static struct ibm_pa_feature {
 	{CPU_FTR_NODSISRALIGN, 0, 0,	1, 1, 1},
 	{0, MMU_FTR_CI_LARGE_PAGE, 0,	1, 2, 0},
 	{CPU_FTR_REAL_LE, PPC_FEATURE_TRUE_LE, 5, 0, 0},
+	/*
+	 * We should use CPU_FTR_TM_COMP so that if we disable TM, it won't get
+	 * enabled via device tree
+	 */
+	{CPU_FTR_TM_COMP, 0, 0,		22, 0, 0},
 };
 
 static void __init scan_features(unsigned long node, const unsigned char *ftrs,
-- 
2.1.0

Re: [PATCH V2] powerpc/TM: Disable/Enable TM looking at the ibm, pa-features device tree entry

From: Michael Neuling <hidden>
Date: 2014-11-12 00:44:06

On Sun, 2014-11-02 at 20:02 +0530, Aneesh Kumar K.V wrote:
Runtime disable transactional memory feature looking at pa-features
device tree entry. We need to do this so that we can run a kernel
built with TM config in PR mode.=20
I'm happy to turn this off but why do we need to do this in PR mode?
Can you explain this in the commit message.
For PR guest we provide a device
tree entry with TM feature disabled in pa-features
quoted hunk
Signed-off-by: Aneesh Kumar K.V <redacted>
---
Changes from V1:
* rebase to latest linus
=20
 arch/powerpc/kernel/prom.c | 5 +++++
 1 file changed, 5 insertions(+)
=20
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 099f27e6d1b0..3e22930f15d1 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -160,6 +160,11 @@ static struct ibm_pa_feature {
 	{CPU_FTR_NODSISRALIGN, 0, 0,	1, 1, 1},
 	{0, MMU_FTR_CI_LARGE_PAGE, 0,	1, 2, 0},
 	{CPU_FTR_REAL_LE, PPC_FEATURE_TRUE_LE, 5, 0, 0},
+	/*
+	 * We should use CPU_FTR_TM_COMP so that if we disable TM, it won't get
+	 * enabled via device tree
+	 */
+	{CPU_FTR_TM_COMP, 0, 0,		22, 0, 0},
 };
=20
 static void __init scan_features(unsigned long node, const unsigned char=
 *ftrs,

Re: [PATCH V2] powerpc/TM: Disable/Enable TM looking at the ibm, pa-features device tree entry

From: Aneesh Kumar K.V <hidden>
Date: 2014-11-12 05:39:42

Michael Neuling [off-list ref] writes:
On Sun, 2014-11-02 at 20:02 +0530, Aneesh Kumar K.V wrote:
quoted
Runtime disable transactional memory feature looking at pa-features
device tree entry. We need to do this so that we can run a kernel
built with TM config in PR mode. 
I'm happy to turn this off but why do we need to do this in PR mode?
Can you explain this in the commit message.
Hmm, that commit message needs an update. I initially did the patch for
P8 PR support and wanted a mechanism to disable TM. Alex added basic TM
support for PR mode after that. So we can drop the PR part of the
commit message.

Michael Ellerman,

Let me know if you want me to send an updated version with the those
part of the commit message dropped
quoted
For PR guest we provide a device
tree entry with TM feature disabled in pa-features
quoted
Signed-off-by: Aneesh Kumar K.V <redacted>
---
Changes from V1:
* rebase to latest linus

 arch/powerpc/kernel/prom.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 099f27e6d1b0..3e22930f15d1 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -160,6 +160,11 @@ static struct ibm_pa_feature {
 	{CPU_FTR_NODSISRALIGN, 0, 0,	1, 1, 1},
 	{0, MMU_FTR_CI_LARGE_PAGE, 0,	1, 2, 0},
 	{CPU_FTR_REAL_LE, PPC_FEATURE_TRUE_LE, 5, 0, 0},
+	/*
+	 * We should use CPU_FTR_TM_COMP so that if we disable TM, it won't get
+	 * enabled via device tree
+	 */
+	{CPU_FTR_TM_COMP, 0, 0,		22, 0, 0},
 };
 
 static void __init scan_features(unsigned long node, const unsigned char *ftrs,
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH V2] powerpc/TM: Disable/Enable TM looking at the ibm, pa-features device tree entry

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2014-11-13 05:42:27

On Wed, 2014-11-12 at 11:09 +0530, Aneesh Kumar K.V wrote:
Michael Neuling [off-list ref] writes:
quoted
On Sun, 2014-11-02 at 20:02 +0530, Aneesh Kumar K.V wrote:
quoted
Runtime disable transactional memory feature looking at pa-features
device tree entry. We need to do this so that we can run a kernel
built with TM config in PR mode. 
I'm happy to turn this off but why do we need to do this in PR mode?
Can you explain this in the commit message.
Hmm, that commit message needs an update. I initially did the patch for
P8 PR support and wanted a mechanism to disable TM. Alex added basic TM
support for PR mode after that. So we can drop the PR part of the
commit message.

Michael Ellerman,

Let me know if you want me to send an updated version with the those
part of the commit message dropped
How about:

  powerpc: Disable CPU_FTR_TM if TM is disabled by firmware
  
  Firmware is allowed to communicate to us via the "ibm,pa-features" property
  that TM (Transactional Memory) support is disabled.
  
  Currently this doesn't happen on any platform we're aware of, but we should
  honor it anyway.


cheers

Re: [PATCH V2] powerpc/TM: Disable/Enable TM looking at the ibm, pa-features device tree entry

From: Aneesh Kumar K.V <hidden>
Date: 2014-11-13 06:19:50

Michael Ellerman [off-list ref] writes:
On Wed, 2014-11-12 at 11:09 +0530, Aneesh Kumar K.V wrote:
quoted
Michael Neuling [off-list ref] writes:
quoted
On Sun, 2014-11-02 at 20:02 +0530, Aneesh Kumar K.V wrote:
quoted
Runtime disable transactional memory feature looking at pa-features
device tree entry. We need to do this so that we can run a kernel
built with TM config in PR mode. 
I'm happy to turn this off but why do we need to do this in PR mode?
Can you explain this in the commit message.
Hmm, that commit message needs an update. I initially did the patch for
P8 PR support and wanted a mechanism to disable TM. Alex added basic TM
support for PR mode after that. So we can drop the PR part of the
commit message.

Michael Ellerman,

Let me know if you want me to send an updated version with the those
part of the commit message dropped
How about:

  powerpc: Disable CPU_FTR_TM if TM is disabled by firmware
  
  Firmware is allowed to communicate to us via the "ibm,pa-features" property
  that TM (Transactional Memory) support is disabled.
  
  Currently this doesn't happen on any platform we're aware of, but we should
  honor it anyway.
Looks good.

-aneesh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help