WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] unexpected results with xc_domain_get_vcpu_context

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] unexpected results with xc_domain_get_vcpu_context
From: "Bryan D. Payne" <bryan@xxxxxxxxxxxx>
Date: Fri, 2 Dec 2005 11:42:27 -0500
Delivery-date: Fri, 02 Dec 2005 16:42:18 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
I'm getting some unexpected results with xc_domain_get_vcpu_context. Basically, I've written a simple application in domain 0 to view the vcpu for another domain. However, each time that I call xc_domain_get_vcpu_context, the value for eip is the same. Is this expected behavior? I would have expected eip to be changing continuously as the machine runs. Or does this function not give me the "live" values?

Here's the code that I'm using...

int main (int argc, char **argv)
{
    int xc_handle;
    vcpu_guest_context_t ctxt;
    struct timespec sleep_timer;

    uint32_t dom = 6;  /* hard code this for easy testing */

    /* setup */
    if ((xc_handle = xc_interface_open()) == -1){
        printf("error opening xc interface\n");
        goto error_exit;
    }

    sleep_timer.tv_sec = 2;
    sleep_timer.tv_nsec = 000000000;  /* 0.00 seconds */
    while (1){

        /* sleep for designated time */
        if (nanosleep(&sleep_timer, NULL) != 0){
            perror("Sleep interrupted, exiting...");
            goto error_exit;
        }

if (xc_domain_get_vcpu_context(xc_handle, dom, 1, &ctxt) == -1){
            printf("error getting vcpu context\n");
            goto error_exit;
        }

        /* perform the designated task */
        printf("eip = 0x%x\n", ctxt.user_regs.eip);
    }

error_exit:
    if (xc_handle != -1) xc_interface_close(xc_handle);

    return 0;
}


Thanks,
-bryan


-
Bryan D. Payne
Graduate Student, Computer Science
Georgia Tech Information Security Center
http://www.bryanpayne.org




_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel