diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-19 16:53:21 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-19 16:53:21 -0400 |
| commit | 88d53766bd0f3bc6e46a0dff25be147a2b98c511 (patch) | |
| tree | dc0500d2685029f47629cffee766cc0b2cc3562a | |
| parent | 860da5e578c25d1ab4528c0d1ad13f9969e3490f (diff) | |
| parent | 54aaacee35afd594bba3244c20b02cc98d80a961 (diff) | |
Merge branch 'kvm-updates-2.6.26' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm
* 'kvm-updates-2.6.26' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm:
KVM: LAPIC: ignore pending timers if LVTT is disabled
KVM: Update MAINTAINERS for new mailing lists
KVM: Fix kvm_vcpu_block() task state race
KVM: ia64: Set KVM_IOAPIC_NUM_PINS to 48
KVM: ia64: fix GVMM module including position-dependent objects
KVM: ia64: Define new kvm_fpreg struture to replace ia64_fpreg
KVM: PIT: take inject_pending into account when emulating hlt
s390: KVM guest: fix compile error
KVM: x86 emulator: fix writes to registers with modrm encodings
| -rw-r--r-- | MAINTAINERS | 14 | ||||
| -rw-r--r-- | arch/ia64/kvm/Makefile | 3 | ||||
| -rw-r--r-- | arch/ia64/kvm/memcpy.S | 1 | ||||
| -rw-r--r-- | arch/ia64/kvm/memset.S | 1 | ||||
| -rw-r--r-- | arch/x86/kvm/i8254.c | 2 | ||||
| -rw-r--r-- | arch/x86/kvm/lapic.c | 2 | ||||
| -rw-r--r-- | arch/x86/kvm/x86_emulate.c | 7 | ||||
| -rw-r--r-- | drivers/s390/kvm/kvm_virtio.c | 40 | ||||
| -rw-r--r-- | include/asm-ia64/kvm.h | 12 | ||||
| -rw-r--r-- | include/asm-x86/kvm_x86_emulate.h | 1 | ||||
| -rw-r--r-- | virt/kvm/kvm_main.c | 29 |
11 files changed, 65 insertions, 47 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 915ad48d8bce..36e330c6f183 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -2352,24 +2352,24 @@ S: Supported | |||
| 2352 | KERNEL VIRTUAL MACHINE (KVM) | 2352 | KERNEL VIRTUAL MACHINE (KVM) |
| 2353 | P: Avi Kivity | 2353 | P: Avi Kivity |
| 2354 | M: avi@qumranet.com | 2354 | M: avi@qumranet.com |
| 2355 | L: kvm-devel@lists.sourceforge.net | 2355 | L: kvm@vger.kernel.org |
| 2356 | W: kvm.sourceforge.net | 2356 | W: http://kvm.qumranet.com |
| 2357 | S: Supported | 2357 | S: Supported |
| 2358 | 2358 | ||
| 2359 | KERNEL VIRTUAL MACHINE (KVM) FOR POWERPC | 2359 | KERNEL VIRTUAL MACHINE (KVM) FOR POWERPC |
| 2360 | P: Hollis Blanchard | 2360 | P: Hollis Blanchard |
| 2361 | M: hollisb@us.ibm.com | 2361 | M: hollisb@us.ibm.com |
| 2362 | L: kvm-ppc-devel@lists.sourceforge.net | 2362 | L: kvm-ppc@vger.kernel.org |
| 2363 | W: kvm.sourceforge.net | 2363 | W: http://kvm.qumranet.com |
| 2364 | S: Supported | 2364 | S: Supported |
| 2365 | 2365 | ||
| 2366 | KERNEL VIRTUAL MACHINE For Itanium(KVM/IA64) | 2366 | KERNEL VIRTUAL MACHINE For Itanium (KVM/IA64) |
| 2367 | P: Anthony Xu | 2367 | P: Anthony Xu |
| 2368 | M: anthony.xu@intel.com | 2368 | M: anthony.xu@intel.com |
| 2369 | P: Xiantao Zhang | 2369 | P: Xiantao Zhang |
| 2370 | M: xiantao.zhang@intel.com | 2370 | M: xiantao.zhang@intel.com |
| 2371 | L: kvm-ia64-devel@lists.sourceforge.net | 2371 | L: kvm-ia64@vger.kernel.org |
| 2372 | W: kvm.sourceforge.net | 2372 | W: http://kvm.qumranet.com |
| 2373 | S: Supported | 2373 | S: Supported |
| 2374 | 2374 | ||
| 2375 | KERNEL VIRTUAL MACHINE for s390 (KVM/s390) | 2375 | KERNEL VIRTUAL MACHINE for s390 (KVM/s390) |
diff --git a/arch/ia64/kvm/Makefile b/arch/ia64/kvm/Makefile index 52353397a1a4..112791dd2542 100644 --- a/arch/ia64/kvm/Makefile +++ b/arch/ia64/kvm/Makefile | |||
| @@ -7,7 +7,6 @@ offsets-file := asm-offsets.h | |||
| 7 | always := $(offsets-file) | 7 | always := $(offsets-file) |
| 8 | targets := $(offsets-file) | 8 | targets := $(offsets-file) |
| 9 | targets += arch/ia64/kvm/asm-offsets.s | 9 | targets += arch/ia64/kvm/asm-offsets.s |
| 10 | clean-files := $(addprefix $(objtree)/,$(targets) $(obj)/memcpy.S $(obj)/memset.S) | ||
| 11 | 10 | ||
| 12 | # Default sed regexp - multiline due to syntax constraints | 11 | # Default sed regexp - multiline due to syntax constraints |
| 13 | define sed-y | 12 | define sed-y |
| @@ -54,5 +53,5 @@ EXTRA_CFLAGS_vcpu.o += -mfixed-range=f2-f5,f12-f127 | |||
| 54 | kvm-intel-objs = vmm.o vmm_ivt.o trampoline.o vcpu.o optvfault.o mmio.o \ | 53 | kvm-intel-objs = vmm.o vmm_ivt.o trampoline.o vcpu.o optvfault.o mmio.o \ |
| 55 | vtlb.o process.o | 54 | vtlb.o process.o |
| 56 | #Add link memcpy and memset to avoid possible structure assignment error | 55 | #Add link memcpy and memset to avoid possible structure assignment error |
| 57 | kvm-intel-objs += ../lib/memset.o ../lib/memcpy.o | 56 | kvm-intel-objs += memcpy.o memset.o |
| 58 | obj-$(CONFIG_KVM_INTEL) += kvm-intel.o | 57 | obj-$(CONFIG_KVM_INTEL) += kvm-intel.o |
diff --git a/arch/ia64/kvm/memcpy.S b/arch/ia64/kvm/memcpy.S new file mode 100644 index 000000000000..c04cdbe9f80f --- /dev/null +++ b/arch/ia64/kvm/memcpy.S | |||
| @@ -0,0 +1 @@ | |||
| #include "../lib/memcpy.S" | |||
diff --git a/arch/ia64/kvm/memset.S b/arch/ia64/kvm/memset.S new file mode 100644 index 000000000000..83c3066d844a --- /dev/null +++ b/arch/ia64/kvm/memset.S | |||
| @@ -0,0 +1 @@ | |||
| #include "../lib/memset.S" | |||
diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index 3324d90038e4..7c077a9d9777 100644 --- a/arch/x86/kvm/i8254.c +++ b/arch/x86/kvm/i8254.c | |||
| @@ -216,7 +216,7 @@ int pit_has_pending_timer(struct kvm_vcpu *vcpu) | |||
| 216 | { | 216 | { |
| 217 | struct kvm_pit *pit = vcpu->kvm->arch.vpit; | 217 | struct kvm_pit *pit = vcpu->kvm->arch.vpit; |
| 218 | 218 | ||
| 219 | if (pit && vcpu->vcpu_id == 0) | 219 | if (pit && vcpu->vcpu_id == 0 && pit->pit_state.inject_pending) |
| 220 | return atomic_read(&pit->pit_state.pit_timer.pending); | 220 | return atomic_read(&pit->pit_state.pit_timer.pending); |
| 221 | 221 | ||
| 222 | return 0; | 222 | return 0; |
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 36809d79788b..c297c50eba63 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c | |||
| @@ -957,7 +957,7 @@ int apic_has_pending_timer(struct kvm_vcpu *vcpu) | |||
| 957 | { | 957 | { |
| 958 | struct kvm_lapic *lapic = vcpu->arch.apic; | 958 | struct kvm_lapic *lapic = vcpu->arch.apic; |
| 959 | 959 | ||
| 960 | if (lapic) | 960 | if (lapic && apic_enabled(lapic) && apic_lvt_enabled(lapic, APIC_LVTT)) |
| 961 | return atomic_read(&lapic->timer.pending); | 961 | return atomic_read(&lapic->timer.pending); |
| 962 | 962 | ||
| 963 | return 0; | 963 | return 0; |
diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c index f2a696d6a243..8a96320ab071 100644 --- a/arch/x86/kvm/x86_emulate.c +++ b/arch/x86/kvm/x86_emulate.c | |||
| @@ -677,8 +677,9 @@ static int decode_modrm(struct x86_emulate_ctxt *ctxt, | |||
| 677 | c->use_modrm_ea = 1; | 677 | c->use_modrm_ea = 1; |
| 678 | 678 | ||
| 679 | if (c->modrm_mod == 3) { | 679 | if (c->modrm_mod == 3) { |
| 680 | c->modrm_val = *(unsigned long *) | 680 | c->modrm_ptr = decode_register(c->modrm_rm, |
| 681 | decode_register(c->modrm_rm, c->regs, c->d & ByteOp); | 681 | c->regs, c->d & ByteOp); |
| 682 | c->modrm_val = *(unsigned long *)c->modrm_ptr; | ||
| 682 | return rc; | 683 | return rc; |
| 683 | } | 684 | } |
| 684 | 685 | ||
| @@ -1005,6 +1006,7 @@ done_prefixes: | |||
| 1005 | if ((c->d & ModRM) && c->modrm_mod == 3) { | 1006 | if ((c->d & ModRM) && c->modrm_mod == 3) { |
| 1006 | c->src.type = OP_REG; | 1007 | c->src.type = OP_REG; |
| 1007 | c->src.val = c->modrm_val; | 1008 | c->src.val = c->modrm_val; |
| 1009 | c->src.ptr = c->modrm_ptr; | ||
| 1008 | break; | 1010 | break; |
| 1009 | } | 1011 | } |
| 1010 | c->src.type = OP_MEM; | 1012 | c->src.type = OP_MEM; |
| @@ -1049,6 +1051,7 @@ done_prefixes: | |||
| 1049 | if ((c->d & ModRM) && c->modrm_mod == 3) { | 1051 | if ((c->d & ModRM) && c->modrm_mod == 3) { |
| 1050 | c->dst.type = OP_REG; | 1052 | c->dst.type = OP_REG; |
| 1051 | c->dst.val = c->dst.orig_val = c->modrm_val; | 1053 | c->dst.val = c->dst.orig_val = c->modrm_val; |
| 1054 | c->dst.ptr = c->modrm_ptr; | ||
| 1052 | break; | 1055 | break; |
| 1053 | } | 1056 | } |
| 1054 | c->dst.type = OP_MEM; | 1057 | c->dst.type = OP_MEM; |
diff --git a/drivers/s390/kvm/kvm_virtio.c b/drivers/s390/kvm/kvm_virtio.c index 47a7e6200b26..9f55ce6f3c78 100644 --- a/drivers/s390/kvm/kvm_virtio.c +++ b/drivers/s390/kvm/kvm_virtio.c | |||
| @@ -78,27 +78,32 @@ static unsigned desc_size(const struct kvm_device_desc *desc) | |||
| 78 | + desc->config_len; | 78 | + desc->config_len; |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | /* | 81 | /* This gets the device's feature bits. */ |
| 82 | * This tests (and acknowleges) a feature bit. | 82 | static u32 kvm_get_features(struct virtio_device *vdev) |
| 83 | */ | ||
| 84 | static bool kvm_feature(struct virtio_device *vdev, unsigned fbit) | ||
| 85 | { | 83 | { |
| 84 | unsigned int i; | ||
| 85 | u32 features = 0; | ||
| 86 | struct kvm_device_desc *desc = to_kvmdev(vdev)->desc; | 86 | struct kvm_device_desc *desc = to_kvmdev(vdev)->desc; |
| 87 | u8 *features; | 87 | u8 *in_features = kvm_vq_features(desc); |
| 88 | 88 | ||
| 89 | if (fbit / 8 > desc->feature_len) | 89 | for (i = 0; i < min(desc->feature_len * 8, 32); i++) |
| 90 | return false; | 90 | if (in_features[i / 8] & (1 << (i % 8))) |
| 91 | features |= (1 << i); | ||
| 92 | return features; | ||
| 93 | } | ||
| 91 | 94 | ||
| 92 | features = kvm_vq_features(desc); | 95 | static void kvm_set_features(struct virtio_device *vdev, u32 features) |
| 93 | if (!(features[fbit / 8] & (1 << (fbit % 8)))) | 96 | { |
| 94 | return false; | 97 | unsigned int i; |
| 98 | struct kvm_device_desc *desc = to_kvmdev(vdev)->desc; | ||
| 99 | /* Second half of bitmap is features we accept. */ | ||
| 100 | u8 *out_features = kvm_vq_features(desc) + desc->feature_len; | ||
| 95 | 101 | ||
| 96 | /* | 102 | memset(out_features, 0, desc->feature_len); |
| 97 | * We set the matching bit in the other half of the bitmap to tell the | 103 | for (i = 0; i < min(desc->feature_len * 8, 32); i++) { |
| 98 | * Host we want to use this feature. | 104 | if (features & (1 << i)) |
| 99 | */ | 105 | out_features[i / 8] |= (1 << (i % 8)); |
| 100 | features[desc->feature_len + fbit / 8] |= (1 << (fbit % 8)); | ||
