Commit d67f2d09 authored by Jeff Dike's avatar Jeff Dike

Pulled in a number of other fixes which were needed to bring the

build up to date.
parent 4781ebda
......@@ -30,8 +30,18 @@ config RWSEM_GENERIC_SPINLOCK
bool
default y
menu "Code maturity level options"
config EXPERIMENTAL
bool "Prompt for development and/or incomplete code/drivers"
endmenu
menu "General Setup"
config MODE_TT
bool
bool "Tracing thread support"
default y
help
This option controls whether tracing thread support is compiled
......@@ -40,7 +50,7 @@ config MODE_TT
then it is OK to say N here.
config STATIC_LINK
bool
bool "Force a static link"
default n
depends on !MODE_TT
help
......@@ -52,24 +62,15 @@ config STATIC_LINK
here.
config MODE_SKAS
bool
bool "Separate Kernel Address Space support"
default y
help
This option controls whether skas (separate kernel address space)
support is compiled in. If you have applied the skas patch to the
host, then you certainly want to say Y here (and consider saying N
to CONFIG_MODE_TT). Otherwise, it is safe to say Y. Disabling this
option will shrink the UML binary slightly.
menu "Code maturity level options"
config EXPERIMENTAL
bool "Prompt for development and/or incomplete code/drivers"
endmenu
menu "General Setup"
config NET
bool "Networking support"
......@@ -254,6 +255,10 @@ config DEBUGSYM
If you're truly short on disk space or don't expect to report any
bugs back to the UML developers, say N, otherwise say Y.
config FRAME_POINTER
bool
default y if DEBUGSYM
config PT_PROXY
bool "Enable ptrace proxy"
depends on XTERM_CHAN && DEBUGSYM
......
......@@ -12,7 +12,7 @@ LINK-$(CONFIG_GPROF) += $(PROFILE)
MODE_INCLUDE += -I$(TOPDIR)/$(ARCH_DIR)/kernel/skas/include
LINK_SKAS = -Wl,-rpath,/lib
LD_SCRIPT_SKAS = dyn_link.ld
LD_SCRIPT_SKAS = dyn.lds.s
GEN_HEADERS += $(ARCH_DIR)/kernel/skas/include/skas_ptregs.h
......
......@@ -452,11 +452,19 @@ void line_register_devfs(struct lines *set, struct line_driver *line_driver,
void lines_init(struct line *lines, int nlines)
{
struct line *line;
int i;
for(i = 0; i < nlines; i++){
INIT_LIST_HEAD(&lines[i].chan_list);
sema_init(&lines[i].sem, 1);
line = &lines[i];
INIT_LIST_HEAD(&line->chan_list);
sema_init(&line->sem, 1);
if(line->init_str != NULL){
line->init_str = uml_strdup(line->init_str);
if(line->init_str == NULL)
printk("lines_init - uml_strdup returned "
"NULL\n");
}
}
}
......
OUTPUT_FORMAT(ELF_FORMAT)
OUTPUT_ARCH(ELF_ARCH)
ENTRY(_start)
jiffies = jiffies_64;
SEARCH_DIR("/usr/local/i686-pc-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
/* Do we need any of these for elf?
__DYNAMIC = 0; */
SECTIONS
{
. = START + SIZEOF_HEADERS;
.interp : { *(.interp) }
. = ALIGN(4096);
__binary_start = .;
. = ALIGN(4096); /* Init code and data */
_stext = .;
__init_begin = .;
.text.init : { *(.text.init) }
. = ALIGN(4096);
/* Read-only sections, merged into text segment: */
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.gnu.version : { *(.gnu.version) }
.gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r : { *(.gnu.version_r) }
.rel.init : { *(.rel.init) }
.rela.init : { *(.rela.init) }
.rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
.rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
.rel.fini : { *(.rel.fini) }
.rela.fini : { *(.rela.fini) }
.rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
.rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
.rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
.rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
.rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
.rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
.rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
.rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
.rel.ctors : { *(.rel.ctors) }
.rela.ctors : { *(.rela.ctors) }
.rel.dtors : { *(.rel.dtors) }
.rela.dtors : { *(.rela.dtors) }
.rel.got : { *(.rel.got) }
.rela.got : { *(.rela.got) }
.rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
.rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
.rel.plt : { *(.rel.plt) }
.rela.plt : { *(.rela.plt) }
.init : {
KEEP (*(.init))
} =0x90909090
.plt : { *(.plt) }
.text : {
*(.text .stub .text.* .gnu.linkonce.t.*)
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
} =0x90909090
.fini : {
KEEP (*(.fini))
} =0x90909090
.kstrtab : { *(.kstrtab) }
. = ALIGN(16); /* Exception table */
__start___ex_table = .;
__ex_table : { *(__ex_table) }
__stop___ex_table = .;
__start___ksymtab = .; /* Kernel symbol table */
__ksymtab : { *(__ksymtab) }
__stop___ksymtab = .;
PROVIDE (__etext = .);
PROVIDE (_etext = .);
PROVIDE (etext = .);
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
.rodata1 : { *(.rodata1) }
.eh_frame_hdr : { *(.eh_frame_hdr) }
. = ALIGN(4096);
PROVIDE (_sdata = .);
.unprotected : { *(.unprotected) }
. = ALIGN(4096);
PROVIDE (_unprotected_end = .);
. = ALIGN(4096);
__uml_setup_start = .;
.uml.setup.init : { *(.uml.setup.init) }
__uml_setup_end = .;
__uml_help_start = .;
.uml.help.init : { *(.uml.help.init) }
__uml_help_end = .;
__uml_postsetup_start = .;
.uml.postsetup.init : { *(.uml.postsetup.init) }
__uml_postsetup_end = .;
__setup_start = .;
.setup.init : { *(.init.setup) }
__setup_end = .;
__start___param = .;
__param : { *(__param) }
__stop___param = .;
__per_cpu_start = . ;
.data.percpu : { *(.data.percpu) }
__per_cpu_end = . ;
__initcall_start = .;
.initcall.init : {
*(.initcall1.init)
*(.initcall2.init)
*(.initcall3.init)
*(.initcall4.init)
*(.initcall5.init)
*(.initcall6.init)
*(.initcall7.init)
}
__initcall_end = .;
__uml_initcall_start = .;
.uml.initcall.init : { *(.uml.initcall.init) }
__uml_initcall_end = .;
__init_end = .;
__exitcall_begin = .;
.exitcall : { *(.exitcall.exit) }
__exitcall_end = .;
__uml_exitcall_begin = .;
.uml.exitcall : { *(.uml.exitcall.exit) }
__uml_exitcall_end = .;
. = ALIGN(4096);
__initramfs_start = .;
.init.ramfs : { *(.init.ramfs) }
__initramfs_end = .;
.data.init : { *(.data.init) }
/* Ensure the __preinit_array_start label is properly aligned. We
could instead move the label definition inside the section, but
the linker would then create the section even if it turns out to
be empty, which isn't pretty. */
. = ALIGN(32 / 8);
.preinit_array : { *(.preinit_array) }
.init_array : { *(.init_array) }
.fini_array : { *(.fini_array) }
.data : {
. = ALIGN(KERNEL_STACK_SIZE); /* init_task */
*(.data.init_task)
*(.data .data.* .gnu.linkonce.d.*)
SORT(CONSTRUCTORS)
}
.data1 : { *(.data1) }
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
.eh_frame : { KEEP (*(.eh_frame)) }
.gcc_except_table : { *(.gcc_except_table) }
.dynamic : { *(.dynamic) }
.ctors : {
/* gcc uses crtbegin.o to find the start of
the constructors, so we make sure it is
first. Because this is a wildcard, it
doesn't matter if the user does not
actually link against crtbegin.o; the
linker won't look for a file to match a
wildcard. The wildcard also means that it
doesn't matter which directory crtbegin.o
is in. */
KEEP (*crtbegin.o(.ctors))
/* We don't want to include the .ctor section from
from the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
}
.dtors : {
KEEP (*crtbegin.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
}
.jcr : { KEEP (*(.jcr)) }
.got : { *(.got.plt) *(.got) }
_edata = .;
PROVIDE (edata = .);
__bss_start = .;
.bss : {
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
. = ALIGN(32 / 8);
. = ALIGN(32 / 8);
}
_end = .;
PROVIDE (end = .);
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
}
......@@ -7,8 +7,15 @@
#define __SYSDEP_I386_PTRACE_H
#include "uml-config.h"
#ifdef CONFIG_MODE_TT
#include "ptrace-tt.h"
#endif
#ifdef CONFIG_MODE_SKAS
#include "ptrace-skas.h"
#endif
#include "choose-mode.h"
struct uml_pt_regs {
......
......@@ -61,7 +61,6 @@ extern int start_fork_tramp(void *arg, unsigned long temp_stack,
int clone_flags, int (*tramp)(void *));
extern int clone_and_wait(int (*fn)(void *), void *arg, void *sp, int flags);
extern int linux_main(int argc, char **argv);
extern void remap_data(void *segment_start, void *segment_end, int w);
extern void set_cmdline(char *cmd);
extern void input_cb(void (*proc)(void *), void *arg, int arg_len);
extern int get_pty(void);
......
......@@ -3,8 +3,6 @@
# Licensed under the GPL
#
EXTRA_TARGETS := unmap_fin.o
obj-y = checksum.o config.o exec_kern.o exitcode.o frame_kern.o frame.o \
helper.o init_task.o irq.o irq_user.o ksyms.o mem.o mem_user.o \
process.o process_kern.o ptrace.o reboot.o resource.o sigio_user.o \
......@@ -30,9 +28,6 @@ USER_OBJS := $(filter %_user.o,$(obj-y)) $(user-objs-y) config.o helper.o \
process.o tempfile.o time.o tty_log.o umid.o user_util.o user_syms.o
USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
UNMAP_CFLAGS := $(patsubst -pg -DPROFILING,,$(USER_CFLAGS))
UNMAP_CFLAGS := $(patsubst -fprofile-arcs -ftest-coverage,,$(UNMAP_CFLAGS))
DMODULES-$(CONFIG_MODULES) = -D__CONFIG_MODULES__
DMODVERSIONS-$(CONFIG_MODVERSIONS) = -D__CONFIG_MODVERSIONS__
......@@ -49,12 +44,6 @@ CFLAGS_frame.o := $(patsubst -fomit-frame-pointer,,$(USER_CFLAGS))
$(USER_OBJS) : %.o: %.c
$(CC) $(CFLAGS_$@) $(USER_CFLAGS) -c -o $@ $<
$(obj)/unmap.o: $(src)/unmap.c
$(CC) $(UNMAP_CFLAGS) -c -o $@ $<
$(obj)/unmap_fin.o : $(src)/unmap.o
ld -r -o $@ $< -lc -L/usr/lib
# This has to be separate because it needs be compiled with frame pointers
# regardless of how the rest of the kernel is built.
......
......@@ -9,7 +9,9 @@
#include "linux/smp_lock.h"
#include "linux/security.h"
#include "linux/ptrace.h"
#ifdef CONFIG_PROC_MM
#include "linux/proc_mm.h"
#endif
#include "asm/ptrace.h"
#include "asm/uaccess.h"
#include "kern_util.h"
......
......@@ -21,6 +21,8 @@ extern void release_thread_skas(struct task_struct *task);
extern void exit_thread_skas(void);
extern void initial_thread_cb_skas(void (*proc)(void *), void *arg);
extern void init_idle_skas(void);
extern void flush_tlb_kernel_range_skas(unsigned long start,
unsigned long end);
extern void flush_tlb_kernel_vm_skas(void);
extern void __flush_tlb_one_skas(unsigned long addr);
extern void flush_tlb_range_skas(struct vm_area_struct *vma,
......
......@@ -67,7 +67,7 @@ static void fix_range(struct mm_struct *mm, unsigned long start_addr,
}
}
static void flush_kernel_vm_range(unsigned long start, unsigned long end)
void flush_tlb_kernel_range_skas(unsigned long start, unsigned long end)
{
struct mm_struct *mm;
pgd_t *pgd;
......@@ -116,19 +116,19 @@ static void flush_kernel_vm_range(unsigned long start, unsigned long end)
void flush_tlb_kernel_vm_skas(void)
{
flush_kernel_vm_range(start_vm, end_vm);
flush_tlb_kernel_range_skas(start_vm, end_vm);
}
void __flush_tlb_one_skas(unsigned long addr)
{
flush_kernel_vm_range(addr, addr + PAGE_SIZE);
flush_tlb_kernel_range_skas(addr, addr + PAGE_SIZE);
}
void flush_tlb_range_skas(struct vm_area_struct *vma, unsigned long start,
unsigned long end)
{
if(vma->vm_mm == NULL)
flush_kernel_vm_range(start, end);
flush_tlb_kernel_range_skas(start, end);
else fix_range(vma->vm_mm, start, end, 0);
}
......
......@@ -21,6 +21,12 @@ void flush_tlb_all(void)
flush_tlb_mm(current->mm);
}
void flush_tlb_kernel_range(unsigned long start, unsigned long end)
{
CHOOSE_MODE_PROC(flush_tlb_kernel_range_tt,
flush_tlb_kernel_range_skas, start, end);
}
void flush_tlb_kernel_vm(void)
{
CHOOSE_MODE(flush_tlb_kernel_vm_tt(), flush_tlb_kernel_vm_skas());
......
......@@ -3,18 +3,31 @@
# Licensed under the GPL
#
obj-y = exec_kern.o exec_user.o gdb.o gdb_kern.o ksyms.o mem.o process_kern.o \
EXTRA_TARGETS := unmap_fin.o
obj-y = exec_kern.o exec_user.o gdb.o ksyms.o mem.o mem_user.o process_kern.o \
syscall_kern.o syscall_user.o time.o tlb.o tracer.o trap_user.o \
uaccess_user.o sys-$(SUBARCH)/
obj-$(CONFIG_PT_PROXY) += ptproxy/
obj-$(CONFIG_PT_PROXY) += gdb_kern.o ptproxy/
export-objs = ksyms.o
USER_OBJS := $(filter %_user.o,$(obj-y)) gdb.o time.o tracer.o
USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
UNMAP_CFLAGS := $(patsubst -pg -DPROFILING,,$(USER_CFLAGS))
UNMAP_CFLAGS := $(patsubst -fprofile-arcs -ftest-coverage,,$(UNMAP_CFLAGS))
$(USER_OBJS) : %.o: %.c
$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
$(O_TARGET) : $(obj)/unmap_fin.o
$(obj)/unmap.o: $(src)/unmap.c
$(CC) $(UNMAP_CFLAGS) -c -o $@ $<
$(obj)/unmap_fin.o : $(src)/unmap.o
ld -r -o $@ $< -lc -L/usr/lib
clean :
......@@ -22,6 +22,7 @@ extern void release_thread_tt(struct task_struct *task);
extern void exit_thread_tt(void);
extern void initial_thread_cb_tt(void (*proc)(void *), void *arg);
extern void init_idle_tt(void);
extern void flush_tlb_kernel_range_tt(unsigned long start, unsigned long end);
extern void flush_tlb_kernel_vm_tt(void);
extern void __flush_tlb_one_tt(unsigned long addr);
extern void flush_tlb_range_tt(struct vm_area_struct *vma,
......
......@@ -132,7 +132,7 @@ static void flush_kernel_vm_range(unsigned long start, unsigned long end,
if(updated && update_seq) atomic_inc(&vmchange_seq);
}
void flush_tlb_kernel_range(unsigned long start, unsigned long end)
void flush_tlb_kernel_range_tt(unsigned long start, unsigned long end)
{
flush_kernel_vm_range(start, end, 1);
}
......
......@@ -46,31 +46,6 @@ void add_arg(char *cmd_line, char *arg)
strcat(cmd_line, arg);
}
void remap_data(void *segment_start, void *segment_end, int w)
{
void *addr;
unsigned long size;
int data, prot;
if(w) prot = PROT_WRITE;
else prot = 0;
prot |= PROT_READ | PROT_EXEC;
size = (unsigned long) segment_end -
(unsigned long) segment_start;
data = create_mem_file(size);
if((addr = mmap(NULL, size, PROT_WRITE | PROT_READ,
MAP_SHARED, data, 0)) < 0){
perror("mapping new data segment");
exit(1);
}
memcpy(addr, segment_start, size);
if(switcheroo(data, prot, addr, segment_start,
size) < 0){
printf("switcheroo failed\n");
exit(1);
}
}
void stop(void)
{
while(1) sleep(1000000);
......
#include "linux/config.h"
#include "linux/stddef.h"
#include "linux/sched.h"
......@@ -12,7 +13,9 @@ int main(int argc, char **argv)
{
print_head();
print_constant_ptr("TASK_DEBUGREGS", THREAD_OFFSET(arch.debugregs));
#ifdef CONFIG_MODE_TT
print_constant("TASK_EXTERN_PID", "int", THREAD_OFFSET(mode.tt.extern_pid));
#endif
print_tail();
return(0);
}
......
......@@ -9,15 +9,17 @@ SECTIONS
. = ALIGN(4096);
__binary_start = .;
#ifdef MODE_TT
.thread_private : {
__start_thread_private = .;
errno = .;
. += 4;
arch/um/kernel/unmap_fin.o (.data)
arch/um/kernel/tt/unmap_fin.o (.data)
__end_thread_private = .;
}
. = ALIGN(4096);
.remap : { arch/um/kernel/unmap_fin.o (.text) }
.remap : { arch/um/kernel/tt/unmap_fin.o (.text) }
#endif
. = ALIGN(4096); /* Init code and data */
_stext = .;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment