aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/cpu/amd.c23
-rw-r--r--arch/x86/kernel/cpuid.c2
-rw-r--r--arch/x86/kernel/espfix_64.c3
-rw-r--r--arch/x86/kernel/msr.c11
-rw-r--r--arch/x86/kernel/sysfb.c2
-rw-r--r--arch/x86/kernel/sysfb_simplefb.c5
6 files changed, 20 insertions, 26 deletions
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 813d29d00a17..15c5df92f74e 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -566,6 +566,17 @@ static void init_amd_k8(struct cpuinfo_x86 *c)
566 566
567 if (!c->x86_model_id[0]) 567 if (!c->x86_model_id[0])
568 strcpy(c->x86_model_id, "Hammer"); 568 strcpy(c->x86_model_id, "Hammer");
569
570#ifdef CONFIG_SMP
571 /*
572 * Disable TLB flush filter by setting HWCR.FFDIS on K8
573 * bit 6 of msr C001_0015
574 *
575 * Errata 63 for SH-B3 steppings
576 * Errata 122 for all steppings (F+ have it disabled by default)
577 */
578 msr_set_bit(MSR_K7_HWCR, 6);
579#endif
569} 580}
570 581
571static void init_amd_gh(struct cpuinfo_x86 *c) 582static void init_amd_gh(struct cpuinfo_x86 *c)
@@ -636,18 +647,6 @@ static void init_amd(struct cpuinfo_x86 *c)
636{ 647{
637 u32 dummy; 648 u32 dummy;
638 649
639#ifdef CONFIG_SMP
640 /*
641 * Disable TLB flush filter by setting HWCR.FFDIS on K8
642 * bit 6 of msr C001_0015
643 *
644 * Errata 63 for SH-B3 steppings
645 * Errata 122 for all steppings (F+ have it disabled by default)
646 */
647 if (c->x86 == 0xf)
648 msr_set_bit(MSR_K7_HWCR, 6);
649#endif
650
651 early_init_amd(c); 650 early_init_amd(c);
652 651
653 /* 652 /*
diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c
index 3225ae6c5180..83741a71558f 100644
--- a/arch/x86/kernel/cpuid.c
+++ b/arch/x86/kernel/cpuid.c
@@ -143,7 +143,7 @@ static int cpuid_device_create(int cpu)
143 143
144 dev = device_create(cpuid_class, NULL, MKDEV(CPUID_MAJOR, cpu), NULL, 144 dev = device_create(cpuid_class, NULL, MKDEV(CPUID_MAJOR, cpu), NULL,
145 "cpu%d", cpu); 145 "cpu%d", cpu);
146 return IS_ERR(dev) ? PTR_ERR(dev) : 0; 146 return PTR_ERR_OR_ZERO(dev);
147} 147}
148 148
149static void cpuid_device_destroy(int cpu) 149static void cpuid_device_destroy(int cpu)
diff --git a/arch/x86/kernel/espfix_64.c b/arch/x86/kernel/espfix_64.c
index 94d857fb1033..f5d0730e7b08 100644
--- a/arch/x86/kernel/espfix_64.c
+++ b/arch/x86/kernel/espfix_64.c
@@ -122,9 +122,6 @@ static void init_espfix_random(void)
122void __init init_espfix_bsp(void) 122void __init init_espfix_bsp(void)
123{ 123{
124 pgd_t *pgd_p; 124 pgd_t *pgd_p;
125 pteval_t ptemask;
126
127 ptemask = __supported_pte_mask;
128 125
129 /* Install the espfix pud into the kernel page directory */ 126 /* Install the espfix pud into the kernel page directory */
130 pgd_p = &init_level4_pgt[pgd_index(ESPFIX_BASE_ADDR)]; 127 pgd_p = &init_level4_pgt[pgd_index(ESPFIX_BASE_ADDR)];
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
index c9603ac80de5..113e70784854 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -22,6 +22,8 @@
22 * an SMP box will direct the access to CPU %d. 22 * an SMP box will direct the access to CPU %d.
23 */ 23 */
24 24
25#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
26
25#include <linux/module.h> 27#include <linux/module.h>
26 28
27#include <linux/types.h> 29#include <linux/types.h>
@@ -50,11 +52,11 @@ static loff_t msr_seek(struct file *file, loff_t offset, int orig)
50 52
51 mutex_lock(&inode->i_mutex); 53 mutex_lock(&inode->i_mutex);
52 switch (orig) { 54 switch (orig) {
53 case 0: 55 case SEEK_SET:
54 file->f_pos = offset; 56 file->f_pos = offset;
55 ret = file->f_pos; 57 ret = file->f_pos;
56 break; 58 break;
57 case 1: 59 case SEEK_CUR:
58 file->f_pos += offset; 60 file->f_pos += offset;
59 ret = file->f_pos; 61 ret = file->f_pos;
60 break; 62 break;
@@ -206,7 +208,7 @@ static int msr_device_create(int cpu)
206 208
207 dev = device_create(msr_class, NULL, MKDEV(MSR_MAJOR, cpu), NULL, 209 dev = device_create(msr_class, NULL, MKDEV(MSR_MAJOR, cpu), NULL,
208 "msr%d", cpu); 210 "msr%d", cpu);
209 return IS_ERR(dev) ? PTR_ERR(dev) : 0; 211 return PTR_ERR_OR_ZERO(dev);
210} 212}
211 213
212static void msr_device_destroy(int cpu) 214static void msr_device_destroy(int cpu)
@@ -248,8 +250,7 @@ static int __init msr_init(void)
248 i = 0; 250 i = 0;
249 251
250 if (__register_chrdev(MSR_MAJOR, 0, NR_CPUS, "cpu/msr", &msr_fops)) { 252 if (__register_chrdev(MSR_MAJOR, 0, NR_CPUS, "cpu/msr", &msr_fops)) {
251 printk(KERN_ERR "msr: unable to get major %d for msr\n", 253 pr_err("unable to get major %d for msr\n", MSR_MAJOR);
252 MSR_MAJOR);
253 err = -EBUSY; 254 err = -EBUSY;
254 goto out; 255 goto out;
255 } 256 }
diff --git a/arch/x86/kernel/sysfb.c b/arch/x86/kernel/sysfb.c
index 193ec2ce46c7..160386e9fc17 100644
--- a/arch/x86/kernel/sysfb.c
+++ b/arch/x86/kernel/sysfb.c
@@ -67,7 +67,7 @@ static __init int sysfb_init(void)
67 67
68 pd = platform_device_register_resndata(NULL, name, 0, 68 pd = platform_device_register_resndata(NULL, name, 0,
69 NULL, 0, si, sizeof(*si)); 69 NULL, 0, si, sizeof(*si));
70 return IS_ERR(pd) ? PTR_ERR(pd) : 0; 70 return PTR_ERR_OR_ZERO(pd);
71} 71}
72 72
73/* must execute after PCI subsystem for EFI quirks */ 73/* must execute after PCI subsystem for EFI quirks */
diff --git a/arch/x86/kernel/sysfb_simplefb.c b/arch/x86/kernel/sysfb_simplefb.c
index 86179d409893..764a29f84de7 100644
--- a/arch/x86/kernel/sysfb_simplefb.c
+++ b/arch/x86/kernel/sysfb_simplefb.c
@@ -88,8 +88,5 @@ __init int create_simplefb(const struct screen_info *si,
88 88
89 pd = platform_device_register_resndata(NULL, "simple-framebuffer", 0, 89 pd = platform_device_register_resndata(NULL, "simple-framebuffer", 0,
90 &res, 1, mode, sizeof(*mode)); 90 &res, 1, mode, sizeof(*mode));
91 if (IS_ERR(pd)) 91 return PTR_ERR_OR_ZERO(pd);
92 return PTR_ERR(pd);
93
94 return 0;
95} 92}