aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kvm/emulate.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 5053e9efb140..90b549ed8997 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -3227,6 +3227,13 @@ static int em_cpuid(struct x86_emulate_ctxt *ctxt)
3227 return X86EMUL_CONTINUE; 3227 return X86EMUL_CONTINUE;
3228} 3228}
3229 3229
3230static int em_lahf(struct x86_emulate_ctxt *ctxt)
3231{
3232 ctxt->regs[VCPU_REGS_RAX] &= ~0xff00UL;
3233 ctxt->regs[VCPU_REGS_RAX] |= (ctxt->eflags & 0xff) << 8;
3234 return X86EMUL_CONTINUE;
3235}
3236
3230static bool valid_cr(int nr) 3237static bool valid_cr(int nr)
3231{ 3238{
3232 switch (nr) { 3239 switch (nr) {
@@ -3622,7 +3629,7 @@ static struct opcode opcode_table[256] = {
3622 D(DstAcc | SrcNone), I(ImplicitOps | SrcAcc, em_cwd), 3629 D(DstAcc | SrcNone), I(ImplicitOps | SrcAcc, em_cwd),
3623 I(SrcImmFAddr | No64, em_call_far), N, 3630 I(SrcImmFAddr | No64, em_call_far), N,
3624 II(ImplicitOps | Stack, em_pushf, pushf), 3631 II(ImplicitOps | Stack, em_pushf, pushf),
3625 II(ImplicitOps | Stack, em_popf, popf), N, N, 3632 II(ImplicitOps | Stack, em_popf, popf), N, I(ImplicitOps, em_lahf),
3626 /* 0xA0 - 0xA7 */ 3633 /* 0xA0 - 0xA7 */
3627 I2bv(DstAcc | SrcMem | Mov | MemAbs, em_mov), 3634 I2bv(DstAcc | SrcMem | Mov | MemAbs, em_mov),
3628 I2bv(DstMem | SrcAcc | Mov | MemAbs | PageTable, em_mov), 3635 I2bv(DstMem | SrcAcc | Mov | MemAbs | PageTable, em_mov),