Skip to content

Commit

Permalink
Merge with master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux…
Browse files Browse the repository at this point in the history
…-2.6.git
  • Loading branch information
David Woodhouse committed May 8, 2005
3 parents 4332bdd + 88d7bd8 + 88d7bd8 commit 13e6528
Show file tree
Hide file tree
Showing 48 changed files with 301 additions and 375 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 12
EXTRAVERSION =-rc3
EXTRAVERSION =-rc4
NAME=Woozy Numbat

# *DOCUMENTATION*
Expand Down
2 changes: 1 addition & 1 deletion arch/i386/kernel/acpi/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ acpi_find_rsdp (void)
*/
rsdp_phys = acpi_scan_rsdp (0, 0x400);
if (!rsdp_phys)
rsdp_phys = acpi_scan_rsdp (0xE0000, 0xFFFFF);
rsdp_phys = acpi_scan_rsdp (0xE0000, 0x20000);

return rsdp_phys;
}
Expand Down
2 changes: 2 additions & 0 deletions arch/ppc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,11 @@ config 44x
bool "44x"

config POWER3
select PPC_FPU
bool "POWER3"

config POWER4
select PPC_FPU
bool "POWER4 and 970 (G5)"

config 8xx
Expand Down
1 change: 1 addition & 0 deletions arch/ppc64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ config PPC_RTAS
config RTAS_PROC
bool "Proc interface to RTAS"
depends on PPC_RTAS
default y

config RTAS_FLASH
tristate "Firmware flash interface"
Expand Down
7 changes: 0 additions & 7 deletions arch/ppc64/kernel/pSeries_smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,6 @@ static void __devinit smp_xics_setup_cpu(int cpu)

cpu_clear(cpu, of_spin_map);

/*
* Put the calling processor into the GIQ. This is really only
* necessary from a secondary thread as the OF start-cpu interface
* performs this function for us on primary threads.
*/
rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE,
(1UL << interrupt_server_size) - 1 - default_distrib_server, 1);
}

static DEFINE_SPINLOCK(timebase_lock);
Expand Down
16 changes: 12 additions & 4 deletions arch/ppc64/kernel/xics.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,16 +432,25 @@ void xics_cause_IPI(int cpu)
{
ops->qirr_info(cpu, IPI_PRIORITY);
}
#endif /* CONFIG_SMP */

void xics_setup_cpu(void)
{
int cpu = smp_processor_id();

ops->cppr_info(cpu, 0xff);
iosync();
}

#endif /* CONFIG_SMP */
/*
* Put the calling processor into the GIQ. This is really only
* necessary from a secondary thread as the OF start-cpu interface
* performs this function for us on primary threads.
*
* XXX: undo of teardown on kexec needs this too, as may hotplug
*/
rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE,
(1UL << interrupt_server_size) - 1 - default_distrib_server, 1);
}

void xics_init_IRQ(void)
{
Expand Down Expand Up @@ -563,8 +572,7 @@ void xics_init_IRQ(void)
for (; i < NR_IRQS; ++i)
get_irq_desc(i)->handler = &xics_pic;

ops->cppr_info(boot_cpuid, 0xff);
iosync();
xics_setup_cpu();

ppc64_boot_msg(0x21, "XICS Done");
}
Expand Down
1 change: 0 additions & 1 deletion arch/um/include/user_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ extern void *um_kmalloc(int size);
extern int switcheroo(int fd, int prot, void *from, void *to, int size);
extern void setup_machinename(char *machine_out);
extern void setup_hostinfo(void);
extern void add_arg(char *arg);
extern void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int));
extern void init_new_thread_signals(int altstack);
extern void do_exec(int old_pid, int new_pid);
Expand Down
6 changes: 1 addition & 5 deletions arch/um/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,10 @@ obj-$(CONFIG_SYSCALL_DEBUG) += syscall_user.o
obj-$(CONFIG_MODE_TT) += tt/
obj-$(CONFIG_MODE_SKAS) += skas/

# This needs be compiled with frame pointers regardless of how the rest of the
# kernel is built.
CFLAGS_frame.o := -fno-omit-frame-pointer

user-objs-$(CONFIG_TTY_LOG) += tty_log.o

USER_OBJS := $(user-objs-y) config.o helper.o main.o process.o tempfile.o \
time.o tty_log.o umid.o user_util.o frame.o
time.o tty_log.o umid.o user_util.o

include arch/um/scripts/Makefile.rules

Expand Down
20 changes: 9 additions & 11 deletions arch/um/kernel/process_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,6 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
return(pid);
}

