Merge branch 'kvm-updates-2.6.26' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 19 May 2008 20:53:21 +0000 (13:53 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 19 May 2008 20:53:21 +0000 (13:53 -0700)
* '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

MAINTAINERS
arch/ia64/kvm/Makefile
arch/ia64/kvm/memcpy.S [new file with mode: 0644]
arch/ia64/kvm/memset.S [new file with mode: 0644]
arch/x86/kvm/i8254.c
arch/x86/kvm/lapic.c
arch/x86/kvm/x86_emulate.c
drivers/s390/kvm/kvm_virtio.c
include/asm-ia64/kvm.h
include/asm-x86/kvm_x86_emulate.h
virt/kvm/kvm_main.c

index 915ad48d8bce09e64819bfe2d768cad97f31ddf1..36e330c6f1838f0d6f73907abdbfc9d64634640f 100644 (file)
@@ -2352,24 +2352,24 @@ S:      Supported
 KERNEL VIRTUAL MACHINE (KVM)
 P:     Avi Kivity
 M:     avi@qumranet.com
-L:     kvm-devel@lists.sourceforge.net
-W:     kvm.sourceforge.net
+L:     kvm@vger.kernel.org
+W:     http://kvm.qumranet.com
 S:     Supported
 
 KERNEL VIRTUAL MACHINE (KVM) FOR POWERPC
 P:     Hollis Blanchard
 M:     hollisb@us.ibm.com
-L:     kvm-ppc-devel@lists.sourceforge.net
-W:     kvm.sourceforge.net
+L:     kvm-ppc@vger.kernel.org
+W:     http://kvm.qumranet.com
 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-devel@lists.sourceforge.net
-W:     kvm.sourceforge.net
+L:     kvm-ia64@vger.kernel.org
+W:     http://kvm.qumranet.com
 S:     Supported
 
 KERNEL VIRTUAL MACHINE for s390 (KVM/s390)
index 52353397a1a4b94d36f167680ffffa7822ca326c..112791dd2542b19145155d4285669012fabe94ff 100644 (file)
@@ -7,7 +7,6 @@ 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
@@ -54,5 +53,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 += ../lib/memset.o ../lib/memcpy.o
+kvm-intel-objs += memcpy.o memset.o
 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 (file)
index 0000000..c04cdbe
--- /dev/null
@@ -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 (file)
index 0000000..83c3066
--- /dev/null
@@ -0,0 +1 @@
+#include "../lib/memset.S"
index 3324d90038e438ab1361d53f31be78948d72aba8..7c077a9d97770c8faee45123b9c049eeb8b33465 100644 (file)
@@ -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)
+       if (pit && vcpu->vcpu_id == 0 && pit->pit_state.inject_pending)
                return atomic_read(&pit->pit_state.pit_timer.pending);
 
        return 0;
index 36809d79788bedffcd8332609c7313175aa09e3a..c297c50eba63535968f72c1596d6a969fb4eb9c9 100644 (file)
@@ -957,7 +957,7 @@ int apic_has_pending_timer(struct kvm_vcpu *vcpu)
 {
        struct kvm_lapic *lapic = vcpu->arch.apic;
 
-       if (lapic)
+       if (lapic && apic_enabled(lapic) && apic_lvt_enabled(lapic, APIC_LVTT))
                return atomic_read(&lapic->timer.pending);
 
        return 0;
index f2a696d6a24383b893504be0eb7a2a904d7abab3..8a96320ab071b06f1d3102518b55877d297517b8 100644 (file)
@@ -677,8 +677,9 @@ static int decode_modrm(struct x86_emulate_ctxt *ctxt,
        c->use_modrm_ea = 1;
 
        if (c->modrm_mod == 3) {
-               c->modrm_val = *(unsigned long *)
-                       decode_register(c->modrm_rm, c->regs, c->d & ByteOp);
+               c->modrm_ptr = decode_register(c->modrm_rm,
+                                              c->regs, c->d & ByteOp);
+               c->modrm_val = *(unsigned long *)c->modrm_ptr;
                return rc;
        }
 
@@ -1005,6 +1006,7 @@ done_prefixes:
                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;
@@ -1049,6 +1051,7 @@ done_prefixes:
                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;
index 47a7e6200b262f660c4471cc8c23bfccd32203c2..9f55ce6f3c7817380f87a429ae74d0f071fa3047 100644 (file)
@@ -78,27 +78,32 @@ static unsigned desc_size(const struct kvm_device_desc *desc)
                + desc->config_len;
 }
 
-/*
- * This tests (and acknowleges) a feature bit.
- */
-static bool kvm_feature(struct virtio_device *vdev, unsigned fbit)
+/* This gets the device's feature bits. */
+static u32 kvm_get_features(struct virtio_device *vdev)
 {
+       unsigned int i;
+       u32 features = 0;
        struct kvm_device_desc *desc = to_kvmdev(vdev)->desc;
-       u8 *features;
+       u8 *in_features = kvm_vq_features(desc);
 
-       if (fbit / 8 > desc->feature_len)
-               return false;
+       for (i = 0; i < min(desc->feature_len * 8, 32); i++)
+               if (in_features[i / 8] & (1 << (i % 8)))
+                       features |= (1 << i);
+       return features;
+}
 
-       features = kvm_vq_features(desc);
-       if (!(features[fbit / 8] & (1 << (fbit % 8))))
-               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;
 
-       /*
-        * 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;
+       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));
+       }
 }
 
 /*
@@ -221,7 +226,8 @@ 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 = {
-       .feature = kvm_feature,
+       .get_features = kvm_get_features,
+       .set_features = kvm_set_features,
        .get = kvm_get,
        .set = kvm_set,
        .get_status = kvm_get_status,
index eb2d3559d089a52c24d7df5cecc1bf0b82cccdab..3f6a090cbd9abeef0ba6732a369bf77cc48b8bb7 100644 (file)
  */
 
 #include <asm/types.h>
-#include <asm/fpu.h>
 
 #include <linux/ioctl.h>
 
 /* Architectural interrupt line count. */
 #define KVM_NR_INTERRUPTS 256
 
-#define KVM_IOAPIC_NUM_PINS  24
+#define KVM_IOAPIC_NUM_PINS  48
 
 struct kvm_ioapic_state {
        __u64 base_address;
@@ -61,6 +60,13 @@ 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];
@@ -77,7 +83,7 @@ union context {
                unsigned long       ibr[8];
                unsigned long       dbr[8];
                unsigned long       pkr[8];
-               struct ia64_fpreg   fr[128];
+               struct kvm_fpreg   fr[128];
        };
 };
 
index d6337f941c9838c9267cde6b3b842c3b34a4556a..b877bbd2d3a7064aa80fc27dbcfe2a45fc5e5246 100644 (file)
@@ -135,6 +135,7 @@ 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;
 };
index f7ba099049eaeab16caf69d6bed1afc280a4a712..2d29e260da3d1b56830794c8dfb1719119195086 100644 (file)
@@ -758,25 +758,26 @@ void mark_page_dirty(struct kvm *kvm, gfn_t gfn)
  */
 void kvm_vcpu_block(struct kvm_vcpu *vcpu)
 {
-       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);
+       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;
+
                vcpu_put(vcpu);
                schedule();
                vcpu_load(vcpu);
        }
 
-       __set_current_state(TASK_RUNNING);
-       remove_wait_queue(&vcpu->wq, &wait);
+       finish_wait(&vcpu->wq, &wait);
 }
 
 void kvm_resched(struct kvm_vcpu *vcpu)
This page took 0.034831 seconds and 5 git commands to generate.