All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: Alexey Kardashevskiy <aik@ozlabs.ru>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Paul Mackerras <paulus@samba.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Michael Neuling <mikey@neuling.org>,
	David Gibson <david@gibson.dropbear.id.au>,
	Alexander Graf <agraf@suse.de>
Cc: linuxppc-dev@lists.ozlabs.org, qemu-devel@nongnu.org,
	qemu-ppc@nongnu.org
Subject: [PATCH 2/3] powerpc: Update cpu_user_features2 in scan_features()
Date: Fri, 15 Apr 2016 12:07:24 +1000	[thread overview]
Message-ID: <20160415120724.40180a50@kryten> (raw)
In-Reply-To: <20160404211112.66b0756f@kryten>

scan_features() updates cpu_user_features but not cpu_user_features2.

Amongst other things, cpu_user_features2 contains the user TM feature
bits which we must keep in sync with the kernel TM feature bit.

Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: stable@vger.kernel.org
---
 arch/powerpc/kernel/prom.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 9a3a7c6..99709bb 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -148,23 +148,24 @@ static struct ibm_pa_feature {
 	unsigned long	cpu_features;	/* CPU_FTR_xxx bit */
 	unsigned long	mmu_features;	/* MMU_FTR_xxx bit */
 	unsigned int	cpu_user_ftrs;	/* PPC_FEATURE_xxx bit */
+	unsigned int	cpu_user_ftrs2;	/* PPC_FEATURE2_xxx bit */
 	unsigned char	pabyte;		/* byte number in ibm,pa-features */
 	unsigned char	pabit;		/* bit number (big-endian) */
 	unsigned char	invert;		/* if 1, pa bit set => clear feature */
 } ibm_pa_features[] __initdata = {
-	{0, 0, PPC_FEATURE_HAS_MMU,	0, 0, 0},
-	{0, 0, PPC_FEATURE_HAS_FPU,	0, 1, 0},
-	{CPU_FTR_CTRL, 0, 0,		0, 3, 0},
-	{CPU_FTR_NOEXECUTE, 0, 0,	0, 6, 0},
-	{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, 0, 5, 0, 0},
+	{0, 0, PPC_FEATURE_HAS_MMU, 0,		0, 0, 0},
+	{0, 0, PPC_FEATURE_HAS_FPU, 0,		0, 1, 0},
+	{CPU_FTR_CTRL, 0, 0, 0,			0, 3, 0},
+	{CPU_FTR_NOEXECUTE, 0, 0, 0,		0, 6, 0},
+	{CPU_FTR_NODSISRALIGN, 0, 0, 0,		1, 1, 1},
+	{0, MMU_FTR_CI_LARGE_PAGE, 0, 0,		1, 2, 0},
+	{CPU_FTR_REAL_LE, PPC_FEATURE_TRUE_LE, 0, 0, 5, 0, 0},
 	/*
 	 * If the kernel doesn't support TM (ie. CONFIG_PPC_TRANSACTIONAL_MEM=n),
 	 * we don't want to turn on CPU_FTR_TM here, so we use CPU_FTR_TM_COMP
 	 * which is 0 if the kernel doesn't support TM.
 	 */
-	{CPU_FTR_TM_COMP, 0, 0,		22, 0, 0},
+	{CPU_FTR_TM_COMP, 0, 0, 0,		22, 0, 0},
 };
 
 static void __init scan_features(unsigned long node, const unsigned char *ftrs,
@@ -195,10 +196,12 @@ static void __init scan_features(unsigned long node, const unsigned char *ftrs,
 		if (bit ^ fp->invert) {
 			cur_cpu_spec->cpu_features |= fp->cpu_features;
 			cur_cpu_spec->cpu_user_features |= fp->cpu_user_ftrs;
+			cur_cpu_spec->cpu_user_features2 |= fp->cpu_user_ftrs2;
 			cur_cpu_spec->mmu_features |= fp->mmu_features;
 		} else {
 			cur_cpu_spec->cpu_features &= ~fp->cpu_features;
 			cur_cpu_spec->cpu_user_features &= ~fp->cpu_user_ftrs;
+			cur_cpu_spec->cpu_user_features2 &= ~fp->cpu_user_ftrs2;
 			cur_cpu_spec->mmu_features &= ~fp->mmu_features;
 		}
 	}
-- 
2.7.4

WARNING: multiple messages have this Message-ID (diff)
From: Anton Blanchard <anton@samba.org>
To: Alexey Kardashevskiy <aik@ozlabs.ru>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Paul Mackerras <paulus@samba.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Michael Neuling <mikey@neuling.org>,
	David Gibson <david@gibson.dropbear.id.au>,
	Alexander Graf <agraf@suse.de>
Cc: linuxppc-dev@lists.ozlabs.org, qemu-devel@nongnu.org,
	qemu-ppc@nongnu.org
Subject: [Qemu-devel] [PATCH 2/3] powerpc: Update cpu_user_features2 in scan_features()
Date: Fri, 15 Apr 2016 12:07:24 +1000	[thread overview]
Message-ID: <20160415120724.40180a50@kryten> (raw)
In-Reply-To: <20160404211112.66b0756f@kryten>

scan_features() updates cpu_user_features but not cpu_user_features2.

Amongst other things, cpu_user_features2 contains the user TM feature
bits which we must keep in sync with the kernel TM feature bit.

Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: stable@vger.kernel.org
---
 arch/powerpc/kernel/prom.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 9a3a7c6..99709bb 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -148,23 +148,24 @@ static struct ibm_pa_feature {
 	unsigned long	cpu_features;	/* CPU_FTR_xxx bit */
 	unsigned long	mmu_features;	/* MMU_FTR_xxx bit */
 	unsigned int	cpu_user_ftrs;	/* PPC_FEATURE_xxx bit */
+	unsigned int	cpu_user_ftrs2;	/* PPC_FEATURE2_xxx bit */
 	unsigned char	pabyte;		/* byte number in ibm,pa-features */
 	unsigned char	pabit;		/* bit number (big-endian) */
 	unsigned char	invert;		/* if 1, pa bit set => clear feature */
 } ibm_pa_features[] __initdata = {
-	{0, 0, PPC_FEATURE_HAS_MMU,	0, 0, 0},
-	{0, 0, PPC_FEATURE_HAS_FPU,	0, 1, 0},
-	{CPU_FTR_CTRL, 0, 0,		0, 3, 0},
-	{CPU_FTR_NOEXECUTE, 0, 0,	0, 6, 0},
-	{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, 0, 5, 0, 0},
+	{0, 0, PPC_FEATURE_HAS_MMU, 0,		0, 0, 0},
+	{0, 0, PPC_FEATURE_HAS_FPU, 0,		0, 1, 0},
+	{CPU_FTR_CTRL, 0, 0, 0,			0, 3, 0},
+	{CPU_FTR_NOEXECUTE, 0, 0, 0,		0, 6, 0},
+	{CPU_FTR_NODSISRALIGN, 0, 0, 0,		1, 1, 1},
+	{0, MMU_FTR_CI_LARGE_PAGE, 0, 0,		1, 2, 0},
+	{CPU_FTR_REAL_LE, PPC_FEATURE_TRUE_LE, 0, 0, 5, 0, 0},
 	/*
 	 * If the kernel doesn't support TM (ie. CONFIG_PPC_TRANSACTIONAL_MEM=n),
 	 * we don't want to turn on CPU_FTR_TM here, so we use CPU_FTR_TM_COMP
 	 * which is 0 if the kernel doesn't support TM.
 	 */
-	{CPU_FTR_TM_COMP, 0, 0,		22, 0, 0},
+	{CPU_FTR_TM_COMP, 0, 0, 0,		22, 0, 0},
 };
 
 static void __init scan_features(unsigned long node, const unsigned char *ftrs,
@@ -195,10 +196,12 @@ static void __init scan_features(unsigned long node, const unsigned char *ftrs,
 		if (bit ^ fp->invert) {
 			cur_cpu_spec->cpu_features |= fp->cpu_features;
 			cur_cpu_spec->cpu_user_features |= fp->cpu_user_ftrs;
+			cur_cpu_spec->cpu_user_features2 |= fp->cpu_user_ftrs2;
 			cur_cpu_spec->mmu_features |= fp->mmu_features;
 		} else {
 			cur_cpu_spec->cpu_features &= ~fp->cpu_features;
 			cur_cpu_spec->cpu_user_features &= ~fp->cpu_user_ftrs;
+			cur_cpu_spec->cpu_user_features2 &= ~fp->cpu_user_ftrs2;
 			cur_cpu_spec->mmu_features &= ~fp->mmu_features;
 		}
 	}
-- 
2.7.4

  parent reply	other threads:[~2016-04-15  2:07 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-04  6:44 PR KVM and TM issues Anton Blanchard
2016-04-04  7:00 ` Alexey Kardashevskiy
2016-04-04 10:43   ` Anton Blanchard
2016-04-04 10:43     ` [Qemu-devel] " Anton Blanchard
2016-04-04 11:09     ` [PATCH] spapr: Don't set the TM ibm,pa-features bit in PR KVM mode Anton Blanchard
2016-04-04 11:09       ` [Qemu-devel] [PATCH] spapr: Don't set the TM ibm, pa-features " Anton Blanchard
2016-04-04 11:13       ` Alexander Graf
2016-04-04 11:13         ` [Qemu-devel] " Alexander Graf
2016-04-30  0:48         ` [PATCH v2] spapr: Don't set the TM ibm,pa-features " Anton Blanchard
2016-04-30  0:48           ` [Qemu-devel] [PATCH v2] spapr: Don't set the TM ibm, pa-features " Anton Blanchard
2016-05-02  9:36           ` haris iqbal
2016-05-27  4:52           ` David Gibson
2016-05-27  4:52             ` [Qemu-devel] " David Gibson
2016-06-07 12:28           ` [PATCH 1/2] Add PowerPC AT_HWCAP2 definitions Anton Blanchard
2016-06-07 12:28             ` [Qemu-devel] " Anton Blanchard
2016-06-07 12:32             ` [PATCH 2/2] spapr: Better handling of ibm,pa-features TM bit Anton Blanchard
2016-06-07 12:32               ` [Qemu-devel] [PATCH 2/2] spapr: Better handling of ibm, pa-features " Anton Blanchard
2016-06-08  2:26               ` [PATCH 2/2] spapr: Better handling of ibm,pa-features " David Gibson
2016-06-08  2:26                 ` [Qemu-devel] [PATCH 2/2] spapr: Better handling of ibm, pa-features " David Gibson
2016-07-05  5:19                 ` [PATCH 0/3] Rework " Sam Bobroff
2016-07-05  5:19                   ` [Qemu-devel] " Sam Bobroff
2016-07-05  5:19                   ` [PATCH 1/3] spapr: Disable ibm, pa-features HTM bit Sam Bobroff
2016-07-05  5:19                     ` [Qemu-devel] " Sam Bobroff
2016-07-05  5:51                     ` David Gibson
2016-07-05  5:51                       ` [Qemu-devel] " David Gibson
2016-07-05  5:19                   ` [PATCH 2/3] Add KVM_CAP_PPC_HTM to linux/kvm.h Sam Bobroff
2016-07-05  5:19                     ` [Qemu-devel] " Sam Bobroff
2016-07-05  6:05                     ` David Gibson
2016-07-05  6:05                       ` [Qemu-devel] " David Gibson
2016-07-06  4:41                       ` Sam Bobroff
2016-07-06  4:41                         ` [Qemu-devel] " Sam Bobroff
2016-07-06  5:09                         ` David Gibson
2016-07-06  5:09                           ` [Qemu-devel] " David Gibson
2016-07-05  5:19                   ` [PATCH 3/3] spapr: Set ibm, pa-features HTM from KVM_CAP_PPC_HTM Sam Bobroff
2016-07-05  5:19                     ` [Qemu-devel] " Sam Bobroff
2016-07-05  6:52                     ` David Gibson
2016-07-05  6:52                       ` [Qemu-devel] " David Gibson
2016-07-06  5:35                   ` [PATCH v2 0/3] Rework spapr: Better handling of ibm, pa-features TM bit Sam Bobroff
2016-07-06  5:35                     ` [Qemu-devel] " Sam Bobroff
2016-07-06  5:35                     ` [PATCH v2 1/3] spapr: Disable ibm, pa-features HTM bit Sam Bobroff
2016-07-06  5:35                       ` [Qemu-devel] " Sam Bobroff
2016-07-07  4:38                       ` David Gibson
2016-07-07  4:38                         ` [Qemu-devel] " David Gibson
2016-07-06  5:35                     ` [PATCH v2 2/3] Add KVM_CAP_PPC_HTM to linux/kvm.h Sam Bobroff
2016-07-06  5:35                       ` [Qemu-devel] " Sam Bobroff
2016-07-07  4:38                       ` David Gibson
2016-07-07  4:38                         ` [Qemu-devel] " David Gibson
2016-07-06  5:35                     ` [PATCH v2 3/3] spapr: Set ibm, pa-features HTM from KVM_CAP_PPC_HTM Sam Bobroff
2016-07-06  5:35                       ` [Qemu-devel] " Sam Bobroff
2016-07-07  4:39                       ` David Gibson
2016-07-07  4:39                         ` [Qemu-devel] " David Gibson
2016-06-08  2:19             ` [PATCH 1/2] Add PowerPC AT_HWCAP2 definitions David Gibson
2016-06-08  2:19               ` [Qemu-devel] " David Gibson
2016-04-05  2:12       ` [PATCH] spapr: Don't set the TM ibm,pa-features bit in PR KVM mode Paul Mackerras
2016-04-05  2:12         ` [Qemu-devel] [PATCH] spapr: Don't set the TM ibm, pa-features " Paul Mackerras
2016-04-05  4:09         ` [PATCH] spapr: Don't set the TM ibm,pa-features " David Gibson
2016-04-05  4:09           ` [Qemu-devel] [PATCH] spapr: Don't set the TM ibm, pa-features " David Gibson
2016-04-05  7:33           ` [PATCH] spapr: Don't set the TM ibm,pa-features " Alexey Kardashevskiy
2016-04-05  7:33             ` [Qemu-devel] [PATCH] spapr: Don't set the TM ibm, pa-features " Alexey Kardashevskiy
2016-04-04 11:11     ` [PATCH] powerpc: Clear user CPU feature bits if TM is disabled at runtime Anton Blanchard
2016-04-04 11:11       ` [Qemu-devel] " Anton Blanchard
2016-04-05  0:52       ` David Gibson
2016-04-05  0:52         ` [Qemu-devel] " David Gibson
2016-04-05  9:35       ` Michael Ellerman
2016-04-05  9:35         ` [Qemu-devel] " Michael Ellerman
2016-04-05  9:56         ` Benjamin Herrenschmidt
2016-04-05  9:56           ` [Qemu-devel] " Benjamin Herrenschmidt
2016-04-05 22:40           ` Michael Ellerman
2016-04-05 22:40             ` [Qemu-devel] " Michael Ellerman
2016-04-15  2:06       ` [PATCH 1/3] powerpc: scan_features() updates incorrect bits Anton Blanchard
2016-04-15  2:06         ` [Qemu-devel] " Anton Blanchard
2016-04-15 14:27         ` [1/3] " Michael Ellerman
2016-04-15 14:27           ` [Qemu-devel] " Michael Ellerman
2016-04-18  4:40           ` Michael Ellerman
2016-04-18  4:40             ` [Qemu-devel] " Michael Ellerman
2016-04-18  4:16         ` Michael Ellerman
2016-04-18  4:16           ` [Qemu-devel] " Michael Ellerman
2016-04-18 10:36         ` [PATCH v2 1/3] powerpc: scan_features() updates incorrect bits for REAL_LE Michael Ellerman
2016-04-18 10:36           ` [Qemu-devel] " Michael Ellerman
2016-04-19 10:09           ` [v2, " Michael Ellerman
2016-04-19 10:09             ` [Qemu-devel] " Michael Ellerman
2016-04-15  2:07       ` Anton Blanchard [this message]
2016-04-15  2:07         ` [Qemu-devel] [PATCH 2/3] powerpc: Update cpu_user_features2 in scan_features() Anton Blanchard
2016-04-19 10:09         ` [2/3] " Michael Ellerman
2016-04-19 10:09           ` [Qemu-devel] " Michael Ellerman
2016-04-15  2:08       ` [PATCH 3/3] powerpc: Update TM user feature bits " Anton Blanchard
2016-04-15  2:08         ` [Qemu-devel] " Anton Blanchard
2016-04-19 10:09         ` [3/3] " Michael Ellerman
2016-04-19 10:09           ` [Qemu-devel] " Michael Ellerman
2016-04-04 11:09   ` PR KVM and TM issues Michael Neuling
2016-04-05  7:29     ` Alexey Kardashevskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160415120724.40180a50@kryten \
    --to=anton@samba.org \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=benh@kernel.crashing.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mikey@neuling.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.