|
|
| Next: [PATCH] kbuild fixes |
| Author |
Message |
Eric W. Biederman External

Since: Jun 21, 2006 Posts: 194
|
Posted: Tue Aug 01, 2006 1:20 pm Post subject: [PATCH 23/33] x86_64: cleanup segments [Login to view extended thread Info.] Archived from groups: linux>kernel (more info?) |
|
|
Move __KERNEL32_CS up into the unused gdt entry. __KERNEL32_CS is
used when entering the kernel so putting it first is useful when
trying to keep boot gdt sizes to a minimum.
Set the accessed bit on all gdt entries. We don't care
so there is no need for the cpu to burn the extra cycles,
and it potentially allows the pages to be immutable. Plus
it is confusing when debugging and your gdt entries mysteriously
change.
Signed-off-by: Eric W. Biederman <ebiederm RemoveThis @xmission.com>
---
arch/x86_64/kernel/head.S | 14 +++++++-------
include/asm-x86_64/segment.h | 4 ++--
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/arch/x86_64/kernel/head.S b/arch/x86_64/kernel/head.S
index a9e34d9..d0e626e 100644
--- a/arch/x86_64/kernel/head.S
+++ b/arch/x86_64/kernel/head.S
@@ -352,16 +352,16 @@ #endif
ENTRY(cpu_gdt_table)
.quad 0x0000000000000000 /* NULL descriptor */
+ .quad 0x00cf9b000000ffff /* __KERNEL32_CS */
+ .quad 0x00af9b000000ffff /* __KERNEL_CS */
+ .quad 0x00cf93000000ffff /* __KERNEL_DS */
+ .quad 0x00cffb000000ffff /* __USER32_CS */
+ .quad 0x00cff3000000ffff /* __USER_DS, __USER32_DS */
+ .quad 0x00affb000000ffff /* __USER_CS */
.quad 0x0 /* unused */
- .quad 0x00af9a000000ffff /* __KERNEL_CS */
- .quad 0x00cf92000000ffff /* __KERNEL_DS */
- .quad 0x00cffa000000ffff /* __USER32_CS */
- .quad 0x00cff2000000ffff /* __USER_DS, __USER32_DS */
- .quad 0x00affa000000ffff /* __USER_CS */
- .quad 0x00cf9a000000ffff /* __KERNEL32_CS */
.quad 0,0 /* TSS */
.quad 0,0 /* LDT */
- .quad 0,0,0 /* three TLS descriptors */
+ .quad 0,0,0 /* three TLS descriptors */
.quad 0 /* unused */
gdt_end:
/* asm/segment.h:GDT_ENTRIES must match this */
diff --git a/include/asm-x86_64/segment.h b/include/asm-x86_64/segment.h
index d4bed33..58d6715 100644
--- a/include/asm-x86_64/segment.h
+++ b/include/asm-x86_64/segment.h
@@ -6,7 +6,7 @@ #include <asm/cache.h>
#define __KERNEL_CS 0x10
#define __KERNEL_DS 0x18
-#define __KERNEL32_CS 0x38
+#define __KERNEL32_CS 0x08
/*
* we cannot use the same code segment descriptor for user and kernel
@@ -20,7 +20,7 @@ #define __USER_DS 0x2b /* 5*8+3 */
#define __USER_CS 0x33 /* 6*8+3 */
#define __USER32_DS __USER_DS
-#define GDT_ENTRY_TLS 1
+#define GDT_ENTRY_TLS 7
#define GDT_ENTRY_TSS 8 /* needs two entries */
#define GDT_ENTRY_LDT 10 /* needs two entries */
#define GDT_ENTRY_TLS_MIN 12
--
1.4.2.rc2.g5209e
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo RemoveThis @vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |
Eric W. Biederman External

Since: Jun 21, 2006 Posts: 194
|
Posted: Tue Aug 01, 2006 1:20 pm Post subject: [PATCH 1/33] i386: vmlinux.lds.S Distinguish absolute symbols [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
Ld knows about 2 kinds of symbols, absolute and section
relative. Section relative symbols symbols change value
when a section is moved and absolute symbols do not.
Currently in the linker script we have several labels
marking the beginning and ending of sections that
are outside of sections, making them absolute symbols.
Having a mixture of absolute and section relative
symbols refereing to the same data is currently harmless
but it is confusing.
This must be done carefully as newer revs of ld do not place
symbols that appear in sections without data and instead
ld makes those symbols global
My ultimate goal is to build a relocatable kernel. The
safest and least intrusive technique is to generate
relocation entries so the kernel can be relocated at load
time. The only penalty would be an increase in the size
of the kernel binary. The problem is that if absolute and
relocatable symbols are not properly specified absolute symbols
will be relocated or section relative symbols won't be, which
is fatal.
The practical motivation is that when generating kernels that
will run from a reserved area for analyzing what caused
a kernel panic, it is simpler if you don't need to hard code
the physical memory location they will run at, especially
for the distributions.
Signed-off-by: Eric W. Biederman <ebiederm.RemoveThis@xmission.com>
---
arch/i386/kernel/vmlinux.lds.S | 111 ++++++++++++++++++++-----------------
include/asm-generic/vmlinux.lds.h | 2 -
2 files changed, 60 insertions(+), 53 deletions(-)
diff --git a/arch/i386/kernel/vmlinux.lds.S b/arch/i386/kernel/vmlinux.lds.S
index 2d4f138..db0833b 100644
--- a/arch/i386/kernel/vmlinux.lds.S
+++ b/arch/i386/kernel/vmlinux.lds.S
@@ -18,43 +18,46 @@ SECTIONS
. = __KERNEL_START;
phys_startup_32 = startup_32 - LOAD_OFFSET;
/* read-only */
- _text = .; /* Text and read-only data */
.text : AT(ADDR(.text) - LOAD_OFFSET) {
+ _text = .; /* Text and read-only data */
*(.text)
SCHED_TEXT
LOCK_TEXT
KPROBES_TEXT
*(.fixup)
*(.gnu.warning)
- } = 0x9090
-
- _etext = .; /* End of text section */
+ _etext = .; /* End of text section */
+ } = 0x9090
. = ALIGN(16); /* Exception table */
- __start___ex_table = .;
- __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { *(__ex_table) }
- __stop___ex_table = .;
+ __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
+ __start___ex_table = .;
+ *(__ex_table)
+ __stop___ex_table = .;
+ }
RODATA
. = ALIGN(4);
- __tracedata_start = .;
.tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {
+ __tracedata_start = .;
*(.tracedata)
+ __tracedata_end = .;
}
- __tracedata_end = .;
/* writeable */
.data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */
*(.data)
CONSTRUCTORS
- }
+ }
. = ALIGN(4096);
- __nosave_begin = .;
- .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) { *(.data.nosave) }
- . = ALIGN(4096);
- __nosave_end = .;
+ .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
+ __nosave_begin = .;
+ *(.data.nosave)
+ . = ALIGN(4096);
+ __nosave_end = .;
+ }
. = ALIGN(4096);
.data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
@@ -68,8 +71,10 @@ SECTIONS
/* rarely changed data like cpu maps */
. = ALIGN(32);
- .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) { *(.data.read_mostly) }
- _edata = .; /* End of data section */
+ .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
+ *(.data.read_mostly)
+ _edata = .; /* End of data section */
+ }
#ifdef CONFIG_STACK_UNWIND
. = ALIGN(4);
@@ -87,39 +92,41 @@ #endif
/* might get freed after init */
. = ALIGN(4096);
- __smp_alt_begin = .;
- __smp_alt_instructions = .;
.smp_altinstructions : AT(ADDR(.smp_altinstructions) - LOAD_OFFSET) {
+ __smp_alt_begin = .;
+ __smp_alt_instructions = .;
*(.smp_altinstructions)
+ __smp_alt_instructions_end = .;
}
- __smp_alt_instructions_end = .;
. = ALIGN(4);
- __smp_locks = .;
.smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
+ __smp_locks = .;
*(.smp_locks)
+ __smp_locks_end = .;
}
- __smp_locks_end = .;
.smp_altinstr_replacement : AT(ADDR(.smp_altinstr_replacement) - LOAD_OFFSET) {
*(.smp_altinstr_replacement)
+ . = ALIGN(4096);
+ __smp_alt_end = .;
}
- . = ALIGN(4096);
- __smp_alt_end = .;
/* will be freed after init */
. = ALIGN(4096); /* Init code and data */
- __init_begin = .;
.init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
+ __init_begin = .;
_sinittext = .;
*(.init.text)
_einittext = .;
}
.init.data : AT(ADDR(.init.data) - LOAD_OFFSET) { *(.init.data) }
. = ALIGN(16);
- __setup_start = .;
- .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) { *(.init.setup) }
- __setup_end = .;
- __initcall_start = .;
+ .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
+ __setup_start = .;
+ *(.init.setup)
+ __setup_end = .;
+ }
.initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
+ __initcall_start = .;
*(.initcall1.init)
*(.initcall2.init)
*(.initcall3.init)
@@ -127,20 +134,20 @@ #endif
*(.initcall5.init)
*(.initcall6.init)
*(.initcall7.init)
+ __initcall_end = .;
}
- __initcall_end = .;
- __con_initcall_start = .;
.con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
+ __con_initcall_start = .;
*(.con_initcall.init)
+ __con_initcall_end = .;
}
- __con_initcall_end = .;
SECURITY_INIT
. = ALIGN(4);
- __alt_instructions = .;
.altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
+ __alt_instructions = .;
*(.altinstructions)
+ __alt_instructions_end = .;
}
- __alt_instructions_end = .;
.altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) {
*(.altinstr_replacement)
}
@@ -149,32 +156,32 @@ #endif
.exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { *(.exit.text) }
.exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { *(.exit.data) }
. = ALIGN(4096);
- __initramfs_start = .;
- .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { *(.init.ramfs) }
- __initramfs_end = .;
+ .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
+ __initramfs_start = .;
+ *(.init.ramfs)
+ __initramfs_end = .;
+ }
. = ALIGN(L1_CACHE_BYTES);
- __per_cpu_start = .;
- .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { *(.data.percpu) }
- __per_cpu_end = .;
+ .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) {
+ __per_cpu_start = .;
+ *(.data.percpu)
+ __per_cpu_end = .;
+ }
. = ALIGN(4096);
- __init_end = .;
/* freed after init ends here */
- __bss_start = .; /* BSS */
- .bss.page_aligned : AT(ADDR(.bss.page_aligned) - LOAD_OFFSET) {
- *(.bss.page_aligned)
- }
.bss : AT(ADDR(.bss) - LOAD_OFFSET) {
+ __init_end = .;
+ __bss_start = .; /* BSS */
+ *(.bss.page_aligned)
*(.bss)
+ . = ALIGN(4);
+ __bss_stop = .;
+ _end = . ;
+ /* This is where the kernel creates the early boot page tables */
+ . = ALIGN(4096);
+ pg0 = . ;
}
- . = ALIGN(4);
- __bss_stop = .;
-
- _end = . ;
-
- /* This is where the kernel creates the early boot page tables */
- . = ALIGN(4096);
- pg0 = .;
/* Sections to be discarded */
/DISCARD/ : {
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index db5a373..7cd3c22 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -11,8 +11,8 @@ #define ALIGN_FUNCTION() . = ALIGN(
#define RODATA \
. = ALIGN(4096); \
- __start_rodata = .; \
.rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
+ VMLINUX_SYMBOL(__start_rodata) = .; \
*(.rodata) *(.rodata.*) \
*(__vermagic) /* Kernel version magic */ \
} \
--
1.4.2.rc2.g5209e
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.RemoveThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |
Eric W. Biederman External

