Skip to contentSkip to conversation

Get IDT from virtual machine

DISCUSSION Matthew Donovan 2 participants 2 messages Jan 31, 2008 – Feb 1, 2008

lore
Share & tools
lore
#0 lore raw

I'm trying to retrieve and print the interrupt descriptor table of a guest OS but every address is coming out 0x00000000.

Here's what I'm doing:

    vcpu_guest_context_t ctx;
    int i;

    int res = xc_vcpu_getcontext (xai->xc_handle, xai->domain_id, 0, &ctx);
    if (res < 0) {
        fprintf (stderr, "xc_vcpu_getcontext failed!\n");
        return;
    }   

    for (i = 0 ; i < 256 ; ++i) {
        printf ("Interrupt %d: Address 0x%08x\n", 
                i,
                ctx.trap_ctxt[i].address);   
    }

I'm using Xen 3.1.2 on Fedora Core 8. The guest OS's have been XP Pro and Vista Ultimate, though I assume that part doesn't matter since the IDT is a processor structure.

Any help is greatly appreciated.
-matthew

#1 lore raw

That's very wishful code! Unfortunately the IDTR is not exposed via vcpu_context for HVM guests. The only way to get it right now is to do a hvm save hypercall and then parse the pickled state to find the IDTR. It actually should be quite easy.

-- Keir

Quoted 33 lines · Matthew Donovan

I'm trying to retrieve and print the interrupt descriptor table of a guest OS but every address is coming out 0x00000000.

Here's what I'm doing:

    vcpu_guest_context_t ctx;
    int i;

    int res = xc_vcpu_getcontext (xai->xc_handle, xai->domain_id, 0, &ctx);
    if (res < 0) {
        fprintf (stderr, "xc_vcpu_getcontext failed!\n");
        return;
    }   

    for (i = 0 ; i < 256 ; ++i) {
        printf ("Interrupt %d: Address 0x%08x\n",
                i,
                ctx.trap_ctxt[i].address);
    }

I'm using Xen 3.1.2 on Fedora Core 8. The guest OS's have been XP Pro and Vista Ultimate, though I assume that part doesn't matter since the IDT is a processor structure.

Any help is greatly appreciated.
-matthew

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel