Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 1918
b: refs/heads/master
c: 8181b8c
h: refs/heads/master
v: v3
  • Loading branch information
Gabor Fekete authored and David S. Miller committed Jun 8, 2005
1 parent 1c91a50 commit 47558bf
Show file tree
Hide file tree
Showing 37 changed files with 143 additions and 258 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ce10d979053379553757c3b178a138facaddff82
refs/heads/master: 8181b8c1f3a69fe5abcc51cb732eb512ccd1566a
2 changes: 1 addition & 1 deletion trunk/arch/i386/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ obj-$(CONFIG_SCx200) += scx200.o
# Note: kbuild does not track this dependency due to usage of .incbin
$(obj)/vsyscall.o: $(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so
targets += $(foreach F,int80 sysenter,vsyscall-$F.o vsyscall-$F.so)
targets += vsyscall-note.o vsyscall.lds
targets += vsyscall.lds

# The DSO images are built using a special linker script.
quiet_cmd_syscall = SYSCALL $@
Expand Down
10 changes: 4 additions & 6 deletions trunk/arch/ia64/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -825,16 +825,14 @@ apply_relocate_add (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symind
* XXX Should have an arch-hook for running this after final section
* addresses have been selected...
*/
uint64_t gp;
if (mod->core_size > MAX_LTOFF)
/* See if gp can cover the entire core module: */
uint64_t gp = (uint64_t) mod->module_core + MAX_LTOFF / 2;
if (mod->core_size >= MAX_LTOFF)
/*
* This takes advantage of fact that SHF_ARCH_SMALL gets allocated
* at the end of the module.
*/
gp = mod->core_size - MAX_LTOFF / 2;
else
gp = mod->core_size / 2;
gp = (uint64_t) mod->module_core + ((gp + 7) & -8);
gp = (uint64_t) mod->module_core + mod->core_size - MAX_LTOFF / 2;
mod->arch.gp = gp;
DEBUGP("%s: placing gp at 0x%lx\n", __FUNCTION__, gp);
}
Expand Down
6 changes: 0 additions & 6 deletions trunk/arch/ia64/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,17 +635,11 @@ ia64_flush_fph (struct task_struct *task)
{
struct ia64_psr *psr = ia64_psr(ia64_task_regs(task));

/*
* Prevent migrating this task while
* we're fiddling with the FPU state
*/
preempt_disable();
if (ia64_is_local_fpu_owner(task) && psr->mfh) {
psr->mfh = 0;
task->thread.flags |= IA64_THREAD_FPH_VALID;
ia64_save_fpu(&task->thread.fph[0]);
}
preempt_enable();
}

/*
Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/ia64/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,8 +720,7 @@ cpu_init (void)
ia64_set_kr(IA64_KR_PT_BASE, __pa(ia64_imva(empty_zero_page)));

/*
* Initialize default control register to defer speculative faults except
* for those arising from TLB misses, which are not deferred. The
* Initialize default control register to defer all speculative faults. The
* kernel MUST NOT depend on a particular setting of these bits (in other words,
* the kernel must have recovery code for all speculative accesses). Turn on
* dcr.lc as per recommendation by the architecture team. Most IA-32 apps
Expand Down
29 changes: 1 addition & 28 deletions trunk/arch/ia64/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,24 +111,6 @@ ia64_bad_break (unsigned long break_num, struct pt_regs *regs)
siginfo_t siginfo;
int sig, code;

/* break.b always sets cr.iim to 0, which causes problems for
* debuggers. Get the real break number from the original instruction,
* but only for kernel code. User space break.b is left alone, to
* preserve the existing behaviour. All break codings have the same
* format, so there is no need to check the slot type.
*/
if (break_num == 0 && !user_mode(regs)) {
struct ia64_psr *ipsr = ia64_psr(regs);
unsigned long *bundle = (unsigned long *)regs->cr_iip;
unsigned long slot;
switch (ipsr->ri) {
case 0: slot = (bundle[0] >> 5); break;
case 1: slot = (bundle[0] >> 46) | (bundle[1] << 18); break;
default: slot = (bundle[1] >> 23); break;
}
break_num = ((slot >> 36 & 1) << 20) | (slot >> 6 & 0xfffff);
}

/* SIGILL, SIGFPE, SIGSEGV, and SIGBUS want these field initialized: */
siginfo.si_addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri);
siginfo.si_imm = break_num;
Expand Down Expand Up @@ -220,21 +202,13 @@ disabled_fph_fault (struct pt_regs *regs)

/* first, grant user-level access to fph partition: */
psr->dfh = 0;

