aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/cpu/cpufreq/speedstep-smi.c39
-rw-r--r--arch/x86/kernel/cpu/mtrr/generic.c42
-rw-r--r--arch/x86/kernel/io_delay.c8
-rw-r--r--arch/x86/kernel/mfgpt_32.c1
-rw-r--r--arch/x86/kernel/setup_32.c9
-rw-r--r--arch/x86/kernel/setup_64.c2
-rw-r--r--arch/x86/mm/discontig_32.c1
-rw-r--r--arch/x86/mm/ioremap.c6
-rw-r--r--arch/x86/mm/pageattr.c2
9 files changed, 67 insertions, 43 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c b/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c
index f2b5a621d27b..8a85c93bd62a 100644
--- a/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c
@@ -63,7 +63,7 @@ static struct cpufreq_frequency_table speedstep_freqs[] = {
63 */ 63 */
64static int speedstep_smi_ownership (void) 64static int speedstep_smi_ownership (void)
65{ 65{
66 u32 command, result, magic; 66 u32 command, result, magic, dummy;
67 u32 function = GET_SPEEDSTEP_OWNER; 67 u32 function = GET_SPEEDSTEP_OWNER;
68 unsigned char magic_data[] = "Copyright (c) 1999 Intel Corporation"; 68 unsigned char magic_data[] = "Copyright (c) 1999 Intel Corporation";
69 69
@@ -73,8 +73,11 @@ static int speedstep_smi_ownership (void)
73 dprintk("trying to obtain ownership with command %x at port %x\n", command, smi_port); 73 dprintk("trying to obtain ownership with command %x at port %x\n", command, smi_port);
74 74
75 __asm__ __volatile__( 75 __asm__ __volatile__(
76 "push %%ebp\n"
76 "out %%al, (%%dx)\n" 77 "out %%al, (%%dx)\n"
77 : "=D" (result) 78 "pop %%ebp\n"
79 : "=D" (result), "=a" (dummy), "=b" (dummy), "=c" (dummy), "=d" (dummy),
80 "=S" (dummy)
78 : "a" (command), "b" (function), "c" (0), "d" (smi_port), 81 : "a" (command), "b" (function), "c" (0), "d" (smi_port),
79 "D" (0), "S" (magic) 82 "D" (0), "S" (magic)
80 : "memory" 83 : "memory"
@@ -96,7 +99,7 @@ static int speedstep_smi_ownership (void)
96 */ 99 */
97static int speedstep_smi_get_freqs (unsigned int *low, unsigned int *high) 100static int speedstep_smi_get_freqs (unsigned int *low, unsigned int *high)
98{ 101{
99 u32 command, result = 0, edi, high_mhz, low_mhz; 102 u32 command, result = 0, edi, high_mhz, low_mhz, dummy;
100 u32 state=0; 103 u32 state=0;
101 u32 function = GET_SPEEDSTEP_FREQS; 104 u32 function = GET_SPEEDSTEP_FREQS;
102 105
@@ -109,10 +112,12 @@ static int speedstep_smi_get_freqs (unsigned int *low, unsigned int *high)
109 112
110 dprintk("trying to determine frequencies with command %x at port %x\n", command, smi_port); 113 dprintk("trying to determine frequencies with command %x at port %x\n", command, smi_port);
111 114
112 __asm__ __volatile__("movl $0, %%edi\n" 115 __asm__ __volatile__(
116 "push %%ebp\n"
113 "out %%al, (%%dx)\n" 117 "out %%al, (%%dx)\n"
114 : "=a" (result), "=b" (high_mhz), "=c" (low_mhz), "=d" (state), "=D" (edi) 118 "pop %%ebp"
115 : "a" (command), "b" (function), "c" (state), "d" (smi_port), "S" (0) 119 : "=a" (result), "=b" (high_mhz), "=c" (low_mhz), "=d" (state), "=D" (edi), "=S" (dummy)
120 : "a" (command), "b" (function), "c" (state), "d" (smi_port), "S" (0), "D" (0)
116 ); 121 );
117 122
118 dprintk("result %x, low_freq %u, high_freq %u\n", result, low_mhz, high_mhz); 123 dprintk("result %x, low_freq %u, high_freq %u\n", result, low_mhz, high_mhz);
@@ -135,16 +140,18 @@ static int speedstep_smi_get_freqs (unsigned int *low, unsigned int *high)
135static int speedstep_get_state (void) 140static int speedstep_get_state (void)
136{ 141{
137 u32 function=GET_SPEEDSTEP_STATE; 142 u32 function=GET_SPEEDSTEP_STATE;
138 u32 result, state, edi, command; 143 u32 result, state, edi, command, dummy;
139 144
140 command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff); 145 command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff);
141 146
142 dprintk("trying to determine current setting with command %x at port %x\n", command, smi_port); 147 dprintk("trying to determine current setting with command %x at port %x\n", command, smi_port);
143 148
144 __asm__ __volatile__("movl $0, %%edi\n" 149 __asm__ __volatile__(
150 "push %%ebp\n"
145 "out %%al, (%%dx)\n" 151 "out %%al, (%%dx)\n"
146 : "=a" (result), "=b" (state), "=D" (edi) 152 "pop %%ebp\n"
147 : "a" (command), "b" (function), "c" (0), "d" (smi_port), "S" (0) 153 : "=a" (result), "=b" (state), "=D" (edi), "=c" (dummy), "=d" (dummy), "=S" (dummy)
154 : "a" (command), "b" (function), "c" (0), "d" (smi_port), "S" (0), "D" (0)
148 ); 155 );
149 156
150 dprintk("state is %x, result is %x\n", state, result); 157 dprintk("state is %x, result is %x\n", state, result);
@@ -160,7 +167,7 @@ static int speedstep_get_state (void)
160 */ 167 */
161static void speedstep_set_state (unsigned int state) 168static void speedstep_set_state (unsigned int state)
162{ 169{
163 unsigned int result = 0, command, new_state; 170 unsigned int result = 0, command, new_state, dummy;
164 unsigned long flags; 171 unsigned long flags;
165 unsigned int function=SET_SPEEDSTEP_STATE; 172 unsigned int function=SET_SPEEDSTEP_STATE;
166 unsigned int retry = 0; 173 unsigned int retry = 0;
@@ -182,10 +189,12 @@ static void speedstep_set_state (unsigned int state)
182 } 189 }
183 retry++; 190 retry++;
184 __asm__ __volatile__( 191 __asm__ __volatile__(
185 "movl $0, %%edi\n" 192 "push %%ebp\n"
186 "out %%al, (%%dx)\n" 193 "out %%al, (%%dx)\n"
187 : "=b" (new_state), "=D" (result) 194 "pop %%ebp"
188 : "a" (command), "b" (function), "c" (state), "d" (smi_port), "S" (0) 195 : "=b" (new_state), "=D" (result), "=c" (dummy), "=a" (dummy),
196 "=d" (dummy), "=S" (dummy)
197 : "a" (command), "b" (function), "c" (state), "d" (smi_port), "S" (0), "D" (0)
189 ); 198 );
190 } while ((new_state != state) && (retry <= SMI_TRIES)); 199 } while ((new_state != state) && (retry <= SMI_TRIES));
191 200
@@ -195,7 +204,7 @@ static void speedstep_set_state (unsigned int state)
195 if (new_state == state) { 204 if (new_state == state) {
196 dprintk("change to %u MHz succeeded after %u tries with result %u\n", (speedstep_freqs[new_state].frequency / 1000), retry, result); 205 dprintk("change to %u MHz succeeded after %u tries with result %u\n", (speedstep_freqs[new_state].frequency / 1000), retry, result);
197 } else { 206 } else {
198 printk(KERN_ERR "cpufreq: change failed with new_state %u and result %u\n", new_state, result); 207 printk(KERN_ERR "cpufreq: change to state %u failed with new_state %u and result %u\n", state, new_state, result);
199 } 208 }
200 209
201 return; 210 return;
diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c
index 103d61a59b19..3e18db4cefee 100644
--- a/arch/x86/kernel/cpu/mtrr/generic.c
+++ b/arch/x86/kernel/cpu/mtrr/generic.c
@@ -176,12 +176,13 @@ static inline void k8_enable_fixed_iorrs(void)
176} 176}
177 177
178/** 178/**
179 * Checks and updates an fixed-range MTRR if it differs from the value it 179 * set_fixed_range - checks & updates a fixed-range MTRR if it differs from the value it should have
180 * should have. If K8 extentions are wanted, update the K8 SYSCFG MSR also. 180 * @msr: MSR address of the MTTR which should be checked and updated
181 * see AMD publication no. 24593, chapter 7.8.1, page 233 for more information 181 * @changed: pointer which indicates whether the MTRR needed to be changed
182 * \param msr MSR address of the MTTR which should be checked and updated 182 * @msrwords: pointer to the MSR values which the MSR should have
183 * \param changed pointer which indicates whether the MTRR needed to be changed 183 *
184 * \param msrwords pointer to the MSR values which the MSR should have 184 * If K8 extentions are wanted, update the K8 SYSCFG MSR also.
185 * See AMD publication no. 24593, chapter 7.8.1, page 233 for more information.
185 */ 186 */
186static void set_fixed_range(int msr, bool *changed, unsigned int *msrwords) 187static void set_fixed_range(int msr, bool *changed, unsigned int *msrwords)
187{ 188{
@@ -199,12 +200,15 @@ static void set_fixed_range(int msr, bool *changed, unsigned int *msrwords)
199 } 200 }
200} 201}
201 202
203/**
204 * generic_get_free_region - Get a free MTRR.
205 * @base: The starting (base) address of the region.
206 * @size: The size (in bytes) of the region.
207 * @replace_reg: mtrr index to be replaced; set to invalid value if none.
208 *
209 * Returns: The index of the region on success, else negative on error.
210 */
202int generic_get_free_region(unsigned long base, unsigned long size, int replace_reg) 211int generic_get_free_region(unsigned long base, unsigned long size, int replace_reg)
203/* [SUMMARY] Get a free MTRR.
204 <base> The starting (base) address of the region.
205 <size> The size (in bytes) of the region.
206 [RETURNS] The index of the region on success, else -1 on error.
207*/
208{ 212{
209 int i, max; 213 int i, max;
210 mtrr_type ltype; 214 mtrr_type ltype;
@@ -249,8 +253,8 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base,
249} 253}
250 254
251/** 255/**
252 * Checks and updates the fixed-range MTRRs if they differ from the saved set 256 * set_fixed_ranges - checks & updates the fixed-range MTRRs if they differ from the saved set
253 * \param frs pointer to fixed-range MTRR values, saved by get_fixed_ranges() 257 * @frs: pointer to fixed-range MTRR values, saved by get_fixed_ranges()
254 */ 258 */
255static int set_fixed_ranges(mtrr_type * frs) 259static int set_fixed_ranges(mtrr_type * frs)
256{ 260{
@@ -294,13 +298,13 @@ static bool set_mtrr_var_ranges(unsigned int index, struct mtrr_var_range *vr)
294 298
295static u32 deftype_lo, deftype_hi; 299static u32 deftype_lo, deftype_hi;
296 300
301/**
302 * set_mtrr_state - Set the MTRR state for this CPU.
303 *
304 * NOTE: The CPU must already be in a safe state for MTRR changes.
305 * RETURNS: 0 if no changes made, else a mask indicating what was changed.
306 */
297static unsigned long set_mtrr_state(void) 307static unsigned long set_mtrr_state(void)
298/* [SUMMARY] Set the MTRR state for this CPU.
299 <state> The MTRR state information to read.
300 <ctxt> Some relevant CPU context.
301 [NOTE] The CPU must already be in a safe state for MTRR changes.
302 [RETURNS] 0 if no changes made, else a mask indication what was changed.
303*/
304{ 308{
305 unsigned int i; 309 unsigned int i;
306 unsigned long change_mask = 0; 310 unsigned long change_mask = 0;
diff --git a/arch/x86/kernel/io_delay.c b/arch/x86/kernel/io_delay.c
index c706a3061553..5921e5f0a640 100644
--- a/arch/x86/kernel/io_delay.c
+++ b/arch/x86/kernel/io_delay.c
@@ -78,6 +78,14 @@ static struct dmi_system_id __initdata io_delay_0xed_port_dmi_table[] = {
78 }, 78 },
79 { 79 {
80 .callback = dmi_io_delay_0xed_port, 80 .callback = dmi_io_delay_0xed_port,
81 .ident = "HP Pavilion dv6000",
82 .matches = {
83 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
84 DMI_MATCH(DMI_BOARD_NAME, "30B8")
85 }
86 },
87 {
88 .callback = dmi_io_delay_0xed_port,
81 .ident = "HP Pavilion tx1000", 89 .ident = "HP Pavilion tx1000",
82 .matches = { 90 .matches = {
83 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), 91 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
diff --git a/arch/x86/kernel/mfgpt_32.c b/arch/x86/kernel/mfgpt_32.c
index 027fc067b399..b402c0f3f192 100644
--- a/arch/x86/kernel/mfgpt_32.c
+++ b/arch/x86/kernel/mfgpt_32.c
@@ -30,6 +30,7 @@
30 30
31#include <linux/kernel.h> 31#include <linux/kernel.h>
32#include <linux/interrupt.h> 32#include <linux/interrupt.h>
33#include <linux/module.h>
33#include <asm/geode.h> 34#include <asm/geode.h>
34 35
35static struct mfgpt_timer_t { 36static struct mfgpt_timer_t {
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c
index a1d7071a51c9..2b3e5d45176b 100644
--- a/arch/x86/kernel/setup_32.c
+++ b/arch/x86/kernel/setup_32.c
@@ -406,8 +406,6 @@ static unsigned long __init setup_memory(void)
406 */ 406 */
407 min_low_pfn = PFN_UP(init_pg_tables_end); 407 min_low_pfn = PFN_UP(init_pg_tables_end);
408 408
409 find_max_pfn();
410
411 max_low_pfn = find_max_low_pfn(); 409 max_low_pfn = find_max_low_pfn();
412 410
413#ifdef CONFIG_HIGHMEM 411#ifdef CONFIG_HIGHMEM
@@ -764,12 +762,13 @@ void __init setup_arch(char **cmdline_p)
764 if (efi_enabled) 762 if (efi_enabled)
765 efi_init(); 763 efi_init();
766 764
767 max_low_pfn = setup_memory();
768
769 /* update e820 for memory not covered by WB MTRRs */ 765 /* update e820 for memory not covered by WB MTRRs */
766 find_max_pfn();
770 mtrr_bp_init(); 767 mtrr_bp_init();
771 if (mtrr_trim_uncached_memory(max_pfn)) 768 if (mtrr_trim_uncached_memory(max_pfn))
772 max_low_pfn = setup_memory(); 769 find_max_pfn();
770
771 max_low_pfn = setup_memory();
773 772
774#ifdef CONFIG_VMI 773#ifdef CONFIG_VMI
775 /* 774 /*
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index 7637dc91c79b..f4f7ecfb898c 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -801,7 +801,7 @@ static void __cpuinit srat_detect_node(void)
801 /* Don't do the funky fallback heuristics the AMD version employs 801 /* Don't do the funky fallback heuristics the AMD version employs
802 for now. */ 802 for now. */
803 node = apicid_to_node[apicid]; 803 node = apicid_to_node[apicid];
804 if (node == NUMA_NO_NODE) 804 if (node == NUMA_NO_NODE || !node_online(node))
805 node = first_node(node_online_map); 805 node = first_node(node_online_map);
806 numa_set_node(cpu, node); 806 numa_set_node(cpu, node);
807 807
diff --git a/arch/x86/mm/discontig_32.c b/arch/x86/mm/discontig_32.c
index c394ca0720b8..8e25e06ff730 100644
--- a/arch/x86/mm/discontig_32.c
+++ b/arch/x86/mm/discontig_32.c
@@ -324,7 +324,6 @@ unsigned long __init setup_memory(void)
324 * this space and use it to adjust the boundary between ZONE_NORMAL 324 * this space and use it to adjust the boundary between ZONE_NORMAL
325 * and ZONE_HIGHMEM. 325 * and ZONE_HIGHMEM.
326 */ 326 */
327 find_max_pfn();
328 get_memcfg_numa(); 327 get_memcfg_numa();
329 328
330 kva_pages = calculate_numa_remap_pages(); 329 kva_pages = calculate_numa_remap_pages();
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index 4afaba0ed722..794895c6dcc9 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -137,7 +137,11 @@ static void __iomem *__ioremap(resource_size_t phys_addr, unsigned long size,
137 switch (mode) { 137 switch (mode) {
138 case IOR_MODE_UNCACHED: 138 case IOR_MODE_UNCACHED:
139 default: 139 default:
140 prot = PAGE_KERNEL_NOCACHE; 140 /*
141 * FIXME: we will use UC MINUS for now, as video fb drivers
142 * depend on it. Upcoming ioremap_wc() will fix this behavior.
143 */
144 prot = PAGE_KERNEL_UC_MINUS;
141 break; 145 break;
142 case IOR_MODE_CACHED: 146 case IOR_MODE_CACHED:
143 prot = PAGE_KERNEL; 147 prot = PAGE_KERNEL;
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 14e48b5a94ba..7b79f6be4e7d 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -771,7 +771,7 @@ static inline int change_page_attr_clear(unsigned long addr, int numpages,
771int set_memory_uc(unsigned long addr, int numpages) 771int set_memory_uc(unsigned long addr, int numpages)
772{ 772{
773 return change_page_attr_set(addr, numpages, 773 return change_page_attr_set(addr, numpages,
774 __pgprot(_PAGE_PCD | _PAGE_PWT)); 774 __pgprot(_PAGE_PCD));
775} 775}
776EXPORT_SYMBOL(set_memory_uc); 776EXPORT_SYMBOL(set_memory_uc);
777 777