aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/Kconfig1
-rw-r--r--arch/x86/include/asm/pci.h2
-rw-r--r--arch/x86/include/asm/thread_info.h2
-rw-r--r--arch/x86/include/uapi/asm/msr-index.h2
-rw-r--r--arch/x86/kernel/apic/apic.c1
-rw-r--r--arch/x86/kernel/cpu/amd.c2
-rw-r--r--arch/x86/kernel/cpu/intel_cacheinfo.c2
-rw-r--r--arch/x86/kernel/cpu/scattered.c2
-rw-r--r--arch/x86/kernel/early-quirks.c12
-rw-r--r--arch/x86/kernel/ftrace.c14
-rw-r--r--arch/x86/mm/pgtable.c6
-rw-r--r--arch/x86/pci/acpi.c4
-rw-r--r--arch/x86/um/Kconfig5
-rw-r--r--arch/x86/um/asm/processor_32.h5
-rw-r--r--arch/x86/um/asm/processor_64.h5
-rw-r--r--arch/x86/um/sysrq_32.c66
-rw-r--r--arch/x86/um/sysrq_64.c8
-rw-r--r--arch/x86/um/vdso/.gitignore2
18 files changed, 57 insertions, 84 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 83f521aa103f..e903c71f7e69 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -22,6 +22,7 @@ config X86_64
22config X86 22config X86
23 def_bool y 23 def_bool y
24 select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS 24 select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
25 select ARCH_MIGHT_HAVE_PC_PARPORT
25 select HAVE_AOUT if X86_32 26 select HAVE_AOUT if X86_32
26 select HAVE_UNSTABLE_SCHED_CLOCK 27 select HAVE_UNSTABLE_SCHED_CLOCK
27 select ARCH_SUPPORTS_NUMA_BALANCING 28 select ARCH_SUPPORTS_NUMA_BALANCING
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index 7d7443283a9d..947b5c417e83 100644
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86/include/asm/pci.h
@@ -15,7 +15,7 @@ struct pci_sysdata {
15 int domain; /* PCI domain */ 15 int domain; /* PCI domain */
16 int node; /* NUMA node */ 16 int node; /* NUMA node */
17#ifdef CONFIG_ACPI 17#ifdef CONFIG_ACPI
18 void *acpi; /* ACPI-specific data */ 18 struct acpi_device *companion; /* ACPI companion device */
19#endif 19#endif
20#ifdef CONFIG_X86_64 20#ifdef CONFIG_X86_64
21 void *iommu; /* IOMMU private data */ 21 void *iommu; /* IOMMU private data */
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index c46a46be1ec6..3ba3de457d05 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -153,8 +153,6 @@ struct thread_info {
153#define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY) 153#define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY)
154#define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW) 154#define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW)
155 155
156#define PREEMPT_ACTIVE 0x10000000
157
158#ifdef CONFIG_X86_32 156#ifdef CONFIG_X86_32
159 157
160#define STACK_WARN (THREAD_SIZE/8) 158#define STACK_WARN (THREAD_SIZE/8)
diff --git a/arch/x86/include/uapi/asm/msr-index.h b/arch/x86/include/uapi/asm/msr-index.h
index b93e09a0fa21..37813b5ddc37 100644
--- a/arch/x86/include/uapi/asm/msr-index.h
+++ b/arch/x86/include/uapi/asm/msr-index.h
@@ -147,6 +147,8 @@
147#define MSR_PP1_ENERGY_STATUS 0x00000641 147#define MSR_PP1_ENERGY_STATUS 0x00000641
148#define MSR_PP1_POLICY 0x00000642 148#define MSR_PP1_POLICY 0x00000642
149 149
150#define MSR_CORE_C1_RES 0x00000660
151
150#define MSR_AMD64_MC0_MASK 0xc0010044 152#define MSR_AMD64_MC0_MASK 0xc0010044
151 153
152#define MSR_IA32_MCx_CTL(x) (MSR_IA32_MC0_CTL + 4*(x)) 154#define MSR_IA32_MCx_CTL(x) (MSR_IA32_MC0_CTL + 4*(x))
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index ed165d657380..d278736bf774 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -62,6 +62,7 @@ unsigned disabled_cpus;
62 62
63/* Processor that is doing the boot up */ 63/* Processor that is doing the boot up */
64unsigned int boot_cpu_physical_apicid = -1U; 64unsigned int boot_cpu_physical_apicid = -1U;
65EXPORT_SYMBOL_GPL(boot_cpu_physical_apicid);
65 66
66/* 67/*
67 * The highest APIC ID seen during enumeration. 68 * The highest APIC ID seen during enumeration.
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 3daece79a142..bca023bdd6b2 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -339,7 +339,7 @@ static void amd_get_topology(struct cpuinfo_x86 *c)
339#endif 339#endif
340 340
341/* 341/*
342 * On a AMD dual core setup the lower bits of the APIC id distingush the cores. 342 * On a AMD dual core setup the lower bits of the APIC id distinguish the cores.
343 * Assumes number of cores is a power of two. 343 * Assumes number of cores is a power of two.
344 */ 344 */
345static void amd_detect_cmp(struct cpuinfo_x86 *c) 345static void amd_detect_cmp(struct cpuinfo_x86 *c)
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
index 1414c90feaba..0641113e2965 100644
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Routines to indentify caches on Intel CPU. 2 * Routines to identify caches on Intel CPU.
3 * 3 *
4 * Changes: 4 * Changes:
5 * Venkatesh Pallipadi : Adding cache identification through cpuid(4) 5 * Venkatesh Pallipadi : Adding cache identification through cpuid(4)
diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattered.c
index f2cc63e9cf08..b6f794aa1693 100644
--- a/arch/x86/kernel/cpu/scattered.c
+++ b/arch/x86/kernel/cpu/scattered.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Routines to indentify additional cpu features that are scattered in 2 * Routines to identify additional cpu features that are scattered in
3 * cpuid space. 3 * cpuid space.
4 */ 4 */
5#include <linux/cpu.h> 5#include <linux/cpu.h>
diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
index b3cd3ebae077..96f958d8cd45 100644
--- a/arch/x86/kernel/early-quirks.c
+++ b/arch/x86/kernel/early-quirks.c
@@ -313,6 +313,16 @@ static size_t __init gen6_stolen_size(int num, int slot, int func)
313 return gmch_ctrl << 25; /* 32 MB units */ 313 return gmch_ctrl << 25; /* 32 MB units */
314} 314}
315 315
316static inline size_t gen8_stolen_size(int num, int slot, int func)
317{
318 u16 gmch_ctrl;
319
320 gmch_ctrl = read_pci_config_16(num, slot, func, SNB_GMCH_CTRL);
321 gmch_ctrl >>= BDW_GMCH_GMS_SHIFT;
322 gmch_ctrl &= BDW_GMCH_GMS_MASK;
323 return gmch_ctrl << 25; /* 32 MB units */
324}
325
316typedef size_t (*stolen_size_fn)(int num, int slot, int func); 326typedef size_t (*stolen_size_fn)(int num, int slot, int func);
317 327
318static struct pci_device_id intel_stolen_ids[] __initdata = { 328static struct pci_device_id intel_stolen_ids[] __initdata = {
@@ -336,6 +346,8 @@ static struct pci_device_id intel_stolen_ids[] __initdata = {
336 INTEL_IVB_D_IDS(gen6_stolen_size), 346 INTEL_IVB_D_IDS(gen6_stolen_size),
337 INTEL_HSW_D_IDS(gen6_stolen_size), 347 INTEL_HSW_D_IDS(gen6_stolen_size),
338 INTEL_HSW_M_IDS(gen6_stolen_size), 348 INTEL_HSW_M_IDS(gen6_stolen_size),
349 INTEL_BDW_M_IDS(gen8_stolen_size),
350 INTEL_BDW_D_IDS(gen8_stolen_size)
339}; 351};
340 352
341static void __init intel_graphics_stolen(int num, int slot, int func) 353static void __init intel_graphics_stolen(int num, int slot, int func)
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index 42a392a9fd02..d4bdd253fea7 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -248,6 +248,15 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
248 return ret; 248 return ret;
249} 249}
250 250
251static int is_ftrace_caller(unsigned long ip)
252{
253 if (ip == (unsigned long)(&ftrace_call) ||
254 ip == (unsigned long)(&ftrace_regs_call))
255 return 1;
256
257 return 0;
258}
259
251/* 260/*
252 * A breakpoint was added to the code address we are about to 261 * A breakpoint was added to the code address we are about to
253 * modify, and this is the handle that will just skip over it. 262 * modify, and this is the handle that will just skip over it.
@@ -257,10 +266,13 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
257 */ 266 */
258int ftrace_int3_handler(struct pt_regs *regs) 267int ftrace_int3_handler(struct pt_regs *regs)
259{ 268{
269 unsigned long ip;
270
260 if (WARN_ON_ONCE(!regs)) 271 if (WARN_ON_ONCE(!regs))
261 return 0; 272 return 0;
262 273
263 if (!ftrace_location(regs->ip - 1)) 274 ip = regs->ip - 1;
275 if (!ftrace_location(ip) && !is_ftrace_caller(ip))
264 return 0; 276 return 0;
265 277
266 regs->ip += MCOUNT_INSN_SIZE - 1; 278 regs->ip += MCOUNT_INSN_SIZE - 1;
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index a7cccb6d7fec..c96314abd144 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -61,6 +61,7 @@ void ___pte_free_tlb(struct mmu_gather *tlb, struct page *pte)
61#if PAGETABLE_LEVELS > 2 61#if PAGETABLE_LEVELS > 2
62void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd) 62void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd)
63{ 63{
64 struct page *page = virt_to_page(pmd);
64 paravirt_release_pmd(__pa(pmd) >> PAGE_SHIFT); 65 paravirt_release_pmd(__pa(pmd) >> PAGE_SHIFT);
65 /* 66 /*
66 * NOTE! For PAE, any changes to the top page-directory-pointer-table 67 * NOTE! For PAE, any changes to the top page-directory-pointer-table
@@ -69,7 +70,8 @@ void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd)
69#ifdef CONFIG_X86_PAE 70#ifdef CONFIG_X86_PAE
70 tlb->need_flush_all = 1; 71 tlb->need_flush_all = 1;
71#endif 72#endif
72 tlb_remove_page(tlb, virt_to_page(pmd)); 73 pgtable_pmd_page_dtor(page);
74 tlb_remove_page(tlb, page);
73} 75}
74 76
75#if PAGETABLE_LEVELS > 3 77#if PAGETABLE_LEVELS > 3
@@ -209,7 +211,7 @@ static int preallocate_pmds(pmd_t *pmds[])
209 if (!pmd) 211 if (!pmd)
210 failed = true; 212 failed = true;
211 if (pmd && !pgtable_pmd_page_ctor(virt_to_page(pmd))) { 213 if (pmd && !pgtable_pmd_page_ctor(virt_to_page(pmd))) {
212 free_page((unsigned long)pmds[i]); 214 free_page((unsigned long)pmd);
213 pmd = NULL; 215 pmd = NULL;
214 failed = true; 216 failed = true;
215 } 217 }
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index 7fb24e53d4c8..4f25ec077552 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -518,7 +518,7 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
518 sd = &info->sd; 518 sd = &info->sd;
519 sd->domain = domain; 519 sd->domain = domain;
520 sd->node = node; 520 sd->node = node;
521 sd->acpi = device->handle; 521 sd->companion = device;
522 /* 522 /*
523 * Maybe the desired pci bus has been already scanned. In such case 523 * Maybe the desired pci bus has been already scanned. In such case
524 * it is unnecessary to scan the pci bus with the given domain,busnum. 524 * it is unnecessary to scan the pci bus with the given domain,busnum.
@@ -589,7 +589,7 @@ int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
589{ 589{
590 struct pci_sysdata *sd = bridge->bus->sysdata; 590 struct pci_sysdata *sd = bridge->bus->sysdata;
591 591
592 ACPI_HANDLE_SET(&bridge->dev, sd->acpi); 592 ACPI_COMPANION_SET(&bridge->dev, sd->companion);
593 return 0; 593 return 0;
594} 594}
595 595
diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
index 14ef8d1dbc33..ed56a1c4ae73 100644
--- a/arch/x86/um/Kconfig
+++ b/arch/x86/um/Kconfig
@@ -31,6 +31,11 @@ config X86_64
31 def_bool 64BIT 31 def_bool 64BIT
32 select MODULES_USE_ELF_RELA 32 select MODULES_USE_ELF_RELA
33 33
34config ARCH_DEFCONFIG
35 string
36 default "arch/um/configs/i386_defconfig" if X86_32
37 default "arch/um/configs/x86_64_defconfig" if X86_64
38
34config RWSEM_XCHGADD_ALGORITHM 39config RWSEM_XCHGADD_ALGORITHM
35 def_bool 64BIT 40 def_bool 64BIT
36 41
diff --git a/arch/x86/um/asm/processor_32.h b/arch/x86/um/asm/processor_32.h
index 6c6689e574ce..c112de81c9e1 100644
--- a/arch/x86/um/asm/processor_32.h
+++ b/arch/x86/um/asm/processor_32.h
@@ -33,6 +33,8 @@ struct arch_thread {
33 .faultinfo = { 0, 0, 0 } \ 33 .faultinfo = { 0, 0, 0 } \
34} 34}
35 35
36#define STACKSLOTS_PER_LINE 8
37
36static inline void arch_flush_thread(struct arch_thread *thread) 38static inline void arch_flush_thread(struct arch_thread *thread)
37{ 39{
38 /* Clear any TLS still hanging */ 40 /* Clear any TLS still hanging */
@@ -53,4 +55,7 @@ static inline void arch_copy_thread(struct arch_thread *from,
53#define current_text_addr() \ 55#define current_text_addr() \
54 ({ void *pc; __asm__("movl $1f,%0\n1:":"=g" (pc)); pc; }) 56 ({ void *pc; __asm__("movl $1f,%0\n1:":"=g" (pc)); pc; })
55 57
58#define current_sp() ({ void *sp; __asm__("movl %%esp, %0" : "=r" (sp) : ); sp; })
59#define current_bp() ({ unsigned long bp; __asm__("movl %%ebp, %0" : "=r" (bp) : ); bp; })
60
56#endif 61#endif
diff --git a/arch/x86/um/asm/processor_64.h b/arch/x86/um/asm/processor_64.h
index 4b02a8455bd1..c3be85205a65 100644
--- a/arch/x86/um/asm/processor_64.h
+++ b/arch/x86/um/asm/processor_64.h
@@ -19,6 +19,8 @@ struct arch_thread {
19 .fs = 0, \ 19 .fs = 0, \
20 .faultinfo = { 0, 0, 0 } } 20 .faultinfo = { 0, 0, 0 } }
21 21
22#define STACKSLOTS_PER_LINE 4
23
22static inline void arch_flush_thread(struct arch_thread *thread) 24static inline void arch_flush_thread(struct arch_thread *thread)
23{ 25{
24} 26}
@@ -32,4 +34,7 @@ static inline void arch_copy_thread(struct arch_thread *from,
32#define current_text_addr() \ 34#define current_text_addr() \
33 ({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; }) 35 ({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; })
34 36
37#define current_sp() ({ void *sp; __asm__("movq %%rsp, %0" : "=r" (sp) : ); sp; })
38#define current_bp() ({ unsigned long bp; __asm__("movq %%rbp, %0" : "=r" (bp) : ); bp; })
39
35#endif 40#endif
diff --git a/arch/x86/um/sysrq_32.c b/arch/x86/um/sysrq_32.c
index c9bee5b8c0d3..16ee0e450e3e 100644
--- a/arch/x86/um/sysrq_32.c
+++ b/arch/x86/um/sysrq_32.c
@@ -30,70 +30,4 @@ void show_regs(struct pt_regs *regs)
30 printk(" DS: %04lx ES: %04lx\n", 30 printk(" DS: %04lx ES: %04lx\n",
31 0xffff & PT_REGS_DS(regs), 31 0xffff & PT_REGS_DS(regs),
32 0xffff & PT_REGS_ES(regs)); 32 0xffff & PT_REGS_ES(regs));
33
34 show_trace(NULL, (unsigned long *) &regs);
35} 33}
36
37/* Copied from i386. */
38static inline int valid_stack_ptr(struct thread_info *tinfo, void *p)
39{
40 return p > (void *)tinfo &&
41 p < (void *)tinfo + THREAD_SIZE - 3;
42}
43
44/* Adapted from i386 (we also print the address we read from). */
45static inline unsigned long print_context_stack(struct thread_info *tinfo,
46 unsigned long *stack, unsigned long ebp)
47{
48 unsigned long addr;
49
50#ifdef CONFIG_FRAME_POINTER
51 while (valid_stack_ptr(tinfo, (void *)ebp)) {
52 addr = *(unsigned long *)(ebp + 4);
53 printk("%08lx: [<%08lx>]", ebp + 4, addr);
54 print_symbol(" %s", addr);
55 printk("\n");
56 ebp = *(unsigned long *)ebp;
57 }
58#else
59 while (valid_stack_ptr(tinfo, stack)) {
60 addr = *stack;
61 if (__kernel_text_address(addr)) {
62 printk("%08lx: [<%08lx>]", (unsigned long) stack, addr);
63 print_symbol(" %s", addr);
64 printk("\n");
65 }
66 stack++;
67 }
68#endif
69 return ebp;
70}
71
72void show_trace(struct task_struct* task, unsigned long * stack)
73{
74 unsigned long ebp;
75 struct thread_info *context;
76
77 /* Turn this into BUG_ON if possible. */
78 if (!stack) {
79 stack = (unsigned long*) &stack;
80 printk("show_trace: got NULL stack, implicit assumption task == current");
81 WARN_ON(1);
82 }
83
84 if (!task)
85 task = current;
86
87 if (task != current) {
88 ebp = (unsigned long) KSTK_EBP(task);
89 } else {
90 asm ("movl %%ebp, %0" : "=r" (ebp) : );
91 }
92
93 context = (struct thread_info *)
94 ((unsigned long)stack & (~(THREAD_SIZE - 1)));
95 print_context_stack(context, stack, ebp);
96
97 printk("\n");
98}
99
diff --git a/arch/x86/um/sysrq_64.c b/arch/x86/um/sysrq_64.c
index a0e7fb1134a0..38b4e4abd0f8 100644
--- a/arch/x86/um/sysrq_64.c
+++ b/arch/x86/um/sysrq_64.c
@@ -12,7 +12,7 @@
12#include <asm/ptrace.h> 12#include <asm/ptrace.h>
13#include <asm/sysrq.h> 13#include <asm/sysrq.h>
14 14
15void __show_regs(struct pt_regs *regs) 15void show_regs(struct pt_regs *regs)
16{ 16{
17 printk("\n"); 17 printk("\n");
18 print_modules(); 18 print_modules();
@@ -33,9 +33,3 @@ void __show_regs(struct pt_regs *regs)
33 printk(KERN_INFO "R13: %016lx R14: %016lx R15: %016lx\n", 33 printk(KERN_INFO "R13: %016lx R14: %016lx R15: %016lx\n",
34 PT_REGS_R13(regs), PT_REGS_R14(regs), PT_REGS_R15(regs)); 34 PT_REGS_R13(regs), PT_REGS_R14(regs), PT_REGS_R15(regs));
35} 35}
36
37void show_regs(struct pt_regs *regs)
38{
39 __show_regs(regs);
40 show_trace(current, (unsigned long *) &regs);
41}
diff --git a/arch/x86/um/vdso/.gitignore b/arch/x86/um/vdso/.gitignore
new file mode 100644
index 000000000000..9cac6d072199
--- /dev/null
+++ b/arch/x86/um/vdso/.gitignore
@@ -0,0 +1,2 @@
1vdso-syms.lds
2vdso.lds