lkml.org 
[lkml]   [2007]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 01/50] KVM: x86 emulator: Add vmmcall/vmcall to x86_emulate (v3)
    Date
    From: Anthony Liguori <aliguori@us.ibm.com>

    Add vmmcall/vmcall to x86_emulate. Future patch will implement functionality
    for these instructions.

    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Signed-off-by: Avi Kivity <avi@qumranet.com>
    ---
    drivers/kvm/x86_emulate.c | 23 +++++++++++++++++------
    1 files changed, 17 insertions(+), 6 deletions(-)

    diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
    index bd46de6..84af9cc 100644
    --- a/drivers/kvm/x86_emulate.c
    +++ b/drivers/kvm/x86_emulate.c
    @@ -1380,6 +1380,12 @@ twobyte_insn:
    u16 size;
    unsigned long address;

    + case 0: /* vmcall */
    + if (modrm_mod != 3 || modrm_rm != 1)
    + goto cannot_emulate;
    +
    + /* nop */
    + break;
    case 2: /* lgdt */
    rc = read_descriptor(ctxt, ops, src.ptr,
    &size, &address, op_bytes);
    @@ -1387,12 +1393,17 @@ twobyte_insn:
    goto done;
    realmode_lgdt(ctxt->vcpu, size, address);
    break;
    - case 3: /* lidt */
    - rc = read_descriptor(ctxt, ops, src.ptr,
    - &size, &address, op_bytes);
    - if (rc)
    - goto done;
    - realmode_lidt(ctxt->vcpu, size, address);
    + case 3: /* lidt/vmmcall */
    + if (modrm_mod == 3 && modrm_rm == 1) {
    + /* nop */
    + } else {
    + rc = read_descriptor(ctxt, ops, src.ptr,
    + &size, &address,
    + op_bytes);
    + if (rc)
    + goto done;
    + realmode_lidt(ctxt->vcpu, size, address);
    + }
    break;
    case 4: /* smsw */
    if (modrm_mod != 3)
    --
    1.5.3.7


    \
     
     \ /
      Last update: 2007-12-23 15:55    [W:4.297 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site