diff --git a/[refs] b/[refs] index be6eb6d17175..749c98f01734 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 88d53766bd0f3bc6e46a0dff25be147a2b98c511 +refs/heads/master: 7a936ce71eed7b887b8a0d6c54dd8a9072f71c9f diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index 36e330c6f183..915ad48d8bce 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -2352,24 +2352,24 @@ S: Supported KERNEL VIRTUAL MACHINE (KVM) P: Avi Kivity M: avi@qumranet.com -L: kvm@vger.kernel.org -W: http://kvm.qumranet.com +L: kvm-devel@lists.sourceforge.net +W: kvm.sourceforge.net S: Supported KERNEL VIRTUAL MACHINE (KVM) FOR POWERPC P: Hollis Blanchard M: hollisb@us.ibm.com -L: kvm-ppc@vger.kernel.org -W: http://kvm.qumranet.com +L: kvm-ppc-devel@lists.sourceforge.net +W: kvm.sourceforge.net S: Supported -KERNEL VIRTUAL MACHINE For Itanium (KVM/IA64) +KERNEL VIRTUAL MACHINE For Itanium(KVM/IA64) P: Anthony Xu M: anthony.xu@intel.com P: Xiantao Zhang M: xiantao.zhang@intel.com -L: kvm-ia64@vger.kernel.org -W: http://kvm.qumranet.com +L: kvm-ia64-devel@lists.sourceforge.net +W: kvm.sourceforge.net S: Supported KERNEL VIRTUAL MACHINE for s390 (KVM/s390) diff --git a/trunk/arch/ia64/kvm/Makefile b/trunk/arch/ia64/kvm/Makefile index 112791dd2542..52353397a1a4 100644 --- a/trunk/arch/ia64/kvm/Makefile +++ b/trunk/arch/ia64/kvm/Makefile @@ -7,6 +7,7 @@ offsets-file := asm-offsets.h always := $(offsets-file) targets := $(offsets-file) targets += arch/ia64/kvm/asm-offsets.s +clean-files := $(addprefix $(objtree)/,$(targets) $(obj)/memcpy.S $(obj)/memset.S) # Default sed regexp - multiline due to syntax constraints define sed-y @@ -53,5 +54,5 @@ EXTRA_CFLAGS_vcpu.o += -mfixed-range=f2-f5,f12-f127 kvm-intel-objs = vmm.o vmm_ivt.o trampoline.o vcpu.o optvfault.o mmio.o \ vtlb.o process.o #Add link memcpy and memset to avoid possible structure assignment error -kvm-intel-objs += memcpy.o memset.o +kvm-intel-objs += ../lib/memset.o ../lib/memcpy.o obj-$(CONFIG_KVM_INTEL) += kvm-intel.o diff --git a/trunk/arch/ia64/kvm/memcpy.S b/trunk/arch/ia64/kvm/memcpy.S deleted file mode 100644 index c04cdbe9f80f..000000000000 --- a/trunk/arch/ia64/kvm/memcpy.S +++ /dev/null @@ -1 +0,0 @@ -#include "../lib/memcpy.S" diff --git a/trunk/arch/ia64/kvm/memset.S b/trunk/arch/ia64/kvm/memset.S deleted file mode 100644 index 83c3066d844a..000000000000 --- a/trunk/arch/ia64/kvm/memset.S +++ /dev/null @@ -1 +0,0 @@ -#include "../lib/memset.S" diff --git a/trunk/arch/x86/kvm/i8254.c b/trunk/arch/x86/kvm/i8254.c index 7c077a9d9777..3324d90038e4 100644 --- a/trunk/arch/x86/kvm/i8254.c +++ b/trunk/arch/x86/kvm/i8254.c @@ -216,7 +216,7 @@ int pit_has_pending_timer(struct kvm_vcpu *vcpu) { struct kvm_pit *pit = vcpu->kvm->arch.vpit; - if (pit && vcpu->vcpu_id == 0 && pit->pit_state.inject_pending) + if (pit && vcpu->vcpu_id == 0) return atomic_read(&pit->pit_state.pit_timer.pending); return 0; diff --git a/trunk/arch/x86/kvm/lapic.c b/trunk/arch/x86/kvm/lapic.c index c297c50eba63..36809d79788b 100644 --- a/trunk/arch/x86/kvm/lapic.c +++ b/trunk/arch/x86/kvm/lapic.c @@ -957,7 +957,7 @@ int apic_has_pending_timer(struct kvm_vcpu *vcpu) { struct kvm_lapic *lapic = vcpu->arch.apic; - if (lapic && apic_enabled(lapic) && apic_lvt_enabled(lapic, APIC_LVTT)) + if (lapic) return atomic_read(&lapic->timer.pending); return 0; diff --git a/trunk/arch/x86/kvm/x86_emulate.c b/trunk/arch/x86/kvm/x86_emulate.c index 8a96320ab071..f2a696d6a243 100644 --- a/trunk/arch/x86/kvm/x86_emulate.c +++ b/trunk/arch/x86/kvm/x86_emulate.c @@ -677,9 +677,8 @@ static int decode_modrm(struct x86_emulate_ctxt *ctxt, c->use_modrm_ea = 1; if (c->modrm_mod == 3) { - c->modrm_ptr = decode_register(c->modrm_rm, - c->regs, c->d & ByteOp); - c->modrm_val = *(unsigned long *)c->modrm_ptr; + c->modrm_val = *(unsigned long *) + decode_register(c->modrm_rm, c->regs, c->d & ByteOp); return rc; } @@ -1006,7 +1005,6 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) if ((c->d & ModRM) && c->modrm_mod == 3) { c->src.type = OP_REG; c->src.val = c->modrm_val; - c->src.ptr = c->modrm_ptr; break; } c->src.type = OP_MEM; @@ -1051,7 +1049,6 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) if ((c->d & ModRM) && c->modrm_mod == 3) { c->dst.type = OP_REG; c->dst.val = c->dst.orig_val = c->modrm_val; - c->dst.ptr = c->modrm_ptr; break; } c->dst.type = OP_MEM; diff --git a/trunk/drivers/s390/kvm/kvm_virtio.c b/trunk/drivers/s390/kvm/kvm_virtio.c index 9f55ce6f3c78..47a7e6200b26 100644 --- a/trunk/drivers/s390/kvm/kvm_virtio.c +++ b/trunk/drivers/s390/kvm/kvm_virtio.c @@ -78,32 +78,27 @@ static unsigned desc_size(const struct kvm_device_desc *desc) + desc->config_len; } -/* This gets the device's feature bits. */ -static u32 kvm_get_features(struct virtio_device *vdev) +/* + * This tests (and acknowleges) a feature bit. + */ +static bool kvm_feature(struct virtio_device *vdev, unsigned fbit) { - unsigned int i; - u32 features = 0; struct kvm_device_desc *desc = to_kvmdev(vdev)->desc; - u8 *in_features = kvm_vq_features(desc); + u8 *features; - for (i = 0; i < min(desc->feature_len * 8, 32); i++) - if (in_features[i / 8] & (1 << (i % 8))) - features |= (1 << i); - return features; -} + if (fbit / 8 > desc->feature_len) + return false; -static void kvm_set_features(struct virtio_device *vdev, u32 features) -{ - unsigned int i; - struct kvm_device_desc *desc = to_kvmdev(vdev)->desc; - /* Second half of bitmap is features we accept. */ - u8 *out_features = kvm_vq_features(desc) + desc->feature_len; + features = kvm_vq_features(desc); + if (!(features[fbit / 8] & (1 << (fbit % 8)))) + return false; - memset(out_features, 0, desc->feature_len); - for (i = 0; i < min(desc->feature_len * 8, 32); i++) { - if (features & (1 << i)) - out_features[i / 8] |= (1 << (i % 8)); - } + /* + * We set the matching bit in the other half of the bitmap to tell the + * Host we want to use this feature. + */ + features[desc->feature_len + fbit / 8] |= (1 << (fbit % 8)); + return true; } /* @@ -226,8 +221,7 @@ static void kvm_del_vq(struct virtqueue *vq) * The config ops structure as defined by virtio config */ static struct virtio_config_ops kvm_vq_configspace_ops = { - .get_features = kvm_get_features, - .set_features = kvm_set_features, + .feature = kvm_feature, .get = kvm_get, .set = kvm_set, .get_status = kvm_get_status, diff --git a/trunk/fs/dlm/lowcomms.c b/trunk/fs/dlm/lowcomms.c index 7c1e5e5cccd8..c7d232a9ae12 100644 --- a/trunk/fs/dlm/lowcomms.c +++ b/trunk/fs/dlm/lowcomms.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include @@ -138,7 +139,7 @@ static struct workqueue_struct *recv_workqueue; static struct workqueue_struct *send_workqueue; static DEFINE_IDR(connections_idr); -static DECLARE_MUTEX(connections_lock); +static DEFINE_MUTEX(connections_lock); static int max_nodeid; static struct kmem_cache *con_cache; @@ -205,9 +206,9 @@ static struct connection *nodeid2con(int nodeid, gfp_t allocation) { struct connection *con; - down(&connections_lock); + mutex_lock(&connections_lock); con = __nodeid2con(nodeid, allocation); - up(&connections_lock); + mutex_unlock(&connections_lock); return con; } @@ -218,15 +219,15 @@ static struct connection *assoc2con(int assoc_id) int i; struct connection *con; - down(&connections_lock); + mutex_lock(&connections_lock); for (i=0; i<=max_nodeid; i++) { con = __nodeid2con(i, 0); if (con && con->sctp_assoc == assoc_id) { - up(&connections_lock); + mutex_unlock(&connections_lock); return con; } } - up(&connections_lock); + mutex_unlock(&connections_lock); return NULL; } @@ -381,7 +382,7 @@ static void sctp_init_failed(void) int i; struct connection *con; - down(&connections_lock); + mutex_lock(&connections_lock); for (i=1; i<=max_nodeid; i++) { con = __nodeid2con(i, 0); if (!con) @@ -393,7 +394,7 @@ static void sctp_init_failed(void) } } } - up(&connections_lock); + mutex_unlock(&connections_lock); } /* Something happened to an association */ @@ -1417,7 +1418,7 @@ void dlm_lowcomms_stop(void) /* Set all the flags to prevent any socket activity. */ - down(&connections_lock); + mutex_lock(&connections_lock); for (i = 0; i <= max_nodeid; i++) { con = __nodeid2con(i, 0); if (con) { @@ -1426,11 +1427,11 @@ void dlm_lowcomms_stop(void) con->sock->sk->sk_user_data = NULL; } } - up(&connections_lock); + mutex_unlock(&connections_lock); work_stop(); - down(&connections_lock); + mutex_lock(&connections_lock); clean_writequeues(); for (i = 0; i <= max_nodeid; i++) { @@ -1443,7 +1444,7 @@ void dlm_lowcomms_stop(void) } } max_nodeid = 0; - up(&connections_lock); + mutex_unlock(&connections_lock); kmem_cache_destroy(con_cache); idr_init(&connections_idr); } diff --git a/trunk/include/asm-ia64/kvm.h b/trunk/include/asm-ia64/kvm.h index 3f6a090cbd9a..eb2d3559d089 100644 --- a/trunk/include/asm-ia64/kvm.h +++ b/trunk/include/asm-ia64/kvm.h @@ -22,13 +22,14 @@ */ #include +#include #include /* Architectural interrupt line count. */ #define KVM_NR_INTERRUPTS 256 -#define KVM_IOAPIC_NUM_PINS 48 +#define KVM_IOAPIC_NUM_PINS 24 struct kvm_ioapic_state { __u64 base_address; @@ -60,13 +61,6 @@ struct kvm_ioapic_state { #define KVM_CONTEXT_SIZE 8*1024 -struct kvm_fpreg { - union { - unsigned long bits[2]; - long double __dummy; /* force 16-byte alignment */ - } u; -}; - union context { /* 8K size */ char dummy[KVM_CONTEXT_SIZE]; @@ -83,7 +77,7 @@ union context { unsigned long ibr[8]; unsigned long dbr[8]; unsigned long pkr[8]; - struct kvm_fpreg fr[128]; + struct ia64_fpreg fr[128]; }; }; diff --git a/trunk/include/asm-x86/kvm_x86_emulate.h b/trunk/include/asm-x86/kvm_x86_emulate.h index b877bbd2d3a7..d6337f941c98 100644 --- a/trunk/include/asm-x86/kvm_x86_emulate.h +++ b/trunk/include/asm-x86/kvm_x86_emulate.h @@ -135,7 +135,6 @@ struct decode_cache { u8 modrm_rm; u8 use_modrm_ea; unsigned long modrm_ea; - void *modrm_ptr; unsigned long modrm_val; struct fetch_cache fetch; }; diff --git a/trunk/virt/kvm/kvm_main.c b/trunk/virt/kvm/kvm_main.c index 2d29e260da3d..f7ba099049ea 100644 --- a/trunk/virt/kvm/kvm_main.c +++ b/trunk/virt/kvm/kvm_main.c @@ -758,26 +758,25 @@ void mark_page_dirty(struct kvm *kvm, gfn_t gfn) */ void kvm_vcpu_block(struct kvm_vcpu *vcpu) { - DEFINE_WAIT(wait); - - for (;;) { - prepare_to_wait(&vcpu->wq, &wait, TASK_INTERRUPTIBLE); - - if (kvm_cpu_has_interrupt(vcpu)) - break; - if (kvm_cpu_has_pending_timer(vcpu)) - break; - if (kvm_arch_vcpu_runnable(vcpu)) - break; - if (signal_pending(current)) - break; - + DECLARE_WAITQUEUE(wait, current); + + add_wait_queue(&vcpu->wq, &wait); + + /* + * We will block until either an interrupt or a signal wakes us up + */ + while (!kvm_cpu_has_interrupt(vcpu) + && !kvm_cpu_has_pending_timer(vcpu) + && !signal_pending(current) + && !kvm_arch_vcpu_runnable(vcpu)) { + set_current_state(TASK_INTERRUPTIBLE); vcpu_put(vcpu); schedule(); vcpu_load(vcpu); } - finish_wait(&vcpu->wq, &wait); + __set_current_state(TASK_RUNNING); + remove_wait_queue(&vcpu->wq, &wait); } void kvm_resched(struct kvm_vcpu *vcpu)