mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2.6.12-rc1-mm1 3/3] perfctr: 64-bit values in register descriptors
@ 2005-03-23  3:00 Mikael Pettersson
  2005-03-23  3:34 ` David Gibson
  2005-03-23  3:43 ` Stephen Rothwell
  0 siblings, 2 replies; 4+ messages in thread
From: Mikael Pettersson @ 2005-03-23  3:00 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel

- <linux/perfctr.h>: Change value fields in register descriptors
  to 64 bits. This will be needed for ppc64, and ppc32 user-space
  on ppc64 kernels, and may eventually also be needed on x86.
  We could have different descriptor types for 32 and 64-bit
  registers, but that just complicates things for no real benefit.

Signed-off-by: Mikael Pettersson <mikpe@csd.uu.se>

 include/linux/perfctr.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -rupN linux-2.6.12-rc1-mm1/include/linux/perfctr.h linux-2.6.12-rc1-mm1.perfctr-update-common/include/linux/perfctr.h
--- linux-2.6.12-rc1-mm1/include/linux/perfctr.h	2005-03-22 21:59:08.000000000 +0100
+++ linux-2.6.12-rc1-mm1.perfctr-update-common/include/linux/perfctr.h	2005-03-23 02:19:45.000000000 +0100
@@ -27,10 +27,10 @@ struct vperfctr_control {
 #define VPERFCTR_CONTROL_RESUME		0x03
 #define VPERFCTR_CONTROL_CLEAR		0x04
 
-/* common description of an arch-specific 32-bit control register */
+/* common description of an arch-specific control register */
 struct perfctr_cpu_reg {
 	__u32 nr;
-	__u32 value;
+	__u64 value;
 };
 
 /* state and control domain numbers

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

* Re: [PATCH 2.6.12-rc1-mm1 3/3] perfctr: 64-bit values in register descriptors
  2005-03-23  3:00 [PATCH 2.6.12-rc1-mm1 3/3] perfctr: 64-bit values in register descriptors Mikael Pettersson
@ 2005-03-23  3:34 ` David Gibson
  2005-03-23  3:43 ` Stephen Rothwell
  1 sibling, 0 replies; 4+ messages in thread
From: David Gibson @ 2005-03-23  3:34 UTC (permalink / raw)
  To: Mikael Pettersson; +Cc: akpm, linux-kernel

On Wed, Mar 23, 2005 at 04:00:03AM +0100, Mikael Pettersson wrote:
> - <linux/perfctr.h>: Change value fields in register descriptors
>   to 64 bits. This will be needed for ppc64, and ppc32 user-space
>   on ppc64 kernels, and may eventually also be needed on x86.
>   We could have different descriptor types for 32 and 64-bit
>   registers, but that just complicates things for no real benefit.
> 
> Signed-off-by: Mikael Pettersson <mikpe@csd.uu.se>

Erm.. won't this stop i386 binaries working on an x86_64 kernel, since
kernel and user will have different ideas of the alignment...?

>  include/linux/perfctr.h |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff -rupN linux-2.6.12-rc1-mm1/include/linux/perfctr.h linux-2.6.12-rc1-mm1.perfctr-update-common/include/linux/perfctr.h
> +++ linux-2.6.12-rc1-mm1.perfctr-update-common/include/linux/perfctr.h	2005-03-23 02:19:45.000000000 +0100
> @@ -27,10 +27,10 @@ struct vperfctr_control {
>  #define VPERFCTR_CONTROL_RESUME		0x03
>  #define VPERFCTR_CONTROL_CLEAR		0x04
>  
> -/* common description of an arch-specific 32-bit control register */
> +/* common description of an arch-specific control register */
>  struct perfctr_cpu_reg {
>  	__u32 nr;
> -	__u32 value;
> +	__u64 value;
>  };
>  
>  /* state and control domain numbers

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/people/dgibson

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

* Re: [PATCH 2.6.12-rc1-mm1 3/3] perfctr: 64-bit values in register descriptors
  2005-03-23  3:00 [PATCH 2.6.12-rc1-mm1 3/3] perfctr: 64-bit values in register descriptors Mikael Pettersson
  2005-03-23  3:34 ` David Gibson
@ 2005-03-23  3:43 ` Stephen Rothwell
  1 sibling, 0 replies; 4+ messages in thread
From: Stephen Rothwell @ 2005-03-23  3:43 UTC (permalink / raw)
  To: Mikael Pettersson; +Cc: akpm, linux-kernel

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

On Wed, 23 Mar 2005 04:00:03 +0100 (MET) Mikael Pettersson <mikpe@csd.uu.se> wrote:
>
> diff -rupN linux-2.6.12-rc1-mm1/include/linux/perfctr.h linux-2.6.12-rc1-mm1.perfctr-update-common/include/linux/perfctr.h
> --- linux-2.6.12-rc1-mm1/include/linux/perfctr.h	2005-03-22 21:59:08.000000000 +0100
> +++ linux-2.6.12-rc1-mm1.perfctr-update-common/include/linux/perfctr.h	2005-03-23 02:19:45.000000000 +0100
> @@ -27,10 +27,10 @@ struct vperfctr_control {
>  #define VPERFCTR_CONTROL_RESUME		0x03
>  #define VPERFCTR_CONTROL_CLEAR		0x04
>  
> -/* common description of an arch-specific 32-bit control register */
> +/* common description of an arch-specific control register */
>  struct perfctr_cpu_reg {
>  	__u32 nr;
> -	__u32 value;
> +	__u64 value;
>  };

I don't know if you support 32 bit binaries on x86_64, but if you do (or
intend to), then this structure will need translating.  The x86 compiler
aligns 64 bit quantities on 32 bit boundaries (as far as I am aware)
whereas (I am pretty sure) the x86_64 compiler aligns them to 64 bit
boundaries. This is fine for ppc/ppc64 as both align 64bit quantities on
64 bit boundaries.

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

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

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