/*
* Make sure that no other task gets in on this processor
* while we're claiming the FPU
*/
preempt_disable();
#ifndef CONFIG_SMP
{
struct task_struct *fpu_owner
= (struct task_struct *)ia64_get_kr(IA64_KR_FPU_OWNER);

if (ia64_is_local_fpu_owner(current)) {
preempt_enable_no_resched();
if (ia64_is_local_fpu_owner(current))
return;
}

if (fpu_owner)
ia64_flush_fph(fpu_owner);
Expand All @@ -252,7 +226,6 @@ disabled_fph_fault (struct pt_regs *regs)
*/
psr->mfh = 1;
}
preempt_enable_no_resched();
}

static inline int
Expand Down
19 changes: 2 additions & 17 deletions trunk/arch/ia64/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,8 @@ setup_gate (void)
struct page *page;

/*
* Map the gate page twice: once read-only to export the ELF
* headers etc. and once execute-only page to enable
* privilege-promotion via "epc":
* Map the gate page twice: once read-only to export the ELF headers etc. and once
* execute-only page to enable privilege-promotion via "epc":
*/
page = virt_to_page(ia64_imva(__start_gate_section));
put_kernel_page(page, GATE_ADDR, PAGE_READONLY);
Expand All @@ -316,20 +315,6 @@ setup_gate (void)
put_kernel_page(page, GATE_ADDR + PAGE_SIZE, PAGE_GATE);
#else
put_kernel_page(page, GATE_ADDR + PERCPU_PAGE_SIZE, PAGE_GATE);
/* Fill in the holes (if any) with read-only zero pages: */
{
unsigned long addr;

for (addr = GATE_ADDR + PAGE_SIZE;
addr < GATE_ADDR + PERCPU_PAGE_SIZE;
addr += PAGE_SIZE)
{
put_kernel_page(ZERO_PAGE(0), addr,
PAGE_READONLY);
put_kernel_page(ZERO_PAGE(0), addr + PERCPU_PAGE_SIZE,
PAGE_READONLY);
}
}
#endif
ia64_patch_gate();
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/ia64/sn/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ void __init early_sn_setup(void)

extern int platform_intr_list[];
extern nasid_t master_nasid;
static int __initdata shub_1_1_found = 0;
static int shub_1_1_found __initdata;

/*
* sn_check_for_wars
Expand Down Expand Up @@ -251,7 +251,7 @@ static void __init sn_check_for_wars(void)
} else {
for_each_online_node(cnode) {
if (is_shub_1_1(cnodeid_to_nasid(cnode)))
shub_1_1_found = 1;
sn_hub_info->shub_1_1_found = 1;
}
}
}
Expand Down
11 changes: 0 additions & 11 deletions trunk/arch/ppc/kernel/cputable.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,17 +849,6 @@ struct cpu_spec cpu_specs[] = {
.icache_bsize = 32,
.dcache_bsize = 32,
},
{ /* 405EP */
.pvr_mask = 0xffff0000,
.pvr_value = 0x51210000,
.cpu_name = "405EP",
.cpu_features = CPU_FTR_SPLIT_ID_CACHE |
CPU_FTR_USE_TB,
.cpu_user_features = PPC_FEATURE_32 |
PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
.icache_bsize = 32,
.dcache_bsize = 32,
},

#endif /* CONFIG_40x */
#ifdef CONFIG_44x
Expand Down
16 changes: 6 additions & 10 deletions trunk/arch/ppc64/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,12 @@ static struct pt_regs jprobe_saved_regs;

int arch_prepare_kprobe(struct kprobe *p)
{
int ret = 0;
kprobe_opcode_t insn = *p->addr;

if ((unsigned long)p->addr & 0x03) {
printk("Attempt to register kprobe at an unaligned address\n");
ret = -EINVAL;
} else if (IS_MTMSRD(insn) || IS_RFID(insn)) {
printk("Cannot register a kprobe on rfid or mtmsrd\n");
ret = -EINVAL;
}
return ret;
if (IS_MTMSRD(insn) || IS_RFID(insn))
/* cannot put bp on RFID/MTMSRD */
return 1;
return 0;
}

void arch_copy_kprobe(struct kprobe *p)
Expand Down Expand Up @@ -177,6 +172,8 @@ static void resume_execution(struct kprobe *p, struct pt_regs *regs)
ret = emulate_step(regs, p->ainsn.insn[0]);
if (ret == 0)
regs->nip = (unsigned long)p->addr + 4;

regs->msr &= ~MSR_SE;
}

static inline int post_kprobe_handler(struct pt_regs *regs)
Expand Down Expand Up @@ -213,7 +210,6 @@ static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr)

if (kprobe_status & KPROBE_HIT_SS) {
resume_execution(current_kprobe, regs);
regs->msr &= ~MSR_SE;
regs->msr |= kprobe_saved_msr;

unlock_kprobes();
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/ppc64/kernel/misc.S
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ _GLOBAL(sys_call_table32)
.llong .compat_sys_newstat
.llong .compat_sys_newlstat
.llong .compat_sys_newfstat
.llong .sys32_uname
.llong .sys_uname
.llong .sys_ni_syscall /* 110 old iopl syscall */
.llong .sys_vhangup
.llong .sys_ni_syscall /* old idle syscall */
Expand Down
70 changes: 37 additions & 33 deletions trunk/arch/ppc64/kernel/sys_ppc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,31 @@ asmlinkage int sys32_pciconfig_iobase(u32 which, u32 in_bus, u32 in_devfn)
}


