aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86')
-rw-r--r--include/asm-x86/amd_iommu_types.h8
-rw-r--r--include/asm-x86/atomic_64.h8
-rw-r--r--include/asm-x86/cpufeature.h2
-rw-r--r--include/asm-x86/genapic_32.h1
-rw-r--r--include/asm-x86/genapic_64.h1
-rw-r--r--include/asm-x86/geode.h3
-rw-r--r--include/asm-x86/i387.h2
-rw-r--r--include/asm-x86/io.h18
-rw-r--r--include/asm-x86/irq_vectors.h1
-rw-r--r--include/asm-x86/kexec.h8
-rw-r--r--include/asm-x86/mce.h1
-rw-r--r--include/asm-x86/mman.h1
-rw-r--r--include/asm-x86/mmconfig.h2
-rw-r--r--include/asm-x86/mmzone_32.h6
-rw-r--r--include/asm-x86/msr.h27
-rw-r--r--include/asm-x86/percpu.h2
-rw-r--r--include/asm-x86/pgtable_64.h2
-rw-r--r--include/asm-x86/processor.h23
-rw-r--r--include/asm-x86/spinlock.h4
-rw-r--r--include/asm-x86/uv/uv_bau.h5
-rw-r--r--include/asm-x86/xen/hypervisor.h1
21 files changed, 81 insertions, 45 deletions
diff --git a/include/asm-x86/amd_iommu_types.h b/include/asm-x86/amd_iommu_types.h
index 22aa58ca199..dcc81206739 100644
--- a/include/asm-x86/amd_iommu_types.h
+++ b/include/asm-x86/amd_iommu_types.h
@@ -31,9 +31,6 @@
31#define ALIAS_TABLE_ENTRY_SIZE 2 31#define ALIAS_TABLE_ENTRY_SIZE 2
32#define RLOOKUP_TABLE_ENTRY_SIZE (sizeof(void *)) 32#define RLOOKUP_TABLE_ENTRY_SIZE (sizeof(void *))
33 33
34/* helper macros */
35#define LOW_U32(x) ((x) & ((1ULL << 32)-1))
36
37/* Length of the MMIO region for the AMD IOMMU */ 34/* Length of the MMIO region for the AMD IOMMU */
38#define MMIO_REGION_LENGTH 0x4000 35#define MMIO_REGION_LENGTH 0x4000
39 36
@@ -69,6 +66,9 @@
69#define MMIO_EVT_TAIL_OFFSET 0x2018 66#define MMIO_EVT_TAIL_OFFSET 0x2018
70#define MMIO_STATUS_OFFSET 0x2020 67#define MMIO_STATUS_OFFSET 0x2020
71 68
69/* MMIO status bits */
70#define MMIO_STATUS_COM_WAIT_INT_MASK 0x04
71
72/* feature control bits */ 72/* feature control bits */
73#define CONTROL_IOMMU_EN 0x00ULL 73#define CONTROL_IOMMU_EN 0x00ULL
74#define CONTROL_HT_TUN_EN 0x01ULL 74#define CONTROL_HT_TUN_EN 0x01ULL
@@ -89,6 +89,7 @@
89#define CMD_INV_IOMMU_PAGES 0x03 89#define CMD_INV_IOMMU_PAGES 0x03
90 90
91#define CMD_COMPL_WAIT_STORE_MASK 0x01 91#define CMD_COMPL_WAIT_STORE_MASK 0x01
92#define CMD_COMPL_WAIT_INT_MASK 0x02
92#define CMD_INV_IOMMU_PAGES_SIZE_MASK 0x01 93#define CMD_INV_IOMMU_PAGES_SIZE_MASK 0x01
93#define CMD_INV_IOMMU_PAGES_PDE_MASK 0x02 94#define CMD_INV_IOMMU_PAGES_PDE_MASK 0x02
94 95
@@ -99,6 +100,7 @@
99#define DEV_ENTRY_TRANSLATION 0x01 100#define DEV_ENTRY_TRANSLATION 0x01
100#define DEV_ENTRY_IR 0x3d 101#define DEV_ENTRY_IR 0x3d
101#define DEV_ENTRY_IW 0x3e 102#define DEV_ENTRY_IW 0x3e
103#define DEV_ENTRY_NO_PAGE_FAULT 0x62
102#define DEV_ENTRY_EX 0x67 104#define DEV_ENTRY_EX 0x67
103#define DEV_ENTRY_SYSMGT1 0x68 105#define DEV_ENTRY_SYSMGT1 0x68
104#define DEV_ENTRY_SYSMGT2 0x69 106#define DEV_ENTRY_SYSMGT2 0x69
diff --git a/include/asm-x86/atomic_64.h b/include/asm-x86/atomic_64.h
index a0095191c02..91c7d03e65b 100644
--- a/include/asm-x86/atomic_64.h
+++ b/include/asm-x86/atomic_64.h
@@ -228,7 +228,7 @@ static inline void atomic64_add(long i, atomic64_t *v)
228{ 228{
229 asm volatile(LOCK_PREFIX "addq %1,%0" 229 asm volatile(LOCK_PREFIX "addq %1,%0"
230 : "=m" (v->counter) 230 : "=m" (v->counter)
231 : "ir" (i), "m" (v->counter)); 231 : "er" (i), "m" (v->counter));
232} 232}
233 233
234/** 234/**
@@ -242,7 +242,7 @@ static inline void atomic64_sub(long i, atomic64_t *v)
242{ 242{
243 asm volatile(LOCK_PREFIX "subq %1,%0" 243 asm volatile(LOCK_PREFIX "subq %1,%0"
244 : "=m" (v->counter) 244 : "=m" (v->counter)
245 : "ir" (i), "m" (v->counter)); 245 : "er" (i), "m" (v->counter));
246} 246}
247 247
248/** 248/**
@@ -260,7 +260,7 @@ static inline int atomic64_sub_and_test(long i, atomic64_t *v)
260 260
261 asm volatile(LOCK_PREFIX "subq %2,%0; sete %1" 261 asm volatile(LOCK_PREFIX "subq %2,%0; sete %1"
262 : "=m" (v->counter), "=qm" (c) 262 : "=m" (v->counter), "=qm" (c)
263 : "ir" (i), "m" (v->counter) : "memory"); 263 : "er" (i), "m" (v->counter) : "memory");
264 return c; 264 return c;
265} 265}
266 266
@@ -341,7 +341,7 @@ static inline int atomic64_add_negative(long i, atomic64_t *v)
341 341
342 asm volatile(LOCK_PREFIX "addq %2,%0; sets %1" 342 asm volatile(LOCK_PREFIX "addq %2,%0; sets %1"
343 : "=m" (v->counter), "=qm" (c) 343 : "=m" (v->counter), "=qm" (c)
344 : "ir" (i), "m" (v->counter) : "memory"); 344 : "er" (i), "m" (v->counter) : "memory");
345 return c; 345 return c;
346} 346}
347 347
diff --git a/include/asm-x86/cpufeature.h b/include/asm-x86/cpufeature.h
index be8b2ad5d41..9489283a4bc 100644
--- a/include/asm-x86/cpufeature.h
+++ b/include/asm-x86/cpufeature.h
@@ -92,6 +92,7 @@
92#define X86_FEATURE_CX16 (4*32+13) /* CMPXCHG16B */ 92#define X86_FEATURE_CX16 (4*32+13) /* CMPXCHG16B */
93#define X86_FEATURE_XTPR (4*32+14) /* Send Task Priority Messages */ 93#define X86_FEATURE_XTPR (4*32+14) /* Send Task Priority Messages */
94#define X86_FEATURE_DCA (4*32+18) /* Direct Cache Access */ 94#define X86_FEATURE_DCA (4*32+18) /* Direct Cache Access */
95#define X86_FEATURE_XMM4_2 (4*32+20) /* Streaming SIMD Extensions-4.2 */
95 96
96/* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */ 97/* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */
97#define X86_FEATURE_XSTORE (5*32+ 2) /* on-CPU RNG present (xstore insn) */ 98#define X86_FEATURE_XSTORE (5*32+ 2) /* on-CPU RNG present (xstore insn) */
@@ -190,6 +191,7 @@ extern const char * const x86_power_flags[32];
190#define cpu_has_gbpages boot_cpu_has(X86_FEATURE_GBPAGES) 191#define cpu_has_gbpages boot_cpu_has(X86_FEATURE_GBPAGES)
191#define cpu_has_arch_perfmon boot_cpu_has(X86_FEATURE_ARCH_PERFMON) 192#define cpu_has_arch_perfmon boot_cpu_has(X86_FEATURE_ARCH_PERFMON)
192#define cpu_has_pat boot_cpu_has(X86_FEATURE_PAT) 193#define cpu_has_pat boot_cpu_has(X86_FEATURE_PAT)
194#define cpu_has_xmm4_2 boot_cpu_has(X86_FEATURE_XMM4_2)
193 195
194#if defined(CONFIG_X86_INVLPG) || defined(CONFIG_X86_64) 196#if defined(CONFIG_X86_INVLPG) || defined(CONFIG_X86_64)
195# define cpu_has_invlpg 1 197# define cpu_has_invlpg 1
diff --git a/include/asm-x86/genapic_32.h b/include/asm-x86/genapic_32.h
index b02ea6e17de..754d635f90f 100644
--- a/include/asm-x86/genapic_32.h
+++ b/include/asm-x86/genapic_32.h
@@ -118,6 +118,7 @@ enum uv_system_type {UV_NONE, UV_LEGACY_APIC, UV_X2APIC, UV_NON_UNIQUE_APIC};
118#define get_uv_system_type() UV_NONE 118#define get_uv_system_type() UV_NONE
119#define is_uv_system() 0 119#define is_uv_system() 0
120#define uv_wakeup_secondary(a, b) 1 120#define uv_wakeup_secondary(a, b) 1
121#define uv_system_init() do {} while (0)
121 122
122 123
123#endif 124#endif
diff --git a/include/asm-x86/genapic_64.h b/include/asm-x86/genapic_64.h
index 0f8504627c4..a47d6312913 100644
--- a/include/asm-x86/genapic_64.h
+++ b/include/asm-x86/genapic_64.h
@@ -42,6 +42,7 @@ extern int is_uv_system(void);
42extern struct genapic apic_x2apic_uv_x; 42extern struct genapic apic_x2apic_uv_x;
43DECLARE_PER_CPU(int, x2apic_extra_bits); 43DECLARE_PER_CPU(int, x2apic_extra_bits);
44extern void uv_cpu_init(void); 44extern void uv_cpu_init(void);
45extern void uv_system_init(void);
45extern int uv_wakeup_secondary(int phys_apicid, unsigned int start_rip); 46extern int uv_wakeup_secondary(int phys_apicid, unsigned int start_rip);
46 47
47extern void setup_apic_routing(void); 48extern void setup_apic_routing(void);
diff --git a/include/asm-x86/geode.h b/include/asm-x86/geode.h
index bb06027fc83..2c1cda0b8a8 100644
--- a/include/asm-x86/geode.h
+++ b/include/asm-x86/geode.h
@@ -50,6 +50,7 @@ extern int geode_get_dev_base(unsigned int dev);
50#define MSR_PIC_YSEL_HIGH 0x51400021 50#define MSR_PIC_YSEL_HIGH 0x51400021
51#define MSR_PIC_ZSEL_LOW 0x51400022 51#define MSR_PIC_ZSEL_LOW 0x51400022
52#define MSR_PIC_ZSEL_HIGH 0x51400023 52#define MSR_PIC_ZSEL_HIGH 0x51400023
53#define MSR_PIC_IRQM_LPC 0x51400025
53 54
54#define MSR_MFGPT_IRQ 0x51400028 55#define MSR_MFGPT_IRQ 0x51400028
55#define MSR_MFGPT_NR 0x51400029 56#define MSR_MFGPT_NR 0x51400029
@@ -237,7 +238,7 @@ static inline u16 geode_mfgpt_read(int timer, u16 reg)
237} 238}
238 239
239extern int geode_mfgpt_toggle_event(int timer, int cmp, int event, int enable); 240extern int geode_mfgpt_toggle_event(int timer, int cmp, int event, int enable);
240extern int geode_mfgpt_set_irq(int timer, int cmp, int irq, int enable); 241extern int geode_mfgpt_set_irq(int timer, int cmp, int *irq, int enable);
241extern int geode_mfgpt_alloc_timer(int timer, int domain); 242extern int geode_mfgpt_alloc_timer(int timer, int domain);
242 243
243#define geode_mfgpt_setup_irq(t, c, i) geode_mfgpt_set_irq((t), (c), (i), 1) 244#define geode_mfgpt_setup_irq(t, c, i) geode_mfgpt_set_irq((t), (c), (i), 1)
diff --git a/include/asm-x86/i387.h b/include/asm-x86/i387.h
index 6d3b2106341..56d00e31aec 100644
--- a/include/asm-x86/i387.h
+++ b/include/asm-x86/i387.h
@@ -63,8 +63,6 @@ static inline int restore_fpu_checking(struct i387_fxsave_struct *fx)
63#else 63#else
64 : [fx] "cdaSDb" (fx), "m" (*fx), "0" (0)); 64 : [fx] "cdaSDb" (fx), "m" (*fx), "0" (0));
65#endif 65#endif
66 if (unlikely(err))
67 init_fpu(current);
68 return err; 66 return err;
69} 67}
70 68
diff --git a/include/asm-x86/io.h b/include/asm-x86/io.h
index bf5d629b3a3..0f954dc89cb 100644
--- a/include/asm-x86/io.h
+++ b/include/asm-x86/io.h
@@ -21,7 +21,7 @@ extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys);
21 21
22#define build_mmio_read(name, size, type, reg, barrier) \ 22#define build_mmio_read(name, size, type, reg, barrier) \
23static inline type name(const volatile void __iomem *addr) \ 23static inline type name(const volatile void __iomem *addr) \
24{ type ret; asm volatile("mov" size " %1,%0":"=" reg (ret) \ 24{ type ret; asm volatile("mov" size " %1,%0":reg (ret) \
25:"m" (*(volatile type __force *)addr) barrier); return ret; } 25:"m" (*(volatile type __force *)addr) barrier); return ret; }
26 26
27#define build_mmio_write(name, size, type, reg, barrier) \ 27#define build_mmio_write(name, size, type, reg, barrier) \
@@ -29,13 +29,13 @@ static inline void name(type val, volatile void __iomem *addr) \
29{ asm volatile("mov" size " %0,%1": :reg (val), \ 29{ asm volatile("mov" size " %0,%1": :reg (val), \
30"m" (*(volatile type __force *)addr) barrier); } 30"m" (*(volatile type __force *)addr) barrier); }
31 31
32build_mmio_read(readb, "b", unsigned char, "q", :"memory") 32build_mmio_read(readb, "b", unsigned char, "=q", :"memory")
33build_mmio_read(readw, "w", unsigned short, "r", :"memory") 33build_mmio_read(readw, "w", unsigned short, "=r", :"memory")
34build_mmio_read(readl, "l", unsigned int, "r", :"memory") 34build_mmio_read(readl, "l", unsigned int, "=r", :"memory")
35 35
36build_mmio_read(__readb, "b", unsigned char, "q", ) 36build_mmio_read(__readb, "b", unsigned char, "=q", )
37build_mmio_read(__readw, "w", unsigned short, "r", ) 37build_mmio_read(__readw, "w", unsigned short, "=r", )
38build_mmio_read(__readl, "l", unsigned int, "r", ) 38build_mmio_read(__readl, "l", unsigned int, "=r", )
39 39
40build_mmio_write(writeb, "b", unsigned char, "q", :"memory") 40build_mmio_write(writeb, "b", unsigned char, "q", :"memory")
41build_mmio_write(writew, "w", unsigned short, "r", :"memory") 41build_mmio_write(writew, "w", unsigned short, "r", :"memory")
@@ -59,8 +59,8 @@ build_mmio_write(__writel, "l", unsigned int, "r", )
59#define mmiowb() barrier() 59#define mmiowb() barrier()
60 60
61#ifdef CONFIG_X86_64 61#ifdef CONFIG_X86_64
62build_mmio_read(readq, "q", unsigned long, "r", :"memory") 62build_mmio_read(readq, "q", unsigned long, "=r", :"memory")
63build_mmio_read(__readq, "q", unsigned long, "r", ) 63build_mmio_read(__readq, "q", unsigned long, "=r", )
64build_mmio_write(writeq, "q", unsigned long, "r", :"memory") 64build_mmio_write(writeq, "q", unsigned long, "r", :"memory")
65build_mmio_write(__writeq, "q", unsigned long, "r", ) 65build_mmio_write(__writeq, "q", unsigned long, "r", )
66 66
diff --git a/include/asm-x86/irq_vectors.h b/include/asm-x86/irq_vectors.h
index b95d167b7fb..a48c7f2dbdc 100644
--- a/include/asm-x86/irq_vectors.h
+++ b/include/asm-x86/irq_vectors.h
@@ -76,6 +76,7 @@
76#define CALL_FUNCTION_SINGLE_VECTOR 0xfb 76#define CALL_FUNCTION_SINGLE_VECTOR 0xfb
77#define THERMAL_APIC_VECTOR 0xfa 77#define THERMAL_APIC_VECTOR 0xfa
78#define THRESHOLD_APIC_VECTOR 0xf9 78#define THRESHOLD_APIC_VECTOR 0xf9
79#define UV_BAU_MESSAGE 0xf8
79#define INVALIDATE_TLB_VECTOR_END 0xf7 80#define INVALIDATE_TLB_VECTOR_END 0xf7
80#define INVALIDATE_TLB_VECTOR_START 0xf0 /* f0-f7 used for TLB flush */ 81#define INVALIDATE_TLB_VECTOR_START 0xf0 /* f0-f7 used for TLB flush */
81 82
diff --git a/include/asm-x86/kexec.h b/include/asm-x86/kexec.h
index c0e52a14fd4..4246ab7dc98 100644
--- a/include/asm-x86/kexec.h
+++ b/include/asm-x86/kexec.h
@@ -41,6 +41,10 @@
41# define PAGES_NR 17 41# define PAGES_NR 17
42#endif 42#endif
43 43
44#ifdef CONFIG_X86_32
45# define KEXEC_CONTROL_CODE_MAX_SIZE 2048
46#endif
47
44#ifndef __ASSEMBLY__ 48#ifndef __ASSEMBLY__
45 49
46#include <linux/string.h> 50#include <linux/string.h>
@@ -63,7 +67,7 @@
63/* Maximum address we can use for the control code buffer */ 67/* Maximum address we can use for the control code buffer */
64# define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE 68# define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE
65 69
66# define KEXEC_CONTROL_CODE_SIZE 4096 70# define KEXEC_CONTROL_PAGE_SIZE 4096
67 71
68/* The native architecture */ 72/* The native architecture */
69# define KEXEC_ARCH KEXEC_ARCH_386 73# define KEXEC_ARCH KEXEC_ARCH_386
@@ -79,7 +83,7 @@
79# define KEXEC_CONTROL_MEMORY_LIMIT (0xFFFFFFFFFFUL) 83# define KEXEC_CONTROL_MEMORY_LIMIT (0xFFFFFFFFFFUL)
80 84
81/* Allocate one page for the pdp and the second for the code */ 85/* Allocate one page for the pdp and the second for the code */
82# define KEXEC_CONTROL_CODE_SIZE (4096UL + 4096UL) 86# define KEXEC_CONTROL_PAGE_SIZE (4096UL + 4096UL)
83 87
84/* The native architecture */ 88/* The native architecture */
85# define KEXEC_ARCH KEXEC_ARCH_X86_64 89# define KEXEC_ARCH KEXEC_ARCH_X86_64
diff --git a/include/asm-x86/mce.h b/include/asm-x86/mce.h
index 94f1fd79e22..531eaa58745 100644
--- a/include/asm-x86/mce.h
+++ b/include/asm-x86/mce.h
@@ -92,6 +92,7 @@ extern int mce_disabled;
92 92
93void mce_log(struct mce *m); 93void mce_log(struct mce *m);
94DECLARE_PER_CPU(struct sys_device, device_mce); 94DECLARE_PER_CPU(struct sys_device, device_mce);
95extern void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu);
95 96
96#ifdef CONFIG_X86_MCE_INTEL 97#ifdef CONFIG_X86_MCE_INTEL
97void mce_intel_feature_init(struct cpuinfo_x86 *c); 98void mce_intel_feature_init(struct cpuinfo_x86 *c);
diff --git a/include/asm-x86/mman.h b/include/asm-x86/mman.h
index c1682b542da..90bc4108a4f 100644
--- a/include/asm-x86/mman.h
+++ b/include/asm-x86/mman.h
@@ -12,6 +12,7 @@
12#define MAP_NORESERVE 0x4000 /* don't check for reservations */ 12#define MAP_NORESERVE 0x4000 /* don't check for reservations */
13#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ 13#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
14#define MAP_NONBLOCK 0x10000 /* do not block on IO */ 14#define MAP_NONBLOCK 0x10000 /* do not block on IO */
15#define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */
15 16
16#define MCL_CURRENT 1 /* lock all current mappings */ 17#define MCL_CURRENT 1 /* lock all current mappings */
17#define MCL_FUTURE 2 /* lock all future mappings */ 18#define MCL_FUTURE 2 /* lock all future mappings */
diff --git a/include/asm-x86/mmconfig.h b/include/asm-x86/mmconfig.h
index 95beda07c6f..e293ab81e85 100644
--- a/include/asm-x86/mmconfig.h
+++ b/include/asm-x86/mmconfig.h
@@ -3,7 +3,7 @@
3 3
4#ifdef CONFIG_PCI_MMCONFIG 4#ifdef CONFIG_PCI_MMCONFIG
5extern void __cpuinit fam10h_check_enable_mmcfg(void); 5extern void __cpuinit fam10h_check_enable_mmcfg(void);
6extern void __init check_enable_amd_mmconf_dmi(void); 6extern void __cpuinit check_enable_amd_mmconf_dmi(void);
7#else 7#else
8static inline void fam10h_check_enable_mmcfg(void) { } 8static inline void fam10h_check_enable_mmcfg(void) { }
9static inline void check_enable_amd_mmconf_dmi(void) { } 9static inline void check_enable_amd_mmconf_dmi(void) { }
diff --git a/include/asm-x86/mmzone_32.h b/include/asm-x86/mmzone_32.h
index b2298a22756..5862e646065 100644
--- a/include/asm-x86/mmzone_32.h
+++ b/include/asm-x86/mmzone_32.h
@@ -97,10 +97,16 @@ static inline int pfn_valid(int pfn)
97 reserve_bootmem_node(NODE_DATA(0), (addr), (size), (flags)) 97 reserve_bootmem_node(NODE_DATA(0), (addr), (size), (flags))
98#define alloc_bootmem(x) \ 98#define alloc_bootmem(x) \
99 __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) 99 __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
100#define alloc_bootmem_nopanic(x) \
101 __alloc_bootmem_node_nopanic(NODE_DATA(0), (x), SMP_CACHE_BYTES, \
102 __pa(MAX_DMA_ADDRESS))
100#define alloc_bootmem_low(x) \ 103#define alloc_bootmem_low(x) \
101 __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, 0) 104 __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, 0)
102#define alloc_bootmem_pages(x) \ 105#define alloc_bootmem_pages(x) \
103 __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) 106 __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
107#define alloc_bootmem_pages_nopanic(x) \
108 __alloc_bootmem_node_nopanic(NODE_DATA(0), (x), PAGE_SIZE, \
109 __pa(MAX_DMA_ADDRESS))
104#define alloc_bootmem_low_pages(x) \ 110#define alloc_bootmem_low_pages(x) \
105 __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, 0) 111 __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, 0)
106#define alloc_bootmem_node(pgdat, x) \ 112#define alloc_bootmem_node(pgdat, x) \
diff --git a/include/asm-x86/msr.h b/include/asm-x86/msr.h
index ca110ee73f0..2362cfda1fb 100644
--- a/include/asm-x86/msr.h
+++ b/include/asm-x86/msr.h
@@ -52,14 +52,14 @@ static inline unsigned long long native_read_msr_safe(unsigned int msr,
52{ 52{
53 DECLARE_ARGS(val, low, high); 53 DECLARE_ARGS(val, low, high);
54 54
55 asm volatile("2: rdmsr ; xor %0,%0\n" 55 asm volatile("2: rdmsr ; xor %[err],%[err]\n"
56 "1:\n\t" 56 "1:\n\t"
57 ".section .fixup,\"ax\"\n\t" 57 ".section .fixup,\"ax\"\n\t"
58 "3: mov %3,%0 ; jmp 1b\n\t" 58 "3: mov %[fault],%[err] ; jmp 1b\n\t"
59 ".previous\n\t" 59 ".previous\n\t"
60 _ASM_EXTABLE(2b, 3b) 60 _ASM_EXTABLE(2b, 3b)
61 : "=r" (*err), EAX_EDX_RET(val, low, high) 61 : [err] "=r" (*err), EAX_EDX_RET(val, low, high)
62 : "c" (msr), "i" (-EFAULT)); 62 : "c" (msr), [fault] "i" (-EFAULT));
63 return EAX_EDX_VAL(val, low, high); 63 return EAX_EDX_VAL(val, low, high);
64} 64}
65 65
@@ -73,15 +73,15 @@ static inline int native_write_msr_safe(unsigned int msr,
73 unsigned low, unsigned high) 73 unsigned low, unsigned high)
74{ 74{
75 int err; 75 int err;
76 asm volatile("2: wrmsr ; xor %0,%0\n" 76 asm volatile("2: wrmsr ; xor %[err],%[err]\n"
77 "1:\n\t" 77 "1:\n\t"
78 ".section .fixup,\"ax\"\n\t" 78 ".section .fixup,\"ax\"\n\t"
79 "3: mov %4,%0 ; jmp 1b\n\t" 79 "3: mov %[fault],%[err] ; jmp 1b\n\t"
80 ".previous\n\t" 80 ".previous\n\t"
81 _ASM_EXTABLE(2b, 3b) 81 _ASM_EXTABLE(2b, 3b)
82 : "=a" (err) 82 : [err] "=a" (err)
83 : "c" (msr), "0" (low), "d" (high), 83 : "c" (msr), "0" (low), "d" (high),
84 "i" (-EFAULT) 84 [fault] "i" (-EFAULT)
85 : "memory"); 85 : "memory");
86 return err; 86 return err;
87} 87}
@@ -192,19 +192,20 @@ do { \
192#define write_rdtscp_aux(val) wrmsr(0xc0000103, (val), 0) 192#define write_rdtscp_aux(val) wrmsr(0xc0000103, (val), 0)
193 193
194#ifdef CONFIG_SMP 194#ifdef CONFIG_SMP
195void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); 195int rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
196void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); 196int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
197int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); 197int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
198
199int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); 198int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
200#else /* CONFIG_SMP */ 199#else /* CONFIG_SMP */
201static inline void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h) 200static inline int rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
202{ 201{
203 rdmsr(msr_no, *l, *h); 202 rdmsr(msr_no, *l, *h);
203 return 0;
204} 204}
205static inline void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) 205static inline int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
206{ 206{
207 wrmsr(msr_no, l, h); 207 wrmsr(msr_no, l, h);
208 return 0;
208} 209}
209static inline int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, 210static inline int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no,
210 u32 *l, u32 *h) 211 u32 *l, u32 *h)
diff --git a/include/asm-x86/percpu.h b/include/asm-x86/percpu.h
index 4e91ee1e37a..f643a3a92da 100644
--- a/include/asm-x86/percpu.h
+++ b/include/asm-x86/percpu.h
@@ -182,7 +182,7 @@ do { \
182 DEFINE_PER_CPU(_type, _name) = _initvalue; \ 182 DEFINE_PER_CPU(_type, _name) = _initvalue; \
183 __typeof__(_type) _name##_early_map[NR_CPUS] __initdata = \ 183 __typeof__(_type) _name##_early_map[NR_CPUS] __initdata = \
184 { [0 ... NR_CPUS-1] = _initvalue }; \ 184 { [0 ... NR_CPUS-1] = _initvalue }; \
185 __typeof__(_type) *_name##_early_ptr = _name##_early_map 185 __typeof__(_type) *_name##_early_ptr __refdata = _name##_early_map
186 186
187#define EXPORT_EARLY_PER_CPU_SYMBOL(_name) \ 187#define EXPORT_EARLY_PER_CPU_SYMBOL(_name) \
188 EXPORT_PER_CPU_SYMBOL(_name) 188 EXPORT_PER_CPU_SYMBOL(_name)
diff --git a/include/asm-x86/pgtable_64.h b/include/asm-x86/pgtable_64.h
index ac5fff4cc58..549144d03d9 100644
--- a/include/asm-x86/pgtable_64.h
+++ b/include/asm-x86/pgtable_64.h
@@ -151,7 +151,7 @@ static inline void native_pgd_clear(pgd_t *pgd)
151#define VMALLOC_END _AC(0xffffe1ffffffffff, UL) 151#define VMALLOC_END _AC(0xffffe1ffffffffff, UL)
152#define VMEMMAP_START _AC(0xffffe20000000000, UL) 152#define VMEMMAP_START _AC(0xffffe20000000000, UL)
153#define MODULES_VADDR _AC(0xffffffffa0000000, UL) 153#define MODULES_VADDR _AC(0xffffffffa0000000, UL)
154#define MODULES_END _AC(0xfffffffffff00000, UL) 154#define MODULES_END _AC(0xffffffffff000000, UL)
155#define MODULES_LEN (MODULES_END - MODULES_VADDR) 155#define MODULES_LEN (MODULES_END - MODULES_VADDR)
156 156
157#ifndef __ASSEMBLY__ 157#ifndef __ASSEMBLY__
diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h
index 5f58da401b4..4df3e2f6fb5 100644
--- a/include/asm-x86/processor.h
+++ b/include/asm-x86/processor.h
@@ -728,6 +728,29 @@ extern unsigned long boot_option_idle_override;
728extern unsigned long idle_halt; 728extern unsigned long idle_halt;
729extern unsigned long idle_nomwait; 729extern unsigned long idle_nomwait;
730 730
731/*
732 * on systems with caches, caches must be flashed as the absolute
733 * last instruction before going into a suspended halt. Otherwise,
734 * dirty data can linger in the cache and become stale on resume,
735 * leading to strange errors.
736 *
737 * perform a variety of operations to guarantee that the compiler
738 * will not reorder instructions. wbinvd itself is serializing
739 * so the processor will not reorder.
740 *
741 * Systems without cache can just go into halt.
742 */
743static inline void wbinvd_halt(void)
744{
745 mb();
746 /* check for clflush to determine if wbinvd is legal */
747 if (cpu_has_clflush)
748 asm volatile("cli; wbinvd; 1: hlt; jmp 1b" : : : "memory");
749 else
750 while (1)
751 halt();
752}
753
731extern void enable_sep_cpu(void); 754extern void enable_sep_cpu(void);
732extern int sysenter_setup(void); 755extern int sysenter_setup(void);
733 756
diff --git a/include/asm-x86/spinlock.h b/include/asm-x86/spinlock.h
index 4f9a9861799..e39c790dbfd 100644
--- a/include/asm-x86/spinlock.h
+++ b/include/asm-x86/spinlock.h
@@ -65,7 +65,7 @@ static inline int __ticket_spin_is_contended(raw_spinlock_t *lock)
65{ 65{
66 int tmp = ACCESS_ONCE(lock->slock); 66 int tmp = ACCESS_ONCE(lock->slock);
67 67
68 return (((tmp >> 8) & 0xff) - (tmp & 0xff)) > 1; 68 return (((tmp >> 8) - tmp) & 0xff) > 1;
69} 69}
70 70
71static __always_inline void __ticket_spin_lock(raw_spinlock_t *lock) 71static __always_inline void __ticket_spin_lock(raw_spinlock_t *lock)
@@ -127,7 +127,7 @@ static inline int __ticket_spin_is_contended(raw_spinlock_t *lock)
127{ 127{
128 int tmp = ACCESS_ONCE(lock->slock); 128 int tmp = ACCESS_ONCE(lock->slock);
129 129
130 return (((tmp >> 16) & 0xffff) - (tmp & 0xffff)) > 1; 130 return (((tmp >> 16) - tmp) & 0xffff) > 1;
131} 131}
132 132
133static __always_inline void __ticket_spin_lock(raw_spinlock_t *lock) 133static __always_inline void __ticket_spin_lock(raw_spinlock_t *lock)
diff --git a/include/asm-x86/uv/uv_bau.h b/include/asm-x86/uv/uv_bau.h
index 91ac0dfb758..610b6b308e9 100644
--- a/include/asm-x86/uv/uv_bau.h
+++ b/include/asm-x86/uv/uv_bau.h
@@ -40,11 +40,6 @@
40#define UV_ACTIVATION_DESCRIPTOR_SIZE 32 40#define UV_ACTIVATION_DESCRIPTOR_SIZE 32
41#define UV_DISTRIBUTION_SIZE 256 41#define UV_DISTRIBUTION_SIZE 256
42#define UV_SW_ACK_NPENDING 8 42#define UV_SW_ACK_NPENDING 8
43#define UV_BAU_MESSAGE 200
44/*
45 * Messaging irq; see irq_64.h and include/asm-x86/hw_irq_64.h
46 * To be dynamically allocated in the future
47 */
48#define UV_NET_ENDPOINT_INTD 0x38 43#define UV_NET_ENDPOINT_INTD 0x38
49#define UV_DESC_BASE_PNODE_SHIFT 49 44#define UV_DESC_BASE_PNODE_SHIFT 49
50#define UV_PAYLOADQ_PNODE_SHIFT 49 45#define UV_PAYLOADQ_PNODE_SHIFT 49
diff --git a/include/asm-x86/xen/hypervisor.h b/include/asm-x86/xen/hypervisor.h
index 8e15dd28c91..04ee0610014 100644
--- a/include/asm-x86/xen/hypervisor.h
+++ b/include/asm-x86/xen/hypervisor.h
@@ -35,7 +35,6 @@
35 35
36#include <linux/types.h> 36#include <linux/types.h>
37#include <linux/kernel.h> 37#include <linux/kernel.h>
38#include <linux/version.h>
39 38
40#include <xen/interface/xen.h> 39#include <xen/interface/xen.h>
41#include <xen/interface/version.h> 40#include <xen/interface/version.h>