summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* dumpstack: x86: add "end" parameter to valid_stack_ptr and print_context_stackAlexander van Heukelum2008-10-132-7/+14
| | | | | | | | - Add "end" parameter to valid_stack_ptr and print_context_stack - use sizeof(long) as the size of a word on the stack Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* dumpstack: x86: make printk_address equalAlexander van Heukelum2008-10-132-27/+4
| | | | | | | | | | | | - x86_64: use %p to print an address - make i386-version the same as the above The result should be the same on x86_64; on i386 the output only changes if CONFIG_KALLSYMS is turned off, in which case the address is printed twice. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* dumpstack: x86: move die_nmi to dumpstack_32.cAlexander van Heukelum2008-10-132-37/+36
| | | | | | | | | For some reason die_nmi is still defined in traps.c for i386, but is found in dumpstack_64.c for x86_64. Move it to dumpstack_32.c Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* traps: x86: finalize unification of traps.cAlexander van Heukelum2008-10-133-1071/+1
| | | | | | | | traps_32.c and traps_64.c are now equal. Move one to traps.c, delete the other one and change the Makefile Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* traps: x86: make traps_32.c and traps_64.c equalAlexander van Heukelum2008-10-132-5/+536
| | | | | | | | | | | Use CONFIG_X86_64/CONFIG_X86_32 to condtionally compile the parts needed for x86_64 or i386 only. Runs a small userspace for a number of minimal configurations and boots the defconfigs. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* traps: x86: various noop-changes preparing for unification of traps_xx.cAlexander van Heukelum2008-10-133-39/+58
| | | | | | | | | | | - reordering include files - whitespace changes - comment changes - removed unused bad_intr() - make default_do_nmi static Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* traps: x86_64: use task_pid_nr(tsk) instead of tsk->pid in do_general_protectionAlexander van Heukelum2008-10-131-1/+1
| | | | | | | Use task_pid_nr(tsk) instead of tsk->pid in do_general_protection. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* traps: i386: expand clear_mem_error and remove from mach_traps.hAlexander van Heukelum2008-10-132-7/+2
| | | | | | | | | This is the last user of clear_mem_error, which is defined only on i386. Expand the inline function and remove it from include/asm-x86/mach-default/mach_traps.h Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* traps: x86_64: make io_check_error equal to the one on i386Alexander van Heukelum2008-10-131-2/+8
| | | | | | | Make io_check_error equal to the one on i386. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* traps: i386: use preempt_conditional_sti/cli in do_int3Alexander van Heukelum2008-10-131-1/+2
| | | | | | | Use preempt_conditional_sti/cli in do_int3, like on x86_64. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* traps: x86_64: make math_state_restore more like i386Alexander van Heukelum2008-10-131-7/+8
| | | | | | | | | | - rename variable me -> tsk - get thread and tsk like i386 - expand used_math() - copy comment Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* traps: x86: converge trap_init functionsAlexander van Heukelum2008-10-134-19/+23
| | | | | | | | | | | | | | | | | | | | - set_system_gate on i386 is really set_system_trap_gate - set_system_gate on x86_64 is really set_system_intr_gate - ist=0 means no special stack switch is done: - introduce STACKFAULT_STACK, DOUBLEFAULT_STACK, NMI_STACK, DEBUG_STACK and MCE_STACK as on x86_64. - use the _ist variants with XXX_STACK set to zero - remove set_system_gate Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu> traps: x86: correct copy/paste bug: a trap is a GATE_TRAP Fix copy/paste/forgot-to-edit bug in desc.h. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86, traps: converge do_debug handlersAlexander van Heukelum2008-10-133-21/+30
| | | | | | | | | | | | | | Make the x86_64-version and the i386-version of do_debug more similar. - introduce preempt_conditional_sti/cli to i386. The preempt-count is now elevated during the trap handler, like on x86_64. It does not run on a separate stack, however. - replace an open-coded "send_sigtrap" - copy some comments Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86, traps: introduce dotraplinkageAlexander van Heukelum2008-10-134-62/+72
| | | | | | | | Mark the exception handlers with "dotraplinkage" to hide the calling convention differences between i386 and x86_64. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86, traps, i386: factor out lazy io-bitmap copyAlexander van Heukelum2008-10-131-33/+43
| | | | | | | | | x86_64 does not do the lazy io-bitmap dance. Putting it in its own function makes i386's do_general_protection look much more like x86_64's. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86, traps: split out math_error and simd_math_errorAlexander van Heukelum2008-10-132-18/+24
| | | | | | | | | | | | | Split out math_error from do_coprocessor_error and simd_math_error from do_simd_coprocessor_error, like on i386. While at it, add the "error_code" parameter to do_coprocessor_error, do_simd_coprocessor_error and do_spurious_interrupt_bug. This does not change the generated code, but brings the declarations in line with all the other trap handlers. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86_64: split out dumpstack code from traps_64.cAlexander van Heukelum2008-10-133-547/+567
| | | | | | | | The dumpstack code is logically quite independent from the hardware traps. Split it out into its own file. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* i386: split out dumpstack code from traps_32.cAlexander van Heukelum2008-10-133-405/+423
| | | | | | | | The dumpstack code is logically quite independent from the hardware traps. Split it out into its own file. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86: fix virt_addr_valid() with CONFIG_DEBUG_VIRTUAL=y, v2Vegard Nossum2008-10-134-6/+44
| | | | | | | | | | | | virt_addr_valid() calls __pa(), which calls __phys_addr(). With CONFIG_DEBUG_VIRTUAL=y, __phys_addr() will kill the kernel if the address *isn't* valid. That's clearly wrong for virt_addr_valid(). We also incorporate the debugging checks into virt_addr_valid(). Signed-off-by: Vegard Nossum <vegardno@ben.ifi.uio.no> Acked-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86: allow number of additional hotplug CPUs to be set at compile time, V2Chuck Ebbert2008-10-132-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | x86: allow number of additional hotplug CPUs to be set at compile time, V2 The default number of additional CPU IDs for hotplugging is determined by asking ACPI or mptables how many "disabled" CPUs there are in the system, but many systems get this wrong so that e.g. a uniprocessor machine gets an extra CPU allocated and never switches to single CPU mode. And sometimes CPU hotplugging is enabled only for suspend/hibernate anyway, so the additional CPU IDs are not wanted. Allow the number to be set to zero at compile time. Also, force the number of extra CPUs to zero if hotplugging is disabled which allows removing some conditional code. Tested on uniprocessor x86_64 that ACPI claims has a disabled processor, with CPU hotplugging configured. ("After" has the number of additional CPUs set to 0) Before: NR_CPUS: 512, nr_cpu_ids: 2, nr_node_ids 1 After: NR_CPUS: 512, nr_cpu_ids: 1, nr_node_ids 1 [Changed the name of the option and the prompt according to Ingo's suggestion.] Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86: do not allow to optimize flag_is_changeable_p() (rev. 2)Krzysztof Helt2008-10-131-12/+19
| | | | | | | | | | | | | | | | | | | | | | | | | The flag_is_changeable_p() is used by has_cpuid_p() which can return different results in the code sequence below: if (!have_cpuid_p()) identify_cpu_without_cpuid(c); /* cyrix could have cpuid enabled via c_identify()*/ if (!have_cpuid_p()) return; Otherwise, the gcc 3.4.6 optimizes these two calls into one which make the code not working correctly. Cyrix cpus have the CPUID instruction enabled before the second call to the have_cpuid_p() but it is not detected due to the gcc optimization. Thus the ARR registers (mtrr like) are not detected on such a cpu. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86: __show_registers() and __show_regs() API unificationPekka Enberg2008-10-135-8/+10
| | | | | | | | | | Currently the low-level function to dump user-passed registers on i386 is called __show_registers() whereas on x86-64 it's called __show_regs(). Unify the API to simplify porting of kmemcheck to x86-64. Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Acked-by: Vegard Nossum <vegard.nossum@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86, UV: new UV genapic functions for x2apicJack Steiner2008-10-131-6/+4
| | | | | | | | | Add functions that use the infrastructure added by the x2apic code. These functions were originally stubbed out since the UV code went into the tree prior to the x2apic code. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86: move prefill_possible_map calling early, fix, V2Chuck Ebbert2008-10-132-36/+34
| | | | | | | | | | | | | | | | | | | Commit 4a701737 ("x86: move prefill_possible_map calling early, fix") is the wrong fix: prefill_possible_map() needs to be available even when CONFIG_HOTPLUG_CPU is not set. A followon patch will do that. Fix this correctly by making prefill_possible_map() available even when CONFIG_HOTPLUG_CPU is not set. The function is needed so that the number of possible CPUs can be determined. Tested on uniprocessor machine with CPU hotplug disabled. From boot log: Before: NR_CPUS: 512, nr_cpu_ids: 512, nr_node_ids 1 After: NR_CPUS: 512, nr_cpu_ids: 1, nr_node_ids 1 Signed-off-by: Chuck Ebbert <cebbert@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86: merge winchip-2 and winchip-2a cpu choicesKrzysztof Helt2008-10-135-23/+9
| | | | | | | | | | | The Winchip-2 and Winchip-2A cpu choices select the same options for kernel and compiler. Merge them to save few bytes and reduce confusion. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Acked-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86, uv: fix for size of hub mappingsJack Steiner2008-10-131-6/+7
| | | | | | | | Fix the size of the mappings of UV hub registers. Size must be a function of the maximum node number within the SSI. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86: cleanup, remove extra ifdefYinghai Lu2008-10-131-4/+2
| | | | | | | also change two functions to static. Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* traps: i386: make do_trap more like x86_64Alexander van Heukelum2008-10-132-40/+17
| | | | | | | | | | | | | This patch hardcodes which traps should be forwarded to handle_vm86_trap in do_trap. This allows to remove the vm86 parameter from the i386-version of do_trap, which makes the DO_VM86_ERROR and DO_VM86_ERROR_INFO macros unnecessary. x86_64 part is whitespace only. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* traps: x86: remove trace_hardirqs_fixup from pagefault handlerAlexander van Heukelum2008-10-132-26/+0
| | | | | | | | | | | | The last use of trace_hardirqs_fixup is unnecessary, because the trap is taken with interrupt off on i386 as well as x86_64, and the irq-tracer is notified of this from the assembly code. trace_hardirqs_fixup and trace_hardirqs_fixup_flags are removed from include/asm-x86/irqflags.h as they are no longer used. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* traps: x86_64: remove trace_hardirqs_fixup from debug handlerAlexander van Heukelum2008-10-131-2/+0
| | | | | | | | | | All exceptions are taken via interrupt gates. TRACE_IRQS_OFF is called just before entering the C code, so the irq state is known to the irq tracer at this point. No need to call trace_hardirqs_fixup. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* traps: x86_64: remove trace_hardirqs_fixup from int3 handlerAlexander van Heukelum2008-10-131-2/+0
| | | | | | | | | | All exceptions are taken via interrupt gates. TRACE_IRQS_OFF is called just before entering the C code, so the irq state is known to the irq tracer at this point. No need to call trace_hardirqs_fixup. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* traps: x86_64: remove trace_hardirqs_fixup from DO_ERROR_INFO macroAlexander van Heukelum2008-10-131-1/+0
| | | | | | | | | | All exceptions are taken via interrupt gates. TRACE_IRQS_OFF is called just before entering the C code, so the irq state is known to the irq tracer at this point. No need to call trace_hardirqs_fixup. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* traps: x86_64: add TRACE_IRQS_OFF in paranoidentry macroAlexander van Heukelum2008-10-131-0/+3
| | | | | | | | | | | Add TRACE_IRQS_OFF just before entering the C code. All exceptions are taken via interrupt gates. If irq tracing is enabled, it should be notified as soon as possible. Interrupts are only (conditionally) re-enabled in C code. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* traps: x86_64: add TRACE_IRQS_OFF in error_entryAlexander van Heukelum2008-10-131-1/+2
| | | | | | | | | | | Add TRACE_IRQS_OFF just before entering the C code. All exceptions are taken via interrupt gates. If irq tracing is enabled, it should be notified as soon as possible. Interrupts are only (conditionally) re-enabled in C code. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86, uv: add early detection of UV system typesJack Steiner2008-10-132-1/+3
| | | | | | | | | | | | | Portions of the ACPI code needs to know if a system is a UV system prior to genapic initialization. This patch adds a call early_acpi_boot_init() so that the apic type is discovered earlier. V2 of the patch adding fixes from Yinghai Lu. Much cleaner and smaller. Signed-off-by: Jack Steiner <steiner@sgi.com> Acked-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86: move vgetcpu mode probing to cpu detectionGlauber Costa2008-10-132-4/+12
| | | | | | | | Take it out of time initialization and move it to cpu detection time. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86: wrap MCA_bus test around an ifdefGlauber Costa2008-10-132-0/+10
| | | | | | | | | | Only test for MCA_bus if support for MCA is compiled in. Also, for x86_64, write the code inside the conditional for consistency with i386. It won't bite us, since it'll probably never select CONFIG_MCA anyway. Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86: replace hardcoded numberGlauber Costa2008-10-131-1/+1
| | | | | | | | Replace "4" in time_32.c code by sizeof(long). This way, it can work on x86_64 too. Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86: rename timer_event_interrupt to timer_interruptGlauber Costa2008-10-131-2/+2
| | | | | Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86: make init_ISA_irqs nonstaticGlauber Costa2008-10-131-1/+1
| | | | | Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86: factor out irq initialization for x86_64Glauber Costa2008-10-131-15/+28
| | | | | | | Provide apic_intr_init and smp_intr_init functions. Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86: bind irq0 irq data to cpu0Glauber Costa2008-10-131-0/+1
| | | | | Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86: use user_mode_vm instead of user_modeGlauber Costa2008-10-131-1/+1
| | | | | | | | For x86_64, it does not really matter. But makes the code equal to i386. Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86: remove SEGMENT_IS_FLAT_CODEGlauber Costa2008-10-131-3/+0
| | | | | | | There are no users in the kernel. Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86: use frame pointer information on x86_64 profile_pcGlauber Costa2008-10-131-0/+4
| | | | | Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86: set bp field in pt_regs properlyGlauber Costa2008-10-131-0/+7
| | | | | | | | | | | Save rbp twice: One is for marking the stack frame, as usual (already there), and the other, to fill pt_regs properly. This is because bx comes right before the last saved register in that structure, and not bp. If the base pointer were in the place bx is today, this would not be needed. Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86: coalesce testsGlauber Costa2008-10-131-2/+1
| | | | | | | | Coalesce v8086_mode and user_mode into a single user_mode_vm() test. Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86: use user_mode macroGlauber Costa2008-10-132-4/+1
| | | | | | | | | Instead of using SEGMENT_IS_KERNEL_CODE, use the "user_mode" macro, which can play the same role. Delete the former, since it now lacks any user. Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86: cpu don't print duplicated vendor stringYinghai Lu2008-10-131-1/+1
| | | | | | | Some CPUs have vendor string in the middle of model_id instead of beginning Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86: make mm/gup.c more virtualization friendlyJan Beulich2008-10-132-6/+6
| | | | | | | | | Since pte_flags() is much cheaper than pte_val() in some virtualized environments (namely, Xen), use the former whereever possible. Signed-off-by: Jan Beulich <jbeulich@novell.com> Cc: "Nick Piggin" <npiggin@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>