Skip to contentSkip to conversation

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

PATCH In review Aneesh Kumar K.V 3 participants 5 messages Nov 2, 2014 – Nov 13, 2014 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 powerpc/TM: Disable/Enable TM looking at the ibm, pa-features device tree entry

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

---
Changes from V1:
* rebase to latest linus

 arch/powerpc/kernel/prom.c | 5 +++++
 1 file changed, 5 insertions(+)
arch/powerpc/kernel/prom.c +5 -0
index 099f27e6d1b0..3e22930f15d1 100644
@@ -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,
Signature · 1 line
2.1.0
#1 lore raw
Quoted 3 lines · Aneesh Kumar K.V

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.

Quoted 25 lines

For PR guest we provide a device
tree entry with TM feature disabled in pa-features

---
Changes from V1:
* rebase to latest linus
=20

 arch/powerpc/kernel/prom.c | 5 +++++
 1 file changed, 5 insertions(+)

=20

arch/powerpc/kernel/prom.c +5 -0
index 099f27e6d1b0..3e22930f15d1 100644
@@ -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},
 };
Quoted 2 lines

=20
static void __init scan_features(unsigned long node, const unsigned char=

*ftrs,

#2 lore raw
Quoted 7 lines · Michael Neuling
Quoted 3 lines · Aneesh Kumar K.V

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 33 lines
Quoted 18 lines

For PR guest we provide a device
tree entry with TM feature disabled in pa-features

---
Changes from V1:
* rebase to latest linus

 arch/powerpc/kernel/prom.c | 5 +++++
 1 file changed, 5 insertions(+)
arch/powerpc/kernel/prom.c +0 -0
index 099f27e6d1b0..3e22930f15d1 100644
@@ -160,6 +160,11 @@ static struct ibm_pa_feature {
 	{CPU_FTR_NODSISRALIGN, 0, 0,	1, 1, 1},

arch/powerpc/kernel/prom.c static struct ibm_pa_feature { · line 170

Quoted 10 lines
arch/powerpc/kernel/prom.c +5 -0
 	{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
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev

#3 lore raw
Quoted 15 lines · Aneesh Kumar K.V
Quoted 7 lines · Michael Neuling
Quoted 3 lines · Aneesh Kumar K.V

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.

Quoted 4 lines

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

#4 lore raw
Quoted 23 lines · Michael Ellerman
Quoted 15 lines · Aneesh Kumar K.V
Quoted 7 lines · Michael Neuling
Quoted 3 lines · Aneesh Kumar K.V

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.

Quoted 4 lines

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:

Quoted 8 lines

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