asmlinkage int ppc64_newuname(struct new_utsname __user * name)
{
int errno = sys_newuname(name);

if (current->personality == PER_LINUX32 && !errno) {
if(copy_to_user(name->machine, "ppc\0\0", 8)) {
errno = -EFAULT;
}
}
return errno;
}

asmlinkage int ppc64_personality(unsigned long personality)
{
int ret;
if (current->personality == PER_LINUX32 && personality == PER_LINUX)
personality = PER_LINUX32;
ret = sys_personality(personality);
if (ret == PER_LINUX32)
ret = PER_LINUX;
return ret;
}



/* Note: it is necessary to treat mode as an unsigned int,
* with the corresponding cast to a signed int to insure that the
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
Expand Down Expand Up @@ -1133,47 +1158,26 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
}
#endif

asmlinkage int sys32_uname(struct old_utsname __user * name)
{
int err = 0;

down_read(&uts_sem);
if (copy_to_user(name, &system_utsname, sizeof(*name)))
err = -EFAULT;
up_read(&uts_sem);
if (!err && personality(current->personality) == PER_LINUX32) {
/* change "ppc64" to "ppc" */
if (__put_user(0, name->machine + 3)
|| __put_user(0, name->machine + 4))
err = -EFAULT;
}
return err;
}

asmlinkage int sys32_olduname(struct oldold_utsname __user * name)
{
int error;


if (!name)
return -EFAULT;
if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname)))
return -EFAULT;

down_read(&uts_sem);
error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN);
error |= __put_user(0,name->sysname+__OLD_UTS_LEN);
error |= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN);
error |= __put_user(0,name->nodename+__OLD_UTS_LEN);
error |= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN);
error |= __put_user(0,name->release+__OLD_UTS_LEN);
error |= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN);
error |= __put_user(0,name->version+__OLD_UTS_LEN);
error |= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN);
error |= __put_user(0,name->machine+__OLD_UTS_LEN);
if (personality(current->personality) == PER_LINUX32) {
/* change "ppc64" to "ppc" */
error |= __put_user(0, name->machine + 3);
error |= __put_user(0, name->machine + 4);
}

error -= __put_user(0,name->sysname+__OLD_UTS_LEN);
error -= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN);
error -= __put_user(0,name->nodename+__OLD_UTS_LEN);
error -= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN);
error -= __put_user(0,name->release+__OLD_UTS_LEN);
error -= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN);
error -= __put_user(0,name->version+__OLD_UTS_LEN);
error -= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN);
error = __put_user(0,name->machine+__OLD_UTS_LEN);
up_read(&uts_sem);

error = error ? -EFAULT : 0;
Expand Down
33 changes: 12 additions & 21 deletions trunk/arch/ppc64/kernel/syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,33 +199,24 @@ unsigned long sys_mmap(unsigned long addr, size_t len,
return ret;
}

long ppc64_personality(unsigned long personality)
static int __init set_fakeppc(char *str)
{
long ret;

if (personality(current->personality) == PER_LINUX32
&& personality == PER_LINUX)
personality = PER_LINUX32;
ret = sys_personality(personality);
if (ret == PER_LINUX32)
ret = PER_LINUX;
return ret;
if (*str)
return 0;
init_task.personality = PER_LINUX32;
return 1;
}
__setup("fakeppc", set_fakeppc);

long ppc64_newuname(struct new_utsname __user * name)
asmlinkage int sys_uname(struct old_utsname __user * name)
{
int err = 0;

int err = -EFAULT;
down_read(&uts_sem);
if (copy_to_user(name, &system_utsname, sizeof(*name)))
err = -EFAULT;
if (name && !copy_to_user(name, &system_utsname, sizeof (*name)))
err = 0;
up_read(&uts_sem);
if (!err && personality(current->personality) == PER_LINUX32) {
/* change ppc64 to ppc */
if (__put_user(0, name->machine + 3)
|| __put_user(0, name->machine + 4))
err = -EFAULT;
}

return err;
}

Expand Down
6 changes: 0 additions & 6 deletions trunk/arch/um/Kconfig_char
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,5 @@ config UML_RANDOM
http://sourceforge.net/projects/gkernel/). rngd periodically reads
/dev/hwrng and injects the entropy into /dev/random.

config MMAPPER
tristate "iomem emulation driver"
help
This driver allows a host file to be used as emulated IO memory inside
UML.

endmenu

Loading

0 comments on commit 47558bf

Please sign in to comment.