void switch_mm(struct mm_struct *prev, struct mm_struct *next,
struct task_struct *tsk)
{
int cpu = smp_processor_id();

if (prev != next)
cpu_clear(cpu, prev->cpu_vm_mask);
cpu_set(cpu, next->cpu_vm_mask);
}

void set_current(void *t)
{
struct task_struct *task = t;
Expand Down Expand Up @@ -152,7 +142,6 @@ void release_thread(struct task_struct *task)

void exit_thread(void)
{
CHOOSE_MODE(exit_thread_tt(), exit_thread_skas());
unprotect_stack((unsigned long) current_thread);
}

Expand Down Expand Up @@ -476,12 +465,21 @@ int singlestepping(void * t)
return 2;
}

/*
* Only x86 and x86_64 have an arch_align_stack().
* All other arches have "#define arch_align_stack(x) (x)"
* in their asm/system.h
* As this is included in UML from asm-um/system-generic.h,
* we can use it to behave as the subarch does.
*/
#ifndef arch_align_stack
unsigned long arch_align_stack(unsigned long sp)
{
if (randomize_va_space)
sp -= get_random_int() % 8192;
return sp & ~0xf;
}
#endif


/*
Expand Down
79 changes: 29 additions & 50 deletions arch/um/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,30 @@
#include "skas_ptrace.h"
#include "sysdep/ptrace.h"

static inline void set_singlestepping(struct task_struct *child, int on)
{
if (on)
child->ptrace |= PT_DTRACE;
else
child->ptrace &= ~PT_DTRACE;
child->thread.singlestep_syscall = 0;

#ifdef SUBARCH_SET_SINGLESTEPPING
SUBARCH_SET_SINGLESTEPPING(child, on)
#endif
}

/*
* Called by kernel/ptrace.c when detaching..
*/
void ptrace_disable(struct task_struct *child)
{
child->ptrace &= ~PT_DTRACE;
child->thread.singlestep_syscall = 0;
set_singlestepping(child,0);
}

extern int peek_user(struct task_struct * child, long addr, long data);
extern int poke_user(struct task_struct * child, long addr, long data);

long sys_ptrace(long request, long pid, long addr, long data)
{
struct task_struct *child;
Expand Down Expand Up @@ -67,6 +82,10 @@ long sys_ptrace(long request, long pid, long addr, long data)
goto out_tsk;
}

#ifdef SUBACH_PTRACE_SPECIAL
SUBARCH_PTRACE_SPECIAL(child,request,addr,data)
#endif

ret = ptrace_check_attach(child, request == PTRACE_KILL);
if (ret < 0)
goto out_tsk;
Expand All @@ -87,28 +106,9 @@ long sys_ptrace(long request, long pid, long addr, long data)
}

/* read the word at location addr in the USER area. */
case PTRACE_PEEKUSR: {
unsigned long tmp;

ret = -EIO;
if ((addr & 3) || addr < 0)
break;

tmp = 0; /* Default return condition */
if(addr < MAX_REG_OFFSET){
tmp = getreg(child, addr);
}
#if defined(CONFIG_UML_X86) && !defined(CONFIG_64BIT)
else if((addr >= offsetof(struct user, u_debugreg[0])) &&
(addr <= offsetof(struct user, u_debugreg[7]))){
addr -= offsetof(struct user, u_debugreg[0]);
addr = addr >> 2;
tmp = child->thread.arch.debugregs[addr];
}
#endif
ret = put_user(tmp, (unsigned long __user *) data);
break;
}
case PTRACE_PEEKUSR:
ret = peek_user(child, addr, data);
break;

/* when I and D space are separate, this will have to be fixed. */
case PTRACE_POKETEXT: /* write the word at location addr. */
Expand All @@ -121,35 +121,16 @@ long sys_ptrace(long request, long pid, long addr, long data)
break;

case PTRACE_POKEUSR: /* write the word at location addr in the USER area */
ret = -EIO;
if ((addr & 3) || addr < 0)
break;

if (addr < MAX_REG_OFFSET) {
ret = putreg(child, addr, data);
break;
}
#if defined(CONFIG_UML_X86) && !defined(CONFIG_64BIT)
else if((addr >= offsetof(struct user, u_debugreg[0])) &&
(addr <= offsetof(struct user, u_debugreg[7]))){
addr -= offsetof(struct user, u_debugreg[0]);
addr = addr >> 2;
if((addr == 4) || (addr == 5)) break;
child->thread.arch.debugregs[addr] = data;
ret = 0;
}
#endif

break;
ret = poke_user(child, addr, data);
break;