* Re: [PATCH 2.6.12-rc1-mm1 3/3] perfctr: 64-bit values in register descriptors
@ 2005-03-23 20:36 Mikael Pettersson
  0 siblings, 0 replies; 4+ messages in thread
From: Mikael Pettersson @ 2005-03-23 20:36 UTC (permalink / raw)
  To: david; +Cc: akpm, linux-kernel

On Wed, 23 Mar 2005 14:34:30 +1100, David Gibson wrote:
>On Wed, Mar 23, 2005 at 04:00:03AM +0100, Mikael Pettersson wrote:
>> - <linux/perfctr.h>: Change value fields in register descriptors
>>   to 64 bits. This will be needed for ppc64, and ppc32 user-space
>>   on ppc64 kernels, and may eventually also be needed on x86.
>>   We could have different descriptor types for 32 and 64-bit
>>   registers, but that just complicates things for no real benefit.
>> 
>> Signed-off-by: Mikael Pettersson <mikpe@csd.uu.se>
>
>Erm.. won't this stop i386 binaries working on an x86_64 kernel, since
>kernel and user will have different ideas of the alignment...?

Indeed it does. A brown paper bag occasion :-(

Andrew, please apply the following fix on top of the previous patch.
This has been tested with i386 binaries on an x86_64 kernel.

- <linux/perfctr.h>: Change number fields in register descriptors to 64 bits.
  Otherwise i386 binaries break on x86_64 kernels since the descriptors
  get larger alignment and sizes on x86_64 than on i386.

Signed-off-by: Mikael Pettersson <mikpe@csd.uu.se>

 include/linux/perfctr.h |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -rupN linux-2.6.12-rc1-mm1.perfctr-update-common/include/linux/perfctr.h linux-2.6.12-rc1-mm1.perfctr-update-common-fix/include/linux/perfctr.h
--- linux-2.6.12-rc1-mm1.perfctr-update-common/include/linux/perfctr.h	2005-03-23 20:59:47.000000000 +0100
+++ linux-2.6.12-rc1-mm1.perfctr-update-common-fix/include/linux/perfctr.h	2005-03-23 20:59:57.000000000 +0100
@@ -29,7 +29,7 @@ struct vperfctr_control {
 
 /* common description of an arch-specific control register */
 struct perfctr_cpu_reg {
-	__u32 nr;
+	__u64 nr;
 	__u64 value;
 };
 

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

end of thread, other threads:[~2005-03-23 20:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-23  3:00 [PATCH 2.6.12-rc1-mm1 3/3] perfctr: 64-bit values in register descriptors Mikael Pettersson
2005-03-23  3:34 ` David Gibson
2005-03-23  3:43 ` Stephen Rothwell
2005-03-23 20:36 Mikael Pettersson

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

all inboxes | Powered by JetHome®