diff options
Diffstat (limited to 'arch/x86/include/asm')
37 files changed, 422 insertions, 109 deletions
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index 4ef949c1972e..df8a300dfe6c 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h | |||
| @@ -75,7 +75,7 @@ static inline void default_inquire_remote_apic(int apicid) | |||
| 75 | #define setup_secondary_clock setup_secondary_APIC_clock | 75 | #define setup_secondary_clock setup_secondary_APIC_clock |
| 76 | #endif | 76 | #endif |
| 77 | 77 | ||
| 78 | #ifdef CONFIG_X86_VSMP | 78 | #ifdef CONFIG_X86_64 |
| 79 | extern int is_vsmp_box(void); | 79 | extern int is_vsmp_box(void); |
| 80 | #else | 80 | #else |
| 81 | static inline int is_vsmp_box(void) | 81 | static inline int is_vsmp_box(void) |
| @@ -108,6 +108,16 @@ extern void native_apic_icr_write(u32 low, u32 id); | |||
| 108 | extern u64 native_apic_icr_read(void); | 108 | extern u64 native_apic_icr_read(void); |
| 109 | 109 | ||
| 110 | #ifdef CONFIG_X86_X2APIC | 110 | #ifdef CONFIG_X86_X2APIC |
| 111 | /* | ||
| 112 | * Make previous memory operations globally visible before | ||
| 113 | * sending the IPI through x2apic wrmsr. We need a serializing instruction or | ||
| 114 | * mfence for this. | ||
| 115 | */ | ||
| 116 | static inline void x2apic_wrmsr_fence(void) | ||
| 117 | { | ||
| 118 | asm volatile("mfence" : : : "memory"); | ||
| 119 | } | ||
| 120 | |||
| 111 | static inline void native_apic_msr_write(u32 reg, u32 v) | 121 | static inline void native_apic_msr_write(u32 reg, u32 v) |
| 112 | { | 122 | { |
| 113 | if (reg == APIC_DFR || reg == APIC_ID || reg == APIC_LDR || | 123 | if (reg == APIC_DFR || reg == APIC_ID || reg == APIC_LDR || |
| @@ -184,6 +194,9 @@ static inline int x2apic_enabled(void) | |||
| 184 | { | 194 | { |
| 185 | return 0; | 195 | return 0; |
| 186 | } | 196 | } |
| 197 | |||
| 198 | #define x2apic 0 | ||
| 199 | |||
| 187 | #endif | 200 | #endif |
| 188 | 201 | ||
| 189 | extern int get_physical_broadcast(void); | 202 | extern int get_physical_broadcast(void); |
| @@ -379,6 +392,7 @@ static inline u32 safe_apic_wait_icr_idle(void) | |||
| 379 | 392 | ||
| 380 | static inline void ack_APIC_irq(void) | 393 | static inline void ack_APIC_irq(void) |
| 381 | { | 394 | { |
| 395 | #ifdef CONFIG_X86_LOCAL_APIC | ||
| 382 | /* | 396 | /* |
| 383 | * ack_APIC_irq() actually gets compiled as a single instruction | 397 | * ack_APIC_irq() actually gets compiled as a single instruction |
| 384 | * ... yummie. | 398 | * ... yummie. |
| @@ -386,6 +400,7 @@ static inline void ack_APIC_irq(void) | |||
| 386 | 400 | ||
| 387 | /* Docs say use 0 for future compatibility */ | 401 | /* Docs say use 0 for future compatibility */ |
| 388 | apic_write(APIC_EOI, 0); | 402 | apic_write(APIC_EOI, 0); |
| 403 | #endif | ||
| 389 | } | 404 | } |
| 390 | 405 | ||
| 391 | static inline unsigned default_get_apic_id(unsigned long x) | 406 | static inline unsigned default_get_apic_id(unsigned long x) |
| @@ -474,10 +489,19 @@ static inline int default_apic_id_registered(void) | |||
| 474 | return physid_isset(read_apic_id(), phys_cpu_present_map); | 489 | return physid_isset(read_apic_id(), phys_cpu_present_map); |
| 475 | } | 490 | } |
| 476 | 491 | ||
| 492 | static inline int default_phys_pkg_id(int cpuid_apic, int index_msb) | ||
| 493 | { | ||
| 494 | return cpuid_apic >> index_msb; | ||
| 495 | } | ||
| 496 | |||
| 497 | extern int default_apicid_to_node(int logical_apicid); | ||
| 498 | |||
| 499 | #endif | ||
| 500 | |||
| 477 | static inline unsigned int | 501 | static inline unsigned int |
| 478 | default_cpu_mask_to_apicid(const struct cpumask *cpumask) | 502 | default_cpu_mask_to_apicid(const struct cpumask *cpumask) |
| 479 | { | 503 | { |
| 480 | return cpumask_bits(cpumask)[0]; | 504 | return cpumask_bits(cpumask)[0] & APIC_ALL_CPUS; |
| 481 | } | 505 | } |
| 482 | 506 | ||
| 483 | static inline unsigned int | 507 | static inline unsigned int |
| @@ -491,15 +515,6 @@ default_cpu_mask_to_apicid_and(const struct cpumask *cpumask, | |||
| 491 | return (unsigned int)(mask1 & mask2 & mask3); | 515 | return (unsigned int)(mask1 & mask2 & mask3); |
| 492 | } | 516 | } |
| 493 | 517 | ||
| 494 | static inline int default_phys_pkg_id(int cpuid_apic, int index_msb) | ||
| 495 | { | ||
| 496 | return cpuid_apic >> index_msb; | ||
| 497 | } | ||
| 498 | |||
| 499 | extern int default_apicid_to_node(int logical_apicid); | ||
| 500 | |||
| 501 | #endif | ||
| 502 | |||
| 503 | static inline unsigned long default_check_apicid_used(physid_mask_t bitmap, int apicid) | 518 | static inline unsigned long default_check_apicid_used(physid_mask_t bitmap, int apicid) |
| 504 | { | 519 | { |
| 505 | return physid_isset(apicid, bitmap); | 520 | return physid_isset(apicid, bitmap); |
diff --git a/arch/x86/include/asm/apicdef.h b/arch/x86/include/asm/apicdef.h index 63134e31e8b9..bc9514fb3b13 100644 --- a/arch/x86/include/asm/apicdef.h +++ b/arch/x86/include/asm/apicdef.h | |||
| @@ -53,6 +53,7 @@ | |||
| 53 | #define APIC_ESR_SENDILL 0x00020 | 53 | #define APIC_ESR_SENDILL 0x00020 |
| 54 | #define APIC_ESR_RECVILL 0x00040 | 54 | #define APIC_ESR_RECVILL 0x00040 |
| 55 | #define APIC_ESR_ILLREGA 0x00080 | 55 | #define APIC_ESR_ILLREGA 0x00080 |
| 56 | #define APIC_LVTCMCI 0x2f0 | ||
| 56 | #define APIC_ICR 0x300 | 57 | #define APIC_ICR 0x300 |
| 57 | #define APIC_DEST_SELF 0x40000 | 58 | #define APIC_DEST_SELF 0x40000 |
| 58 | #define APIC_DEST_ALLINC 0x80000 | 59 | #define APIC_DEST_ALLINC 0x80000 |
diff --git a/arch/x86/include/asm/boot.h b/arch/x86/include/asm/boot.h index 6526cf08b0e4..6ba23dd9fc92 100644 --- a/arch/x86/include/asm/boot.h +++ b/arch/x86/include/asm/boot.h | |||
| @@ -1,10 +1,6 @@ | |||
| 1 | #ifndef _ASM_X86_BOOT_H | 1 | #ifndef _ASM_X86_BOOT_H |
| 2 | #define _ASM_X86_BOOT_H | 2 | #define _ASM_X86_BOOT_H |
| 3 | 3 | ||
| 4 | /* Don't touch these, unless you really know what you're doing. */ | ||
| 5 | #define DEF_SYSSEG 0x1000 | ||
| 6 | #define DEF_SYSSIZE 0x7F00 | ||
| 7 | |||
| 8 | /* Internal svga startup constants */ | 4 | /* Internal svga startup constants */ |
| 9 | #define NORMAL_VGA 0xffff /* 80x25 mode */ | 5 | #define NORMAL_VGA 0xffff /* 80x25 mode */ |
| 10 | #define EXTENDED_VGA 0xfffe /* 80x50 mode */ | 6 | #define EXTENDED_VGA 0xfffe /* 80x50 mode */ |
diff --git a/arch/x86/include/asm/cacheflush.h b/arch/x86/include/asm/cacheflush.h index 5b301b7ff5f4..b3894bf52fcd 100644 --- a/arch/x86/include/asm/cacheflush.h +++ b/arch/x86/include/asm/cacheflush.h | |||
| @@ -90,6 +90,9 @@ int set_memory_4k(unsigned long addr, int numpages); | |||
| 90 | int set_memory_array_uc(unsigned long *addr, int addrinarray); | 90 | int set_memory_array_uc(unsigned long *addr, int addrinarray); |
| 91 | int set_memory_array_wb(unsigned long *addr, int addrinarray); | 91 | int set_memory_array_wb(unsigned long *addr, int addrinarray); |
| 92 | 92 | ||
| 93 | int set_pages_array_uc(struct page **pages, int addrinarray); | ||
| 94 | int set_pages_array_wb(struct page **pages, int addrinarray); | ||
| 95 | |||
| 93 | /* | 96 | /* |
| 94 | * For legacy compatibility with the old APIs, a few functions | 97 | * For legacy compatibility with the old APIs, a few functions |
| 95 | * are provided that work on a "struct page". | 98 | * are provided that work on a "struct page". |
diff --git a/arch/x86/include/asm/cpu_debug.h b/arch/x86/include/asm/cpu_debug.h new file mode 100755 index 000000000000..222802029fa6 --- /dev/null +++ b/arch/x86/include/asm/cpu_debug.h | |||
| @@ -0,0 +1,226 @@ | |||
| 1 | #ifndef _ASM_X86_CPU_DEBUG_H | ||
| 2 | #define _ASM_X86_CPU_DEBUG_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * CPU x86 architecture debug | ||
| 6 | * | ||
| 7 | * Copyright(C) 2009 Jaswinder Singh Rajput | ||
| 8 | */ | ||
| 9 | |||
| 10 | /* Register flags */ | ||
| 11 | enum cpu_debug_bit { | ||
| 12 | /* Model Specific Registers (MSRs) */ | ||
| 13 | CPU_MC_BIT, /* Machine Check */ | ||
| 14 | CPU_MONITOR_BIT, /* Monitor */ | ||
| 15 | CPU_TIME_BIT, /* Time */ | ||
| 16 | CPU_PMC_BIT, /* Performance Monitor */ | ||
| 17 | CPU_PLATFORM_BIT, /* Platform */ | ||
| 18 | CPU_APIC_BIT, /* APIC */ | ||
| 19 | CPU_POWERON_BIT, /* Power-on */ | ||
| 20 | CPU_CONTROL_BIT, /* Control */ | ||
| 21 | CPU_FEATURES_BIT, /* Features control */ | ||
| 22 | CPU_LBRANCH_BIT, /* Last Branch */ | ||
| 23 | CPU_BIOS_BIT, /* BIOS */ | ||
| 24 | CPU_FREQ_BIT, /* Frequency */ | ||
| 25 | CPU_MTTR_BIT, /* MTRR */ | ||
| 26 | CPU_PERF_BIT, /* Performance */ | ||
| 27 | CPU_CACHE_BIT, /* Cache */ | ||
| 28 | CPU_SYSENTER_BIT, /* Sysenter */ | ||
| 29 | CPU_THERM_BIT, /* Thermal */ | ||
| 30 | CPU_MISC_BIT, /* Miscellaneous */ | ||
| 31 | CPU_DEBUG_BIT, /* Debug */ | ||
| 32 | CPU_PAT_BIT, /* PAT */ | ||
| 33 | CPU_VMX_BIT, /* VMX */ | ||
| 34 | CPU_CALL_BIT, /* System Call */ | ||
| 35 | CPU_BASE_BIT, /* BASE Address */ | ||
| 36 | CPU_VER_BIT, /* Version ID */ | ||
| 37 | CPU_CONF_BIT, /* Configuration */ | ||
| 38 | CPU_SMM_BIT, /* System mgmt mode */ | ||
| 39 | CPU_SVM_BIT, /*Secure Virtual Machine*/ | ||
| 40 | CPU_OSVM_BIT, /* OS-Visible Workaround*/ | ||
| 41 | /* Standard Registers */ | ||
| 42 | CPU_TSS_BIT, /* Task Stack Segment */ | ||
| 43 | CPU_CR_BIT, /* Control Registers */ | ||
| 44 | CPU_DT_BIT, /* Descriptor Table */ | ||
| 45 | /* End of Registers flags */ | ||
| 46 | CPU_REG_ALL_BIT, /* Select all Registers */ | ||
| 47 | }; | ||
| 48 | |||
| 49 | #define CPU_REG_ALL (~0) /* Select all Registers */ | ||
| 50 | |||
| 51 | #define CPU_MC (1 << CPU_MC_BIT) | ||
| 52 | #define CPU_MONITOR (1 << CPU_MONITOR_BIT) | ||
| 53 | #define CPU_TIME (1 << CPU_TIME_BIT) | ||
| 54 | #define CPU_PMC (1 << CPU_PMC_BIT) | ||
| 55 | #define CPU_PLATFORM (1 << CPU_PLATFORM_BIT) | ||
| 56 | #define CPU_APIC (1 << CPU_APIC_BIT) | ||
| 57 | #define CPU_POWERON (1 << CPU_POWERON_BIT) | ||
| 58 | #define CPU_CONTROL (1 << CPU_CONTROL_BIT) | ||
| 59 | #define CPU_FEATURES (1 << CPU_FEATURES_BIT) | ||
| 60 | #define CPU_LBRANCH (1 << CPU_LBRANCH_BIT) | ||
| 61 | #define CPU_BIOS (1 << CPU_BIOS_BIT) | ||
| 62 | #define CPU_FREQ (1 << CPU_FREQ_BIT) | ||
| 63 | #define CPU_MTRR (1 << CPU_MTTR_BIT) | ||
| 64 | #define CPU_PERF (1 << CPU_PERF_BIT) | ||
| 65 | #define CPU_CACHE (1 << CPU_CACHE_BIT) | ||
| 66 | #define CPU_SYSENTER (1 << CPU_SYSENTER_BIT) | ||
| 67 | #define CPU_THERM (1 << CPU_THERM_BIT) | ||
| 68 | #define CPU_MISC (1 << CPU_MISC_BIT) | ||
| 69 | #define CPU_DEBUG (1 << CPU_DEBUG_BIT) | ||
| 70 | #define CPU_PAT (1 << CPU_PAT_BIT) | ||
| 71 | #define CPU_VMX (1 << CPU_VMX_BIT) | ||
| 72 | #define CPU_CALL (1 << CPU_CALL_BIT) | ||
| 73 | #define CPU_BASE (1 << CPU_BASE_BIT) | ||
| 74 | #define CPU_VER (1 << CPU_VER_BIT) | ||
| 75 | #define CPU_CONF (1 << CPU_CONF_BIT) | ||
| 76 | #define CPU_SMM (1 << CPU_SMM_BIT) | ||
| 77 | #define CPU_SVM (1 << CPU_SVM_BIT) | ||
| 78 | #define CPU_OSVM (1 << CPU_OSVM_BIT) | ||
| 79 | #define CPU_TSS (1 << CPU_TSS_BIT) | ||
| 80 | #define CPU_CR (1 << CPU_CR_BIT) | ||
| 81 | #define CPU_DT (1 << CPU_DT_BIT) | ||
| 82 | |||
| 83 | /* Register file flags */ | ||
| 84 | enum cpu_file_bit { | ||
| 85 | CPU_INDEX_BIT, /* index */ | ||
| 86 | CPU_VALUE_BIT, /* value */ | ||
| 87 | }; | ||
| 88 | |||
| 89 | #define CPU_FILE_VALUE (1 << CPU_VALUE_BIT) | ||
| 90 | |||
| 91 | /* | ||
| 92 | * DisplayFamily_DisplayModel Processor Families/Processor Number Series | ||
| 93 | * -------------------------- ------------------------------------------ | ||
| 94 | * 05_01, 05_02, 05_04 Pentium, Pentium with MMX | ||
| 95 | * | ||
| 96 | * 06_01 Pentium Pro | ||
| 97 | * 06_03, 06_05 Pentium II Xeon, Pentium II | ||
| 98 | * 06_07, 06_08, 06_0A, 06_0B Pentium III Xeon, Pentum III | ||
| 99 | * | ||
| 100 | * 06_09, 060D Pentium M | ||
| 101 | * | ||
| 102 | * 06_0E Core Duo, Core Solo | ||
| 103 | * | ||
| 104 | * 06_0F Xeon 3000, 3200, 5100, 5300, 7300 series, | ||
| 105 | * Core 2 Quad, Core 2 Extreme, Core 2 Duo, | ||
| 106 | * Pentium dual-core | ||
| 107 | * 06_17 Xeon 5200, 5400 series, Core 2 Quad Q9650 | ||
| 108 | * | ||
| 109 | * 06_1C Atom | ||
| 110 | * | ||
| 111 | * 0F_00, 0F_01, 0F_02 Xeon, Xeon MP, Pentium 4 | ||
| 112 | * 0F_03, 0F_04 Xeon, Xeon MP, Pentium 4, Pentium D | ||
| 113 | * | ||
| 114 | * 0F_06 Xeon 7100, 5000 Series, Xeon MP, | ||
| 115 | * Pentium 4, Pentium D | ||
| 116 | */ | ||
| 117 | |||
| 118 | /* Register processors bits */ | ||
| 119 | enum cpu_processor_bit { | ||
| 120 | CPU_NONE, | ||
| 121 | /* Intel */ | ||
| 122 | CPU_INTEL_PENTIUM_BIT, | ||
| 123 | CPU_INTEL_P6_BIT, | ||
| 124 | CPU_INTEL_PENTIUM_M_BIT, | ||
| 125 | CPU_INTEL_CORE_BIT, | ||
| 126 | CPU_INTEL_CORE2_BIT, | ||
| 127 | CPU_INTEL_ATOM_BIT, | ||
| 128 | CPU_INTEL_XEON_P4_BIT, | ||
| 129 | CPU_INTEL_XEON_MP_BIT, | ||
| 130 | /* AMD */ | ||
| 131 | CPU_AMD_K6_BIT, | ||
| 132 | CPU_AMD_K7_BIT, | ||
| 133 | CPU_AMD_K8_BIT, | ||
| 134 | CPU_AMD_0F_BIT, | ||
| 135 | CPU_AMD_10_BIT, | ||
| 136 | CPU_AMD_11_BIT, | ||
| 137 | }; | ||
| 138 | |||
| 139 | #define CPU_INTEL_PENTIUM (1 << CPU_INTEL_PENTIUM_BIT) | ||
| 140 | #define CPU_INTEL_P6 (1 << CPU_INTEL_P6_BIT) | ||
| 141 | #define CPU_INTEL_PENTIUM_M (1 << CPU_INTEL_PENTIUM_M_BIT) | ||
| 142 | #define CPU_INTEL_CORE (1 << CPU_INTEL_CORE_BIT) | ||
| 143 | #define CPU_INTEL_CORE2 (1 << CPU_INTEL_CORE2_BIT) | ||
| 144 | #define CPU_INTEL_ATOM (1 << CPU_INTEL_ATOM_BIT) | ||
| 145 | #define CPU_INTEL_XEON_P4 (1 << CPU_INTEL_XEON_P4_BIT) | ||
| 146 | #define CPU_INTEL_XEON_MP (1 << CPU_INTEL_XEON_MP_BIT) | ||
| 147 | |||
| 148 | #define CPU_INTEL_PX (CPU_INTEL_P6 | CPU_INTEL_PENTIUM_M) | ||
| 149 | #define CPU_INTEL_COREX (CPU_INTEL_CORE | CPU_INTEL_CORE2) | ||
| 150 | #define CPU_INTEL_XEON (CPU_INTEL_XEON_P4 | CPU_INTEL_XEON_MP) | ||
| 151 | #define CPU_CO_AT (CPU_INTEL_CORE | CPU_INTEL_ATOM) | ||
| 152 | #define CPU_C2_AT (CPU_INTEL_CORE2 | CPU_INTEL_ATOM) | ||
| 153 | #define CPU_CX_AT (CPU_INTEL_COREX | CPU_INTEL_ATOM) | ||
| 154 | #define CPU_CX_XE (CPU_INTEL_COREX | CPU_INTEL_XEON) | ||
| 155 | #define CPU_P6_XE (CPU_INTEL_P6 | CPU_INTEL_XEON) | ||
| 156 | #define CPU_PM_CO_AT (CPU_INTEL_PENTIUM_M | CPU_CO_AT) | ||
| 157 | #define CPU_C2_AT_XE (CPU_C2_AT | CPU_INTEL_XEON) | ||
| 158 | #define CPU_CX_AT_XE (CPU_CX_AT | CPU_INTEL_XEON) | ||
| 159 | #define CPU_P6_CX_AT (CPU_INTEL_P6 | CPU_CX_AT) | ||
| 160 | #define CPU_P6_CX_XE (CPU_P6_XE | CPU_INTEL_COREX) | ||
| 161 | #define CPU_P6_CX_AT_XE (CPU_INTEL_P6 | CPU_CX_AT_XE) | ||
| 162 | #define CPU_PM_CX_AT_XE (CPU_INTEL_PENTIUM_M | CPU_CX_AT_XE) | ||
| 163 | #define CPU_PM_CX_AT (CPU_INTEL_PENTIUM_M | CPU_CX_AT) | ||
| 164 | #define CPU_PM_CX_XE (CPU_INTEL_PENTIUM_M | CPU_CX_XE) | ||
| 165 | #define CPU_PX_CX_AT (CPU_INTEL_PX | CPU_CX_AT) | ||
| 166 | #define CPU_PX_CX_AT_XE (CPU_INTEL_PX | CPU_CX_AT_XE) | ||
| 167 | |||
| 168 | /* Select all supported Intel CPUs */ | ||
| 169 | #define CPU_INTEL_ALL (CPU_INTEL_PENTIUM | CPU_PX_CX_AT_XE) | ||
| 170 | |||
| 171 | #define CPU_AMD_K6 (1 << CPU_AMD_K6_BIT) | ||
| 172 | #define CPU_AMD_K7 (1 << CPU_AMD_K7_BIT) | ||
| 173 | #define CPU_AMD_K8 (1 << CPU_AMD_K8_BIT) | ||
| 174 | #define CPU_AMD_0F (1 << CPU_AMD_0F_BIT) | ||
| 175 | #define CPU_AMD_10 (1 << CPU_AMD_10_BIT) | ||
| 176 | #define CPU_AMD_11 (1 << CPU_AMD_11_BIT) | ||
| 177 | |||
| 178 | #define CPU_K10_PLUS (CPU_AMD_10 | CPU_AMD_11) | ||
| 179 | #define CPU_K0F_PLUS (CPU_AMD_0F | CPU_K10_PLUS) | ||
| 180 | #define CPU_K8_PLUS (CPU_AMD_K8 | CPU_K0F_PLUS) | ||
| 181 | #define CPU_K7_PLUS (CPU_AMD_K7 | CPU_K8_PLUS) | ||
| 182 | |||
| 183 | /* Select all supported AMD CPUs */ | ||
| 184 | #define CPU_AMD_ALL (CPU_AMD_K6 | CPU_K7_PLUS) | ||
| 185 | |||
| 186 | /* Select all supported CPUs */ | ||
| 187 | #define CPU_ALL (CPU_INTEL_ALL | CPU_AMD_ALL) | ||
| 188 | |||
| 189 | #define MAX_CPU_FILES 512 | ||
| 190 | |||
| 191 | struct cpu_private { | ||
| 192 | unsigned cpu; | ||
| 193 | unsigned type; | ||
| 194 | unsigned reg; | ||
| 195 | unsigned file; | ||
| 196 | }; | ||
| 197 | |||
| 198 | struct cpu_debug_base { | ||
| 199 | char *name; /* Register name */ | ||
| 200 | unsigned flag; /* Register flag */ | ||
| 201 | unsigned write; /* Register write flag */ | ||
| 202 | }; | ||
| 203 | |||
| 204 | /* | ||
| 205 | * Currently it looks similar to cpu_debug_base but once we add more files | ||
| 206 | * cpu_file_base will go in different direction | ||
| 207 | */ | ||
| 208 | struct cpu_file_base { | ||
| 209 | char *name; /* Register file name */ | ||
| 210 | unsigned flag; /* Register file flag */ | ||
| 211 | unsigned write; /* Register write flag */ | ||
| 212 | }; | ||
| 213 | |||
| 214 | struct cpu_cpuX_base { | ||
| 215 | struct dentry *dentry; /* Register dentry */ | ||
| 216 | int init; /* Register index file */ | ||
| 217 | }; | ||
| 218 | |||
| 219 | struct cpu_debug_range { | ||
| 220 | unsigned min; /* Register range min */ | ||
| 221 | unsigned max; /* Register range max */ | ||
| 222 | unsigned flag; /* Supported flags */ | ||
| 223 | unsigned model; /* Supported models */ | ||
| 224 | }; | ||
| 225 | |||
| 226 | #endif /* _ASM_X86_CPU_DEBUG_H */ | ||
diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h index dc27705f5443..5623c50d67b2 100644 --- a/arch/x86/include/asm/desc.h +++ b/arch/x86/include/asm/desc.h | |||
| @@ -91,7 +91,6 @@ static inline int desc_empty(const void *ptr) | |||
| 91 | #define store_gdt(dtr) native_store_gdt(dtr) | 91 | #define store_gdt(dtr) native_store_gdt(dtr) |
| 92 | #define store_idt(dtr) native_store_idt(dtr) | 92 | #define store_idt(dtr) native_store_idt(dtr) |
| 93 | #define store_tr(tr) (tr = native_store_tr()) | 93 | #define store_tr(tr) (tr = native_store_tr()) |
| 94 | #define store_ldt(ldt) asm("sldt %0":"=m" (ldt)) | ||
| 95 | 94 | ||
| 96 | #define load_TLS(t, cpu) native_load_tls(t, cpu) | 95 | #define load_TLS(t, cpu) native_load_tls(t, cpu) |
| 97 | #define set_ldt native_set_ldt | 96 | #define set_ldt native_set_ldt |
| @@ -112,6 +111,8 @@ static inline void paravirt_free_ldt(struct desc_struct *ldt, unsigned entries) | |||
| 112 | } | 111 | } |
| 113 | #endif /* CONFIG_PARAVIRT */ | 112 | #endif /* CONFIG_PARAVIRT */ |
| 114 | 113 | ||
| 114 | #define store_ldt(ldt) asm("sldt %0" : "=m"(ldt)) | ||
| 115 | |||
| 115 | static inline void native_write_idt_entry(gate_desc *idt, int entry, | 116 | static inline void native_write_idt_entry(gate_desc *idt, int entry, |
| 116 | const gate_desc *gate) | 117 | const gate_desc *gate) |
| 117 | { | 118 | { |
diff --git a/arch/x86/include/asm/dmi.h b/arch/x86/include/asm/dmi.h index bc68212c6bc0..fd8f9e2ca35f 100644 --- a/arch/x86/include/asm/dmi.h +++ b/arch/x86/include/asm/dmi.h | |||
| @@ -1,22 +1,15 @@ | |||
| 1 | #ifndef _ASM_X86_DMI_H | 1 | #ifndef _ASM_X86_DMI_H |
| 2 | #define _ASM_X86_DMI_H | 2 | #define _ASM_X86_DMI_H |
| 3 | 3 | ||
| 4 | #include <asm/io.h> | 4 | #include <linux/compiler.h> |
| 5 | 5 | #include <linux/init.h> | |
| 6 | #define DMI_MAX_DATA 2048 | ||
| 7 | 6 | ||
| 8 | extern int dmi_alloc_index; | 7 | #include <asm/io.h> |
| 9 | extern char dmi_alloc_data[DMI_MAX_DATA]; | 8 | #include <asm/setup.h> |
| 10 | 9 | ||
| 11 | /* This is so early that there is no good way to allocate dynamic memory. | 10 | static __always_inline __init void *dmi_alloc(unsigned len) |
| 12 | Allocate data in an BSS array. */ | ||
| 13 | static inline void *dmi_alloc(unsigned len) | ||
| 14 | { | 11 | { |
| 15 | int idx = dmi_alloc_index; | 12 | return extend_brk(len, sizeof(int)); |
| 16 | if ((dmi_alloc_index + len) > DMI_MAX_DATA) | ||
| 17 | return NULL; | ||
| 18 | dmi_alloc_index += len; | ||
| 19 | return dmi_alloc_data + idx; | ||
| 20 | } | 13 | } |
| 21 | 14 | ||
| 22 | /* Use early IO mappings for DMI because it's initialized early */ | 15 | /* Use early IO mappings for DMI because it's initialized early */ |
diff --git a/arch/x86/include/asm/e820.h b/arch/x86/include/asm/e820.h index 00d41ce4c844..7ecba4d85089 100644 --- a/arch/x86/include/asm/e820.h +++ b/arch/x86/include/asm/e820.h | |||
| @@ -72,7 +72,7 @@ extern int e820_all_mapped(u64 start, u64 end, unsigned type); | |||
| 72 | extern void e820_add_region(u64 start, u64 size, int type); | 72 | extern void e820_add_region(u64 start, u64 size, int type); |
| 73 | extern void e820_print_map(char *who); | 73 | extern void e820_print_map(char *who); |
| 74 | extern int | 74 | extern int |
| 75 | sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, int *pnr_map); | 75 | sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, u32 *pnr_map); |
| 76 | extern u64 e820_update_range(u64 start, u64 size, unsigned old_type, | 76 | extern u64 e820_update_range(u64 start, u64 size, unsigned old_type, |
| 77 | unsigned new_type); | 77 | unsigned new_type); |
| 78 | extern u64 e820_remove_range(u64 start, u64 size, unsigned old_type, | 78 | extern u64 e820_remove_range(u64 start, u64 size, unsigned old_type, |
diff --git a/arch/x86/include/asm/entry_arch.h b/arch/x86/include/asm/entry_arch.h index 854d538ae857..c2e6bedaf258 100644 --- a/arch/x86/include/asm/entry_arch.h +++ b/arch/x86/include/asm/entry_arch.h | |||
| @@ -33,6 +33,8 @@ BUILD_INTERRUPT3(invalidate_interrupt7,INVALIDATE_TLB_VECTOR_START+7, | |||
| 33 | smp_invalidate_interrupt) | 33 | smp_invalidate_interrupt) |
| 34 | #endif | 34 | #endif |
| 35 | 35 | ||
| 36 | BUILD_INTERRUPT(generic_interrupt, GENERIC_INTERRUPT_VECTOR) | ||
| 37 | |||
| 36 | /* | 38 | /* |
| 37 | * every pentium local APIC has two 'local interrupts', with a | 39 | * every pentium local APIC has two 'local interrupts', with a |
| 38 | * soft-definable vector attached to both interrupts, one of | 40 | * soft-definable vector attached to both interrupts, one of |
diff --git a/arch/x86/include/asm/hardirq.h b/arch/x86/include/asm/hardirq.h index 176f058e7159..039db6aa8e02 100644 --- a/arch/x86/include/asm/hardirq.h +++ b/arch/x86/include/asm/hardirq.h | |||
| @@ -12,6 +12,7 @@ typedef struct { | |||
| 12 | unsigned int apic_timer_irqs; /* arch dependent */ | 12 | unsigned int apic_timer_irqs; /* arch dependent */ |
| 13 | unsigned int irq_spurious_count; | 13 | unsigned int irq_spurious_count; |
| 14 | #endif | 14 | #endif |
| 15 | unsigned int generic_irqs; /* arch dependent */ | ||
| 15 | #ifdef CONFIG_SMP | 16 | #ifdef CONFIG_SMP |
| 16 | unsigned int irq_resched_count; | 17 | unsigned int irq_resched_count; |
| 17 | unsigned int irq_call_count; | 18 | unsigned int irq_call_count; |
diff --git a/arch/x86/include/asm/highmem.h b/arch/x86/include/asm/highmem.h index bf9276bea660..014c2b85ae45 100644 --- a/arch/x86/include/asm/highmem.h +++ b/arch/x86/include/asm/highmem.h | |||
| @@ -63,6 +63,7 @@ void *kmap_atomic_prot(struct page *page, enum km_type type, pgprot_t prot); | |||
| 63 | void *kmap_atomic(struct page *page, enum km_type type); | 63 | void *kmap_atomic(struct page *page, enum km_type type); |
| 64 | void kunmap_atomic(void *kvaddr, enum km_type type); | 64 | void kunmap_atomic(void *kvaddr, enum km_type type); |
| 65 | void *kmap_atomic_pfn(unsigned long pfn, enum km_type type); | 65 | void *kmap_atomic_pfn(unsigned long pfn, enum km_type type); |
| 66 | void *kmap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot); | ||
| 66 | struct page *kmap_atomic_to_page(void *ptr); | 67 | struct page *kmap_atomic_to_page(void *ptr); |
| 67 | 68 | ||
| 68 | #ifndef CONFIG_PARAVIRT | 69 | #ifndef CONFIG_PARAVIRT |
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h index 370e1c83bb49..b762ea49bd70 100644 --- a/arch/x86/include/asm/hw_irq.h +++ b/arch/x86/include/asm/hw_irq.h | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | 27 | ||
| 28 | /* Interrupt handlers registered during init_IRQ */ | 28 | /* Interrupt handlers registered during init_IRQ */ |
| 29 | extern void apic_timer_interrupt(void); | 29 | extern void apic_timer_interrupt(void); |
| 30 | extern void generic_interrupt(void); | ||
| 30 | extern void error_interrupt(void); | 31 | extern void error_interrupt(void); |
| 31 | extern void spurious_interrupt(void); | 32 | extern void spurious_interrupt(void); |
| 32 | extern void thermal_interrupt(void); | 33 | extern void thermal_interrupt(void); |
diff --git a/arch/x86/include/asm/init.h b/arch/x86/include/asm/init.h new file mode 100644 index 000000000000..36fb1a6a5109 --- /dev/null +++ b/arch/x86/include/asm/init.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | #ifndef _ASM_X86_INIT_32_H | ||
| 2 | #define _ASM_X86_INIT_32_H | ||
| 3 | |||
| 4 | #ifdef CONFIG_X86_32 | ||
| 5 | extern void __init early_ioremap_page_table_range_init(void); | ||
| 6 | #endif | ||
| 7 | |||
| 8 | extern unsigned long __init | ||
| 9 | kernel_physical_mapping_init(unsigned long start, | ||
| 10 | unsigned long end, | ||
| 11 | unsigned long page_size_mask); | ||
| 12 | |||
| 13 | |||
| 14 | extern unsigned long __initdata e820_table_start; | ||
| 15 | extern unsigned long __meminitdata e820_table_end; | ||
| 16 | extern unsigned long __meminitdata e820_table_top; | ||
| 17 | |||
| 18 | #endif /* _ASM_X86_INIT_32_H */ | ||
diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h index 59cb4a1317b7..373cc2bbcad2 100644 --- a/arch/x86/include/asm/io_apic.h +++ b/arch/x86/include/asm/io_apic.h | |||
| @@ -162,7 +162,8 @@ extern int (*ioapic_renumber_irq)(int ioapic, int irq); | |||
| 162 | extern void ioapic_init_mappings(void); | 162 | extern void ioapic_init_mappings(void); |
| 163 | 163 | ||
| 164 | #ifdef CONFIG_X86_64 | 164 | #ifdef CONFIG_X86_64 |
| 165 | extern int save_mask_IO_APIC_setup(void); | 165 | extern int save_IO_APIC_setup(void); |
| 166 | extern void mask_IO_APIC_setup(void); | ||
| 166 | extern void restore_IO_APIC_setup(void); | 167 | extern void restore_IO_APIC_setup(void); |
| 167 | extern void reinit_intr_remapped_IO_APIC(int); | 168 | extern void reinit_intr_remapped_IO_APIC(int); |
| 168 | #endif | 169 | #endif |
| @@ -172,7 +173,7 @@ extern void probe_nr_irqs_gsi(void); | |||
| 172 | extern int setup_ioapic_entry(int apic, int irq, | 173 | extern int setup_ioapic_entry(int apic, int irq, |
| 173 | struct IO_APIC_route_entry *entry, | 174 | struct IO_APIC_route_entry *entry, |
| 174 | unsigned int destination, int trigger, | 175 | unsigned int destination, int trigger, |
| 175 | int polarity, int vector); | 176 | int polarity, int vector, int pin); |
| 176 | extern void ioapic_write_entry(int apic, int pin, | 177 | extern void ioapic_write_entry(int apic, int pin, |
| 177 | struct IO_APIC_route_entry e); | 178 | struct IO_APIC_route_entry e); |
| 178 | #else /* !CONFIG_X86_IO_APIC */ | 179 | #else /* !CONFIG_X86_IO_APIC */ |
diff --git a/arch/x86/include/asm/irq.h b/arch/x86/include/asm/irq.h index 107eb2196691..f38481bcd455 100644 --- a/arch/x86/include/asm/irq.h +++ b/arch/x86/include/asm/irq.h | |||
| @@ -36,6 +36,7 @@ static inline int irq_canonicalize(int irq) | |||
| 36 | extern void fixup_irqs(void); | 36 | extern void fixup_irqs(void); |
| 37 | #endif | 37 | #endif |
| 38 | 38 | ||
| 39 | extern void (*generic_interrupt_extension)(void); | ||
| 39 | extern void init_IRQ(void); | 40 | extern void init_IRQ(void); |
| 40 | extern void native_init_IRQ(void); | 41 | extern void native_init_IRQ(void); |
| 41 | extern bool handle_irq(unsigned irq, struct pt_regs *regs); | 42 | extern bool handle_irq(unsigned irq, struct pt_regs *regs); |
diff --git a/arch/x86/include/asm/irq_remapping.h b/arch/x86/include/asm/irq_remapping.h index 20e1fd588dbf..0396760fccb8 100644 --- a/arch/x86/include/asm/irq_remapping.h +++ b/arch/x86/include/asm/irq_remapping.h | |||
| @@ -1,8 +1,6 @@ | |||
| 1 | #ifndef _ASM_X86_IRQ_REMAPPING_H | 1 | #ifndef _ASM_X86_IRQ_REMAPPING_H |
| 2 | #define _ASM_X86_IRQ_REMAPPING_H | 2 | #define _ASM_X86_IRQ_REMAPPING_H |
| 3 | 3 | ||
| 4 | extern int x2apic; | ||
| 5 | |||
| 6 | #define IRTE_DEST(dest) ((x2apic) ? dest : dest << 8) | 4 | #define IRTE_DEST(dest) ((x2apic) ? dest : dest << 8) |
| 7 | 5 | ||
| 8 | #endif /* _ASM_X86_IRQ_REMAPPING_H */ | 6 | #endif /* _ASM_X86_IRQ_REMAPPING_H */ |
diff --git a/arch/x86/include/asm/irq_vectors.h b/arch/x86/include/asm/irq_vectors.h index 8a285f356f8a..3cbd79bbb47c 100644 --- a/arch/x86/include/asm/irq_vectors.h +++ b/arch/x86/include/asm/irq_vectors.h | |||
| @@ -112,6 +112,11 @@ | |||
| 112 | #define LOCAL_PERF_VECTOR 0xee | 112 | #define LOCAL_PERF_VECTOR 0xee |
| 113 | 113 | ||
| 114 | /* | 114 | /* |
| 115 | * Generic system vector for platform specific use | ||
| 116 | */ | ||
| 117 | #define GENERIC_INTERRUPT_VECTOR 0xed | ||
| 118 | |||
| 119 | /* | ||
| 115 | * First APIC vector available to drivers: (vectors 0x30-0xee) we | 120 | * First APIC vector available to drivers: (vectors 0x30-0xee) we |
| 116 | * start at 0x31(0x41) to spread out vectors evenly between priority | 121 | * start at 0x31(0x41) to spread out vectors evenly between priority |
| 117 | * levels. (0x80 is the syscall vector) | 122 | * levels. (0x80 is the syscall vector) |
diff --git a/arch/x86/include/asm/kexec.h b/arch/x86/include/asm/kexec.h index 0ceb6d19ed30..317ff1703d0b 100644 --- a/arch/x86/include/asm/kexec.h +++ b/arch/x86/include/asm/kexec.h | |||
| @@ -9,13 +9,13 @@ | |||
| 9 | # define PAGES_NR 4 | 9 | # define PAGES_NR 4 |
| 10 | #else | 10 | #else |
| 11 | # define PA_CONTROL_PAGE 0 | 11 | # define PA_CONTROL_PAGE 0 |
| 12 | # define PA_TABLE_PAGE 1 | 12 | # define VA_CONTROL_PAGE 1 |
| 13 | # define PAGES_NR 2 | 13 | # define PA_TABLE_PAGE 2 |
| 14 | # define PA_SWAP_PAGE 3 | ||
| 15 | # define PAGES_NR 4 | ||
| 14 | #endif | 16 | #endif |
| 15 | 17 | ||
| 16 | #ifdef CONFIG_X86_32 | ||
| 17 | # define KEXEC_CONTROL_CODE_MAX_SIZE 2048 | 18 | # define KEXEC_CONTROL_CODE_MAX_SIZE 2048 |
| 18 | #endif | ||
| 19 | 19 | ||
| 20 | #ifndef __ASSEMBLY__ | 20 | #ifndef __ASSEMBLY__ |
| 21 | 21 | ||
| @@ -136,10 +136,11 @@ relocate_kernel(unsigned long indirection_page, | |||
| 136 | unsigned int has_pae, | 136 | unsigned int has_pae, |
| 137 | unsigned int preserve_context); | 137 | unsigned int preserve_context); |
| 138 | #else | 138 | #else |
| 139 | NORET_TYPE void | 139 | unsigned long |
| 140 | relocate_kernel(unsigned long indirection_page, | 140 | relocate_kernel(unsigned long indirection_page, |
| 141 | unsigned long page_list, | 141 | unsigned long page_list, |
| 142 | unsigned long start_address) ATTRIB_NORET; | 142 | unsigned long start_address, |
| 143 | unsigned int preserve_context); | ||
| 143 | #endif | 144 | #endif |
| 144 | 145 | ||
| 145 | #define ARCH_HAS_KIMAGE_ARCH | 146 | #define ARCH_HAS_KIMAGE_ARCH |
diff --git a/arch/x86/include/asm/linkage.h b/arch/x86/include/asm/linkage.h index 9320e2a8a26a..12d55e773eb6 100644 --- a/arch/x86/include/asm/linkage.h +++ b/arch/x86/include/asm/linkage.h | |||
| @@ -1,14 +1,11 @@ | |||
| 1 | #ifndef _ASM_X86_LINKAGE_H | 1 | #ifndef _ASM_X86_LINKAGE_H |
| 2 | #define _ASM_X86_LINKAGE_H | 2 | #define _ASM_X86_LINKAGE_H |
| 3 | 3 | ||
| 4 | #include <linux/stringify.h> | ||
| 5 | |||
| 4 | #undef notrace | 6 | #undef notrace |
| 5 | #define notrace __attribute__((no_instrument_function)) | 7 | #define notrace __attribute__((no_instrument_function)) |
| 6 | 8 | ||
| 7 | #ifdef CONFIG_X86_64 | ||
| 8 | #define __ALIGN .p2align 4,,15 | ||
| 9 | #define __ALIGN_STR ".p2align 4,,15" | ||
| 10 | #endif | ||
| 11 | |||
| 12 | #ifdef CONFIG_X86_32 | 9 | #ifdef CONFIG_X86_32 |
| 13 | #define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0))) | 10 | #define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0))) |
| 14 | /* | 11 | /* |
| @@ -50,16 +47,20 @@ | |||
| 50 | __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \ | 47 | __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \ |
| 51 | "g" (arg4), "g" (arg5), "g" (arg6)) | 48 | "g" (arg4), "g" (arg5), "g" (arg6)) |
| 52 | 49 | ||
| 53 | #endif | 50 | #endif /* CONFIG_X86_32 */ |
| 51 | |||
| 52 | #ifdef __ASSEMBLY__ | ||
| 54 | 53 | ||
| 55 | #define GLOBAL(name) \ | 54 | #define GLOBAL(name) \ |
| 56 | .globl name; \ | 55 | .globl name; \ |
| 57 | name: | 56 | name: |
| 58 | 57 | ||
| 59 | #ifdef CONFIG_X86_ALIGNMENT_16 | 58 | #if defined(CONFIG_X86_64) || defined(CONFIG_X86_ALIGNMENT_16) |
| 60 | #define __ALIGN .align 16,0x90 | 59 | #define __ALIGN .p2align 4, 0x90 |
| 61 | #define __ALIGN_STR ".align 16,0x90" | 60 | #define __ALIGN_STR __stringify(__ALIGN) |
| 62 | #endif | 61 | #endif |
| 63 | 62 | ||
| 63 | #endif /* __ASSEMBLY__ */ | ||
| 64 | |||
| 64 | #endif /* _ASM_X86_LINKAGE_H */ | 65 | #endif /* _ASM_X86_LINKAGE_H */ |
| 65 | 66 | ||
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h index 32c6e17b960b..563933e06a35 100644 --- a/arch/x86/include/asm/mce.h +++ b/arch/x86/include/asm/mce.h | |||
| @@ -11,6 +11,8 @@ | |||
| 11 | */ | 11 | */ |
| 12 | 12 | ||
| 13 | #define MCG_CTL_P (1UL<<8) /* MCG_CAP register available */ | 13 | #define MCG_CTL_P (1UL<<8) /* MCG_CAP register available */ |
| 14 | #define MCG_EXT_P (1ULL<<9) /* Extended registers available */ | ||
| 15 | #define MCG_CMCI_P (1ULL<<10) /* CMCI supported */ | ||
| 14 | 16 | ||
| 15 | #define MCG_STATUS_RIPV (1UL<<0) /* restart ip valid */ | 17 | #define MCG_STATUS_RIPV (1UL<<0) /* restart ip valid */ |
| 16 | #define MCG_STATUS_EIPV (1UL<<1) /* ip points to correct instruction */ | 18 | #define MCG_STATUS_EIPV (1UL<<1) /* ip points to correct instruction */ |
| @@ -90,14 +92,29 @@ extern int mce_disabled; | |||
| 90 | 92 | ||
| 91 | #include <asm/atomic.h> | 93 | #include <asm/atomic.h> |
| 92 | 94 | ||
| 95 | void mce_setup(struct mce *m); | ||
| 93 | void mce_log(struct mce *m); | 96 | void mce_log(struct mce *m); |
| 94 | DECLARE_PER_CPU(struct sys_device, device_mce); | 97 | DECLARE_PER_CPU(struct sys_device, device_mce); |
| 95 | extern void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu); | 98 | extern void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu); |
| 96 | 99 | ||
| 100 | /* | ||
| 101 | * To support more than 128 would need to escape the predefined | ||
| 102 | * Linux defined extended banks first. | ||
| 103 | */ | ||
| 104 | #define MAX_NR_BANKS (MCE_EXTENDED_BANK - 1) | ||
| 105 | |||
| 97 | #ifdef CONFIG_X86_MCE_INTEL | 106 | #ifdef CONFIG_X86_MCE_INTEL |
| 98 | void mce_intel_feature_init(struct cpuinfo_x86 *c); | 107 | void mce_intel_feature_init(struct cpuinfo_x86 *c); |
| 108 | void cmci_clear(void); | ||
| 109 | void cmci_reenable(void); | ||
| 110 | void cmci_rediscover(int dying); | ||
| 111 | void cmci_recheck(void); | ||
| 99 | #else | 112 | #else |
| 100 | static inline void mce_intel_feature_init(struct cpuinfo_x86 *c) { } | 113 | static inline void mce_intel_feature_init(struct cpuinfo_x86 *c) { } |
| 114 | static inline void cmci_clear(void) {} | ||
| 115 | static inline void cmci_reenable(void) {} | ||
| 116 | static inline void cmci_rediscover(int dying) {} | ||
| 117 | static inline void cmci_recheck(void) {} | ||
| 101 | #endif | 118 | #endif |
| 102 | 119 | ||
| 103 | #ifdef CONFIG_X86_MCE_AMD | 120 | #ifdef CONFIG_X86_MCE_AMD |
| @@ -106,11 +123,23 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c); | |||
| 106 | static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) { } | 123 | static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) { } |
| 107 | #endif | 124 | #endif |
| 108 | 125 | ||
| 109 | void mce_log_therm_throt_event(unsigned int cpu, __u64 status); | 126 | extern int mce_available(struct cpuinfo_x86 *c); |
| 127 | |||
| 128 | void mce_log_therm_throt_event(__u64 status); | ||
| 110 | 129 | ||
| 111 | extern atomic_t mce_entry; | 130 | extern atomic_t mce_entry; |
| 112 | 131 | ||
| 113 | extern void do_machine_check(struct pt_regs *, long); | 132 | extern void do_machine_check(struct pt_regs *, long); |
| 133 | |||
| 134 | typedef DECLARE_BITMAP(mce_banks_t, MAX_NR_BANKS); | ||
| 135 | DECLARE_PER_CPU(mce_banks_t, mce_poll_banks); | ||
| 136 | |||
| 137 | enum mcp_flags { | ||
| 138 | MCP_TIMESTAMP = (1 << 0), /* log time stamp */ | ||
| 139 | MCP_UC = (1 << 1), /* log uncorrected errors */ | ||
| 140 | }; | ||
| 141 | extern void machine_check_poll(enum mcp_flags flags, mce_banks_t *b); | ||
| 142 | |||
| 114 | extern int mce_notify_user(void); | 143 | extern int mce_notify_user(void); |
| 115 | 144 | ||
| 116 | #endif /* !CONFIG_X86_32 */ | 145 | #endif /* !CONFIG_X86_32 */ |
| @@ -120,8 +149,8 @@ extern void mcheck_init(struct cpuinfo_x86 *c); | |||
| 120 | #else | 149 | #else |
| 121 | #define mcheck_init(c) do { } while (0) | 150 | #define mcheck_init(c) do { } while (0) |
| 122 | #endif | 151 | #endif |
| 123 | extern void stop_mce(void); | 152 | |
| 124 | extern void restart_mce(void); | 153 | extern void (*mce_threshold_vector)(void); |
| 125 | 154 | ||
| 126 | #endif /* __KERNEL__ */ | 155 | #endif /* __KERNEL__ */ |
| 127 | #endif /* _ASM_X86_MCE_H */ | 156 | #endif /* _ASM_X86_MCE_H */ |
diff --git a/arch/x86/include/asm/msidef.h b/arch/x86/include/asm/msidef.h index 6706b3006f13..4cc48af23fef 100644 --- a/arch/x86/include/asm/msidef.h +++ b/arch/x86/include/asm/msidef.h | |||
| @@ -47,6 +47,7 @@ | |||
| 47 | #define MSI_ADDR_DEST_ID_MASK 0x00ffff0 | 47 | #define MSI_ADDR_DEST_ID_MASK 0x00ffff0 |
| 48 | #define MSI_ADDR_DEST_ID(dest) (((dest) << MSI_ADDR_DEST_ID_SHIFT) & \ | 48 | #define MSI_ADDR_DEST_ID(dest) (((dest) << MSI_ADDR_DEST_ID_SHIFT) & \ |
| 49 | MSI_ADDR_DEST_ID_MASK) | 49 | MSI_ADDR_DEST_ID_MASK) |
| 50 | #define MSI_ADDR_EXT_DEST_ID(dest) ((dest) & 0xffffff00) | ||
| 50 | 51 | ||
| 51 | #define MSI_ADDR_IR_EXT_INT (1 << 4) | 52 | #define MSI_ADDR_IR_EXT_INT (1 << 4) |
| 52 | #define MSI_ADDR_IR_SHV (1 << 3) | 53 | #define MSI_ADDR_IR_SHV (1 << 3) |
diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h index f4e505f286bc..ec41fc16c167 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h | |||
| @@ -81,6 +81,11 @@ | |||
| 81 | #define MSR_IA32_MC0_ADDR 0x00000402 | 81 | #define MSR_IA32_MC0_ADDR 0x00000402 |
| 82 | #define MSR_IA32_MC0_MISC 0x00000403 | 82 | #define MSR_IA32_MC0_MISC 0x00000403 |
| 83 | 83 | ||
| 84 | /* These are consecutive and not in the normal 4er MCE bank block */ | ||
| 85 | #define MSR_IA32_MC0_CTL2 0x00000280 | ||
| 86 | #define CMCI_EN (1ULL << 30) | ||
| 87 | #define CMCI_THRESHOLD_MASK 0xffffULL | ||
| 88 | |||
| 84 | #define MSR_P6_PERFCTR0 0x000000c1 | 89 | #define MSR_P6_PERFCTR0 0x000000c1 |
| 85 | #define MSR_P6_PERFCTR1 0x000000c2 | 90 | #define MSR_P6_PERFCTR1 0x000000c2 |
| 86 | #define MSR_P6_EVNTSEL0 0x00000186 | 91 | #define MSR_P6_EVNTSEL0 0x00000186 |
diff --git a/arch/x86/include/asm/page_32_types.h b/arch/x86/include/asm/page_32_types.h index f1e4a79a6e41..0f915ae649a7 100644 --- a/arch/x86/include/asm/page_32_types.h +++ b/arch/x86/include/asm/page_32_types.h | |||
| @@ -39,6 +39,11 @@ | |||
| 39 | #define __VIRTUAL_MASK_SHIFT 32 | 39 | #define __VIRTUAL_MASK_SHIFT 32 |
| 40 | #endif /* CONFIG_X86_PAE */ | 40 | #endif /* CONFIG_X86_PAE */ |
| 41 | 41 | ||
| 42 | /* | ||
| 43 | * Kernel image size is limited to 512 MB (see in arch/x86/kernel/head_32.S) | ||
| 44 | */ | ||
| 45 | #define KERNEL_IMAGE_SIZE (512 * 1024 * 1024) | ||
| 46 | |||
| 42 | #ifndef __ASSEMBLY__ | 47 | #ifndef __ASSEMBLY__ |
| 43 | 48 | ||
| 44 | /* | 49 | /* |
diff --git a/arch/x86/include/asm/page_types.h b/arch/x86/include/asm/page_types.h index 2d625da6603c..826ad37006ab 100644 --- a/arch/x86/include/asm/page_types.h +++ b/arch/x86/include/asm/page_types.h | |||
| @@ -40,14 +40,8 @@ | |||
| 40 | 40 | ||
| 41 | #ifndef __ASSEMBLY__ | 41 | #ifndef __ASSEMBLY__ |
| 42 | 42 | ||
| 43 | struct pgprot; | ||
| 44 | |||
| 45 | extern int page_is_ram(unsigned long pagenr); | 43 | extern int page_is_ram(unsigned long pagenr); |
| 46 | extern int devmem_is_allowed(unsigned long pagenr); | 44 | extern int devmem_is_allowed(unsigned long pagenr); |
| 47 | extern void map_devmem(unsigned long pfn, unsigned long size, | ||
| 48 | struct pgprot vma_prot); | ||
| 49 | extern void unmap_devmem(unsigned long pfn, unsigned long size, | ||
| 50 | struct pgprot vma_prot); | ||
| 51 | 45 | ||
| 52 | extern unsigned long max_low_pfn_mapped; | 46 | extern unsigned long max_low_pfn_mapped; |
| 53 | extern unsigned long max_pfn_mapped; | 47 | extern unsigned long max_pfn_mapped; |
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h index 0617d5cc9712..7727aa8b7dda 100644 --- a/arch/x86/include/asm/paravirt.h +++ b/arch/x86/include/asm/paravirt.h | |||
| @@ -317,8 +317,6 @@ struct pv_mmu_ops { | |||
| 317 | #if PAGETABLE_LEVELS >= 3 | 317 | #if PAGETABLE_LEVELS >= 3 |
| 318 | #ifdef CONFIG_X86_PAE | 318 | #ifdef CONFIG_X86_PAE |
| 319 | void (*set_pte_atomic)(pte_t *ptep, pte_t pteval); | 319 | void (*set_pte_atomic)(pte_t *ptep, pte_t pteval); |
| 320 | void (*set_pte_present)(struct mm_struct *mm, unsigned long addr, | ||
| 321 | pte_t *ptep, pte_t pte); | ||
| 322 | void (*pte_clear)(struct mm_struct *mm, unsigned long addr, | 320 | void (*pte_clear)(struct mm_struct *mm, unsigned long addr, |
| 323 | pte_t *ptep); | 321 | pte_t *ptep); |
| 324 | void (*pmd_clear)(pmd_t *pmdp); | 322 | void (*pmd_clear)(pmd_t *pmdp); |
| @@ -389,7 +387,7 @@ extern struct pv_lock_ops pv_lock_ops; | |||
| 389 | 387 | ||
| 390 | #define paravirt_type(op) \ | 388 | #define paravirt_type(op) \ |
| 391 | [paravirt_typenum] "i" (PARAVIRT_PATCH(op)), \ | 389 | [paravirt_typenum] "i" (PARAVIRT_PATCH(op)), \ |
| 392 | [paravirt_opptr] "m" (op) | 390 | [paravirt_opptr] "i" (&(op)) |
| 393 | #define paravirt_clobber(clobber) \ | 391 | #define paravirt_clobber(clobber) \ |
| 394 | [paravirt_clobber] "i" (clobber) | 392 | [paravirt_clobber] "i" (clobber) |
| 395 | 393 | ||
| @@ -443,7 +441,7 @@ int paravirt_disable_iospace(void); | |||
| 443 | * offset into the paravirt_patch_template structure, and can therefore be | 441 | * offset into the paravirt_patch_template structure, and can therefore be |
| 444 | * freely converted back into a structure offset. | 442 | * freely converted back into a structure offset. |
| 445 | */ | 443 | */ |
| 446 | #define PARAVIRT_CALL "call *%[paravirt_opptr];" | 444 | #define PARAVIRT_CALL "call *%c[paravirt_opptr];" |
| 447 | 445 | ||
| 448 | /* | 446 | /* |
| 449 | * These macros are intended to wrap calls through one of the paravirt | 447 | * These macros are intended to wrap calls through one of the paravirt |
| @@ -1365,13 +1363,6 @@ static inline void set_pte_atomic(pte_t *ptep, pte_t pte) | |||
| 1365 | pte.pte, pte.pte >> 32); | 1363 | pte.pte, pte.pte >> 32); |
| 1366 | } | 1364 | } |
| 1367 | 1365 | ||
| 1368 | static inline void set_pte_present(struct mm_struct *mm, unsigned long addr, | ||
| 1369 | pte_t *ptep, pte_t pte) | ||
| 1370 | { | ||
| 1371 | /* 5 arg words */ | ||
| 1372 | pv_mmu_ops.set_pte_present(mm, addr, ptep, pte); | ||
| 1373 | } | ||
| 1374 | |||
| 1375 | static inline void pte_clear(struct mm_struct *mm, unsigned long addr, | 1366 | static inline void pte_clear(struct mm_struct *mm, unsigned long addr, |
| 1376 | pte_t *ptep) | 1367 | pte_t *ptep) |
| 1377 | { | 1368 | { |
| @@ -1388,12 +1379,6 @@ static inline void set_pte_atomic(pte_t *ptep, pte_t pte) | |||
| 1388 | set_pte(ptep, pte); | 1379 | set_pte(ptep, pte); |
| 1389 | } | 1380 | } |
| 1390 | 1381 | ||
| 1391 | static inline void set_pte_present(struct mm_struct *mm, unsigned long addr, | ||
| 1392 | pte_t *ptep, pte_t pte) | ||
| 1393 | { | ||
| 1394 | set_pte(ptep, pte); | ||
| 1395 | } | ||
| 1396 | |||
| 1397 | static inline void pte_clear(struct mm_struct *mm, unsigned long addr, | 1382 | static inline void pte_clear(struct mm_struct *mm, unsigned long addr, |
| 1398 | pte_t *ptep) | 1383 | pte_t *ptep) |
| 1399 | { | 1384 | { |
diff --git a/arch/x86/include/asm/pat.h b/arch/x86/include/asm/pat.h index b0e70056838e..2cd07b9422f4 100644 --- a/arch/x86/include/asm/pat.h +++ b/arch/x86/include/asm/pat.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define _ASM_X86_PAT_H | 2 | #define _ASM_X86_PAT_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <asm/pgtable_types.h> | ||
| 5 | 6 | ||
| 6 | #ifdef CONFIG_X86_PAT | 7 | #ifdef CONFIG_X86_PAT |
| 7 | extern int pat_enabled; | 8 | extern int pat_enabled; |
| @@ -17,5 +18,9 @@ extern int free_memtype(u64 start, u64 end); | |||
| 17 | 18 | ||
| 18 | extern int kernel_map_sync_memtype(u64 base, unsigned long size, | 19 | extern int kernel_map_sync_memtype(u64 base, unsigned long size, |
| 19 | unsigned long flag); | 20 | unsigned long flag); |
| 21 | extern void map_devmem(unsigned long pfn, unsigned long size, | ||
| 22 | struct pgprot vma_prot); | ||
| 23 | extern void unmap_devmem(unsigned long pfn, unsigned long size, | ||
| 24 | struct pgprot vma_prot); | ||
| 20 | 25 | ||
| 21 | #endif /* _ASM_X86_PAT_H */ | 26 | #endif /* _ASM_X86_PAT_H */ |
diff --git a/arch/x86/include/asm/pgtable-2level.h b/arch/x86/include/asm/pgtable-2level.h index c1774ac9da7a..2334982b339e 100644 --- a/arch/x86/include/asm/pgtable-2level.h +++ b/arch/x86/include/asm/pgtable-2level.h | |||
| @@ -26,13 +26,6 @@ static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte) | |||
| 26 | native_set_pte(ptep, pte); | 26 | native_set_pte(ptep, pte); |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | static inline void native_set_pte_present(struct mm_struct *mm, | ||
| 30 | unsigned long addr, | ||
| 31 | pte_t *ptep, pte_t pte) | ||
| 32 | { | ||
| 33 | native_set_pte(ptep, pte); | ||
| 34 | } | ||
| 35 | |||
| 36 | static inline void native_pmd_clear(pmd_t *pmdp) | 29 | static inline void native_pmd_clear(pmd_t *pmdp) |
| 37 | { | 30 | { |
| 38 | native_set_pmd(pmdp, __pmd(0)); | 31 | native_set_pmd(pmdp, __pmd(0)); |
diff --git a/arch/x86/include/asm/pgtable-3level.h b/arch/x86/include/asm/pgtable-3level.h index 3f13cdf61156..177b0165ea01 100644 --- a/arch/x86/include/asm/pgtable-3level.h +++ b/arch/x86/include/asm/pgtable-3level.h | |||
| @@ -31,23 +31,6 @@ static inline void native_set_pte(pte_t *ptep, pte_t pte) | |||
| 31 | ptep->pte_low = pte.pte_low; | 31 | ptep->pte_low = pte.pte_low; |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | /* | ||
| 35 | * Since this is only called on user PTEs, and the page fault handler | ||
| 36 | * must handle the already racy situation of simultaneous page faults, | ||
| 37 | * we are justified in merely clearing the PTE present bit, followed | ||
| 38 | * by a set. The ordering here is important. | ||
| 39 | */ | ||
| 40 | static inline void native_set_pte_present(struct mm_struct *mm, | ||
| 41 | unsigned long addr, | ||
| 42 | pte_t *ptep, pte_t pte) | ||
| 43 | { | ||
| 44 | ptep->pte_low = 0; | ||
| 45 | smp_wmb(); | ||
| 46 | ptep->pte_high = pte.pte_high; | ||
| 47 | smp_wmb(); | ||
| 48 | ptep->pte_low = pte.pte_low; | ||
| 49 | } | ||
| 50 | |||
| 51 | static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte) | 34 | static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte) |
| 52 | { | 35 | { |
| 53 | set_64bit((unsigned long long *)(ptep), native_pte_val(pte)); | 36 | set_64bit((unsigned long long *)(ptep), native_pte_val(pte)); |
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index d0812e155f1d..29d96d168bc0 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h | |||
| @@ -31,8 +31,6 @@ extern struct list_head pgd_list; | |||
| 31 | #define set_pte(ptep, pte) native_set_pte(ptep, pte) | 31 | #define set_pte(ptep, pte) native_set_pte(ptep, pte) |
| 32 | #define set_pte_at(mm, addr, ptep, pte) native_set_pte_at(mm, addr, ptep, pte) | 32 | #define set_pte_at(mm, addr, ptep, pte) native_set_pte_at(mm, addr, ptep, pte) |
| 33 | 33 | ||
| 34 | #define set_pte_present(mm, addr, ptep, pte) \ | ||
| 35 | native_set_pte_present(mm, addr, ptep, pte) | ||
| 36 | #define set_pte_atomic(ptep, pte) \ | 34 | #define set_pte_atomic(ptep, pte) \ |
| 37 | native_set_pte_atomic(ptep, pte) | 35 | native_set_pte_atomic(ptep, pte) |
| 38 | 36 | ||
diff --git a/arch/x86/include/asm/pgtable_32.h b/arch/x86/include/asm/pgtable_32.h index 97612fc7632f..31bd120cf2a2 100644 --- a/arch/x86/include/asm/pgtable_32.h +++ b/arch/x86/include/asm/pgtable_32.h | |||
| @@ -42,9 +42,6 @@ extern void set_pmd_pfn(unsigned long, unsigned long, pgprot_t); | |||
| 42 | */ | 42 | */ |
| 43 | #undef TEST_ACCESS_OK | 43 | #undef TEST_ACCESS_OK |
| 44 | 44 | ||
| 45 | /* The boot page tables (all created as a single array) */ | ||
| 46 | extern unsigned long pg0[]; | ||
| 47 | |||
| 48 | #ifdef CONFIG_X86_PAE | 45 | #ifdef CONFIG_X86_PAE |
| 49 | # include <asm/pgtable-3level.h> | 46 | # include <asm/pgtable-3level.h> |
| 50 | #else | 47 | #else |
diff --git a/arch/x86/include/asm/pgtable_32_types.h b/arch/x86/include/asm/pgtable_32_types.h index bd8df3b2fe04..2733fad45f98 100644 --- a/arch/x86/include/asm/pgtable_32_types.h +++ b/arch/x86/include/asm/pgtable_32_types.h | |||
| @@ -25,6 +25,11 @@ | |||
| 25 | * area for the same reason. ;) | 25 | * area for the same reason. ;) |
| 26 | */ | 26 | */ |
| 27 | #define VMALLOC_OFFSET (8 * 1024 * 1024) | 27 | #define VMALLOC_OFFSET (8 * 1024 * 1024) |
| 28 | |||
| 29 | #ifndef __ASSEMBLER__ | ||
| 30 | extern bool __vmalloc_start_set; /* set once high_memory is set */ | ||
| 31 | #endif | ||
| 32 | |||
| 28 | #define VMALLOC_START ((unsigned long)high_memory + VMALLOC_OFFSET) | 33 | #define VMALLOC_START ((unsigned long)high_memory + VMALLOC_OFFSET) |
| 29 | #ifdef CONFIG_X86_PAE | 34 | #ifdef CONFIG_X86_PAE |
| 30 | #define LAST_PKMAP 512 | 35 | #define LAST_PKMAP 512 |
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h index 4d258ad76a0f..b8238dc8786d 100644 --- a/arch/x86/include/asm/pgtable_types.h +++ b/arch/x86/include/asm/pgtable_types.h | |||
| @@ -273,6 +273,7 @@ typedef struct page *pgtable_t; | |||
| 273 | 273 | ||
| 274 | extern pteval_t __supported_pte_mask; | 274 | extern pteval_t __supported_pte_mask; |
| 275 | extern int nx_enabled; | 275 | extern int nx_enabled; |
| 276 | extern void set_nx(void); | ||
| 276 | 277 | ||
| 277 | #define pgprot_writecombine pgprot_writecombine | 278 | #define pgprot_writecombine pgprot_writecombine |
| 278 | extern pgprot_t pgprot_writecombine(pgprot_t prot); | 279 | extern pgprot_t pgprot_writecombine(pgprot_t prot); |
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 76139506c3e4..ae85a8d66a30 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
| @@ -75,9 +75,9 @@ struct cpuinfo_x86 { | |||
| 75 | #else | 75 | #else |
| 76 | /* Number of 4K pages in DTLB/ITLB combined(in pages): */ | 76 | /* Number of 4K pages in DTLB/ITLB combined(in pages): */ |
| 77 | int x86_tlbsize; | 77 | int x86_tlbsize; |
| 78 | #endif | ||
| 78 | __u8 x86_virt_bits; | 79 | __u8 x86_virt_bits; |
| 79 | __u8 x86_phys_bits; | 80 | __u8 x86_phys_bits; |
| 80 | #endif | ||
| 81 | /* CPUID returned core id bits: */ | 81 | /* CPUID returned core id bits: */ |
| 82 | __u8 x86_coreid_bits; | 82 | __u8 x86_coreid_bits; |
| 83 | /* Max extended CPUID function supported: */ | 83 | /* Max extended CPUID function supported: */ |
| @@ -391,6 +391,9 @@ DECLARE_PER_CPU(union irq_stack_union, irq_stack_union); | |||
| 391 | DECLARE_INIT_PER_CPU(irq_stack_union); | 391 | DECLARE_INIT_PER_CPU(irq_stack_union); |
| 392 | 392 | ||
| 393 | DECLARE_PER_CPU(char *, irq_stack_ptr); | 393 | DECLARE_PER_CPU(char *, irq_stack_ptr); |
| 394 | DECLARE_PER_CPU(unsigned int, irq_count); | ||
| 395 | extern unsigned long kernel_eflags; | ||
| 396 | extern asmlinkage void ignore_sysret(void); | ||
| 394 | #else /* X86_64 */ | 397 | #else /* X86_64 */ |
| 395 | #ifdef CONFIG_CC_STACKPROTECTOR | 398 | #ifdef CONFIG_CC_STACKPROTECTOR |
| 396 | DECLARE_PER_CPU(unsigned long, stack_canary); | 399 | DECLARE_PER_CPU(unsigned long, stack_canary); |
diff --git a/arch/x86/include/asm/sections.h b/arch/x86/include/asm/sections.h index 2b8c5160388f..1b7ee5d673c2 100644 --- a/arch/x86/include/asm/sections.h +++ b/arch/x86/include/asm/sections.h | |||
| @@ -1 +1,8 @@ | |||
| 1 | #ifndef _ASM_X86_SECTIONS_H | ||
| 2 | #define _ASM_X86_SECTIONS_H | ||
| 3 | |||
| 1 | #include <asm-generic/sections.h> | 4 | #include <asm-generic/sections.h> |
| 5 | |||
| 6 | extern char __brk_base[], __brk_limit[]; | ||
| 7 | |||
| 8 | #endif /* _ASM_X86_SECTIONS_H */ | ||
diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h index 05c6f6b11fd5..bdc2ada05ae0 100644 --- a/arch/x86/include/asm/setup.h +++ b/arch/x86/include/asm/setup.h | |||
| @@ -64,7 +64,7 @@ extern void x86_quirk_time_init(void); | |||
| 64 | #include <asm/bootparam.h> | 64 | #include <asm/bootparam.h> |
| 65 | 65 | ||
| 66 | /* Interrupt control for vSMPowered x86_64 systems */ | 66 | /* Interrupt control for vSMPowered x86_64 systems */ |
| 67 | #ifdef CONFIG_X86_VSMP | 67 | #ifdef CONFIG_X86_64 |
| 68 | void vsmp_init(void); | 68 | void vsmp_init(void); |
| 69 | #else | 69 | #else |
| 70 | static inline void vsmp_init(void) { } | 70 | static inline void vsmp_init(void) { } |
| @@ -100,20 +100,51 @@ extern struct boot_params boot_params; | |||
| 100 | */ | 100 | */ |
| 101 | #define LOWMEMSIZE() (0x9f000) | 101 | #define LOWMEMSIZE() (0x9f000) |
| 102 | 102 | ||
| 103 | /* exceedingly early brk-like allocator */ | ||
| 104 | extern unsigned long _brk_end; | ||
| 105 | void *extend_brk(size_t size, size_t align); | ||
| 106 | |||
| 107 | /* | ||
| 108 | * Reserve space in the brk section. The name must be unique within | ||
| 109 | * the file, and somewhat descriptive. The size is in bytes. Must be | ||
| 110 | * used at file scope. | ||
| 111 | * | ||
| 112 | * (This uses a temp function to wrap the asm so we can pass it the | ||
| 113 | * size parameter; otherwise we wouldn't be able to. We can't use a | ||
| 114 | * "section" attribute on a normal variable because it always ends up | ||
| 115 | * being @progbits, which ends up allocating space in the vmlinux | ||
| 116 | * executable.) | ||
| 117 | */ | ||
| 118 | #define RESERVE_BRK(name,sz) \ | ||
| 119 | static void __section(.discard) __used \ | ||
| 120 | __brk_reservation_fn_##name##__(void) { \ | ||
| 121 | asm volatile ( \ | ||
| 122 | ".pushsection .brk_reservation,\"aw\",@nobits;" \ | ||
| 123 | ".brk." #name ":" \ | ||
| 124 | " 1:.skip %c0;" \ | ||
| 125 | " .size .brk." #name ", . - 1b;" \ | ||
| 126 | " .popsection" \ | ||
| 127 | : : "i" (sz)); \ | ||
| 128 | } | ||
| 129 | |||
| 103 | #ifdef __i386__ | 130 | #ifdef __i386__ |
| 104 | 131 | ||
| 105 | void __init i386_start_kernel(void); | 132 | void __init i386_start_kernel(void); |
| 106 | extern void probe_roms(void); | 133 | extern void probe_roms(void); |
| 107 | 134 | ||
| 108 | extern unsigned long init_pg_tables_start; | ||
| 109 | extern unsigned long init_pg_tables_end; | ||
| 110 | |||
| 111 | #else | 135 | #else |
| 112 | void __init x86_64_start_kernel(char *real_mode); | 136 | void __init x86_64_start_kernel(char *real_mode); |
| 113 | void __init x86_64_start_reservations(char *real_mode_data); | 137 | void __init x86_64_start_reservations(char *real_mode_data); |
| 114 | 138 | ||
| 115 | #endif /* __i386__ */ | 139 | #endif /* __i386__ */ |
| 116 | #endif /* _SETUP */ | 140 | #endif /* _SETUP */ |
| 141 | #else | ||
| 142 | #define RESERVE_BRK(name,sz) \ | ||
| 143 | .pushsection .brk_reservation,"aw",@nobits; \ | ||
| 144 | .brk.name: \ | ||
| 145 | 1: .skip sz; \ | ||
| 146 | .size .brk.name,.-1b; \ | ||
| 147 | .popsection | ||
| 117 | #endif /* __ASSEMBLY__ */ | 148 | #endif /* __ASSEMBLY__ */ |
| 118 | #endif /* __KERNEL__ */ | 149 | #endif /* __KERNEL__ */ |
| 119 | 150 | ||
diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h index 777327ef05c1..9f4dfba33b28 100644 --- a/arch/x86/include/asm/uv/uv_hub.h +++ b/arch/x86/include/asm/uv/uv_hub.h | |||
| @@ -199,6 +199,10 @@ DECLARE_PER_CPU(struct uv_hub_info_s, __uv_hub_info); | |||
| 199 | #define SCIR_CPU_ACTIVITY 0x02 /* not idle */ | 199 | #define SCIR_CPU_ACTIVITY 0x02 /* not idle */ |
| 200 | #define SCIR_CPU_HB_INTERVAL (HZ) /* once per second */ | 200 | #define SCIR_CPU_HB_INTERVAL (HZ) /* once per second */ |
| 201 | 201 | ||
| 202 | /* Loop through all installed blades */ | ||
| 203 | #define for_each_possible_blade(bid) \ | ||
| 204 | for ((bid) = 0; (bid) < uv_num_possible_blades(); (bid)++) | ||
| 205 | |||
| 202 | /* | 206 | /* |
| 203 | * Macros for converting between kernel virtual addresses, socket local physical | 207 | * Macros for converting between kernel virtual addresses, socket local physical |
| 204 | * addresses, and UV global physical addresses. | 208 | * addresses, and UV global physical addresses. |
diff --git a/arch/x86/include/asm/xen/hypercall.h b/arch/x86/include/asm/xen/hypercall.h index 5e79ca694326..9c371e4a9fa6 100644 --- a/arch/x86/include/asm/xen/hypercall.h +++ b/arch/x86/include/asm/xen/hypercall.h | |||
| @@ -296,6 +296,8 @@ HYPERVISOR_get_debugreg(int reg) | |||
| 296 | static inline int | 296 | static inline int |
| 297 | HYPERVISOR_update_descriptor(u64 ma, u64 desc) | 297 | HYPERVISOR_update_descriptor(u64 ma, u64 desc) |
| 298 | { | 298 | { |
| 299 | if (sizeof(u64) == sizeof(long)) | ||
| 300 | return _hypercall2(int, update_descriptor, ma, desc); | ||
| 299 | return _hypercall4(int, update_descriptor, ma, ma>>32, desc, desc>>32); | 301 | return _hypercall4(int, update_descriptor, ma, ma>>32, desc, desc>>32); |
| 300 | } | 302 | } |
| 301 | 303 | ||
