From: "Jan Beulich" <JBeulich@novell.com>
To: <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/2] i386: double fault adjustment - introduce THREAD_ORDER
Date: Wed, 09 Nov 2005 09:37:36 +0100 [thread overview]
Message-ID: <4371C360.76F0.0078.0@novell.com> (raw)
In-Reply-To: <4370E5FB.76F0.0078.0@novell.com>
[-- Attachment #1: Type: text/plain, Size: 328 bytes --]
This introduces THREAD_ORDER (to accompany THREAD_SIZE, which now
becomes a derivate of the former) in order to easily pass this to page
allocation routines. Code consuming this (fixing the double fault
handler to use per-CPU stacks) will soon follow.
Signed-Off-By: Jan Beulich <jbeulich@novell.com>
(actual patch attached)
[-- Attachment #2: linux-2.6.14-i386-THREAD_ORDER.patch --]
[-- Type: application/octet-stream, Size: 3183 bytes --]
This introduces THREAD_ORDER (to accompany THREAD_SIZE, which now
becomes a derivate of the former) in order to easily pass this to page
allocation routines. Code consuming this (fixing the double fault
handler to use per-CPU stacks) will soon follow.
Signed-Off-By: Jan Beulich <jbeulich@novell.com>
--- 2.6.14/arch/i386/kernel/asm-offsets.c 2005-10-28 02:02:08.000000000 +0200
+++ 2.6.14-i386-THREAD_ORDER/arch/i386/kernel/asm-offsets.c 2005-11-04 16:19:32.000000000 +0100
@@ -68,5 +68,6 @@ void foo(void)
sizeof(struct tss_struct));
DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
+ DEFINE(THREAD_SIZE_asm, THREAD_SIZE);
DEFINE(VSYSCALL_BASE, __fix_to_virt(FIX_VSYSCALL));
}
--- 2.6.14/arch/i386/kernel/entry.S 2005-10-28 02:02:08.000000000 +0200
+++ 2.6.14-i386-THREAD_ORDER/arch/i386/kernel/entry.S 2005-11-04 16:45:13.000000000 +0100
@@ -540,8 +540,8 @@ ENTRY(nmi)
/* Do not access memory above the end of our stack page,
* it might not exist.
*/
- andl $(THREAD_SIZE-1),%eax
- cmpl $(THREAD_SIZE-20),%eax
+ andl $(THREAD_SIZE_asm-1),%eax
+ cmpl $(THREAD_SIZE_asm-20),%eax
popl %eax
jae nmi_stack_correct
cmpl $sysenter_entry,12(%esp)
--- 2.6.14/arch/i386/kernel/head.S 2005-10-28 02:02:08.000000000 +0200
+++ 2.6.14-i386-THREAD_ORDER/arch/i386/kernel/head.S 2005-11-04 16:47:02.000000000 +0100
@@ -429,7 +429,7 @@ ENTRY(empty_zero_page)
.data
ENTRY(stack_start)
- .long init_thread_union+THREAD_SIZE
+ .long init_thread_union+THREAD_SIZE_asm
.long __BOOT_DS
ready: .byte 0
--- 2.6.14/arch/i386/kernel/vmlinux.lds.S 2005-10-28 02:02:08.000000000 +0200
+++ 2.6.14-i386-THREAD_ORDER/arch/i386/kernel/vmlinux.lds.S 2005-11-08 14:45:53.000000000 +0100
@@ -4,8 +4,9 @@
#define LOAD_OFFSET __PAGE_OFFSET
+#include <linux/config.h>
#include <asm-generic/vmlinux.lds.h>
-#include <asm/thread_info.h>
+#include <asm/asm-offsets.h>
#include <asm/page.h>
OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
@@ -63,7 +64,7 @@ SECTIONS
.data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) { *(.data.read_mostly) }
_edata = .; /* End of data section */
- . = ALIGN(THREAD_SIZE); /* init_task */
+ . = ALIGN(THREAD_SIZE_asm); /* init_task */
.data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
*(.data.init_task)
}
--- 2.6.14/include/asm-i386/thread_info.h 2005-10-28 02:02:08.000000000 +0200
+++ 2.6.14-i386-THREAD_ORDER/include/asm-i386/thread_info.h 2005-11-04 16:19:34.000000000 +0100
@@ -54,10 +54,11 @@ struct thread_info {
#define PREEMPT_ACTIVE 0x10000000
#ifdef CONFIG_4KSTACKS
-#define THREAD_SIZE (4096)
+#define THREAD_ORDER 0
#else
-#define THREAD_SIZE (8192)
+#define THREAD_ORDER 1
#endif
+#define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER)
#define STACK_WARN (THREAD_SIZE/8)
/*
@@ -118,12 +119,12 @@ register unsigned long current_stack_poi
/* how to get the thread information struct from ASM */
#define GET_THREAD_INFO(reg) \
- movl $-THREAD_SIZE, reg; \
+ movl $-THREAD_SIZE_asm, reg; \
andl %esp, reg
/* use this one if reg already contains %esp */
#define GET_THREAD_INFO_WITH_ESP(reg) \
- andl $-THREAD_SIZE, reg
+ andl $-THREAD_SIZE_asm, reg
#endif
next prev parent reply other threads:[~2005-11-09 8:36 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-08 12:57 [PATCH] i386: export genapic again Jan Beulich
2005-11-08 13:08 ` Arjan van de Ven
2005-11-08 13:22 ` Jan Beulich
2005-11-08 13:29 ` Adrian Bunk
2005-11-08 14:17 ` Jan Beulich
2005-11-08 16:52 ` [PATCH] i386: make trap information available to die handlers Jan Beulich
2005-11-08 16:59 ` Randy.Dunlap
2005-11-08 17:08 ` Jan Beulich
2005-11-08 17:13 ` Randy.Dunlap
2005-11-09 8:20 ` Jan Beulich
2005-11-10 12:21 ` Pavel Machek
2005-11-08 20:58 ` Richard Knutsson
2005-11-08 16:52 ` [PATCH] i386: int3 adjustment Jan Beulich
2005-11-09 8:37 ` Jan Beulich [this message]
2005-11-09 8:38 ` [PATCH 2/2] i386: double fault adjustment Jan Beulich
2005-11-08 16:54 ` [PATCH] i386: NMI <-> debugging handler adjustments Jan Beulich
2005-11-08 16:55 ` [PATCH] i386: handle NMI case in IPI sending Jan Beulich
2005-11-08 16:55 ` [PATCH] i386: stand-alone CONFIG_PAE Jan Beulich
2005-11-08 17:02 ` Adrian Bunk
2005-11-08 17:10 ` Jan Beulich
2005-11-08 16:57 ` [PATCH] i386: adjust page fault handling Jan Beulich
2005-11-08 21:22 ` [PATCH] i386: export genapic again Randy.Dunlap
2005-11-09 8:18 ` Jan Beulich
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=4371C360.76F0.0078.0@novell.com \
--to=jbeulich@novell.com \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome