aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64/kernel')
-rw-r--r--arch/ia64/kernel/audit.c21
-rw-r--r--arch/ia64/kernel/entry.S39
-rw-r--r--arch/ia64/kernel/ivt.S114
-rw-r--r--arch/ia64/kernel/process.c55
-rw-r--r--arch/ia64/kernel/ptrace.c14
-rw-r--r--arch/ia64/kernel/setup.c5
-rw-r--r--arch/ia64/kernel/signal.c54
-rw-r--r--arch/ia64/kernel/smpboot.c5
-rw-r--r--arch/ia64/kernel/traps.c9
9 files changed, 19 insertions, 297 deletions
diff --git a/arch/ia64/kernel/audit.c b/arch/ia64/kernel/audit.c
index f3802ae89b10..96a9d18ff4c4 100644
--- a/arch/ia64/kernel/audit.c
+++ b/arch/ia64/kernel/audit.c
@@ -30,20 +30,11 @@ static unsigned signal_class[] = {
30 30
31int audit_classify_arch(int arch) 31int audit_classify_arch(int arch)
32{ 32{
33#ifdef CONFIG_IA32_SUPPORT
34 if (arch == AUDIT_ARCH_I386)
35 return 1;
36#endif
37 return 0; 33 return 0;
38} 34}
39 35
40int audit_classify_syscall(int abi, unsigned syscall) 36int audit_classify_syscall(int abi, unsigned syscall)
41{ 37{
42#ifdef CONFIG_IA32_SUPPORT
43 extern int ia32_classify_syscall(unsigned);
44 if (abi == AUDIT_ARCH_I386)
45 return ia32_classify_syscall(syscall);
46#endif
47 switch(syscall) { 38 switch(syscall) {
48 case __NR_open: 39 case __NR_open:
49 return 2; 40 return 2;
@@ -58,18 +49,6 @@ int audit_classify_syscall(int abi, unsigned syscall)
58 49
59static int __init audit_classes_init(void) 50static int __init audit_classes_init(void)
60{ 51{
61#ifdef CONFIG_IA32_SUPPORT
62 extern __u32 ia32_dir_class[];
63 extern __u32 ia32_write_class[];
64 extern __u32 ia32_read_class[];
65 extern __u32 ia32_chattr_class[];
66 extern __u32 ia32_signal_class[];
67 audit_register_class(AUDIT_CLASS_WRITE_32, ia32_write_class);
68 audit_register_class(AUDIT_CLASS_READ_32, ia32_read_class);
69 audit_register_class(AUDIT_CLASS_DIR_WRITE_32, ia32_dir_class);
70 audit_register_class(AUDIT_CLASS_CHATTR_32, ia32_chattr_class);
71 audit_register_class(AUDIT_CLASS_SIGNAL_32, ia32_signal_class);
72#endif
73 audit_register_class(AUDIT_CLASS_WRITE, write_class); 52 audit_register_class(AUDIT_CLASS_WRITE, write_class);
74 audit_register_class(AUDIT_CLASS_READ, read_class); 53 audit_register_class(AUDIT_CLASS_READ, read_class);
75 audit_register_class(AUDIT_CLASS_DIR_WRITE, dir_class); 54 audit_register_class(AUDIT_CLASS_DIR_WRITE, dir_class);
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index d75b872ca4dc..9a260b317d8d 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -71,15 +71,6 @@ ENTRY(ia64_execve)
71 add out3=16,sp // regs 71 add out3=16,sp // regs
72 br.call.sptk.many rp=sys_execve 72 br.call.sptk.many rp=sys_execve
73.ret0: 73.ret0:
74#ifdef CONFIG_IA32_SUPPORT
75 /*
76 * Check if we're returning to ia32 mode. If so, we need to restore ia32 registers
77 * from pt_regs.
78 */
79 adds r16=PT(CR_IPSR)+16,sp
80 ;;
81 ld8 r16=[r16]
82#endif
83 cmp4.ge p6,p7=r8,r0 74 cmp4.ge p6,p7=r8,r0
84 mov ar.pfs=loc1 // restore ar.pfs 75 mov ar.pfs=loc1 // restore ar.pfs
85 sxt4 r8=r8 // return 64-bit result 76 sxt4 r8=r8 // return 64-bit result
@@ -108,12 +99,6 @@ ENTRY(ia64_execve)
108 ldf.fill f23=[sp]; ldf.fill f24=[sp]; mov f25=f0 99 ldf.fill f23=[sp]; ldf.fill f24=[sp]; mov f25=f0
109 ldf.fill f26=[sp]; ldf.fill f27=[sp]; mov f28=f0 100 ldf.fill f26=[sp]; ldf.fill f27=[sp]; mov f28=f0
110 ldf.fill f29=[sp]; ldf.fill f30=[sp]; mov f31=f0 101 ldf.fill f29=[sp]; ldf.fill f30=[sp]; mov f31=f0
111#ifdef CONFIG_IA32_SUPPORT
112 tbit.nz p6,p0=r16, IA64_PSR_IS_BIT
113 movl loc0=ia64_ret_from_ia32_execve
114 ;;
115(p6) mov rp=loc0
116#endif
117 br.ret.sptk.many rp 102 br.ret.sptk.many rp
118END(ia64_execve) 103END(ia64_execve)
119 104
@@ -848,30 +833,6 @@ __paravirt_work_processed_syscall:
848 br.cond.sptk.many rbs_switch // B 833 br.cond.sptk.many rbs_switch // B
849END(__paravirt_leave_syscall) 834END(__paravirt_leave_syscall)
850 835
851#ifdef __IA64_ASM_PARAVIRTUALIZED_NATIVE
852#ifdef CONFIG_IA32_SUPPORT
853GLOBAL_ENTRY(ia64_ret_from_ia32_execve)
854 PT_REGS_UNWIND_INFO(0)
855 adds r2=PT(R8)+16,sp // r2 = &pt_regs.r8
856 adds r3=PT(R10)+16,sp // r3 = &pt_regs.r10
857 ;;
858 .mem.offset 0,0
859 st8.spill [r2]=r8 // store return value in slot for r8 and set unat bit
860 .mem.offset 8,0
861 st8.spill [r3]=r0 // clear error indication in slot for r10 and set unat bit
862#ifdef CONFIG_PARAVIRT
863 ;;
864 // don't fall through, ia64_leave_kernel may be #define'd
865 br.cond.sptk.few ia64_leave_kernel
866 ;;
867#endif /* CONFIG_PARAVIRT */
868END(ia64_ret_from_ia32_execve)
869#ifndef CONFIG_PARAVIRT
870 // fall through
871#endif
872#endif /* CONFIG_IA32_SUPPORT */
873#endif /* __IA64_ASM_PARAVIRTUALIZED_NATIVE */
874
875GLOBAL_ENTRY(__paravirt_leave_kernel) 836GLOBAL_ENTRY(__paravirt_leave_kernel)
876 PT_REGS_UNWIND_INFO(0) 837 PT_REGS_UNWIND_INFO(0)
877 /* 838 /*
diff --git a/arch/ia64/kernel/ivt.S b/arch/ia64/kernel/ivt.S
index ec9a5fdfa1b9..179fd122e837 100644
--- a/arch/ia64/kernel/ivt.S
+++ b/arch/ia64/kernel/ivt.S
@@ -49,7 +49,6 @@
49 49
50#include <asm/asmmacro.h> 50#include <asm/asmmacro.h>
51#include <asm/break.h> 51#include <asm/break.h>
52#include <asm/ia32.h>
53#include <asm/kregs.h> 52#include <asm/kregs.h>
54#include <asm/asm-offsets.h> 53#include <asm/asm-offsets.h>
55#include <asm/pgtable.h> 54#include <asm/pgtable.h>
@@ -1386,28 +1385,6 @@ END(ia32_exception)
1386// 0x6a00 Entry 46 (size 16 bundles) IA-32 Intercept (30,31,59,70,71) 1385// 0x6a00 Entry 46 (size 16 bundles) IA-32 Intercept (30,31,59,70,71)
1387ENTRY(ia32_intercept) 1386ENTRY(ia32_intercept)
1388 DBG_FAULT(46) 1387 DBG_FAULT(46)
1389#ifdef CONFIG_IA32_SUPPORT
1390 mov r31=pr
1391 MOV_FROM_ISR(r16)
1392 ;;
1393 extr.u r17=r16,16,8 // get ISR.code
1394 mov r18=ar.eflag
1395 MOV_FROM_IIM(r19) // old eflag value
1396 ;;
1397 cmp.ne p6,p0=2,r17
1398(p6) br.cond.spnt 1f // not a system flag fault
1399 xor r16=r18,r19
1400 ;;
1401 extr.u r17=r16,18,1 // get the eflags.ac bit
1402 ;;
1403 cmp.eq p6,p0=0,r17
1404(p6) br.cond.spnt 1f // eflags.ac bit didn't change
1405 ;;
1406 mov pr=r31,-1 // restore predicate registers
1407 RFI
1408
14091:
1410#endif // CONFIG_IA32_SUPPORT
1411 FAULT(46) 1388 FAULT(46)
1412END(ia32_intercept) 1389END(ia32_intercept)
1413 1390
@@ -1416,12 +1393,7 @@ END(ia32_intercept)
1416// 0x6b00 Entry 47 (size 16 bundles) IA-32 Interrupt (74) 1393// 0x6b00 Entry 47 (size 16 bundles) IA-32 Interrupt (74)
1417ENTRY(ia32_interrupt) 1394ENTRY(ia32_interrupt)
1418 DBG_FAULT(47) 1395 DBG_FAULT(47)
1419#ifdef CONFIG_IA32_SUPPORT
1420 mov r31=pr
1421 br.sptk.many dispatch_to_ia32_handler
1422#else
1423 FAULT(47) 1396 FAULT(47)
1424#endif
1425END(ia32_interrupt) 1397END(ia32_interrupt)
1426 1398
1427 .org ia64_ivt+0x6c00 1399 .org ia64_ivt+0x6c00
@@ -1715,89 +1687,3 @@ ENTRY(dispatch_illegal_op_fault)
1715(p6) br.call.dpnt.many b6=b6 // call returns to ia64_leave_kernel 1687(p6) br.call.dpnt.many b6=b6 // call returns to ia64_leave_kernel
1716 br.sptk.many ia64_leave_kernel 1688 br.sptk.many ia64_leave_kernel
1717END(dispatch_illegal_op_fault) 1689END(dispatch_illegal_op_fault)
1718
1719#ifdef CONFIG_IA32_SUPPORT
1720
1721 /*
1722 * There is no particular reason for this code to be here, other than that
1723 * there happens to be space here that would go unused otherwise. If this
1724 * fault ever gets "unreserved", simply moved the following code to a more
1725 * suitable spot...
1726 */
1727
1728 // IA32 interrupt entry point
1729
1730ENTRY(dispatch_to_ia32_handler)
1731 SAVE_MIN
1732 ;;
1733 MOV_FROM_ISR(r14)
1734 SSM_PSR_IC_AND_DEFAULT_BITS_AND_SRLZ_I(r3, r24)
1735 // guarantee that interruption collection is on
1736 ;;
1737 SSM_PSR_I(p15, p15, r3)
1738 adds r3=8,r2 // Base pointer for SAVE_REST
1739 ;;
1740 SAVE_REST
1741 ;;
1742 mov r15=0x80
1743 shr r14=r14,16 // Get interrupt number
1744 ;;
1745 cmp.ne p6,p0=r14,r15
1746(p6) br.call.dpnt.many b6=non_ia32_syscall
1747
1748 adds r14=IA64_PT_REGS_R8_OFFSET + 16,sp // 16 byte hole per SW conventions
1749 adds r15=IA64_PT_REGS_R1_OFFSET + 16,sp
1750 ;;
1751 cmp.eq pSys,pNonSys=r0,r0 // set pSys=1, pNonSys=0
1752 ld8 r8=[r14] // get r8
1753 ;;
1754 st8 [r15]=r8 // save original EAX in r1 (IA32 procs don't use the GP)
1755 ;;
1756 alloc r15=ar.pfs,0,0,6,0 // must first in an insn group
1757 ;;
1758 ld4 r8=[r14],8 // r8 == eax (syscall number)
1759 mov r15=IA32_NR_syscalls
1760 ;;
1761 cmp.ltu.unc p6,p7=r8,r15
1762 ld4 out1=[r14],8 // r9 == ecx
1763 ;;
1764 ld4 out2=[r14],8 // r10 == edx
1765 ;;
1766 ld4 out0=[r14] // r11 == ebx
1767 adds r14=(IA64_PT_REGS_R13_OFFSET) + 16,sp
1768 ;;
1769 ld4 out5=[r14],PT(R14)-PT(R13) // r13 == ebp
1770 ;;
1771 ld4 out3=[r14],PT(R15)-PT(R14) // r14 == esi
1772 adds r2=TI_FLAGS+IA64_TASK_SIZE,r13
1773 ;;
1774 ld4 out4=[r14] // r15 == edi
1775 movl r16=ia32_syscall_table
1776 ;;
1777(p6) shladd r16=r8,3,r16 // force ni_syscall if not valid syscall number
1778 ld4 r2=[r2] // r2 = current_thread_info()->flags
1779 ;;
1780 ld8 r16=[r16]
1781 and r2=_TIF_SYSCALL_TRACEAUDIT,r2 // mask trace or audit
1782 ;;
1783 mov b6=r16
1784 movl r15=ia32_ret_from_syscall
1785 cmp.eq p8,p0=r2,r0
1786 ;;
1787 mov rp=r15
1788(p8) br.call.sptk.many b6=b6
1789 br.cond.sptk ia32_trace_syscall
1790
1791non_ia32_syscall:
1792 alloc r15=ar.pfs,0,0,2,0
1793 mov out0=r14 // interrupt #
1794 add out1=16,sp // pointer to pt_regs
1795 ;; // avoid WAW on CFM
1796 br.call.sptk.many rp=ia32_bad_interrupt
1797.ret1: movl r15=ia64_leave_kernel
1798 ;;
1799 mov rp=r15
1800 br.ret.sptk.many rp
1801END(dispatch_to_ia32_handler)
1802
1803#endif /* CONFIG_IA32_SUPPORT */
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index 9bcec9945c12..883ecc9cfef5 100644
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -33,7 +33,6 @@
33#include <asm/cpu.h> 33#include <asm/cpu.h>
34#include <asm/delay.h> 34#include <asm/delay.h>
35#include <asm/elf.h> 35#include <asm/elf.h>
36#include <asm/ia32.h>
37#include <asm/irq.h> 36#include <asm/irq.h>
38#include <asm/kexec.h> 37#include <asm/kexec.h>
39#include <asm/pgalloc.h> 38#include <asm/pgalloc.h>
@@ -358,11 +357,6 @@ ia64_save_extra (struct task_struct *task)
358 if (info & PFM_CPUINFO_SYST_WIDE) 357 if (info & PFM_CPUINFO_SYST_WIDE)
359 pfm_syst_wide_update_task(task, info, 0); 358 pfm_syst_wide_update_task(task, info, 0);
360#endif 359#endif
361
362#ifdef CONFIG_IA32_SUPPORT
363 if (IS_IA32_PROCESS(task_pt_regs(task)))
364 ia32_save_state(task);
365#endif
366} 360}
367 361
368void 362void
@@ -383,11 +377,6 @@ ia64_load_extra (struct task_struct *task)
383 if (info & PFM_CPUINFO_SYST_WIDE) 377 if (info & PFM_CPUINFO_SYST_WIDE)
384 pfm_syst_wide_update_task(task, info, 1); 378 pfm_syst_wide_update_task(task, info, 1);
385#endif 379#endif
386
387#ifdef CONFIG_IA32_SUPPORT
388 if (IS_IA32_PROCESS(task_pt_regs(task)))
389 ia32_load_state(task);
390#endif
391} 380}
392 381
393/* 382/*
@@ -426,7 +415,7 @@ copy_thread(unsigned long clone_flags,
426 unsigned long user_stack_base, unsigned long user_stack_size, 415 unsigned long user_stack_base, unsigned long user_stack_size,
427 struct task_struct *p, struct pt_regs *regs) 416 struct task_struct *p, struct pt_regs *regs)
428{ 417{
429 extern char ia64_ret_from_clone, ia32_ret_from_clone; 418 extern char ia64_ret_from_clone;
430 struct switch_stack *child_stack, *stack; 419 struct switch_stack *child_stack, *stack;
431 unsigned long rbs, child_rbs, rbs_size; 420 unsigned long rbs, child_rbs, rbs_size;
432 struct pt_regs *child_ptregs; 421 struct pt_regs *child_ptregs;
@@ -457,7 +446,7 @@ copy_thread(unsigned long clone_flags,
457 memcpy((void *) child_rbs, (void *) rbs, rbs_size); 446 memcpy((void *) child_rbs, (void *) rbs, rbs_size);
458 447
459 if (likely(user_mode(child_ptregs))) { 448 if (likely(user_mode(child_ptregs))) {
460 if ((clone_flags & CLONE_SETTLS) && !IS_IA32_PROCESS(regs)) 449 if (clone_flags & CLONE_SETTLS)
461 child_ptregs->r13 = regs->r16; /* see sys_clone2() in entry.S */ 450 child_ptregs->r13 = regs->r16; /* see sys_clone2() in entry.S */
462 if (user_stack_base) { 451 if (user_stack_base) {
463 child_ptregs->r12 = user_stack_base + user_stack_size - 16; 452 child_ptregs->r12 = user_stack_base + user_stack_size - 16;
@@ -477,10 +466,7 @@ copy_thread(unsigned long clone_flags,
477 child_ptregs->r13 = (unsigned long) p; /* set `current' pointer */ 466 child_ptregs->r13 = (unsigned long) p; /* set `current' pointer */
478 } 467 }
479 child_stack->ar_bspstore = child_rbs + rbs_size; 468 child_stack->ar_bspstore = child_rbs + rbs_size;
480 if (IS_IA32_PROCESS(regs)) 469 child_stack->b0 = (unsigned long) &ia64_ret_from_clone;
481 child_stack->b0 = (unsigned long) &ia32_ret_from_clone;
482 else
483 child_stack->b0 = (unsigned long) &ia64_ret_from_clone;
484 470
485 /* copy parts of thread_struct: */ 471 /* copy parts of thread_struct: */
486 p->thread.ksp = (unsigned long) child_stack - 16; 472 p->thread.ksp = (unsigned long) child_stack - 16;
@@ -515,22 +501,6 @@ copy_thread(unsigned long clone_flags,
515 p->thread.flags = ((current->thread.flags & ~THREAD_FLAGS_TO_CLEAR) 501 p->thread.flags = ((current->thread.flags & ~THREAD_FLAGS_TO_CLEAR)
516 | THREAD_FLAGS_TO_SET); 502 | THREAD_FLAGS_TO_SET);
517 ia64_drop_fpu(p); /* don't pick up stale state from a CPU's fph */ 503 ia64_drop_fpu(p); /* don't pick up stale state from a CPU's fph */
518#ifdef CONFIG_IA32_SUPPORT
519 /*
520 * If we're cloning an IA32 task then save the IA32 extra
521 * state from the current task to the new task
522 */
523 if (IS_IA32_PROCESS(task_pt_regs(current))) {
524 ia32_save_state(p);
525 if (clone_flags & CLONE_SETTLS)
526 retval = ia32_clone_tls(p, child_ptregs);
527
528 /* Copy partially mapped page list */
529 if (!retval)
530 retval = ia32_copy_ia64_partial_page_list(p,
531 clone_flags);
532 }
533#endif
534 504
535#ifdef CONFIG_PERFMON 505#ifdef CONFIG_PERFMON
536 if (current->thread.pfm_context) 506 if (current->thread.pfm_context)
@@ -704,15 +674,6 @@ EXPORT_SYMBOL(kernel_thread);
704int 674int
705kernel_thread_helper (int (*fn)(void *), void *arg) 675kernel_thread_helper (int (*fn)(void *), void *arg)
706{ 676{
707#ifdef CONFIG_IA32_SUPPORT
708 if (IS_IA32_PROCESS(task_pt_regs(current))) {
709 /* A kernel thread is always a 64-bit process. */
710 current->thread.map_base = DEFAULT_MAP_BASE;
711 current->thread.task_size = DEFAULT_TASK_SIZE;
712 ia64_set_kr(IA64_KR_IO_BASE, current->thread.old_iob);
713 ia64_set_kr(IA64_KR_TSSD, current->thread.old_k1);
714 }
715#endif
716 return (*fn)(arg); 677 return (*fn)(arg);
717} 678}
718 679
@@ -725,14 +686,6 @@ flush_thread (void)
725 /* drop floating-point and debug-register state if it exists: */ 686 /* drop floating-point and debug-register state if it exists: */
726 current->thread.flags &= ~(IA64_THREAD_FPH_VALID | IA64_THREAD_DBG_VALID); 687 current->thread.flags &= ~(IA64_THREAD_FPH_VALID | IA64_THREAD_DBG_VALID);
727 ia64_drop_fpu(current); 688 ia64_drop_fpu(current);
728#ifdef CONFIG_IA32_SUPPORT
729 if (IS_IA32_PROCESS(task_pt_regs(current))) {
730 ia32_drop_ia64_partial_page_list(current);
731 current->thread.task_size = IA32_PAGE_OFFSET;
732 set_fs(USER_DS);
733 memset(current->thread.tls_array, 0, sizeof(current->thread.tls_array));
734 }
735#endif
736} 689}
737 690
738/* 691/*
@@ -753,8 +706,6 @@ exit_thread (void)
753 if (current->thread.flags & IA64_THREAD_DBG_VALID) 706 if (current->thread.flags & IA64_THREAD_DBG_VALID)
754 pfm_release_debug_registers(current); 707 pfm_release_debug_registers(current);
755#endif 708#endif
756 if (IS_IA32_PROCESS(task_pt_regs(current)))
757 ia32_drop_ia64_partial_page_list(current);
758} 709}
759 710
760unsigned long 711unsigned long
diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c
index 9daa87fdb018..b61afbbe076f 100644
--- a/arch/ia64/kernel/ptrace.c
+++ b/arch/ia64/kernel/ptrace.c
@@ -1250,13 +1250,8 @@ syscall_trace_enter (long arg0, long arg1, long arg2, long arg3,
1250 long syscall; 1250 long syscall;
1251 int arch; 1251 int arch;
1252 1252
1253 if (IS_IA32_PROCESS(&regs)) { 1253 syscall = regs.r15;
1254 syscall = regs.r1; 1254 arch = AUDIT_ARCH_IA64;
1255 arch = AUDIT_ARCH_I386;
1256 } else {
1257 syscall = regs.r15;
1258 arch = AUDIT_ARCH_IA64;
1259 }
1260 1255
1261 audit_syscall_entry(arch, syscall, arg0, arg1, arg2, arg3); 1256 audit_syscall_entry(arch, syscall, arg0, arg1, arg2, arg3);
1262 } 1257 }
@@ -2172,11 +2167,6 @@ static const struct user_regset_view user_ia64_view = {
2172 2167
2173const struct user_regset_view *task_user_regset_view(struct task_struct *tsk) 2168const struct user_regset_view *task_user_regset_view(struct task_struct *tsk)
2174{ 2169{
2175#ifdef CONFIG_IA32_SUPPORT
2176 extern const struct user_regset_view user_ia32_view;
2177 if (IS_IA32_PROCESS(task_pt_regs(tsk)))
2178 return &user_ia32_view;
2179#endif
2180 return &user_ia64_view; 2170 return &user_ia64_view;
2181} 2171}
2182 2172
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index a1ea87919777..41ae6a596b50 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -46,7 +46,6 @@
46#include <linux/kexec.h> 46#include <linux/kexec.h>
47#include <linux/crash_dump.h> 47#include <linux/crash_dump.h>
48 48
49#include <asm/ia32.h>
50#include <asm/machvec.h> 49#include <asm/machvec.h>
51#include <asm/mca.h> 50#include <asm/mca.h>
52#include <asm/meminit.h> 51#include <asm/meminit.h>
@@ -1016,10 +1015,6 @@ cpu_init (void)
1016 ia64_mmu_init(ia64_imva(cpu_data)); 1015 ia64_mmu_init(ia64_imva(cpu_data));
1017 ia64_mca_cpu_init(ia64_imva(cpu_data)); 1016 ia64_mca_cpu_init(ia64_imva(cpu_data));
1018 1017
1019#ifdef CONFIG_IA32_SUPPORT
1020 ia32_cpu_init();
1021#endif
1022
1023 /* Clear ITC to eliminate sched_clock() overflows in human time. */ 1018 /* Clear ITC to eliminate sched_clock() overflows in human time. */
1024 ia64_set_itc(0); 1019 ia64_set_itc(0);
1025 1020
diff --git a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c
index e1821ca4c7df..7bdafc8788bd 100644
--- a/arch/ia64/kernel/signal.c
+++ b/arch/ia64/kernel/signal.c
@@ -21,7 +21,6 @@
21#include <linux/unistd.h> 21#include <linux/unistd.h>
22#include <linux/wait.h> 22#include <linux/wait.h>
23 23
24#include <asm/ia32.h>
25#include <asm/intrinsics.h> 24#include <asm/intrinsics.h>
26#include <asm/uaccess.h> 25#include <asm/uaccess.h>
27#include <asm/rse.h> 26#include <asm/rse.h>
@@ -425,14 +424,8 @@ static long
425handle_signal (unsigned long sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *oldset, 424handle_signal (unsigned long sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *oldset,
426 struct sigscratch *scr) 425 struct sigscratch *scr)
427{ 426{
428 if (IS_IA32_PROCESS(&scr->pt)) { 427 if (!setup_frame(sig, ka, info, oldset, scr))
429 /* send signal to IA-32 process */ 428 return 0;
430 if (!ia32_setup_frame1(sig, ka, info, oldset, &scr->pt))
431 return 0;
432 } else
433 /* send signal to IA-64 process */
434 if (!setup_frame(sig, ka, info, oldset, scr))
435 return 0;
436 429
437 spin_lock_irq(&current->sighand->siglock); 430 spin_lock_irq(&current->sighand->siglock);
438 sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask); 431 sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask);
@@ -462,7 +455,6 @@ ia64_do_signal (struct sigscratch *scr, long in_syscall)
462 siginfo_t info; 455 siginfo_t info;
463 long restart = in_syscall; 456 long restart = in_syscall;
464 long errno = scr->pt.r8; 457 long errno = scr->pt.r8;
465# define ERR_CODE(c) (IS_IA32_PROCESS(&scr->pt) ? -(c) : (c))
466 458
467 /* 459 /*
468 * In the ia64_leave_kernel code path, we want the common case to go fast, which 460 * In the ia64_leave_kernel code path, we want the common case to go fast, which
@@ -490,14 +482,7 @@ ia64_do_signal (struct sigscratch *scr, long in_syscall)
490 * inferior call), thus it's important to check for restarting _after_ 482 * inferior call), thus it's important to check for restarting _after_
491 * get_signal_to_deliver(). 483 * get_signal_to_deliver().
492 */ 484 */
493 if (IS_IA32_PROCESS(&scr->pt)) { 485 if ((long) scr->pt.r10 != -1)
494 if (in_syscall) {
495 if (errno >= 0)
496 restart = 0;
497 else
498 errno = -errno;
499 }
500 } else if ((long) scr->pt.r10 != -1)
501 /* 486 /*
502 * A system calls has to be restarted only if one of the error codes 487 * A system calls has to be restarted only if one of the error codes
503 * ERESTARTNOHAND, ERESTARTSYS, or ERESTARTNOINTR is returned. If r10 488 * ERESTARTNOHAND, ERESTARTSYS, or ERESTARTNOINTR is returned. If r10
@@ -513,22 +498,18 @@ ia64_do_signal (struct sigscratch *scr, long in_syscall)
513 switch (errno) { 498 switch (errno) {
514 case ERESTART_RESTARTBLOCK: 499 case ERESTART_RESTARTBLOCK:
515 case ERESTARTNOHAND: 500 case ERESTARTNOHAND:
516 scr->pt.r8 = ERR_CODE(EINTR); 501 scr->pt.r8 = EINTR;
517 /* note: scr->pt.r10 is already -1 */ 502 /* note: scr->pt.r10 is already -1 */
518 break; 503 break;
519 504
520 case ERESTARTSYS: 505 case ERESTARTSYS:
521 if ((ka.sa.sa_flags & SA_RESTART) == 0) { 506 if ((ka.sa.sa_flags & SA_RESTART) == 0) {
522 scr->pt.r8 = ERR_CODE(EINTR); 507 scr->pt.r8 = EINTR;
523 /* note: scr->pt.r10 is already -1 */ 508 /* note: scr->pt.r10 is already -1 */
524 break; 509 break;
525 } 510 }
526 case ERESTARTNOINTR: 511 case ERESTARTNOINTR:
527 if (IS_IA32_PROCESS(&scr->pt)) { 512 ia64_decrement_ip(&scr->pt);
528 scr->pt.r8 = scr->pt.r1;
529 scr->pt.cr_iip -= 2;
530 } else
531 ia64_decrement_ip(&scr->pt);
532 restart = 0; /* don't restart twice if handle_signal() fails... */ 513 restart = 0; /* don't restart twice if handle_signal() fails... */
533 } 514 }
534 } 515 }
@@ -555,21 +536,14 @@ ia64_do_signal (struct sigscratch *scr, long in_syscall)
555 if (errno == ERESTARTNOHAND || errno == ERESTARTSYS || errno == ERESTARTNOINTR 536 if (errno == ERESTARTNOHAND || errno == ERESTARTSYS || errno == ERESTARTNOINTR
556 || errno == ERESTART_RESTARTBLOCK) 537 || errno == ERESTART_RESTARTBLOCK)
557 { 538 {
558 if (IS_IA32_PROCESS(&scr->pt)) { 539 /*
559 scr->pt.r8 = scr->pt.r1; 540 * Note: the syscall number is in r15 which is saved in
560 scr->pt.cr_iip -= 2; 541 * pt_regs so all we need to do here is adjust ip so that
561 if (errno == ERESTART_RESTARTBLOCK) 542 * the "break" instruction gets re-executed.
562 scr->pt.r8 = 0; /* x86 version of __NR_restart_syscall */ 543 */
563 } else { 544 ia64_decrement_ip(&scr->pt);
564 /* 545 if (errno == ERESTART_RESTARTBLOCK)
565 * Note: the syscall number is in r15 which is saved in 546 scr->pt.r15 = __NR_restart_syscall;
566 * pt_regs so all we need to do here is adjust ip so that
567 * the "break" instruction gets re-executed.
568 */
569 ia64_decrement_ip(&scr->pt);
570 if (errno == ERESTART_RESTARTBLOCK)
571 scr->pt.r15 = __NR_restart_syscall;
572 }
573 } 547 }
574 } 548 }
575 549
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
index de100aa7ff03..e5230b2ff2c5 100644
--- a/arch/ia64/kernel/smpboot.c
+++ b/arch/ia64/kernel/smpboot.c
@@ -44,7 +44,6 @@
44#include <asm/cache.h> 44#include <asm/cache.h>
45#include <asm/current.h> 45#include <asm/current.h>
46#include <asm/delay.h> 46#include <asm/delay.h>
47#include <asm/ia32.h>
48#include <asm/io.h> 47#include <asm/io.h>
49#include <asm/irq.h> 48#include <asm/irq.h>
50#include <asm/machvec.h> 49#include <asm/machvec.h>
@@ -443,10 +442,6 @@ smp_callin (void)
443 calibrate_delay(); 442 calibrate_delay();
444 local_cpu_data->loops_per_jiffy = loops_per_jiffy; 443 local_cpu_data->loops_per_jiffy = loops_per_jiffy;
445 444
446#ifdef CONFIG_IA32_SUPPORT
447 ia32_gdt_init();
448#endif
449
450 /* 445 /*
451 * Allow the master to continue. 446 * Allow the master to continue.
452 */ 447 */
diff --git a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c
index f0cda765e681..fd80e70018a9 100644
--- a/arch/ia64/kernel/traps.c
+++ b/arch/ia64/kernel/traps.c
@@ -19,7 +19,6 @@
19#include <linux/kdebug.h> 19#include <linux/kdebug.h>
20 20
21#include <asm/fpswa.h> 21#include <asm/fpswa.h>
22#include <asm/ia32.h>
23#include <asm/intrinsics.h> 22#include <asm/intrinsics.h>
24#include <asm/processor.h> 23#include <asm/processor.h>
25#include <asm/uaccess.h> 24#include <asm/uaccess.h>
@@ -626,10 +625,6 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa,
626 break; 625 break;
627 626
628 case 45: 627 case 45:
629#ifdef CONFIG_IA32_SUPPORT
630 if (ia32_exception(&regs, isr) == 0)
631 return;
632#endif
633 printk(KERN_ERR "Unexpected IA-32 exception (Trap 45)\n"); 628 printk(KERN_ERR "Unexpected IA-32 exception (Trap 45)\n");
634 printk(KERN_ERR " iip - 0x%lx, ifa - 0x%lx, isr - 0x%lx\n", 629 printk(KERN_ERR " iip - 0x%lx, ifa - 0x%lx, isr - 0x%lx\n",
635 iip, ifa, isr); 630 iip, ifa, isr);
@@ -637,10 +632,6 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa,
637 break; 632 break;
638 633
639 case 46: 634 case 46:
640#ifdef CONFIG_IA32_SUPPORT
641 if (ia32_intercept(&regs, isr) == 0)
642 return;
643#endif
644 printk(KERN_ERR "Unexpected IA-32 intercept trap (Trap 46)\n"); 635 printk(KERN_ERR "Unexpected IA-32 intercept trap (Trap 46)\n");
645 printk(KERN_ERR " iip - 0x%lx, ifa - 0x%lx, isr - 0x%lx, iim - 0x%lx\n", 636 printk(KERN_ERR " iip - 0x%lx, ifa - 0x%lx, isr - 0x%lx, iim - 0x%lx\n",
646 iip, ifa, isr, iim); 637 iip, ifa, isr, iim);