diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-11 19:46:20 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-11 19:46:20 -0500 |
commit | 671d5532aaad777782b66eff71bc4dfad25f942d (patch) | |
tree | fdd480fbd7bd8078c60e1fe3eea98a8cefb8df67 /arch/x86/kernel/cpu/common.c | |
parent | 67c707e451e12f59e57bca6cf33b5803cb74b022 (diff) | |
parent | 0007bccc3cfd1e69deb0fd73ccc426b4cedb061d (diff) |
Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 cpu updates from Ingo Molnar:
"The main changes in this cycle were:
- Improved CPU ID handling code and related enhancements (Borislav
Petkov)
- RDRAND fix (Len Brown)"
* 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86: Replace RDRAND forced-reseed with simple sanity check
x86/MSR: Chop off lower 32-bit value
x86/cpu: Fix MSR value truncation issue
x86/cpu/amd, kvm: Satisfy guest kernel reads of IC_CFG MSR
kvm: Add accessors for guest CPU's family, model, stepping
x86/cpu: Unify CPU family, model, stepping calculation
Diffstat (limited to 'arch/x86/kernel/cpu/common.c')
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 4d5279c95d5f..37830de8f60a 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -581,14 +581,9 @@ void cpu_detect(struct cpuinfo_x86 *c) | |||
581 | u32 junk, tfms, cap0, misc; | 581 | u32 junk, tfms, cap0, misc; |
582 | 582 | ||
583 | cpuid(0x00000001, &tfms, &misc, &junk, &cap0); | 583 | cpuid(0x00000001, &tfms, &misc, &junk, &cap0); |
584 | c->x86 = (tfms >> 8) & 0xf; | 584 | c->x86 = x86_family(tfms); |
585 | c->x86_model = (tfms >> 4) & 0xf; | 585 | c->x86_model = x86_model(tfms); |
586 | c->x86_mask = tfms & 0xf; | 586 | c->x86_mask = x86_stepping(tfms); |
587 | |||
588 | if (c->x86 == 0xf) | ||
589 | c->x86 += (tfms >> 20) & 0xff; | ||
590 | if (c->x86 >= 0x6) | ||
591 | c->x86_model += ((tfms >> 16) & 0xf) << 4; | ||
592 | 587 | ||
593 | if (cap0 & (1<<19)) { | 588 | if (cap0 & (1<<19)) { |
594 | c->x86_clflush_size = ((misc >> 8) & 0xff) * 8; | 589 | c->x86_clflush_size = ((misc >> 8) & 0xff) * 8; |
@@ -1187,7 +1182,7 @@ void syscall_init(void) | |||
1187 | * They both write to the same internal register. STAR allows to | 1182 | * They both write to the same internal register. STAR allows to |
1188 | * set CS/DS but only a 32bit target. LSTAR sets the 64bit rip. | 1183 | * set CS/DS but only a 32bit target. LSTAR sets the 64bit rip. |
1189 | */ | 1184 | */ |
1190 | wrmsrl(MSR_STAR, ((u64)__USER32_CS)<<48 | ((u64)__KERNEL_CS)<<32); | 1185 | wrmsr(MSR_STAR, 0, (__USER32_CS << 16) | __KERNEL_CS); |
1191 | wrmsrl(MSR_LSTAR, (unsigned long)entry_SYSCALL_64); | 1186 | wrmsrl(MSR_LSTAR, (unsigned long)entry_SYSCALL_64); |
1192 | 1187 | ||
1193 | #ifdef CONFIG_IA32_EMULATION | 1188 | #ifdef CONFIG_IA32_EMULATION |