Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315873
b: refs/heads/master
c: 6d6eede
h: refs/heads/master
i:
  315871: d9d2e01
v: v3
  • Loading branch information
Avi Kivity committed Jul 9, 2012
1 parent fcb5e69 commit ef30427
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0017f93a2776597b798ec1a9594e41dfd96d3c11
refs/heads/master: 6d6eede4a0492c7478d44d7c8fae80c3bcf529d9
16 changes: 15 additions & 1 deletion trunk/arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -3142,6 +3142,20 @@ static int em_bsr(struct x86_emulate_ctxt *ctxt)
return X86EMUL_CONTINUE;
}

static int em_cpuid(struct x86_emulate_ctxt *ctxt)
{
u32 eax, ebx, ecx, edx;

eax = ctxt->regs[VCPU_REGS_RAX];
ecx = ctxt->regs[VCPU_REGS_RCX];
ctxt->ops->get_cpuid(ctxt, &eax, &ebx, &ecx, &edx);
ctxt->regs[VCPU_REGS_RAX] = eax;
ctxt->regs[VCPU_REGS_RBX] = ebx;
ctxt->regs[VCPU_REGS_RCX] = ecx;
ctxt->regs[VCPU_REGS_RDX] = edx;
return X86EMUL_CONTINUE;
}

static bool valid_cr(int nr)
{
switch (nr) {
Expand Down Expand Up @@ -3634,7 +3648,7 @@ static struct opcode twobyte_table[256] = {
X16(D(ByteOp | DstMem | SrcNone | ModRM| Mov)),
/* 0xA0 - 0xA7 */
I(Stack | Src2FS, em_push_sreg), I(Stack | Src2FS, em_pop_sreg),
DI(ImplicitOps, cpuid), I(DstMem | SrcReg | ModRM | BitOp, em_bt),
II(ImplicitOps, em_cpuid, cpuid), I(DstMem | SrcReg | ModRM | BitOp, em_bt),
D(DstMem | SrcReg | Src2ImmByte | ModRM),
D(DstMem | SrcReg | Src2CL | ModRM), N, N,
/* 0xA8 - 0xAF */
Expand Down

0 comments on commit ef30427

Please sign in to comment.