Re: Linux 2.4.22-pre7

From: J.A. Magallon (jamagallon@able.es)
Date: Fri Jul 18 2003 - 18:18:02 EST


On 07.18, Marcelo Tosatti wrote:
>
> Hello,
>
> Here goes -pre7.
>
> This is a feature freeze, only bugfixes will be accepted from now on.
>

HyperThreaded P4s will still fail to set AT_PLATFORM correctly.
Do you want to kill this bug from .22 ? ;)

--- linux/fs/binfmt_elf.c.orig 2002-12-28 00:12:32.000000000 +0100
+++ linux/fs/binfmt_elf.c 2002-12-28 00:32:37.000000000 +0100
@@ -116,11 +116,14 @@
         elf_caddr_t *argv;
         elf_caddr_t *envp;
         elf_addr_t *sp, *csp;
+ char *stack_top;
         char *k_platform, *u_platform;
         long hwcap;
         size_t platform_len = 0;
         size_t len;
 
+ stack_top = p;
+
         /*
          * Get hold of platform and hardware capabilities masks for
          * the machine we are running on. In some cases (Sparc),
@@ -135,8 +138,8 @@
                 platform_len = strlen(k_platform) + 1;
                 u_platform = p - platform_len;
                 __copy_to_user(u_platform, k_platform, platform_len);
- } else
- u_platform = p;
+ stack_top = u_platform;
+ }
 
 #if defined(__i386__) && defined(CONFIG_SMP)
         /*
@@ -149,15 +152,14 @@
          * processors. This keeps Mr Marcelo Person happier but should be
          * removed for 2.5
          */
-
         if(smp_num_siblings > 1)
- u_platform = u_platform - ((current->pid % 64) << 7);
+ stack_top -= ((current->pid % NR_CPUS) << 7);
 #endif
 
         /*
          * Force 16 byte _final_ alignment here for generality.
          */
- sp = (elf_addr_t *)(~15UL & (unsigned long)(u_platform));
+ sp = (elf_addr_t *)(~15UL & (unsigned long)(stack_top));
         csp = sp;
         csp -= (1+DLINFO_ITEMS)*2 + (k_platform ? 2 : 0);
 #ifdef DLINFO_ARCH_ITEMS

-- 
J.A. Magallon <jamagallon@able.es>      \                 Software is like sex:
werewolf.able.es                         \           It's better when it's free
Mandrake Linux release 9.2 (Cooker) for i586
Linux 2.4.22-pre6-jam1m (gcc 3.3.1 (Mandrake Linux 9.2 3.3.1-0.3mdk))
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Jul 23 2003 - 22:00:36 EST