All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kirill Korotaev <dev@sw.ru>
To: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>
Subject: [PATCH] 4/4GB: remove FIXADDR_TOP changing
Date: Thu, 11 Nov 2004 19:18:20 +0300	[thread overview]
Message-ID: <419390CC.9040805@sw.ru> (raw)

[-- 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)
 

             reply	other threads:[~2004-11-11 16:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-11 16:18 Kirill Korotaev [this message]
2004-11-11 21:44 ` [PATCH] 4/4GB: remove FIXADDR_TOP changing Ingo Molnar

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=419390CC.9040805@sw.ru \
    --to=dev@sw.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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.