diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-09-10 11:02:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-09-10 11:02:45 -0400 |
commit | be6200aac985e0a3db56ec636763a32f3e32e7f1 (patch) | |
tree | 2ce9fb31018c3348c0dd270d5be187bb4b724ca7 | |
parent | f2955b490b249ca56e465fd32cc355f84aedf8bd (diff) | |
parent | da908f2fb4e783c2a4de751fb90f11a0dd041161 (diff) |
Merge branch 'kvm-updates/2.6.36' of git://git.kernel.org/pub/scm/virt/kvm/kvm
* 'kvm-updates/2.6.36' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
KVM: x86: Perform hardware_enable in CPU_STARTING callback
KVM: i8259: fix migration
KVM: fix i8259 oops when no vcpus are online
KVM: x86 emulator: fix regression with cmpxchg8b on i386 hosts
-rw-r--r-- | arch/x86/include/asm/kvm_emulate.h | 7 | ||||
-rw-r--r-- | arch/x86/kvm/emulate.c | 9 | ||||
-rw-r--r-- | arch/x86/kvm/i8259.c | 3 | ||||
-rw-r--r-- | arch/x86/kvm/irq.h | 2 | ||||
-rw-r--r-- | virt/kvm/kvm_main.c | 5 |
5 files changed, 16 insertions, 10 deletions
diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h index 51cfd730ac5d..1f99ecfc48e1 100644 --- a/arch/x86/include/asm/kvm_emulate.h +++ b/arch/x86/include/asm/kvm_emulate.h | |||
@@ -152,9 +152,14 @@ struct x86_emulate_ops { | |||
152 | struct operand { | 152 | struct operand { |
153 | enum { OP_REG, OP_MEM, OP_IMM, OP_NONE } type; | 153 | enum { OP_REG, OP_MEM, OP_IMM, OP_NONE } type; |
154 | unsigned int bytes; | 154 | unsigned int bytes; |
155 | unsigned long orig_val, *ptr; | 155 | union { |
156 | unsigned long orig_val; | ||
157 | u64 orig_val64; | ||
158 | }; | ||
159 | unsigned long *ptr; | ||
156 | union { | 160 | union { |
157 | unsigned long val; | 161 | unsigned long val; |
162 | u64 val64; | ||
158 | char valptr[sizeof(unsigned long) + 2]; | 163 | char valptr[sizeof(unsigned long) + 2]; |
159 | }; | 164 | }; |
160 | }; | 165 | }; |
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index b38bd8b92aa6..66ca98aafdd6 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -1870,17 +1870,16 @@ static inline int emulate_grp9(struct x86_emulate_ctxt *ctxt, | |||
1870 | struct x86_emulate_ops *ops) | 1870 | struct x86_emulate_ops *ops) |
1871 | { | 1871 | { |
1872 | struct decode_cache *c = &ctxt->decode; | 1872 | struct decode_cache *c = &ctxt->decode; |
1873 | u64 old = c->dst.orig_val; | 1873 | u64 old = c->dst.orig_val64; |
1874 | 1874 | ||
1875 | if (((u32) (old >> 0) != (u32) c->regs[VCPU_REGS_RAX]) || | 1875 | if (((u32) (old >> 0) != (u32) c->regs[VCPU_REGS_RAX]) || |
1876 | ((u32) (old >> 32) != (u32) c->regs[VCPU_REGS_RDX])) { | 1876 | ((u32) (old >> 32) != (u32) c->regs[VCPU_REGS_RDX])) { |
1877 | |||
1878 | c->regs[VCPU_REGS_RAX] = (u32) (old >> 0); | 1877 | c->regs[VCPU_REGS_RAX] = (u32) (old >> 0); |
1879 | c->regs[VCPU_REGS_RDX] = (u32) (old >> 32); | 1878 | c->regs[VCPU_REGS_RDX] = (u32) (old >> 32); |
1880 | ctxt->eflags &= ~EFLG_ZF; | 1879 | ctxt->eflags &= ~EFLG_ZF; |
1881 | } else { | 1880 | } else { |
1882 | c->dst.val = ((u64)c->regs[VCPU_REGS_RCX] << 32) | | 1881 | c->dst.val64 = ((u64)c->regs[VCPU_REGS_RCX] << 32) | |
1883 | (u32) c->regs[VCPU_REGS_RBX]; | 1882 | (u32) c->regs[VCPU_REGS_RBX]; |
1884 | 1883 | ||
1885 | ctxt->eflags |= EFLG_ZF; | 1884 | ctxt->eflags |= EFLG_ZF; |
1886 | } | 1885 | } |
@@ -2616,7 +2615,7 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) | |||
2616 | c->src.valptr, c->src.bytes); | 2615 | c->src.valptr, c->src.bytes); |
2617 | if (rc != X86EMUL_CONTINUE) | 2616 | if (rc != X86EMUL_CONTINUE) |
2618 | goto done; | 2617 | goto done; |
2619 | c->src.orig_val = c->src.val; | 2618 | c->src.orig_val64 = c->src.val64; |
2620 | } | 2619 | } |
2621 | 2620 | ||
2622 | if (c->src2.type == OP_MEM) { | 2621 | if (c->src2.type == OP_MEM) { |
diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c index 8d10c063d7f2..4b7b73ce2098 100644 --- a/arch/x86/kvm/i8259.c +++ b/arch/x86/kvm/i8259.c | |||
@@ -64,6 +64,9 @@ static void pic_unlock(struct kvm_pic *s) | |||
64 | if (!found) | 64 | if (!found) |
65 | found = s->kvm->bsp_vcpu; | 65 | found = s->kvm->bsp_vcpu; |
66 | 66 | ||
67 | if (!found) | ||
68 | return; | ||
69 | |||
67 | kvm_vcpu_kick(found); | 70 | kvm_vcpu_kick(found); |
68 | } | 71 | } |
69 | } | 72 | } |
diff --git a/arch/x86/kvm/irq.h b/arch/x86/kvm/irq.h index ffed06871c5c..63c314502993 100644 --- a/arch/x86/kvm/irq.h +++ b/arch/x86/kvm/irq.h | |||
@@ -43,7 +43,6 @@ struct kvm_kpic_state { | |||
43 | u8 irr; /* interrupt request register */ | 43 | u8 irr; /* interrupt request register */ |
44 | u8 imr; /* interrupt mask register */ | 44 | u8 imr; /* interrupt mask register */ |
45 | u8 isr; /* interrupt service register */ | 45 | u8 isr; /* interrupt service register */ |
46 | u8 isr_ack; /* interrupt ack detection */ | ||
47 | u8 priority_add; /* highest irq priority */ | 46 | u8 priority_add; /* highest irq priority */ |
48 | u8 irq_base; | 47 | u8 irq_base; |
49 | u8 read_reg_select; | 48 | u8 read_reg_select; |
@@ -56,6 +55,7 @@ struct kvm_kpic_state { | |||
56 | u8 init4; /* true if 4 byte init */ | 55 | u8 init4; /* true if 4 byte init */ |
57 | u8 elcr; /* PIIX edge/trigger selection */ | 56 | u8 elcr; /* PIIX edge/trigger selection */ |
58 | u8 elcr_mask; | 57 | u8 elcr_mask; |
58 | u8 isr_ack; /* interrupt ack detection */ | ||
59 | struct kvm_pic *pics_state; | 59 | struct kvm_pic *pics_state; |
60 | }; | 60 | }; |
61 | 61 | ||
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index b78b794c1039..d4853a54771a 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -1958,10 +1958,10 @@ static int kvm_cpu_hotplug(struct notifier_block *notifier, unsigned long val, | |||
1958 | cpu); | 1958 | cpu); |
1959 | hardware_disable(NULL); | 1959 | hardware_disable(NULL); |
1960 | break; | 1960 | break; |
1961 | case CPU_ONLINE: | 1961 | case CPU_STARTING: |
1962 | printk(KERN_INFO "kvm: enabling virtualization on CPU%d\n", | 1962 | printk(KERN_INFO "kvm: enabling virtualization on CPU%d\n", |
1963 | cpu); | 1963 | cpu); |
1964 | smp_call_function_single(cpu, hardware_enable, NULL, 1); | 1964 | hardware_enable(NULL); |
1965 | break; | 1965 | break; |
1966 | } | 1966 | } |
1967 | return NOTIFY_OK; | 1967 | return NOTIFY_OK; |
@@ -2096,7 +2096,6 @@ int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, | |||
2096 | 2096 | ||
2097 | static struct notifier_block kvm_cpu_notifier = { | 2097 | static struct notifier_block kvm_cpu_notifier = { |
2098 | .notifier_call = kvm_cpu_hotplug, | 2098 | .notifier_call = kvm_cpu_hotplug, |
2099 | .priority = 20, /* must be > scheduler priority */ | ||
2100 | }; | 2099 | }; |
2101 | 2100 | ||
2102 | static int vm_stat_get(void *_offset, u64 *val) | 2101 | static int vm_stat_get(void *_offset, u64 *val) |