public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 4/4GB: remove FIXADDR_TOP changing
@ 2004-11-11 16:18 Kirill Korotaev
  2004-11-11 21:44 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Kirill Korotaev @ 2004-11-11 16:18 UTC (permalink / raw)
  To: linux-kernel, Ingo Molnar

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

This patch fixes VSYSCALL_BASE/FIXADDR_TOP relations problems
in 4gb split kernels (under some combinations of options/patches):
- if FIXADDR_TOP is changed, VSYSCALL_BASE in vsyscall.lds should be
   changed as well
- original 4gb split changes FIXADDR_TOP to be sure that stack
   is 2 pages aligned, but vsyscall.lds uses hardcoded constants inside.
   So we had /sbin/init loading problems due to ld-linux.so trying to
   access wrong addresses in VSYSCALL page.

The fix is the aligment of 4gb pages instead of alignment of FIXADDR_TOP

Signed-Off-By: Kirill Korotaev <dev@sw.ru>

Kirill

P.S. These 4GB split patches are against modified 2.6.8.1 kernel, but 
should be appliable to last Fedora kernels

[-- Attachment #2: diff-arch-4gb-fixaddr --]
[-- Type: text/plain, Size: 1847 bytes --]

--- ./include/asm-i386/kmap_types.h.4gb-fix	2004-10-08 16:05:35.000000000 +0400
+++ ./include/asm-i386/kmap_types.h	2004-10-11 16:16:28.462098360 +0400
@@ -10,7 +10,8 @@ enum km_type {
 	 * the 4G/4G virtual stack must be THREAD_SIZE aligned on each cpu.
 	 */
 	KM_BOUNCE_READ,
-	KM_VSTACK_BASE,
+	__KM_VSTACK_BASE,
+	KM_VSTACK_BASE = __KM_VSTACK_BASE + (__KM_VSTACK_BASE % 2),
 	KM_VSTACK_TOP = KM_VSTACK_BASE + STACK_PAGE_COUNT-1,
 
 	KM_LDT_PAGE15,
@@ -29,7 +30,8 @@ enum km_type {
 	KM_IRQ1,
 	KM_SOFTIRQ0,
 	KM_SOFTIRQ1,
-	KM_TYPE_NR
+	__KM_TYPE_NR,
+	KM_TYPE_NR=__KM_TYPE_NR + (__KM_TYPE_NR % 2)
 };
 
 #endif
--- ./include/asm-i386/fixmap.h.4gb-fix	2004-10-11 15:55:38.000000000 +0400
+++ ./include/asm-i386/fixmap.h	2004-10-11 16:25:58.279472952 +0400
@@ -21,6 +21,8 @@
 #include <linux/threads.h>
 #include <asm/kmap_types.h>
 
+#define __FIXADDR_TOP (0xfffff000UL)
+
 /*
  * Here we define all the compile-time 'special' virtual
  * addresses. The point is to have a constant address at
@@ -77,7 +79,10 @@ enum fixed_addresses {
 	FIX_CYCLONE_TIMER, /*cyclone timer register*/
 	FIX_VSTACK_HOLE_2,
 #endif 
-	FIX_KMAP_BEGIN,	/* reserved pte's for temporary kernel mappings */
+	/* reserved pte's for temporary kernel mappings */
+	__FIX_KMAP_BEGIN,
+	FIX_KMAP_BEGIN = __FIX_KMAP_BEGIN + (__FIX_KMAP_BEGIN & 1) +
+		((__FIXADDR_TOP >> PAGE_SHIFT) & 1),
 	FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
 #ifdef CONFIG_ACPI_BOOT
 	FIX_ACPI_BEGIN,
@@ -118,7 +123,7 @@ extern void __set_fixmap (enum fixed_add
  * IMPORTANT: we have to align FIXADDR_TOP so that the virtual stack
  * is THREAD_SIZE aligned.
  */
-#define FIXADDR_TOP	(0xffffe000UL & ~(THREAD_SIZE-1))
+#define FIXADDR_TOP	__FIXADDR_TOP
 #define __FIXADDR_SIZE	(__end_of_permanent_fixed_addresses << PAGE_SHIFT)
 #define FIXADDR_START	(FIXADDR_TOP - __FIXADDR_SIZE)
 

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

* Re: [PATCH] 4/4GB: remove FIXADDR_TOP changing
  2004-11-11 16:18 [PATCH] 4/4GB: remove FIXADDR_TOP changing Kirill Korotaev
@ 2004-11-11 21:44 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2004-11-11 21:44 UTC (permalink / raw)
  To: Kirill Korotaev; +Cc: linux-kernel


* Kirill Korotaev <dev@sw.ru> wrote:

> This patch fixes VSYSCALL_BASE/FIXADDR_TOP relations problems
> in 4gb split kernels (under some combinations of options/patches):
> - if FIXADDR_TOP is changed, VSYSCALL_BASE in vsyscall.lds should be
>   changed as well
> - original 4gb split changes FIXADDR_TOP to be sure that stack
>   is 2 pages aligned, but vsyscall.lds uses hardcoded constants inside.
>   So we had /sbin/init loading problems due to ld-linux.so trying to
>   access wrong addresses in VSYSCALL page.
> 
> The fix is the aligment of 4gb pages instead of alignment of
> FIXADDR_TOP

indeed - thanks!

	Ingo

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

end of thread, other threads:[~2004-11-11 20:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-11 16:18 [PATCH] 4/4GB: remove FIXADDR_TOP changing Kirill Korotaev
2004-11-11 21:44 ` Ingo Molnar

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