Since: Jun 21, 2006 Posts: 194
|
Posted: Tue Aug 01, 2006 1:20 pm Post subject: [PATCH 29/33] x86_64: __pa and __pa_symbol address space separation [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
Currently __pa_symbol is for use with symbols in the kernel address
map and __pa is for use with pointers into the physical memory map.
But the code is implemented so you can usually interchange the two.
__pa which is much more common can be implemented much more cheaply
if it is it doesn't have to worry about any other kernel address
spaces. This is especially true with a relocatable kernel as
__pa_symbol needs to peform an extra variable read to resolve
the address.
There is a third macro that is added for the vsyscall data
__pa_vsymbol for finding the physical addesses of vsyscall pages.
Most of this patch is simply sorting through the references to
__pa or __pa_symbol and using the proper one. A little of
it is continuing to use a physical address when we have it
instead of recalculating it several times.
swapper_pgd is now NULL. leave_mm now uses init_mm.pgd
and init_mm.pgd is initialized at boot (instead of compile time)
to the physmem virtual mapping of init_level4_pgd. The
physical address changed.
Except for the for EMPTY_ZERO page all of the remaining references
to __pa_symbol appear to be during kernel initialization. So this
should reduce the cost of __pa in the common case, even on a relocated
kernel.
As this is technically a semantic change we need to be on the lookout
for anything I missed. But it works for me (tm).
Signed-off-by: Eric W. Biederman <ebiederm.DeleteThis@xmission.com>
---
arch/i386/kernel/alternative.c | 8 ++++----
arch/i386/mm/init.c | 15 ++++++++-------
arch/x86_64/kernel/setup.c | 9 +++++----
arch/x86_64/kernel/smp.c | 2 +-
arch/x86_64/kernel/vsyscall.c | 10 ++++++++--
arch/x86_64/mm/init.c | 21 +++++++++++----------
arch/x86_64/mm/pageattr.c | 20 +++++++++++---------
include/asm-x86_64/page.h | 6 ++----
include/asm-x86_64/pgtable.h | 4 ++--
9 files changed, 52 insertions(+), 43 deletions(-)
diff --git a/arch/i386/kernel/alternative.c b/arch/i386/kernel/alternative.c
index 28ab806..e573263 100644
--- a/arch/i386/kernel/alternative.c
+++ b/arch/i386/kernel/alternative.c
@@ -347,8 +347,8 @@ void __init alternative_instructions(voi
if (no_replacement) {
printk(KERN_INFO "(SMP-)alternatives turned off\n");
free_init_pages("SMP alternatives",
- (unsigned long)__smp_alt_begin,
- (unsigned long)__smp_alt_end);
+ __pa_symbol(&__smp_alt_begin),
+ __pa_symbol(&__smp_alt_end));
return;
}
apply_alternatives(__alt_instructions, __alt_instructions_end);
@@ -375,8 +375,8 @@ #ifdef CONFIG_SMP
_text, _etext);
}
free_init_pages("SMP alternatives",
- (unsigned long)__smp_alt_begin,
- (unsigned long)__smp_alt_end);
+ __pa_symbol(&__smp_alt_begin),
+ __pa_symbol(&__smp_alt_end));
} else {
alternatives_smp_save(__smp_alt_instructions,
__smp_alt_instructions_end);
diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c
index 89e8486..8dbbb09 100644
--- a/arch/i386/mm/init.c
+++ b/arch/i386/mm/init.c
@@ -750,10 +750,11 @@ void free_init_pages(char *what, unsigne
unsigned long addr;
for (addr = begin; addr < end; addr += PAGE_SIZE) {
- ClearPageReserved(virt_to_page(addr));
- init_page_count(virt_to_page(addr));
- memset((void *)addr, POISON_FREE_INITMEM, PAGE_SIZE);
- free_page(addr);
+ struct page *page = pfn_to_page(addr >> PAGE_SHIFT);
+ ClearPageReserved(page);
+ init_page_count(page);
+ memset(page_address(page), POISON_FREE_INITMEM, PAGE_SIZE);
+ __free_page(page);
totalram_pages++;
}
printk(KERN_INFO "Freeing %s: %ldk freed\n", what, (end - begin) >> 10);
@@ -762,14 +763,14 @@ void free_init_pages(char *what, unsigne
void free_initmem(void)
{
free_init_pages("unused kernel memory",
- (unsigned long)(&__init_begin),
- (unsigned long)(&__init_end));
+ __pa_symbol(&__init_begin),
+ __pa_symbol(&__init_end));
}
#ifdef CONFIG_BLK_DEV_INITRD
void free_initrd_mem(unsigned long start, unsigned long end)
{
- free_init_pages("initrd memory", start, end);
+ free_init_pages("initrd memory", __pa(start), __pa(end));
}
#endif
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
index 7225f61..44a40e6 100644
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86_64/kernel/setup.c
@@ -543,11 +543,12 @@ #endif
init_mm.end_code = (unsigned long) &_etext;
init_mm.end_data = (unsigned long) &_edata;
init_mm.brk = (unsigned long) &_end;
+ init_mm.pgd = __va(__pa_symbol(&init_level4_pgt));
- code_resource.start = virt_to_phys(&_text);
- code_resource.end = virt_to_phys(&_etext)-1;
- data_resource.start = virt_to_phys(&_etext);
- data_resource.end = virt_to_phys(&_edata)-1;
+ code_resource.start = __pa_symbol(&_text);
+ code_resource.end = __pa_symbol(&_etext)-1;
+ data_resource.start = __pa_symbol(&_etext);
+ data_resource.end = __pa_symbol(&_edata)-1;
parse_cmdline_early(cmdline_p);
diff --git a/arch/x86_64/kernel/smp.c b/arch/x86_64/kernel/smp.c
index 5a1c0a3..5a54066 100644
--- a/arch/x86_64/kernel/smp.c
+++ b/arch/x86_64/kernel/smp.c
@@ -76,7 +76,7 @@ static inline void leave_mm(int cpu)
if (read_pda(mmu_state) == TLBSTATE_OK)
BUG();
cpu_clear(cpu, read_pda(active_mm)->cpu_vm_mask);
- load_cr3(swapper_pg_dir);
+ load_cr3(init_mm.pgd);
}
/*
diff --git a/arch/x86_64/kernel/vsyscall.c b/arch/x86_64/kernel/vsyscall.c
index f603037..2e48407 100644
--- a/arch/x86_64/kernel/vsyscall.c
+++ b/arch/x86_64/kernel/vsyscall.c
@@ -41,6 +41,12 @@ seqlock_t __xtime_lock __section_xtime_l
#include <asm/unistd.h>
+#define __pa_vsymbol(x) \
+ ({unsigned long v; \
+ extern char __vsyscall_0; \
+ asm("" : "=r" (v) : "0" (x)); \
+ ((v - VSYSCALL_FIRST_PAGE) + __pa_symbol(&__vsyscall_0)); })
+
static __always_inline void timeval_normalize(struct timeval * tv)
{
time_t __sec;
@@ -155,10 +161,10 @@ static int vsyscall_sysctl_change(ctl_ta
return ret;
/* gcc has some trouble with __va(__pa()), so just do it this
way. */
- map1 = ioremap(__pa_symbol(&vsysc1), 2);
+ map1 = ioremap(__pa_vsymbol(&vsysc1), 2);
if (!map1)
return -ENOMEM;
- map2 = ioremap(__pa_symbol(&vsysc2), 2);
+ map2 = ioremap(__pa_vsymbol(&vsysc2), 2);
if (!map2) {
ret = -ENOMEM;
goto out;
diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c
index 149f363..5db93b9 100644
--- a/arch/x86_64/mm/init.c
+++ b/arch/x86_64/mm/init.c
@@ -663,11 +663,11 @@ void free_init_pages(char *what, unsigne
printk(KERN_INFO "Freeing %s: %ldk freed\n", what, (end - begin) >> 10);
for (addr = begin; addr < end; addr += PAGE_SIZE) {
- ClearPageReserved(virt_to_page(addr));
- init_page_count(virt_to_page(addr));
- memset((void *)(addr & ~(PAGE_SIZE-1)),
- POISON_FREE_INITMEM, PAGE_SIZE);
- free_page(addr);
+ struct page *page = pfn_to_page(addr >> PAGE_SHIFT);
+ ClearPageReserved(page);
+ init_page_count(page);
+ memset(page_address(page), POISON_FREE_INITMEM, PAGE_SIZE);
+ __free_page(page);
totalram_pages++;
}
}
@@ -677,17 +677,18 @@ void free_initmem(void)
memset(__initdata_begin, POISON_FREE_INITDATA,
__initdata_end - __initdata_begin);
free_init_pages("unused kernel memory",
- (unsigned long)(&__init_begin),
- (unsigned long)(&__init_end));
+ __pa_symbol(&__init_begin),
+ __pa_symbol(&__init_end));
}
#ifdef CONFIG_DEBUG_RODATA
void mark_rodata_ro(void)
{
- unsigned long addr = (unsigned long)__start_rodata;
+ unsigned long addr = (unsigned long)__va(__pa_symbol(&__start_rodata));
+ unsigned long end = (unsigned long)__va(__pa_symbol(&__end_rodata));
- for (; addr < (unsigned long)__end_rodata; addr += PAGE_SIZE)
+ for (; addr < end; addr += PAGE_SIZE)
change_page_attr_addr(addr, 1, PAGE_KERNEL_RO);
printk ("Write protecting the kernel read-only data: %luk\n",
@@ -706,7 +707,7 @@ #endif
#ifdef CONFIG_BLK_DEV_INITRD
void free_initrd_mem(unsigned long start, unsigned long end)
{
- free_init_pages("initrd memory", start, end);
+ free_init_pages("initrd memory", __pa(start), __pa(end));
}
#endif
diff --git a/arch/x86_64/mm/pageattr.c b/arch/x86_64/mm/pageattr.c
index 2685b1f..9d6196d 100644
--- a/arch/x86_64/mm/pageattr.c
+++ b/arch/x86_64/mm/pageattr.c
@@ -51,7 +51,6 @@ static struct page *split_large_page(uns
SetPagePrivate(base);
page_private(base) = 0;
- address = __pa(address);
addr = address & LARGE_PAGE_MASK;
pbase = (pte_t *)page_address(base);
for (i = 0; i < PTRS_PER_PTE; i++, addr += PAGE_SIZE) {
@@ -95,7 +94,7 @@ static inline void save_page(struct page
* No more special protections in this 2/4MB area - revert to a
* large page again.
*/
-static void revert_page(unsigned long address, pgprot_t ref_prot)
+static void revert_page(unsigned long address, unsigned long pfn, pgprot_t ref_prot)
{
pgd_t *pgd;
pud_t *pud;
@@ -109,7 +108,7 @@ static void revert_page(unsigned long ad
pmd = pmd_offset(pud, address);
BUG_ON(pmd_val(*pmd) & _PAGE_PSE);
pgprot_val(ref_prot) |= _PAGE_PSE;
- large_pte = mk_pte_phys(__pa(address) & LARGE_PAGE_MASK, ref_prot);
+ large_pte = mk_pte_phys((pfn << PAGE_SHIFT) & LARGE_PAGE_MASK, ref_prot);
set_pte((pte_t *)pmd, large_pte);
}
@@ -137,7 +136,7 @@ __change_page_attr(unsigned long address
struct page *split;
ref_prot2 = __pgprot(pgprot_val(pte_pgprot(*lookup_address(address))) & ~(1<<_PAGE_BIT_PSE));
- split = split_large_page(address, prot, ref_prot2);
+ split = split_large_page(pfn << PAGE_SHIFT, prot, ref_prot2);
if (!split)
return -ENOMEM;
set_pte(kpte,mk_pte(split, ref_prot2));
@@ -156,7 +155,7 @@ __change_page_attr(unsigned long address
if (page_private(kpte_page) == 0) {
save_page(kpte_page);
- revert_page(address, ref_prot);
+ revert_page(address, pfn, ref_prot);
}
return 0;
}
@@ -176,6 +175,7 @@ __change_page_attr(unsigned long address
*/
int change_page_attr_addr(unsigned long address, int numpages, pgprot_t prot)
{
+ unsigned long phys_base_pfn = __pa_symbol(__START_KERNEL_map) >> PAGE_SHIFT;
int err = 0;
int i;
@@ -188,14 +188,16 @@ int change_page_attr_addr(unsigned long
break;
/* Handle kernel mapping too which aliases part of the
* lowmem */
- if (__pa(address) < KERNEL_TEXT_SIZE) {
+ if ((pfn >= phys_base_pfn) &&
+ ((pfn - phys_base_pfn) < (KERNEL_TEXT_SIZE >> PAGE_SHIFT)))
+ {
unsigned long addr2;
pgprot_t prot2 = prot;
- addr2 = __START_KERNEL_map + __pa(address);
+ addr2 = __START_KERNEL_map + ((pfn - phys_base_pfn) << PAGE_SHIFT);
pgprot_val(prot2) &= ~_PAGE_NX;
err = __change_page_attr(addr2, pfn, prot2, PAGE_KERNEL_EXEC);
- }
- }
+ }
+ }
up_write(&init_mm.mmap_sem);
return err;
}
diff --git a/include/asm-x86_64/page.h b/include/asm-x86_64/page.h
index f030260..37f95ca 100644
--- a/include/asm-x86_64/page.h
+++ b/include/asm-x86_64/page.h
@@ -102,17 +102,15 @@ #define PAGE_OFFSET __PAGE_OFFSET
/* Note: __pa(&symbol_visible_to_c) should be always replaced with __pa_symbol.
Otherwise you risk miscompilation. */
-#define __pa(x) (((unsigned long)(x)>=__START_KERNEL_map)?(unsigned long)(x) - (unsigned long)__START_KERNEL_map:(unsigned long)(x) - PAGE_OFFSET)
+#define __pa(x) ((unsigned long)(x) - PAGE_OFFSET)
/* __pa_symbol should be used for C visible symbols.
This seems to be the official gcc blessed way to do such arithmetic. */
#define __pa_symbol(x) \
({unsigned long v; \
asm("" : "=r" (v) : "0" (x)); \
- __pa(v); })
+ (v - __START_KERNEL_map); })
#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET))
-#define __boot_va(x) __va(x)
-#define __boot_pa(x) __pa(x)
#ifdef CONFIG_FLATMEM
#define pfn_valid(pfn) ((pfn) < end_pfn)
#endif
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h
index d0816fb..fa43712 100644
--- a/include/asm-x86_64/pgtable.h
+++ b/include/asm-x86_64/pgtable.h
@@ -20,7 +20,7 @@ extern pmd_t level2_kernel_pgt[512];
extern pgd_t init_level4_pgt[];
extern unsigned long __supported_pte_mask;
-#define swapper_pg_dir init_level4_pgt
+#define swapper_pg_dir ((pgd_t *)NULL)
extern int nonx_setup(char *str);
extern void paging_init(void);
@@ -33,7 +33,7 @@ extern unsigned long pgkern_mask;
* for zero-mapped memory areas etc..
*/
extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)];
-#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
+#define ZERO_PAGE(vaddr) (pfn_to_page(__pa_symbol(&empty_zero_page) >> PAGE_SHIFT))
#endif /* !__ASSEMBLY__ */
--
1.4.2.rc2.g5209e
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.DeleteThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |
Eric W. Biederman External

Since: Jun 21, 2006 Posts: 194
|
Posted: Tue Aug 01, 2006 1:20 pm Post subject: [PATCH 9/33] i386 boot: Add serial output support to the decompressor [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
This patch does two very simple things.
It adds a serial output capability to the decompressor.
It adds a command line parser for the early_printk
option so we know which output method to use for the decompressor.
This makes debugging the decompressor a little easier, and
keeps us from assuming we always have a vga console on all
hardware.
Signed-off-by: Eric W. Biederman <ebiederm.TakeThisOut@xmission.com>
---
arch/i386/boot/compressed/misc.c | 258 +++++++++++++++++++++++++++++++++++---
1 files changed, 241 insertions(+), 17 deletions(-)
diff --git a/arch/i386/boot/compressed/misc.c b/arch/i386/boot/compressed/misc.c
index 905c37e..fcaa9f0 100644
--- a/arch/i386/boot/compressed/misc.c
+++ b/arch/i386/boot/compressed/misc.c
@@ -9,11 +9,14 @@
* High loaded stuff by Hans Lermen & Werner Almesberger, Feb. 1996
*/
+#define __init
#include <linux/config.h>
#include <linux/linkage.h>
#include <linux/vmalloc.h>
+#include <linux/serial_reg.h>
#include <linux/screen_info.h>
#include <asm/io.h>
+#include <asm/setup.h>
/*
* gzip declarations
@@ -24,7 +27,9 @@ #define STATIC static
#undef memset
#undef memcpy
+#undef memcmp
#define memzero(s, n) memset ((s), 0, (n))
+char *strstr(const char *haystack, const char *needle);
typedef unsigned char uch;
typedef unsigned short ush;
@@ -78,12 +83,17 @@ static void gzip_release(void **);
* This is set up by the setup-routine at boot-time
*/
static unsigned char *real_mode; /* Pointer to real-mode data */
+static char saved_command_line[COMMAND_LINE_SIZE];
#define RM_EXT_MEM_K (*(unsigned short *)(real_mode + 0x2))
#ifndef STANDARD_MEMORY_BIOS_CALL
#define RM_ALT_MEM_K (*(unsigned long *)(real_mode + 0x1e0))
#endif
#define RM_SCREEN_INFO (*(struct screen_info *)(real_mode+0))
+#define RM_NEW_CL_POINTER ((char *)(unsigned long)(*(unsigned *)(real_mode+0x228)))
+#define RM_OLD_CL_MAGIC (*(unsigned short *)(real_mode + 0x20))
+#define RM_OLD_CL_OFFSET (*(unsigned short *)(real_mode + 0x22))
+#define OLD_CL_MAGIC 0xA33F
extern unsigned char input_data[];
extern int input_len;
@@ -97,8 +107,10 @@ static void free(void *where);
static void *memset(void *s, int c, unsigned n);
static void *memcpy(void *dest, const void *src, unsigned n);
+static int memcmp(const void *s1, const void *s2, unsigned n);
static void putstr(const char *);
+static unsigned simple_strtou(const char *cp,char **endp,unsigned base);
extern int end;
static long free_mem_ptr = (long)&end;
@@ -112,14 +124,25 @@ static unsigned int low_buffer_end, low_
static int high_loaded =0;
static uch *high_buffer_start /* = (uch *)(((ulg)&end) + HEAP_SIZE)*/;
-static char *vidmem = (char *)0xb8000;
+static char *vidmem;
static int vidport;
static int lines, cols;
#ifdef CONFIG_X86_NUMAQ
-static void * xquad_portio = NULL;
+static void * xquad_portio;
#endif
+/* The early serial console */
+
+#define DEFAULT_BAUD 9600
+#define DEFAULT_BASE 0x3f8 /* ttyS0 */
+static unsigned serial_base = DEFAULT_BASE;
+
+#define CONSOLE_NOOP 0
+#define CONSOLE_VID 1
+#define CONSOLE_SERIAL 2
+static int console = CONSOLE_NOOP;
+
#include "../../../../lib/inflate.c"
static void *malloc(int size)
@@ -154,7 +177,8 @@ static void gzip_release(void **ptr)
free_mem_ptr = (long) *ptr;
}
-static void scroll(void)
+/* The early video console */
+static void vid_scroll(void)
{
int i;
@@ -163,7 +187,7 @@ static void scroll(void)
vidmem[i] = ' ';
}
-static void putstr(const char *s)
+static void vid_putstr(const char *s)
{
int x,y,pos;
char c;
@@ -175,7 +199,7 @@ static void putstr(const char *s)
if ( c == '\n' ) {
x = 0;
if ( ++y >= lines ) {
- scroll();
+ vid_scroll();
y--;
}
} else {
@@ -183,7 +207,7 @@ static void putstr(const char *s)
if ( ++x >= cols ) {
x = 0;
if ( ++y >= lines ) {
- scroll();
+ vid_scroll();
y--;
}
}
@@ -200,6 +224,178 @@ static void putstr(const char *s)
outb_p(0xff & (pos >> 1), vidport+1);
}
+static void vid_console_init(void)
+{
+ if (RM_SCREEN_INFO.orig_video_mode == 7) {
+ vidmem = (char *) 0xb0000;
+ vidport = 0x3b4;
+ } else {
+ vidmem = (char *) 0xb8000;
+ vidport = 0x3d4;
+ }
+
+ lines = RM_SCREEN_INFO.orig_video_lines;
+ cols = RM_SCREEN_INFO.orig_video_cols;
+}
+
+/* The early serial console */
+static void serial_putc(int ch)
+{
+ if (ch == '\n') {
+ serial_putc('\r');
+ }
+ /* Wait until I can send a byte */
+ while ((inb(serial_base + UART_LSR) & UART_LSR_THRE) == 0)
+ ;
+
+ /* Send the byte */
+ outb(ch, serial_base + UART_TX);
+
+ /* Wait until the byte is transmitted */
+ while (!(inb(serial_base + UART_LSR) & UART_LSR_TEMT))
+ ;
+}
+
+static void serial_putstr(const char *str)
+{
+ int ch;
+ while((ch = *str++) != '\0') {
+ if (ch == '\n') {
+ serial_putc('\r');
+ }
+ serial_putc(ch);
+ }
+}
+
+static void serial_console_init(char *s)
+{
+ unsigned base = DEFAULT_BASE;
+ unsigned baud = DEFAULT_BAUD;
+ unsigned divisor;
+ char *e;
+
+ if (*s == ',')
+ ++s;
+ if (*s && (*s != ' ')) {
+ if (memcmp(s, "0x", 2) == 0) {
+ base = simple_strtou(s, &e, 16);
+ } else {
+ static const unsigned bases[] = { 0x3f8, 0x2f8 };
+ unsigned port;
+
+ if (memcmp(s, "ttyS", 4) == 0)
+ s += 4;
+ port = simple_strtou(s, &e, 10);
+ if ((port > 1) || (s == e))
+ port = 0;
+ base = bases[port];
+ }
+ s = e;
+ if (*s == ',')
+ ++s;
+ }
+ if (*s && (*s != ' ')) {
+ baud = simple_strtou(s, &e, 0);
+ if ((baud == 0) || (s == e))
+ baud = DEFAULT_BAUD;
+ }
+ divisor = 115200 / baud;
+ serial_base = base;
+
+ outb(0x00, serial_base + UART_IER); /* no interrupt */
+ outb(0x00, serial_base + UART_FCR); /* no fifo */
+ outb(0x03, serial_base + UART_MCR); /* DTR + RTS */
+
+ /* Set Baud Rate divisor */
+ outb(0x83, serial_base + UART_LCR);
+ outb(divisor & 0xff, serial_base + UART_DLL);
+ outb(divisor >> 8, serial_base + UART_DLM);
+ outb(0x03, serial_base + UART_LCR); /* 8n1 */
+
+}
+
+static void putstr(const char *str)
+{
+ if (console == CONSOLE_VID) {
+ vid_putstr(str);
+ } else if (console == CONSOLE_SERIAL) {
+ serial_putstr(str);
+ }
+}
+
+static void console_init(char *cmdline)
+{
+ cmdline = strstr(cmdline, "earlyprintk=");
+ if (!cmdline)
+ return;
+ cmdline += 12;
+ if (memcmp(cmdline, "vga", 3) == 0) {
+ vid_console_init();
+ console = CONSOLE_VID;
+ } else if (memcmp(cmdline, "serial", 6) == 0) {
+ serial_console_init(cmdline + 6);
+ console = CONSOLE_SERIAL;
+ } else if (memcmp(cmdline, "ttyS", 4) == 0) {
+ serial_console_init(cmdline);
+ console = CONSOLE_SERIAL;
+ }
+}
+
+static inline int tolower(int ch)
+{
+ return ch | 0x20;
+}
+
+static inline int isdigit(int ch)
+{
+ return (ch >= '0') && (ch <= '9');
+}
+
+static inline int isxdigit(int ch)
+{
+ ch = tolower(ch);
+ return isdigit(ch) || ((ch >= 'a') && (ch <= 'f'));
+}
+
+
+static inline int digval(int ch)
+{
+ return isdigit(ch)? (ch - '0') : tolower(ch) - 'a' + 10;
+}
+
+/**
+ * simple_strtou - convert a string to an unsigned
+ * @cp: The start of the string
+ * @endp: A pointer to the end of the parsed string will be placed here
+ * @base: The number base to use
+ */
+static unsigned simple_strtou(const char *cp, char **endp, unsigned base)
+{
+ unsigned result = 0,value;
+
+ if (!base) {
+ base = 10;
+ if (*cp == '0') {
+ base = 8;
+ cp++;
+ if ((tolower(*cp) == 'x') && isxdigit(cp[1])) {
+ cp++;
+ base = 16;
+ }
+ }
+ } else if (base == 16) {
+ if (cp[0] == '0' && tolower(cp[1]) == 'x')
+ cp += 2;
+ }
+ while (isxdigit(*cp) && ((value = digval(*cp)) < base)) {
+ result = result*base + value;
+ cp++;
+ }
+ if (endp)
+ *endp = (char *)cp;
+ return result;
+}
+
static void* memset(void* s, int c, unsigned n)
{
int i;
@@ -218,6 +414,29 @@ static void* memcpy(void* dest, const vo
return dest;
}
+static int memcmp(const void *s1, const void *s2, unsigned n)
+{
+ const unsigned char *str1 = s1, *str2 = s2;
+ size_t i;
+ int result = 0;
+ for(i = 0; (result == 0) && (i < n); i++) {
+ result = *str1++ - *str2++;
+ }
+ return result;
+}
+
+char *strstr(const char *haystack, const char *needle)
+{
+ size_t len;
+ len = strlen(needle);
+ while(*haystack) {
+ if (memcmp(haystack, needle, len) == 0)
+ return (char *)haystack;
+ haystack++;
+ }
+ return NULL;
+}
+
/* ===========================================================================
* Fill the input buffer. This is called only when the buffer is empty
* and at least one byte is really needed.
@@ -346,20 +565,25 @@ static void close_output_buffer_if_we_ru
}
}
-asmlinkage int decompress_kernel(struct moveparams *mv, void *rmode)
+static void save_command_line(void)
{
- real_mode = rmode;
-
- if (RM_SCREEN_INFO.orig_video_mode == 7) {
- vidmem = (char *) 0xb0000;
- vidport = 0x3b4;
- } else {
- vidmem = (char *) 0xb8000;
- vidport = 0x3d4;
+ /* Find the command line */
+ char *cmdline;
+ cmdline = saved_command_line;
+ if (RM_NEW_CL_POINTER) {
+ cmdline = RM_NEW_CL_POINTER;
+ } else if (OLD_CL_MAGIC == RM_OLD_CL_MAGIC) {
+ cmdline = real_mode + RM_OLD_CL_OFFSET;
}
+ memcpy(saved_command_line, cmdline, COMMAND_LINE_SIZE);
+ saved_command_line[COMMAND_LINE_SIZE - 1] = '\0';
+}
- lines = RM_SCREEN_INFO.orig_video_lines;
- cols = RM_SCREEN_INFO.orig_video_cols;
+asmlinkage int decompress_kernel(struct moveparams *mv, void *rmode)
+{
+ real_mode = rmode;
+ save_command_line();
+ console_init(saved_command_line);
if (free_mem_ptr < 0x100000) setup_normal_output_buffer();
else setup_output_buffer_if_we_run_high(mv);
--
1.4.2.rc2.g5209e
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.TakeThisOut@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |
Eric W. Biederman External

Since: Jun 21, 2006 Posts: 194
|
Posted: Tue Aug 01, 2006 1:20 pm Post subject: [PATCH 31/33] x86_64 boot: Add serial output support to the decompressor [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
This patch does two very simple things.
It adds a serial output capability to the decompressor.
It adds a command line parser for the early_printk
option so we know which output method to use for the decompressor.
This makes debugging the decompressor a little easier, and
keeps us from assuming we always have a vga console on all
hardware.
Signed-off-by: Eric W. Biederman <ebiederm.TakeThisOut@xmission.com>
---
arch/x86_64/boot/compressed/Makefile | 2
arch/x86_64/boot/compressed/misc.c | 262 ++++++++++++++++++++++++++++++++--
2 files changed, 248 insertions(+), 16 deletions(-)
diff --git a/arch/x86_64/boot/compressed/Makefile b/arch/x86_64/boot/compressed/Makefile
index f89d96f..8987c97 100644
--- a/arch/x86_64/boot/compressed/Makefile
+++ b/arch/x86_64/boot/compressed/Makefile
@@ -11,7 +11,7 @@ EXTRA_AFLAGS := -traditional -m32
# cannot use EXTRA_CFLAGS because base CFLAGS contains -mkernel which conflicts with
# -m32
-CFLAGS := -m32 -D__KERNEL__ -Iinclude -O2 -fno-strict-aliasing
+CFLAGS := -m32 -D__KERNEL__ -Iinclude -O2 -fno-strict-aliasing -fno-builtin
LDFLAGS := -m elf_i386
LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup_32 -m elf_i386
diff --git a/arch/x86_64/boot/compressed/misc.c b/arch/x86_64/boot/compressed/misc.c
index 259bb05..2cbd7cb 100644
--- a/arch/x86_64/boot/compressed/misc.c
+++ b/arch/x86_64/boot/compressed/misc.c
@@ -10,8 +10,10 @@
*/
#include <linux/screen_info.h>
+#include <linux/serial_reg.h>
#include <asm/io.h>
#include <asm/page.h>
+#include <asm/setup.h>
/*
* gzip declarations
@@ -76,12 +78,17 @@ static void gzip_release(void **);
* This is set up by the setup-routine at boot-time
*/
static unsigned char *real_mode; /* Pointer to real-mode data */
+static char saved_command_line[COMMAND_LINE_SIZE];
#define RM_EXT_MEM_K (*(unsigned short *)(real_mode + 0x2))
#ifndef STANDARD_MEMORY_BIOS_CALL
#define RM_ALT_MEM_K (*(unsigned long *)(real_mode + 0x1e0))
#endif
#define RM_SCREEN_INFO (*(struct screen_info *)(real_mode+0))
+#define RM_NEW_CL_POINTER ((char *)(unsigned long)(*(unsigned *)(real_mode+0x228)))
+#define RM_OLD_CL_MAGIC (*(unsigned short *)(real_mode + 0x20))
+#define RM_OLD_CL_OFFSET (*(unsigned short *)(real_mode + 0x22))
+#define OLD_CL_MAGIC 0xA33F
extern unsigned char input_data[];
extern int input_len;
@@ -95,8 +102,12 @@ static void free(void *where);
static void *memset(void *s, int c, unsigned n);
static void *memcpy(void *dest, const void *src, unsigned n);
+static int memcmp(const void *s1, const void *s2, unsigned n);
+static size_t strlen(const char *str);
+static char *strstr(const char *haystack, const char *needle);
static void putstr(const char *);
+static unsigned simple_strtou(const char *cp, char **endp, unsigned base);
extern int end;
static long free_mem_ptr = (long)&end;
@@ -110,10 +121,21 @@ static unsigned int low_buffer_end, low_
static int high_loaded =0;
static uch *high_buffer_start /* = (uch *)(((ulg)&end) + HEAP_SIZE)*/;
-static char *vidmem = (char *)0xb8000;
+static char *vidmem;
static int vidport;
static int lines, cols;
+/* The early serial console */
+
+#define DEFAULT_BAUD 9600
+#define DEFAULT_BASE 0x3f8 /* ttyS0 */
+static unsigned serial_base = DEFAULT_BASE;
+
+#define CONSOLE_NOOP 0
+#define CONSOLE_VID 1
+#define CONSOLE_SERIAL 2
+static int console = CONSOLE_NOOP;
+
#include "../../../../lib/inflate.c"
static void *malloc(int size)
@@ -148,7 +170,8 @@ static void gzip_release(void **ptr)
free_mem_ptr = (long) *ptr;
}
-static void scroll(void)
+/* The early video console */
+static void vid_scroll(void)
{
int i;
@@ -157,7 +180,7 @@ static void scroll(void)
vidmem[i] = ' ';
}
-static void putstr(const char *s)
+static void vid_putstr(const char *s)
{
int x,y,pos;
char c;
@@ -169,7 +192,7 @@ static void putstr(const char *s)
if ( c == '\n' ) {
x = 0;
if ( ++y >= lines ) {
- scroll();
+ vid_scroll();
y--;
}
} else {
@@ -177,7 +200,7 @@ static void putstr(const char *s)
if ( ++x >= cols ) {
x = 0;
if ( ++y >= lines ) {
- scroll();
+ vid_scroll();
y--;
}
}
@@ -194,6 +217,178 @@ static void putstr(const char *s)
outb_p(0xff & (pos >> 1), vidport+1);
}
+static void vid_console_init(void)
+{
+ if (RM_SCREEN_INFO.orig_video_mode == 7) {
+ vidmem = (char *) 0xb0000;
+ vidport = 0x3b4;
+ } else {
+ vidmem = (char *) 0xb8000;
+ vidport = 0x3d4;
+ }
+
+ lines = RM_SCREEN_INFO.orig_video_lines;
+ cols = RM_SCREEN_INFO.orig_video_cols;
+}
+
+/* The early serial console */
+static void serial_putc(int ch)
+{
+ if (ch == '\n') {
+ serial_putc('\r');
+ }
+ /* Wait until I can send a byte */
+ while ((inb(serial_base + UART_LSR) & UART_LSR_THRE) == 0)
+ ;
+
+ /* Send the byte */
+ outb(ch, serial_base + UART_TX);
+
+ /* Wait until the byte is transmitted */
+ while (!(inb(serial_base + UART_LSR) & UART_LSR_TEMT))
+ ;
+}
+
+static void serial_putstr(const char *str)
+{
+ int ch;
+ while((ch = *str++) != '\0') {
+ if (ch == '\n') {
+ serial_putc('\r');
+ }
+ serial_putc(ch);
+ }
+}
+
+static void serial_console_init(char *s)
+{
+ unsigned base = DEFAULT_BASE;
+ unsigned baud = DEFAULT_BAUD;
+ unsigned divisor;
+ char *e;
+
+ if (*s == ',')
+ ++s;
+ if (*s && (*s != ' ')) {
+ if (memcmp(s, "0x", 2) == 0) {
+ base = simple_strtou(s, &e, 16);
+ } else {
+ static const unsigned bases[] = { 0x3f8, 0x2f8 };
+ unsigned port;
+
+ if (memcmp(s, "ttyS", 4) == 0)
+ s += 4;
+ port = simple_strtou(s, &e, 10);
+ if ((port > 1) || (s == e))
+ port = 0;
+ base = bases[port];
+ }
+ s = e;
+ if (*s == ',')
+ ++s;
+ }
+ if (*s && (*s != ' ')) {
+ baud = simple_strtou(s, &e, 0);
+ if ((baud == 0) || (s == e))
+ baud = DEFAULT_BAUD;
+ }
+ divisor = 115200 / baud;
+ serial_base = base;
+
+ outb(0x00, serial_base + UART_IER); /* no interrupt */
+ outb(0x00, serial_base + UART_FCR); /* no fifo */
+ outb(0x03, serial_base + UART_MCR); /* DTR + RTS */
+
+ /* Set Baud Rate divisor */
+ outb(0x83, serial_base + UART_LCR);
+ outb(divisor & 0xff, serial_base + UART_DLL);
+ outb(divisor >> 8, serial_base + UART_DLM);
+ outb(0x03, serial_base + UART_LCR); /* 8n1 */
+
+}
+
+static void putstr(const char *str)
+{
+ if (console == CONSOLE_VID) {
+ vid_putstr(str);
+ } else if (console == CONSOLE_SERIAL) {
+ serial_putstr(str);
+ }
+}
+
+static void console_init(char *cmdline)
+{
+ cmdline = strstr(cmdline, "earlyprintk=");
+ if (!cmdline)
+ return;
+ cmdline += 12;
+ if (memcmp(cmdline, "vga", 3) == 0) {
+ vid_console_init();
+ console = CONSOLE_VID;
+ } else if (memcmp(cmdline, "serial", 6) == 0) {
+ serial_console_init(cmdline + 6);
+ console = CONSOLE_SERIAL;
+ } else if (memcmp(cmdline, "ttyS", 4) == 0) {
+ serial_console_init(cmdline);
+ console = CONSOLE_SERIAL;
+ }
+}
+
+static inline int tolower(int ch)
+{
+ return ch | 0x20;
+}
+
+static inline int isdigit(int ch)
+{
+ return (ch >= '0') && (ch <= '9');
+}
+
+static inline int isxdigit(int ch)
+{
+ ch = tolower(ch);
+ return isdigit(ch) || ((ch >= 'a') && (ch <= 'f'));
+}
+
+
+static inline int digval(int ch)
+{
+ return isdigit(ch)? (ch - '0') : tolower(ch) - 'a' + 10;
+}
+
+/**
+ * simple_strtou - convert a string to an unsigned
+ * @cp: The start of the string
+ * @endp: A pointer to the end of the parsed string will be placed here
+ * @base: The number base to use
+ */
+static unsigned simple_strtou(const char *cp, char **endp, unsigned base)
+{
+ unsigned result = 0,value;
+
+ if (!base) {
+ base = 10;
+ if (*cp == '0') {
+ base = 8;
+ cp++;
+ if ((tolower(*cp) == 'x') && isxdigit(cp[1])) {
+ cp++;
+ base = 16;
+ }
+ }
+ } else if (base == 16) {
+ if (cp[0] == '0' && tolower(cp[1]) == 'x')
+ cp += 2;
+ }
+ while (isxdigit(*cp) && ((value = digval(*cp)) < base)) {
+ result = result*base + value;
+ cp++;
+ }
+ if (endp)
+ *endp = (char *)cp;
+ return result;
+}
+
static void* memset(void* s, int c, unsigned n)
{
int i;
@@ -212,6 +407,37 @@ static void* memcpy(void* dest, const vo
return dest;
}
+static int memcmp(const void *s1, const void *s2, unsigned n)
+{
+ const unsigned char *str1 = s1, *str2 = s2;
+ size_t i;
+ int result = 0;
+ for(i = 0; (result == 0) && (i < n); i++) {
+ result = *str1++ - *str2++;
+ }
+ return result;
+}
+
+static size_t strlen(const char *str)
+{
+ size_t len = 0;
+ while (*str++)
+ len++;
+ return len;
+}
+
+static char *strstr(const char *haystack, const char *needle)
+{
+ size_t len;
+ len = strlen(needle);
+ while(*haystack) {
+ if (memcmp(haystack, needle, len) == 0)
+ return (char *)haystack;
+ haystack++;
+ }
+ return NULL;
+}
+
/* ===========================================================================
* Fill the input buffer. This is called only when the buffer is empty
* and at least one byte is really needed.
@@ -331,20 +557,26 @@ static void close_output_buffer_if_we_ru
}
}
+static void save_command_line(void)
+{
+ /* Find the command line */
+ char *cmdline;
+ cmdline = saved_command_line;
+ if (RM_NEW_CL_POINTER) {
+ cmdline = RM_NEW_CL_POINTER;
+ } else if (OLD_CL_MAGIC == RM_OLD_CL_MAGIC) {
+ cmdline = real_mode + RM_OLD_CL_OFFSET;
+ }
+ memcpy(saved_command_line, cmdline, COMMAND_LINE_SIZE);
+ saved_command_line[COMMAND_LINE_SIZE - 1] = '\0';
+}
+
int decompress_kernel(struct moveparams *mv, void *rmode)
{
real_mode = rmode;
- if (RM_SCREEN_INFO.orig_video_mode == 7) {
- vidmem = (char *) 0xb0000;
- vidport = 0x3b4;
- } else {
- vidmem = (char *) 0xb8000;
- vidport = 0x3d4;
- }
-
- lines = RM_SCREEN_INFO.orig_video_lines;
- cols = RM_SCREEN_INFO.orig_video_cols;
+ save_command_line();
+ console_init(saved_command_line);
if (free_mem_ptr < 0x100000) setup_normal_output_buffer();
else setup_output_buffer_if_we_run_high(mv);
--
1.4.2.rc2.g5209e
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.TakeThisOut@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |
Eric W. Biederman External

Since: Jun 21, 2006 Posts: 194
|
Posted: Tue Aug 01, 2006 1:20 pm Post subject: [PATCH 5/33] i386 Kconfig: Add a range definition to config PHYSICAL_START [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
The kernels physical start address must fall in the first 1GB on i386.
This just adds a small range definition to enforce that.
Signed-off-by: Eric W. Biederman <ebiederm DeleteThis @xmission.com>
---
arch/i386/Kconfig | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index daa75ce..062fa01 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -766,6 +766,7 @@ config PHYSICAL_START
default "0x1000000" if CRASH_DUMP
default "0x100000"
+ range 0x100000 0x37c00000
help
This gives the physical address where the kernel is loaded. Normally
for regular kernels this value is 0x100000 (1MB). But in the case
--
1.4.2.rc2.g5209e
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo DeleteThis @vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |
Paulo Marques External

Since: May 16, 2006 Posts: 46
|
Posted: Tue Aug 01, 2006 1:40 pm Post subject: Re: [PATCH 8/33] kallsyms.c: Generate relocatable symbols. [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
Eric W. Biederman wrote:
> Print the addresses of non-absolute symbols relative to _text
> so that ld will generate relocations. Allowing a relocatable
> kernel to relocate them. We can't actually use the symbol names
> because kallsyms includes static symbols that are not exported
> from their object files.
>
> [...]
> output_label("kallsyms_addresses");
> for (i = 0; i < table_cnt; i++) {
> - printf("\tPTR\t%#llx\n", table[i].addr);
> + if (toupper(table[i].sym[0]) != 'A') {
> + printf("\tPTR\t_text + %#llx\n",
> + table[i].addr - _text);
> + } else {
> + printf("\tPTR\t%#llx\n", table[i].addr);
> + }
Doesn't this break kallsyms for almost everyone?
kallsyms addresses aren't used just for displaying, but also to find
symbols from their addresses (from the stack trace, etc.).
Am I missing something?
--
Paulo Marques - www.grupopie.com
"The face of a child can say it all, especially the
mouth part of the face."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.DeleteThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |
Eric W. Biederman External

Since: May 19, 2006 Posts: 1134
|
Posted: Tue Aug 01, 2006 2:00 pm Post subject: Re: [PATCH 8/33] kallsyms.c: Generate relocatable symbols. [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
Paulo Marques <pmarques.TakeThisOut@grupopie.com> writes:
> Eric W. Biederman wrote:
>> Print the addresses of non-absolute symbols relative to _text
>> so that ld will generate relocations. Allowing a relocatable
>> kernel to relocate them. We can't actually use the symbol names
>> because kallsyms includes static symbols that are not exported
>> from their object files.
>> [...]
>> output_label("kallsyms_addresses");
>> for (i = 0; i < table_cnt; i++) {
>> - printf("\tPTR\t%#llx\n", table[i].addr);
>> + if (toupper(table[i].sym[0]) != 'A') {
>> + printf("\tPTR\t_text + %#llx\n",
>> + table[i].addr - _text);
>> + } else {
>> + printf("\tPTR\t%#llx\n", table[i].addr);
>> + }
>
> Doesn't this break kallsyms for almost everyone?
>
> kallsyms addresses aren't used just for displaying, but also to find symbols
> from their addresses (from the stack trace, etc.).
>
> Am I missing something?
Yes, you are missing something. This fixes the addresses in the table.
All this does is to put the same values in kallsyms that we have now
but it creates relocations for them. So on a kernel where we process
relocations before loading (because we are running the kernel at a
different virtual address). The processing of the relocations will
fix kallsyms to match the running kernel.
If we don't do this we will have the problems you are worried about.
Of course I would be overjoyed if you could point out a bug like
you are worried about so I could fix it
Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.TakeThisOut@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |
Mika_Penttilä External

Since: Aug 01, 2006 Posts: 9
|
Posted: Tue Aug 01, 2006 3:40 pm Post subject: Re: [PATCH 10/33] i386: Relocatable kernel support. [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
> @@ -1,9 +1,10 @@
> SECTIONS
> {
> - .data : {
> + .data.compressed : {
> input_len = .;
> LONG(input_data_end - input_data) input_data = .;
> *(.data)
> + output_len = . - 4;
> input_data_end = .;
> }
> }
>
I don't see how you are getting the uncompressed length from output_len...
--Mika
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo RemoveThis @vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |
Eric W. Biederman External

Since: May 19, 2006 Posts: 1134
|
Posted: Tue Aug 01, 2006 8:10 pm Post subject: Re: [PATCH 10/33] i386: Relocatable kernel support. [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
Mika Penttilä <mika.penttila.DeleteThis@kolumbus.fi> writes:
>> @@ -1,9 +1,10 @@
>> SECTIONS
>> {
>> - .data : { + .data.compressed : {
>> input_len = .;
>> LONG(input_data_end - input_data) input_data = .; *(.data)
>> + output_len = . - 4;
>> input_data_end = .; }
>> }
>>
> I don't see how you are getting the uncompressed length from output_len...
It's part of the gzip format. It places the length at the end of
the compressed data. I am just computing the address of where gzip
put the length and putting a variable there called output_len.
Isn't linker script magic wonderful
Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.DeleteThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |
Sam Ravnborg External

Since: May 17, 2006 Posts: 644
|
Posted: Tue Aug 01, 2006 8:20 pm Post subject: Re: [PATCH 10/33] i386: Relocatable kernel support. [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
On Tue, Aug 01, 2006 at 12:07:02PM -0600, Eric W. Biederman wrote:
> Mika Penttil? <mika.penttila DeleteThis @kolumbus.fi> writes:
>
> >> @@ -1,9 +1,10 @@
> >> SECTIONS
> >> {
> >> - .data : { + .data.compressed : {
> >> input_len = .;
> >> LONG(input_data_end - input_data) input_data = .; *(.data)
> >> + output_len = . - 4;
> >> input_data_end = .; }
> >> }
> >>
> > I don't see how you are getting the uncompressed length from output_len...
>
> It's part of the gzip format. It places the length at the end of
> the compressed data. I am just computing the address of where gzip
> put the length and putting a variable there called output_len.
>
> Isn't linker script magic wonderful
A comment would be appreciated.
Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo DeleteThis @vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |
Mika_Penttilä External

Since: Aug 01, 2006 Posts: 9
|
Posted: Tue Aug 01, 2006 8:20 pm Post subject: Re: [PATCH 10/33] i386: Relocatable kernel support. [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
Eric W. Biederman wrote:
> Mika Penttilä <mika.penttila.RemoveThis@kolumbus.fi> writes:
>
>
>>> @@ -1,9 +1,10 @@
>>> SECTIONS
>>> {
>>> - .data : { + .data.compressed : {
>>> input_len = .;
>>> LONG(input_data_end - input_data) input_data = .; *(.data)
>>> + output_len = . - 4;
>>> input_data_end = .; }
>>> }
>>>
>>>
>> I don't see how you are getting the uncompressed length from output_len...
>>
>
> It's part of the gzip format. It places the length at the end of
> the compressed data. I am just computing the address of where gzip
> put the length and putting a variable there called output_len.
>
> Isn't linker script magic wonderful
>
> Eric
> -
>
Huh, quite a nice trick indeed!
Thanks,
Mika
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.RemoveThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |
Andi Kleen External

Since: Jul 07, 2006 Posts: 1925
|
Posted: Tue Aug 01, 2006 9:00 pm Post subject: Re: [PATCH 22/33] x86_64: Fix gdt table size in trampoline.S [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
Makes sense, thanks. I queued the patch.
-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo RemoveThis @vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |
Sam Ravnborg External

Since: May 17, 2006 Posts: 644
|
Posted: Tue Aug 01, 2006 9:10 pm Post subject: Re: [PATCH 1/33] i386: vmlinux.lds.S Distinguish absolute symbols [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
On Tue, Aug 01, 2006 at 05:03:16AM -0600, Eric W. Biederman wrote:
> Ld knows about 2 kinds of symbols, absolute and section
> relative. Section relative symbols symbols change value
> when a section is moved and absolute symbols do not.
>
> Currently in the linker script we have several labels
> marking the beginning and ending of sections that
> are outside of sections, making them absolute symbols.
> Having a mixture of absolute and section relative
> symbols refereing to the same data is currently harmless
> but it is confusing.
In the past we have seen problems when there was some padding between
the global symbol and the actual section start. The reason for the
padding was the alignment of the section which is aligned accordign to
the longest of the contained symbols. So no matter the
relocatable kernel this is an improvement.
Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo DeleteThis @vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |
Andi Kleen External

Since: Jul 07, 2006 Posts: 1925
|
Posted: Tue Aug 01, 2006 9:10 pm Post subject: Re: [PATCH 2/33] i386: define __pa_symbol [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
"Eric W. Biederman" <ebiederm.DeleteThis@xmission.com> writes:
> On x86_64 we have to be careful with calculating the physical
> address of kernel symbols. Both because of compiler odditities
> and because the symbols live in a different range of the virtual
> address space.
>
> Having a defintition of __pa_symbol that works on both x86_64 and
> i386 simplifies writing code that works for both x86_64 and
> i386 that has these kinds of dependencies.
>
> So this patch adds the trivial i386 __pa_symbol definition.
>
> Signed-off-by: Eric W. Biederman <ebiederm.DeleteThis@xmission.com>
> ---
> include/asm-i386/page.h | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h
> index f5bf544..eceb7f5 100644
> --- a/include/asm-i386/page.h
> +++ b/include/asm-i386/page.h
> @@ -124,6 +124,7 @@ #define PAGE_OFFSET ((unsigned long)__P
> #define VMALLOC_RESERVE ((unsigned long)__VMALLOC_RESERVE)
> #define MAXMEM (-__PAGE_OFFSET-__VMALLOC_RESERVE)
> #define __pa(x) ((unsigned long)(x)-PAGE_OFFSET)
> +#define __pa_symbol(x) __pa(x)
Actually PAGE_OFFSET arithmetic on symbols is outside ISO C and gcc
misoptimizes it occassionally. You would need to use HIDE_RELOC
or similar. That is why x86-64 has the magic.
-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.DeleteThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |
Andi Kleen External

Since: Jul 07, 2006 Posts: 1925
|
Posted: Tue Aug 01, 2006 9:10 pm Post subject: Re: [PATCH 18/33] x86_64: Kill temp_boot_pmds II [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
"Eric W. Biederman" <ebiederm.DeleteThis@xmission.com> writes:
>
> I also modify the early page table initialization code
> to use early_ioreamp and early_iounmap, instead of the
> special case version of those functions that they are
> now calling.
Or rather I tried to apply it - it doesn't apply at all
on its own:
patching file arch/x86_64/mm/init.c
Hunk #1 FAILED at 167.
Hunk #2 succeeded at 274 with fuzz 1 (offset 28 lines).
Hunk #3 FAILED at 286.
Hunk #4 FAILED at 341.
3 out of 4 hunks FAILED -- rejects in file arch/x86_64/mm/init.c
-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.DeleteThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |
Andi Kleen External

Since: Jul 07, 2006 Posts: 1925
|
Posted: Tue Aug 01, 2006 9:10 pm Post subject: Re: [PATCH 18/33] x86_64: Kill temp_boot_pmds [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
"Eric W. Biederman" <ebiederm.RemoveThis@xmission.com> writes:
>
> I also modify the early page table initialization code
> to use early_ioreamp and early_iounmap, instead of the
> special case version of those functions that they are
> now calling.
Ok valuable cleanup. I queued that one too.
> The only really silly part left with init_memory_mapping
> is that find_early_table_space always finds pages below 1M.
I fixed this some time ago - obsolete comment?
-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.RemoveThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |
Andi Kleen External

Since: Jul 07, 2006 Posts: 1925
|
Posted: Tue Aug 01, 2006 9:20 pm Post subject: Re: [PATCH 26/33] x86_64: 64bit PIC ACPI wakeup [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
"Eric W. Biederman" <ebiederm.RemoveThis@xmission.com> writes:
>
> I don't have a configuration I can test this but it compiles cleanly
> and it should work, the code is very similar to the SMP trampoline,
> which I have tested. At least now the comments about still running in
> low memory are actually correct.
We would need someone to actually test this before it could
be merged. I didn't see anything that tripped me up though.
-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.RemoveThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |
Sam Ravnborg External

Since: May 17, 2006 Posts: 644
|
Posted: Tue Aug 01, 2006 9:20 pm Post subject: Re: [PATCH 4/33] i386: CONFIG_PHYSICAL_START cleanup [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
On Tue, Aug 01, 2006 at 05:03:19AM -0600, Eric W. Biederman wrote:
> Defining __PHYSICAL_START and __KERNEL_START in asm-i386/page.h works but
> it triggers a full kernel rebuild for the silliest of reasons. This
> modifies the users to directly use CONFIG_PHYSICAL_START and linux/config.h
> which prevents the full rebuild problem, which makes the code much
> more maintainer and hopefully user friendly.
>
> Signed-off-by: Eric W. Biederman <ebiederm.RemoveThis@xmission.com>
> ---
> arch/i386/boot/compressed/head.S | 8 ++++----
> arch/i386/boot/compressed/misc.c | 8 ++++----
> arch/i386/kernel/vmlinux.lds.S | 3 ++-
> include/asm-i386/page.h | 3 ---
> 4 files changed, 10 insertions(+), 12 deletions(-)
>
> diff --git a/arch/i386/boot/compressed/head.S b/arch/i386/boot/compressed/head.S
> index b5893e4..8f28ecd 100644
> --- a/arch/i386/boot/compressed/head.S
> +++ b/arch/i386/boot/compressed/head.S
> @@ -23,9 +23,9 @@
> */
> .text
>
> +#include <linux/config.h>
You already have full access to all CONFIG_* symbols - kbuild includes
it on the commandline. So please kill this include.
Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.RemoveThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |
Andi Kleen External

Since: Jul 07, 2006 Posts: 1925
|
Posted: Tue Aug 01, 2006 9:20 pm Post subject: Re: [PATCH 32/33] x86_64: Relocatable kernel support [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
"Eric W. Biederman" <ebiederm.TakeThisOut@xmission.com> writes:
>
> When loaded with a normal bootloader the decompressor will decompress
> the kernel to 2M and it will run there. This both ensures the
> relocation code is always working, and makes it easier to use 2M
> pages for the kernel and the cpu.
It would have been nicer if you had moved the uncompressor to be 64bit
first like it was planned for a long time.
-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.TakeThisOut@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ |
|
| Back to top |
|
 |
|
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
| |
|
|