Skip to contentSkip to conversation

Finding guest calling function

DISCUSSION Dan Magenheimer 2 participants 2 messages Jul 20, 2010

lore
Share & tools
lore
#0 lore raw

In the hypervisor, I can use regs->eip to get the location of a trapped instruction in a guest (in this case rdtsc) which allows me to determine the function in which the trapping instruction was used.

Is there any easy way to determine the function that CALLED the function in which the trapping instruction was used? If so, is there any example code in Xen that I can steal from?

(This is for a find-the-guest-kernel-rdtsc-uses exercise from another thread... all the rdtsc uses are in native_read_tsc so I need to know the frequencies of what is calling native_read_tsc.)

Thanks,
Dan

#1 lore raw

Call show_stack(regs) and then pick apart the numeric guest stack dump.

K.

Quoted 15 lines · Dan Magenheimer

In the hypervisor, I can use regs->eip to get the location of a trapped instruction in a guest (in this case rdtsc) which allows me to determine the function in which the trapping instruction was used.

Is there any easy way to determine the function that CALLED the function in which the trapping instruction was used? If so, is there any example code in Xen that I can steal from?

(This is for a find-the-guest-kernel-rdtsc-uses exercise from another thread... all the rdtsc uses are in native_read_tsc so I need to know the frequencies of what is calling native_read_tsc.)

Thanks,
Dan