aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-31 13:43:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-31 13:43:11 -0400
commit0c6be87161a6865a6f685a27c6a0404f9d1a0d5e (patch)
treeffa5034d41215a901b10697dbf7470d04cc3627b /arch
parent6a445c7fa739d2cde881a22f1ed38455eeb56f51 (diff)
parent1ab46fd319bcf1fcd9fb6311727d532b580e4eba (diff)
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull additional x86 fixes from Peter Anvin. * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86, amd, xen: Avoid NULL pointer paravirt references x86, mtrr: Fix a type overflow in range_to_mtrr func x86, realmode: Unbreak the ia64 build of drivers/acpi/sleep.c x86/mm/pat: Improve scaling of pat_pagerange_is_ram() x86: hpet: Fix copy-and-paste mistake in earlier change x86/mce: Fix 32-bit build x86/bitops: Move BIT_64() for a wider use
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/acpi.h7
-rw-r--r--arch/x86/include/asm/bitops.h2
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c6
-rw-r--r--arch/x86/kernel/cpu/mtrr/cleanup.c2
-rw-r--r--arch/x86/kernel/hpet.c2
-rw-r--r--arch/x86/mm/pat.c56
-rw-r--r--arch/x86/xen/enlighten.c3
7 files changed, 49 insertions, 29 deletions
diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h
index 724aa441de7d..0c44630d1789 100644
--- a/arch/x86/include/asm/acpi.h
+++ b/arch/x86/include/asm/acpi.h
@@ -29,6 +29,7 @@
29#include <asm/processor.h> 29#include <asm/processor.h>
30#include <asm/mmu.h> 30#include <asm/mmu.h>
31#include <asm/mpspec.h> 31#include <asm/mpspec.h>
32#include <asm/realmode.h>
32 33
33#define COMPILER_DEPENDENT_INT64 long long 34#define COMPILER_DEPENDENT_INT64 long long
34#define COMPILER_DEPENDENT_UINT64 unsigned long long 35#define COMPILER_DEPENDENT_UINT64 unsigned long long
@@ -116,10 +117,8 @@ static inline void acpi_disable_pci(void)
116/* Low-level suspend routine. */ 117/* Low-level suspend routine. */
117extern int acpi_suspend_lowlevel(void); 118extern int acpi_suspend_lowlevel(void);
118 119
119extern const unsigned char acpi_wakeup_code[]; 120/* Physical address to resume after wakeup */
120 121#define acpi_wakeup_address ((unsigned long)(real_mode_header->wakeup_start))
121/* early initialization routine */
122extern void acpi_reserve_wakeup_memory(void);
123 122
124/* 123/*
125 * Check if the CPU can handle C2 and deeper 124 * Check if the CPU can handle C2 and deeper
diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h
index b97596e2b68c..a6983b277220 100644
--- a/arch/x86/include/asm/bitops.h
+++ b/arch/x86/include/asm/bitops.h
@@ -15,6 +15,8 @@
15#include <linux/compiler.h> 15#include <linux/compiler.h>
16#include <asm/alternative.h> 16#include <asm/alternative.h>
17 17
18#define BIT_64(n) (U64_C(1) << (n))
19
18/* 20/*
19 * These have to be done with inline assembly: that way the bit-setting 21 * These have to be done with inline assembly: that way the bit-setting
20 * is guaranteed to be atomic. All bit operations return 0 if the bit 22 * is guaranteed to be atomic. All bit operations return 0 if the bit
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index b772dd6ad450..b4180f425fb8 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -1472,9 +1472,9 @@ static int __cpuinit __mcheck_cpu_apply_quirks(struct cpuinfo_x86 *c)
1472 rdmsrl(msrs[i], val); 1472 rdmsrl(msrs[i], val);
1473 1473
1474 /* CntP bit set? */ 1474 /* CntP bit set? */
1475 if (val & BIT(62)) { 1475 if (val & BIT_64(62)) {
1476 val &= ~BIT(62); 1476 val &= ~BIT_64(62);
1477 wrmsrl(msrs[i], val); 1477 wrmsrl(msrs[i], val);
1478 } 1478 }
1479 } 1479 }
1480 1480
diff --git a/arch/x86/kernel/cpu/mtrr/cleanup.c b/arch/x86/kernel/cpu/mtrr/cleanup.c
index ac140c7be396..bdda2e6c673b 100644
--- a/arch/x86/kernel/cpu/mtrr/cleanup.c
+++ b/arch/x86/kernel/cpu/mtrr/cleanup.c
@@ -266,7 +266,7 @@ range_to_mtrr(unsigned int reg, unsigned long range_startk,
266 if (align > max_align) 266 if (align > max_align)
267 align = max_align; 267 align = max_align;
268 268
269 sizek = 1 << align; 269 sizek = 1UL << align;
270 if (debug_print) { 270 if (debug_print) {
271 char start_factor = 'K', size_factor = 'K'; 271 char start_factor = 'K', size_factor = 'K';
272 unsigned long start_base, size_base; 272 unsigned long start_base, size_base;
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 9cc7b4392f7c..1460a5df92f7 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -870,7 +870,7 @@ int __init hpet_enable(void)
870 else 870 else
871 pr_warn("HPET initial state will not be saved\n"); 871 pr_warn("HPET initial state will not be saved\n");
872 cfg &= ~(HPET_CFG_ENABLE | HPET_CFG_LEGACY); 872 cfg &= ~(HPET_CFG_ENABLE | HPET_CFG_LEGACY);
873 hpet_writel(cfg, HPET_Tn_CFG(i)); 873 hpet_writel(cfg, HPET_CFG);
874 if (cfg) 874 if (cfg)
875 pr_warn("HPET: Unrecognized bits %#x set in global cfg\n", 875 pr_warn("HPET: Unrecognized bits %#x set in global cfg\n",
876 cfg); 876 cfg);
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
index f11729fd019c..3d68ef6d2266 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
@@ -158,31 +158,47 @@ static unsigned long pat_x_mtrr_type(u64 start, u64 end, unsigned long req_type)
158 return req_type; 158 return req_type;
159} 159}
160 160
161struct pagerange_state {
162 unsigned long cur_pfn;
163 int ram;
164 int not_ram;
165};
166
167static int
168pagerange_is_ram_callback(unsigned long initial_pfn, unsigned long total_nr_pages, void *arg)
169{
170 struct pagerange_state *state = arg;
171
172 state->not_ram |= initial_pfn > state->cur_pfn;
173 state->ram |= total_nr_pages > 0;
174 state->cur_pfn = initial_pfn + total_nr_pages;
175
176 return state->ram && state->not_ram;
177}
178
161static int pat_pagerange_is_ram(resource_size_t start, resource_size_t end) 179static int pat_pagerange_is_ram(resource_size_t start, resource_size_t end)
162{ 180{
163 int ram_page = 0, not_rampage = 0; 181 int ret = 0;
164 unsigned long page_nr; 182 unsigned long start_pfn = start >> PAGE_SHIFT;
183 unsigned long end_pfn = (end + PAGE_SIZE - 1) >> PAGE_SHIFT;
184 struct pagerange_state state = {start_pfn, 0, 0};
165 185
166 for (page_nr = (start >> PAGE_SHIFT); page_nr < (end >> PAGE_SHIFT); 186 /*
167 ++page_nr) { 187 * For legacy reasons, physical address range in the legacy ISA
168 /* 188 * region is tracked as non-RAM. This will allow users of
169 * For legacy reasons, physical address range in the legacy ISA 189 * /dev/mem to map portions of legacy ISA region, even when
170 * region is tracked as non-RAM. This will allow users of 190 * some of those portions are listed(or not even listed) with
171 * /dev/mem to map portions of legacy ISA region, even when 191 * different e820 types(RAM/reserved/..)
172 * some of those portions are listed(or not even listed) with 192 */
173 * different e820 types(RAM/reserved/..) 193 if (start_pfn < ISA_END_ADDRESS >> PAGE_SHIFT)
174 */ 194 start_pfn = ISA_END_ADDRESS >> PAGE_SHIFT;
175 if (page_nr >= (ISA_END_ADDRESS >> PAGE_SHIFT) && 195
176 page_is_ram(page_nr)) 196 if (start_pfn < end_pfn) {
177 ram_page = 1; 197 ret = walk_system_ram_range(start_pfn, end_pfn - start_pfn,
178 else 198 &state, pagerange_is_ram_callback);
179 not_rampage = 1;
180
181 if (ram_page == not_rampage)
182 return -1;
183 } 199 }
184 200
185 return ram_page; 201 return (ret > 0) ? -1 : (state.ram ? 1 : 0);
186} 202}
187 203
188/* 204/*
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 75f33b2a5933..e74df9548a02 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1116,7 +1116,10 @@ static const struct pv_cpu_ops xen_cpu_ops __initconst = {
1116 .wbinvd = native_wbinvd, 1116 .wbinvd = native_wbinvd,
1117 1117
1118 .read_msr = native_read_msr_safe, 1118 .read_msr = native_read_msr_safe,
1119 .rdmsr_regs = native_rdmsr_safe_regs,
1119 .write_msr = xen_write_msr_safe, 1120 .write_msr = xen_write_msr_safe,
1121 .wrmsr_regs = native_wrmsr_safe_regs,
1122
1120 .read_tsc = native_read_tsc, 1123 .read_tsc = native_read_tsc,
1121 .read_pmc = native_read_pmc, 1124 .read_pmc = native_read_pmc,
1122 1125