All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Mishin <dim@openvz.org>
To: "David S. Miller" <davem@davemloft.net>
Cc: schwab@suse.de, netfilter-devel@lists.netfilter.org,
	kaber@trash.net, dev@openvz.org
Subject: [RFC][PATCH] compat_uint64_t type
Date: Mon, 17 Apr 2006 14:59:09 +0400	[thread overview]
Message-ID: <200604171459.13312.dim@openvz.org> (raw)
In-Reply-To: <20060416.222435.02924300.davem@davemloft.net>

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

This patch introduces compat_uint64_t type, which is required for proper 
handling different alignment of structures, containing u64 objects, on 
compatible with ia32 64bit platforms and others.

Signed-off-by: Dmitry Mishin <dim@openvz.org>
Acked-of-by: Kirill Korotaev <dev@openvz.org>
 
On Monday 17 April 2006 09:24, David S. Miller wrote:
> From: Patrick McHardy <kaber@trash.net>
> Date: Sun, 16 Apr 2006 17:07:26 +0200
>
> > David S. Miller wrote:
> > > A struct containing a u64 has to be 64-bit aligned on at least sparc64
> > > and ppc64, both of which use the compat layer for 32-bit programs, so
> > > I think it's quite clear this will have to be implemented differently.
> >
> > Do these alignment requirements also hold for 32bit compiled programms?
>
> Yes, it does.
>
> > This is what we need to match with compat_xt_counters.
>
> This issue is exactly why the compat layer requirements are so wildly
> different between "x86_64/ia64 --> ia32" and all other compat
> situations.
>
> ia32 doesn't have the 64-bit alignment requirement for structures
> containing u64 objects, whereas every other 32-bit platform does.

-- 
Thanks,
Dmitry.

