diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-30 18:36:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-30 18:36:45 -0400 |
commit | 1bc87b00556e8f7ba30a1010471951c5b8f71114 (patch) | |
tree | e73c2d187e2dff0df97ed82e32b45e362b923117 /arch/x86/include/asm | |
parent | acff987d94cbdb4049f3706bed1f1792f8ef6837 (diff) | |
parent | f1c1da2bde712812a3e0f9a7a7ebe7a916a4b5f4 (diff) |
Merge branch 'kvm-updates/3.2' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm
* 'kvm-updates/3.2' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm: (75 commits)
KVM: SVM: Keep intercepting task switching with NPT enabled
KVM: s390: implement sigp external call
KVM: s390: fix register setting
KVM: s390: fix return value of kvm_arch_init_vm
KVM: s390: check cpu_id prior to using it
KVM: emulate lapic tsc deadline timer for guest
x86: TSC deadline definitions
KVM: Fix simultaneous NMIs
KVM: x86 emulator: convert push %sreg/pop %sreg to direct decode
KVM: x86 emulator: switch lds/les/lss/lfs/lgs to direct decode
KVM: x86 emulator: streamline decode of segment registers
KVM: x86 emulator: simplify OpMem64 decode
KVM: x86 emulator: switch src decode to decode_operand()
KVM: x86 emulator: qualify OpReg inhibit_byte_regs hack
KVM: x86 emulator: switch OpImmUByte decode to decode_imm()
KVM: x86 emulator: free up some flag bits near src, dst
KVM: x86 emulator: switch src2 to generic decode_operand()
KVM: x86 emulator: expand decode flags to 64 bits
KVM: x86 emulator: split dst decode to a generic decode_operand()
KVM: x86 emulator: move memop, memopp into emulation context
...
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r-- | arch/x86/include/asm/apicdef.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/cpufeature.h | 1 | ||||
-rw-r--r-- | arch/x86/include/asm/kvm_emulate.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/kvm_host.h | 14 | ||||
-rw-r--r-- | arch/x86/include/asm/msr-index.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/vmx.h | 12 |
6 files changed, 29 insertions, 6 deletions
diff --git a/arch/x86/include/asm/apicdef.h b/arch/x86/include/asm/apicdef.h index 34595d5e1038..3925d8007864 100644 --- a/arch/x86/include/asm/apicdef.h +++ b/arch/x86/include/asm/apicdef.h | |||
@@ -100,7 +100,9 @@ | |||
100 | #define APIC_TIMER_BASE_CLKIN 0x0 | 100 | #define APIC_TIMER_BASE_CLKIN 0x0 |
101 | #define APIC_TIMER_BASE_TMBASE 0x1 | 101 | #define APIC_TIMER_BASE_TMBASE 0x1 |
102 | #define APIC_TIMER_BASE_DIV 0x2 | 102 | #define APIC_TIMER_BASE_DIV 0x2 |
103 | #define APIC_LVT_TIMER_ONESHOT (0 << 17) | ||
103 | #define APIC_LVT_TIMER_PERIODIC (1 << 17) | 104 | #define APIC_LVT_TIMER_PERIODIC (1 << 17) |
105 | #define APIC_LVT_TIMER_TSCDEADLINE (2 << 17) | ||
104 | #define APIC_LVT_MASKED (1 << 16) | 106 | #define APIC_LVT_MASKED (1 << 16) |
105 | #define APIC_LVT_LEVEL_TRIGGER (1 << 15) | 107 | #define APIC_LVT_LEVEL_TRIGGER (1 << 15) |
106 | #define APIC_LVT_REMOTE_IRR (1 << 14) | 108 | #define APIC_LVT_REMOTE_IRR (1 << 14) |
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index aa6a488cd075..2f84a433b6a0 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h | |||
@@ -121,6 +121,7 @@ | |||
121 | #define X86_FEATURE_X2APIC (4*32+21) /* x2APIC */ | 121 | #define X86_FEATURE_X2APIC (4*32+21) /* x2APIC */ |
122 | #define X86_FEATURE_MOVBE (4*32+22) /* MOVBE instruction */ | 122 | #define X86_FEATURE_MOVBE (4*32+22) /* MOVBE instruction */ |
123 | #define X86_FEATURE_POPCNT (4*32+23) /* POPCNT instruction */ | 123 | #define X86_FEATURE_POPCNT (4*32+23) /* POPCNT instruction */ |
124 | #define X86_FEATURE_TSC_DEADLINE_TIMER (4*32+24) /* Tsc deadline timer */ | ||
124 | #define X86_FEATURE_AES (4*32+25) /* AES instructions */ | 125 | #define X86_FEATURE_AES (4*32+25) /* AES instructions */ |
125 | #define X86_FEATURE_XSAVE (4*32+26) /* XSAVE/XRSTOR/XSETBV/XGETBV */ | 126 | #define X86_FEATURE_XSAVE (4*32+26) /* XSAVE/XRSTOR/XSETBV/XGETBV */ |
126 | #define X86_FEATURE_OSXSAVE (4*32+27) /* "" XSAVE enabled in the OS */ | 127 | #define X86_FEATURE_OSXSAVE (4*32+27) /* "" XSAVE enabled in the OS */ |
diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h index 6040d115ef51..a026507893e9 100644 --- a/arch/x86/include/asm/kvm_emulate.h +++ b/arch/x86/include/asm/kvm_emulate.h | |||
@@ -262,7 +262,7 @@ struct x86_emulate_ctxt { | |||
262 | struct operand dst; | 262 | struct operand dst; |
263 | bool has_seg_override; | 263 | bool has_seg_override; |
264 | u8 seg_override; | 264 | u8 seg_override; |
265 | unsigned int d; | 265 | u64 d; |
266 | int (*execute)(struct x86_emulate_ctxt *ctxt); | 266 | int (*execute)(struct x86_emulate_ctxt *ctxt); |
267 | int (*check_perm)(struct x86_emulate_ctxt *ctxt); | 267 | int (*check_perm)(struct x86_emulate_ctxt *ctxt); |
268 | /* modrm */ | 268 | /* modrm */ |
@@ -275,6 +275,8 @@ struct x86_emulate_ctxt { | |||
275 | unsigned long _eip; | 275 | unsigned long _eip; |
276 | /* Fields above regs are cleared together. */ | 276 | /* Fields above regs are cleared together. */ |
277 | unsigned long regs[NR_VCPU_REGS]; | 277 | unsigned long regs[NR_VCPU_REGS]; |
278 | struct operand memop; | ||
279 | struct operand *memopp; | ||
278 | struct fetch_cache fetch; | 280 | struct fetch_cache fetch; |
279 | struct read_cache io_read; | 281 | struct read_cache io_read; |
280 | struct read_cache mem_read; | 282 | struct read_cache mem_read; |
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index dd51c83aa5de..b4973f4dab98 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h | |||
@@ -26,7 +26,8 @@ | |||
26 | #include <asm/mtrr.h> | 26 | #include <asm/mtrr.h> |
27 | #include <asm/msr-index.h> | 27 | #include <asm/msr-index.h> |
28 | 28 | ||
29 | #define KVM_MAX_VCPUS 64 | 29 | #define KVM_MAX_VCPUS 254 |
30 | #define KVM_SOFT_MAX_VCPUS 64 | ||
30 | #define KVM_MEMORY_SLOTS 32 | 31 | #define KVM_MEMORY_SLOTS 32 |
31 | /* memory slots that does not exposed to userspace */ | 32 | /* memory slots that does not exposed to userspace */ |
32 | #define KVM_PRIVATE_MEM_SLOTS 4 | 33 | #define KVM_PRIVATE_MEM_SLOTS 4 |
@@ -264,6 +265,7 @@ struct kvm_mmu { | |||
264 | void (*new_cr3)(struct kvm_vcpu *vcpu); | 265 | void (*new_cr3)(struct kvm_vcpu *vcpu); |
265 | void (*set_cr3)(struct kvm_vcpu *vcpu, unsigned long root); | 266 | void (*set_cr3)(struct kvm_vcpu *vcpu, unsigned long root); |
266 | unsigned long (*get_cr3)(struct kvm_vcpu *vcpu); | 267 | unsigned long (*get_cr3)(struct kvm_vcpu *vcpu); |
268 | u64 (*get_pdptr)(struct kvm_vcpu *vcpu, int index); | ||
267 | int (*page_fault)(struct kvm_vcpu *vcpu, gva_t gva, u32 err, | 269 | int (*page_fault)(struct kvm_vcpu *vcpu, gva_t gva, u32 err, |
268 | bool prefault); | 270 | bool prefault); |
269 | void (*inject_page_fault)(struct kvm_vcpu *vcpu, | 271 | void (*inject_page_fault)(struct kvm_vcpu *vcpu, |
@@ -411,8 +413,9 @@ struct kvm_vcpu_arch { | |||
411 | u32 tsc_catchup_mult; | 413 | u32 tsc_catchup_mult; |
412 | s8 tsc_catchup_shift; | 414 | s8 tsc_catchup_shift; |
413 | 415 | ||
414 | bool nmi_pending; | 416 | atomic_t nmi_queued; /* unprocessed asynchronous NMIs */ |
415 | bool nmi_injected; | 417 | unsigned nmi_pending; /* NMI queued after currently running handler */ |
418 | bool nmi_injected; /* Trying to inject an NMI this entry */ | ||
416 | 419 | ||
417 | struct mtrr_state_type mtrr_state; | 420 | struct mtrr_state_type mtrr_state; |
418 | u32 pat; | 421 | u32 pat; |
@@ -628,14 +631,13 @@ struct kvm_x86_ops { | |||
628 | void (*write_tsc_offset)(struct kvm_vcpu *vcpu, u64 offset); | 631 | void (*write_tsc_offset)(struct kvm_vcpu *vcpu, u64 offset); |
629 | 632 | ||
630 | u64 (*compute_tsc_offset)(struct kvm_vcpu *vcpu, u64 target_tsc); | 633 | u64 (*compute_tsc_offset)(struct kvm_vcpu *vcpu, u64 target_tsc); |
634 | u64 (*read_l1_tsc)(struct kvm_vcpu *vcpu); | ||
631 | 635 | ||
632 | void (*get_exit_info)(struct kvm_vcpu *vcpu, u64 *info1, u64 *info2); | 636 | void (*get_exit_info)(struct kvm_vcpu *vcpu, u64 *info1, u64 *info2); |
633 | 637 | ||
634 | int (*check_intercept)(struct kvm_vcpu *vcpu, | 638 | int (*check_intercept)(struct kvm_vcpu *vcpu, |
635 | struct x86_instruction_info *info, | 639 | struct x86_instruction_info *info, |
636 | enum x86_intercept_stage stage); | 640 | enum x86_intercept_stage stage); |
637 | |||
638 | const struct trace_print_flags *exit_reasons_str; | ||
639 | }; | 641 | }; |
640 | 642 | ||
641 | struct kvm_arch_async_pf { | 643 | struct kvm_arch_async_pf { |
@@ -672,6 +674,8 @@ u8 kvm_get_guest_memory_type(struct kvm_vcpu *vcpu, gfn_t gfn); | |||
672 | 674 | ||
673 | extern bool tdp_enabled; | 675 | extern bool tdp_enabled; |
674 | 676 | ||
677 | u64 vcpu_tsc_khz(struct kvm_vcpu *vcpu); | ||
678 | |||
675 | /* control of guest tsc rate supported? */ | 679 | /* control of guest tsc rate supported? */ |
676 | extern bool kvm_has_tsc_control; | 680 | extern bool kvm_has_tsc_control; |
677 | /* minimum supported tsc_khz for guests */ | 681 | /* minimum supported tsc_khz for guests */ |
diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h index d52609aeeab8..a6962d9161a0 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h | |||
@@ -229,6 +229,8 @@ | |||
229 | #define MSR_IA32_APICBASE_ENABLE (1<<11) | 229 | #define MSR_IA32_APICBASE_ENABLE (1<<11) |
230 | #define MSR_IA32_APICBASE_BASE (0xfffff<<12) | 230 | #define MSR_IA32_APICBASE_BASE (0xfffff<<12) |
231 | 231 | ||
232 | #define MSR_IA32_TSCDEADLINE 0x000006e0 | ||
233 | |||
232 | #define MSR_IA32_UCODE_WRITE 0x00000079 | 234 | #define MSR_IA32_UCODE_WRITE 0x00000079 |
233 | #define MSR_IA32_UCODE_REV 0x0000008b | 235 | #define MSR_IA32_UCODE_REV 0x0000008b |
234 | 236 | ||
diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h index 2caf290e9895..31f180c21ce9 100644 --- a/arch/x86/include/asm/vmx.h +++ b/arch/x86/include/asm/vmx.h | |||
@@ -350,6 +350,18 @@ enum vmcs_field { | |||
350 | #define DEBUG_REG_ACCESS_REG(eq) (((eq) >> 8) & 0xf) /* 11:8, general purpose reg. */ | 350 | #define DEBUG_REG_ACCESS_REG(eq) (((eq) >> 8) & 0xf) /* 11:8, general purpose reg. */ |
351 | 351 | ||
352 | 352 | ||
353 | /* | ||
354 | * Exit Qualifications for APIC-Access | ||
355 | */ | ||
356 | #define APIC_ACCESS_OFFSET 0xfff /* 11:0, offset within the APIC page */ | ||
357 | #define APIC_ACCESS_TYPE 0xf000 /* 15:12, access type */ | ||
358 | #define TYPE_LINEAR_APIC_INST_READ (0 << 12) | ||
359 | #define TYPE_LINEAR_APIC_INST_WRITE (1 << 12) | ||
360 | #define TYPE_LINEAR_APIC_INST_FETCH (2 << 12) | ||
361 | #define TYPE_LINEAR_APIC_EVENT (3 << 12) | ||
362 | #define TYPE_PHYSICAL_APIC_EVENT (10 << 12) | ||
363 | #define TYPE_PHYSICAL_APIC_INST (15 << 12) | ||
364 | |||
353 | /* segment AR */ | 365 | /* segment AR */ |
354 | #define SEGMENT_AR_L_MASK (1 << 13) | 366 | #define SEGMENT_AR_L_MASK (1 << 13) |
355 | 367 | ||