aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/common.c
diff options
context:
space:
mode:
authorSeiji Aguchi <seiji.aguchi@hds.com>2013-06-20 11:45:44 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2013-06-21 01:25:13 -0400
commit629f4f9d59a27d8e58aa612e886e6a9a63ea7aeb (patch)
tree049f9d16e2c304a51fa62d47cde34af8b10fc65d /arch/x86/kernel/cpu/common.c
parenteddc0e922a3530e0f22cef170229bcae3a7d5e31 (diff)
x86: Rename variables for debugging
Rename variables for debugging to describe meaning of them precisely. Also, introduce a generic way to switch IDT by checking a current state, debug on/off. Signed-off-by: Seiji Aguchi <seiji.aguchi@hds.com> Link: http://lkml.kernel.org/r/51C323A8.7050905@hds.com Signed-off-by: H. Peter Anvin <hpa@linux.intel.com> Cc: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'arch/x86/kernel/cpu/common.c')
-rw-r--r--arch/x86/kernel/cpu/common.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 22018f70a671..8f6a0f909d6f 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1071,8 +1071,8 @@ __setup("clearcpuid=", setup_disablecpuid);
1071 1071
1072#ifdef CONFIG_X86_64 1072#ifdef CONFIG_X86_64
1073struct desc_ptr idt_descr = { NR_VECTORS * 16 - 1, (unsigned long) idt_table }; 1073struct desc_ptr idt_descr = { NR_VECTORS * 16 - 1, (unsigned long) idt_table };
1074struct desc_ptr nmi_idt_descr = { NR_VECTORS * 16 - 1, 1074struct desc_ptr debug_idt_descr = { NR_VECTORS * 16 - 1,
1075 (unsigned long) nmi_idt_table }; 1075 (unsigned long) debug_idt_table };
1076 1076
1077DEFINE_PER_CPU_FIRST(union irq_stack_union, 1077DEFINE_PER_CPU_FIRST(union irq_stack_union,
1078 irq_stack_union) __aligned(PAGE_SIZE); 1078 irq_stack_union) __aligned(PAGE_SIZE);
@@ -1148,20 +1148,20 @@ int is_debug_stack(unsigned long addr)
1148 addr > (__get_cpu_var(debug_stack_addr) - DEBUG_STKSZ)); 1148 addr > (__get_cpu_var(debug_stack_addr) - DEBUG_STKSZ));
1149} 1149}
1150 1150
1151static DEFINE_PER_CPU(u32, debug_stack_use_ctr); 1151DEFINE_PER_CPU(u32, debug_idt_ctr);
1152 1152
1153void debug_stack_set_zero(void) 1153void debug_stack_set_zero(void)
1154{ 1154{
1155 this_cpu_inc(debug_stack_use_ctr); 1155 this_cpu_inc(debug_idt_ctr);
1156 load_idt((const struct desc_ptr *)&nmi_idt_descr); 1156 load_current_idt();
1157} 1157}
1158 1158
1159void debug_stack_reset(void) 1159void debug_stack_reset(void)
1160{ 1160{
1161 if (WARN_ON(!this_cpu_read(debug_stack_use_ctr))) 1161 if (WARN_ON(!this_cpu_read(debug_idt_ctr)))
1162 return; 1162 return;
1163 if (this_cpu_dec_return(debug_stack_use_ctr) == 0) 1163 if (this_cpu_dec_return(debug_idt_ctr) == 0)
1164 load_idt((const struct desc_ptr *)&idt_descr); 1164 load_current_idt();
1165} 1165}
1166 1166
1167#else /* CONFIG_X86_64 */ 1167#else /* CONFIG_X86_64 */