diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/alpha/include/asm/percpu.h | 26 | ||||
-rw-r--r-- | arch/x86/kvm/svm.c | 8 | ||||
-rw-r--r-- | arch/x86/kvm/x86.c | 6 |
3 files changed, 33 insertions, 7 deletions
diff --git a/arch/alpha/include/asm/percpu.h b/arch/alpha/include/asm/percpu.h index e9e0bb5a23bf..06c5c7a4afd3 100644 --- a/arch/alpha/include/asm/percpu.h +++ b/arch/alpha/include/asm/percpu.h | |||
@@ -1,7 +1,9 @@ | |||
1 | #ifndef __ALPHA_PERCPU_H | 1 | #ifndef __ALPHA_PERCPU_H |
2 | #define __ALPHA_PERCPU_H | 2 | #define __ALPHA_PERCPU_H |
3 | |||
3 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
4 | #include <linux/threads.h> | 5 | #include <linux/threads.h> |
6 | #include <linux/percpu-defs.h> | ||
5 | 7 | ||
6 | /* | 8 | /* |
7 | * Determine the real variable name from the name visible in the | 9 | * Determine the real variable name from the name visible in the |
@@ -73,6 +75,28 @@ extern unsigned long __per_cpu_offset[NR_CPUS]; | |||
73 | 75 | ||
74 | #endif /* SMP */ | 76 | #endif /* SMP */ |
75 | 77 | ||
76 | #include <asm-generic/percpu.h> | 78 | #ifdef CONFIG_SMP |
79 | #define PER_CPU_BASE_SECTION ".data.percpu" | ||
80 | #else | ||
81 | #define PER_CPU_BASE_SECTION ".data" | ||
82 | #endif | ||
83 | |||
84 | #ifdef CONFIG_SMP | ||
85 | |||
86 | #ifdef MODULE | ||
87 | #define PER_CPU_SHARED_ALIGNED_SECTION "" | ||
88 | #else | ||
89 | #define PER_CPU_SHARED_ALIGNED_SECTION ".shared_aligned" | ||
90 | #endif | ||
91 | #define PER_CPU_FIRST_SECTION ".first" | ||
92 | |||
93 | #else | ||
94 | |||
95 | #define PER_CPU_SHARED_ALIGNED_SECTION "" | ||
96 | #define PER_CPU_FIRST_SECTION "" | ||
97 | |||
98 | #endif | ||
99 | |||
100 | #define PER_CPU_ATTRIBUTES | ||
77 | 101 | ||
78 | #endif /* __ALPHA_PERCPU_H */ | 102 | #endif /* __ALPHA_PERCPU_H */ |
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 1821c2078199..1f8510c51d6e 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -411,7 +411,6 @@ static __init int svm_hardware_setup(void) | |||
411 | 411 | ||
412 | iopm_va = page_address(iopm_pages); | 412 | iopm_va = page_address(iopm_pages); |
413 | memset(iopm_va, 0xff, PAGE_SIZE * (1 << IOPM_ALLOC_ORDER)); | 413 | memset(iopm_va, 0xff, PAGE_SIZE * (1 << IOPM_ALLOC_ORDER)); |
414 | clear_bit(0x80, iopm_va); /* allow direct access to PC debug port */ | ||
415 | iopm_base = page_to_pfn(iopm_pages) << PAGE_SHIFT; | 414 | iopm_base = page_to_pfn(iopm_pages) << PAGE_SHIFT; |
416 | 415 | ||
417 | if (boot_cpu_has(X86_FEATURE_NX)) | 416 | if (boot_cpu_has(X86_FEATURE_NX)) |
@@ -796,6 +795,11 @@ static void svm_get_segment(struct kvm_vcpu *vcpu, | |||
796 | var->db = (s->attrib >> SVM_SELECTOR_DB_SHIFT) & 1; | 795 | var->db = (s->attrib >> SVM_SELECTOR_DB_SHIFT) & 1; |
797 | var->g = (s->attrib >> SVM_SELECTOR_G_SHIFT) & 1; | 796 | var->g = (s->attrib >> SVM_SELECTOR_G_SHIFT) & 1; |
798 | 797 | ||
798 | /* AMD's VMCB does not have an explicit unusable field, so emulate it | ||
799 | * for cross vendor migration purposes by "not present" | ||
800 | */ | ||
801 | var->unusable = !var->present || (var->type == 0); | ||
802 | |||
799 | switch (seg) { | 803 | switch (seg) { |
800 | case VCPU_SREG_CS: | 804 | case VCPU_SREG_CS: |
801 | /* | 805 | /* |
@@ -827,8 +831,6 @@ static void svm_get_segment(struct kvm_vcpu *vcpu, | |||
827 | var->type |= 0x1; | 831 | var->type |= 0x1; |
828 | break; | 832 | break; |
829 | } | 833 | } |
830 | |||
831 | var->unusable = !var->present; | ||
832 | } | 834 | } |
833 | 835 | ||
834 | static int svm_get_cpl(struct kvm_vcpu *vcpu) | 836 | static int svm_get_cpl(struct kvm_vcpu *vcpu) |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 7c1ce5ac6131..49079a46687b 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -1121,9 +1121,9 @@ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) | |||
1121 | 1121 | ||
1122 | static int is_efer_nx(void) | 1122 | static int is_efer_nx(void) |
1123 | { | 1123 | { |
1124 | u64 efer; | 1124 | unsigned long long efer = 0; |
1125 | 1125 | ||
1126 | rdmsrl(MSR_EFER, efer); | 1126 | rdmsrl_safe(MSR_EFER, &efer); |
1127 | return efer & EFER_NX; | 1127 | return efer & EFER_NX; |
1128 | } | 1128 | } |
1129 | 1129 | ||
@@ -1259,7 +1259,7 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, | |||
1259 | bit(X86_FEATURE_CMOV) | bit(X86_FEATURE_PSE36) | | 1259 | bit(X86_FEATURE_CMOV) | bit(X86_FEATURE_PSE36) | |
1260 | bit(X86_FEATURE_MMX) | bit(X86_FEATURE_FXSR) | | 1260 | bit(X86_FEATURE_MMX) | bit(X86_FEATURE_FXSR) | |
1261 | bit(X86_FEATURE_SYSCALL) | | 1261 | bit(X86_FEATURE_SYSCALL) | |
1262 | (bit(X86_FEATURE_NX) && is_efer_nx()) | | 1262 | (is_efer_nx() ? bit(X86_FEATURE_NX) : 0) | |
1263 | #ifdef CONFIG_X86_64 | 1263 | #ifdef CONFIG_X86_64 |
1264 | bit(X86_FEATURE_LM) | | 1264 | bit(X86_FEATURE_LM) | |
1265 | #endif | 1265 | #endif |