case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
case PTRACE_CONT: { /* restart after signal. */
ret = -EIO;
if (!valid_signal(data))
break;

child->ptrace &= ~PT_DTRACE;
child->thread.singlestep_syscall = 0;
set_singlestepping(child, 0);
if (request == PTRACE_SYSCALL) {
set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
}
Expand All @@ -172,8 +153,7 @@ long sys_ptrace(long request, long pid, long addr, long data)
if (child->exit_state == EXIT_ZOMBIE) /* already dead */
break;

child->ptrace &= ~PT_DTRACE;
child->thread.singlestep_syscall = 0;
set_singlestepping(child, 0);
child->exit_code = SIGKILL;
wake_up_process(child);
break;
Expand All @@ -184,8 +164,7 @@ long sys_ptrace(long request, long pid, long addr, long data)
if (!valid_signal(data))
break;
clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
child->ptrace |= PT_DTRACE;
child->thread.singlestep_syscall = 0;
set_singlestepping(child, 1);
child->exit_code = data;
/* give it a chance to run. */
wake_up_process(child);
Expand Down
1 change: 0 additions & 1 deletion arch/um/kernel/skas/include/mode_kern-skas.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ extern int copy_thread_skas(int nr, unsigned long clone_flags,
unsigned long sp, unsigned long stack_top,
struct task_struct *p, struct pt_regs *regs);
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,
Expand Down
4 changes: 2 additions & 2 deletions arch/um/kernel/skas/include/uaccess-skas.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
((unsigned long) (addr) + (size) <= FIXADDR_USER_END) && \
((unsigned long) (addr) + (size) >= (unsigned long)(addr))))

static inline int __deprecated verify_area_skas(int type, const void * addr,
unsigned long size)
static inline int verify_area_skas(int type, const void * addr,
unsigned long size)
{
return(access_ok_skas(type, addr, size) ? 0 : -EFAULT);
}
Expand Down
35 changes: 22 additions & 13 deletions arch/um/kernel/skas/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ void userspace(union uml_pt_regs *regs)
}
}
}
#define INIT_JMP_NEW_THREAD 0
#define INIT_JMP_REMOVE_SIGSTACK 1
#define INIT_JMP_CALLBACK 2
#define INIT_JMP_HALT 3
#define INIT_JMP_REBOOT 4

void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr,
void (*handler)(int))
Expand Down Expand Up @@ -236,7 +241,7 @@ void thread_wait(void *sw, void *fb)
*switch_buf = &buf;
fork_buf = fb;
if(sigsetjmp(buf, 1) == 0)
siglongjmp(*fork_buf, 1);
siglongjmp(*fork_buf, INIT_JMP_REMOVE_SIGSTACK);
}

void switch_threads(void *me, void *next)
Expand Down Expand Up @@ -266,21 +271,25 @@ int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr)

*fork_buf_ptr = &initial_jmpbuf;
n = sigsetjmp(initial_jmpbuf, 1);
if(n == 0)
new_thread_proc((void *) stack, new_thread_handler);
else if(n == 1)
remove_sigstack();
else if(n == 2){
switch(n){
case INIT_JMP_NEW_THREAD:
new_thread_proc((void *) stack, new_thread_handler);
break;
case INIT_JMP_REMOVE_SIGSTACK:
remove_sigstack();
break;
case INIT_JMP_CALLBACK:
(*cb_proc)(cb_arg);
siglongjmp(*cb_back, 1);
}
else if(n == 3){
break;
case INIT_JMP_HALT:
kmalloc_ok = 0;
return(0);
}
else if(n == 4){
case INIT_JMP_REBOOT:
kmalloc_ok = 0;
return(1);
default:
panic("Bad sigsetjmp return in start_idle_thread - %d\n", n);
}
siglongjmp(**switch_buf, 1);
}
Expand All @@ -305,7 +314,7 @@ void initial_thread_cb_skas(void (*proc)(void *), void *arg)

block_signals();
if(sigsetjmp(here, 1) == 0)
siglongjmp(initial_jmpbuf, 2);
siglongjmp(initial_jmpbuf, INIT_JMP_CALLBACK);
unblock_signals();

cb_proc = NULL;
Expand All @@ -316,13 +325,13 @@ void initial_thread_cb_skas(void (*proc)(void *), void *arg)
void halt_skas(void)
{
block_signals();
siglongjmp(initial_jmpbuf, 3);
siglongjmp(initial_jmpbuf, INIT_JMP_HALT);
}

void reboot_skas(void)
{
block_signals();
siglongjmp(initial_jmpbuf, 4);
siglongjmp(initial_jmpbuf, INIT_JMP_REBOOT);
}

void switch_mm_skas(int mm_fd)
Expand Down
Loading

0 comments on commit 13e6528

Please sign in to comment.