[-- Attachment #2: diff-ms-net-netfilter-compat-20060417 --]
[-- Type: text/plain, Size: 3028 bytes --]

diff --git a/include/asm-ia64/compat.h b/include/asm-ia64/compat.h
index 40d01d8..3e6417b 100644
--- a/include/asm-ia64/compat.h
+++ b/include/asm-ia64/compat.h
@@ -34,6 +34,8 @@ typedef s32		compat_long_t;
 typedef u32		compat_uint_t;
 typedef u32		compat_ulong_t;
 
+typedef u64 __attribute__((aligned(4)))	compat_uint64_t;
+
 struct compat_timespec {
 	compat_time_t	tv_sec;
 	s32		tv_nsec;
diff --git a/include/asm-mips/compat.h b/include/asm-mips/compat.h
index 986511d..f95640f 100644
--- a/include/asm-mips/compat.h
+++ b/include/asm-mips/compat.h
@@ -38,6 +38,8 @@ typedef s32		compat_long_t;
 typedef u32		compat_uint_t;
 typedef u32		compat_ulong_t;
 
+typedef u64		compat_uint64_t;
+
 struct compat_timespec {
 	compat_time_t	tv_sec;
 	s32		tv_nsec;
diff --git a/include/asm-parisc/compat.h b/include/asm-parisc/compat.h
index 289624d..312829d 100644
--- a/include/asm-parisc/compat.h
+++ b/include/asm-parisc/compat.h
@@ -33,6 +33,8 @@ typedef s32	compat_long_t;
 typedef u32	compat_uint_t;
 typedef u32	compat_ulong_t;
 
+typedef u64	compat_uint64_t;
+
 struct compat_timespec {
 	compat_time_t		tv_sec;
 	s32			tv_nsec;
diff --git a/include/asm-powerpc/compat.h b/include/asm-powerpc/compat.h
index aacaabd..e90fa22 100644
--- a/include/asm-powerpc/compat.h
+++ b/include/asm-powerpc/compat.h
@@ -36,6 +36,8 @@ typedef s32		compat_long_t;
 typedef u32		compat_uint_t;
 typedef u32		compat_ulong_t;
 
+typedef u64		compat_uint64_t;
+
 struct compat_timespec {
 	compat_time_t	tv_sec;
 	s32		tv_nsec;
diff --git a/include/asm-s390/compat.h b/include/asm-s390/compat.h
index 356a0b1..1b8c7f7 100644
--- a/include/asm-s390/compat.h
+++ b/include/asm-s390/compat.h
@@ -35,6 +35,8 @@ typedef s32		compat_long_t;
 typedef u32		compat_uint_t;
 typedef u32		compat_ulong_t;
 
+typedef u64		compat_uint64_t;
+
 struct compat_timespec {
 	compat_time_t	tv_sec;
 	s32		tv_nsec;
diff --git a/include/asm-sparc64/compat.h b/include/asm-sparc64/compat.h
index c73935d..6adc10c 100644
--- a/include/asm-sparc64/compat.h
+++ b/include/asm-sparc64/compat.h
@@ -34,6 +34,8 @@ typedef s32		compat_long_t;
 typedef u32		compat_uint_t;
 typedef u32		compat_ulong_t;
 
+typedef u64		compat_uint64_t;
+
 struct compat_timespec {
 	compat_time_t	tv_sec;
 	s32		tv_nsec;
diff --git a/include/asm-x86_64/compat.h b/include/asm-x86_64/compat.h
index b37ab82..4d7eb9c 100644
--- a/include/asm-x86_64/compat.h
+++ b/include/asm-x86_64/compat.h
@@ -36,6 +36,8 @@ typedef s32		compat_long_t;
 typedef u32		compat_uint_t;
 typedef u32		compat_ulong_t;
 
+typedef u64 __attribute__((aligned(4)))	compat_uint64_t;
+
 struct compat_timespec {
 	compat_time_t	tv_sec;
 	s32		tv_nsec;
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index f6bdef8..558125c 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -361,7 +361,7 @@ struct compat_xt_entry_target
 
 struct compat_xt_counters
 {
-	u_int32_t cnt[4];
+	compat_uint64_t pcnt, bcnt;
 };
 
 struct compat_xt_counters_info

  reply	other threads:[~2006-04-17 10:59 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-14 17:12 compat_xt_counters is not compatible Andreas Schwab
2006-04-15 14:11 ` Dmitry Mishin
2006-04-15 14:16   ` Andreas Schwab
2006-04-15 16:14     ` Dmitry Mishin
2006-04-15 17:32       ` Andreas Schwab
2006-04-15 18:38         ` Dmitry Mishin
2006-04-15 22:09           ` Andreas Schwab
2006-04-16  6:28             ` Dmitry Mishin
2006-04-16 11:41               ` Andreas Schwab
2006-04-17 20:13               ` David S. Miller
2006-04-15 16:37 ` Patrick McHardy
2006-04-15 17:31   ` Andreas Schwab
2006-04-15 17:52     ` Patrick McHardy
2006-04-16  7:24       ` David S. Miller
2006-04-16 15:07         ` Patrick McHardy
2006-04-17  5:24           ` David S. Miller
2006-04-17 10:59             ` Dmitry Mishin [this message]
2006-04-17 11:51               ` [RFC][PATCH] compat_uint64_t type Andreas Schwab
2006-04-17 12:04                 ` Dmitry Mishin
2006-04-17 14:05                   ` Andreas Schwab
2006-04-17 15:47               ` Patrick McHardy
2006-04-17 16:03                 ` Patrick McHardy
2006-04-17 20:20                   ` David S. Miller
2006-04-21  0:07                     ` Patrick McHardy
     [not found]                 ` <jehd4sdvh1.fsf@sykes.suse.de>
2006-04-17 17:12                   ` Patrick McHardy

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=200604171459.13312.dim@openvz.org \
    --to=dim@openvz.org \
    --cc=davem@davemloft.net \
    --cc=dev@openvz.org \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=schwab@suse.de \
    /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.