LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH] powerpc/book3e: Fix CPU feature handling on e5500
@ 2011-04-06  5:29 Kumar Gala
  2011-04-06  5:41 ` Stephen Rothwell
  0 siblings, 1 reply; 3+ messages in thread
From: Kumar Gala @ 2011-04-06  5:29 UTC (permalink / raw)
  To: linuxppc-dev

The CPU_FTRS_POSSIBLE and CPU_FTRS_ALWAYS defines did not encompass
e5500 CPU features when built for 64-bit.  This causes issues with
cpu_has_feature() as it utilizes the POSSIBLE & ALWAYS defines as part
of its check.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
* I'm concerned if its ok to assume 'enum' can handle a 64-bit mask or not.
  I'm assuming this is the reason that we use a #define on __powerpc64__

 arch/powerpc/include/asm/cputable.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h
index be3cdf9..8200e9d 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -434,7 +434,7 @@ extern const char *powerpc_base_platform;
 	    CPU_FTR_PURR | CPU_FTR_REAL_LE | CPU_FTR_NO_SLBIE_B)
 #define CPU_FTRS_COMPATIBLE	(CPU_FTR_USE_TB | CPU_FTR_PPCAS_ARCH_V2)
 
-#ifdef __powerpc64__
+#if defined(__powerpc64__) && !defined(CONFIG_PPC_BOOK3E)
 #define CPU_FTRS_POSSIBLE	\
 	    (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 |	\
 	    CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_POWER6 |	\
@@ -478,7 +478,7 @@ enum {
 };
 #endif /* __powerpc64__ */
 
-#ifdef __powerpc64__
+#if defined(__powerpc64__) && !defined(CONFIG_PPC_BOOK3E)
 #define CPU_FTRS_ALWAYS		\
 	    (CPU_FTRS_POWER3 & CPU_FTRS_RS64 & CPU_FTRS_POWER4 &	\
 	    CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & CPU_FTRS_POWER6 &	\
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [RFC][PATCH] powerpc/book3e: Fix CPU feature handling on e5500
  2011-04-06  5:29 [RFC][PATCH] powerpc/book3e: Fix CPU feature handling on e5500 Kumar Gala
@ 2011-04-06  5:41 ` Stephen Rothwell
  2011-04-06 12:26   ` Kumar Gala
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2011-04-06  5:41 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 522 bytes --]

Hi Kumar,

On Wed,  6 Apr 2011 00:29:32 -0500 Kumar Gala <galak@kernel.crashing.org> wrote:
>
> * I'm concerned if its ok to assume 'enum' can handle a 64-bit mask or not.
>   I'm assuming this is the reason that we use a #define on __powerpc64__

enums are *ints* and therefore 32 bit.  gcc can cope, but warns about it
(I think). So we must use the #define if any of the included bits are
above 2^32.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC][PATCH] powerpc/book3e: Fix CPU feature handling on e5500
  2011-04-06  5:41 ` Stephen Rothwell
@ 2011-04-06 12:26   ` Kumar Gala
  0 siblings, 0 replies; 3+ messages in thread
From: Kumar Gala @ 2011-04-06 12:26 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev


On Apr 6, 2011, at 12:41 AM, Stephen Rothwell wrote:

> Hi Kumar,
>=20
> On Wed,  6 Apr 2011 00:29:32 -0500 Kumar Gala =
<galak@kernel.crashing.org> wrote:
>>=20
>> * I'm concerned if its ok to assume 'enum' can handle a 64-bit mask =
or not.
>>  I'm assuming this is the reason that we use a #define on =
__powerpc64__
>=20
> enums are *ints* and therefore 32 bit.  gcc can cope, but warns about =
it
> (I think). So we must use the #define if any of the included bits are
> above 2^32.

Thanks, I'll rework the patch to use #define.

- k=

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-04-06 12:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-06  5:29 [RFC][PATCH] powerpc/book3e: Fix CPU feature handling on e5500 Kumar Gala
2011-04-06  5:41 ` Stephen Rothwell
2011-04-06 12:26   ` Kumar Gala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox