[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Is there something in Xen to clear IA32_DEBUGCTL MSR during hvm execution


  • To: xen-devel@xxxxxxxxxxxxx
  • From: 刘维杰 <liuwj0129@xxxxxxx>
  • Date: Sat, 28 Oct 2017 20:40:05 +0800 (CST)
  • Delivery-date: Sat, 28 Oct 2017 12:40:29 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

Dear list,

We are some researchers who are interested in Xen so much. And recently we meet a problem when we want to fetch some Intel Last Branch Record information of guest HVMs.

When we are trying to debug the Intel IA32_DEBUGCTL MSR on Xen 4.6.0 (specifically we set the value as 1 when every vm-exit cased by a mov-to-cr3 i.e. a context switch in an HVM machine comes), we find that the value in this IA32_DEBUGCTL MSR became 0 again. Does anyone know what's happening there? The problem makes us going crazy because we really want to use the LBR information which is enabled by the last bit of the IA32_DEBUGCTL MSR, but we cannot find where the key code makes the bit flip to zero again.

BTW, to get the some useful information from LBR, we first disabled EPT mechanism which allow us to intercept CR3 accessing. Then we pinned an Ubuntu 14.04 HVM to physical CPU 2 and 3 (we have 8 pCPUs). At the beginning of the hvm startup, we use wrmsrl to set the MSR on each core (using the function "on_each_cpu()") as 1 when exactly the domain is initialized (in hvm_domain_initialise() of hvm.c). However, when we used rdmsrl to read the value of MSR_IA32_DEBUGCTLMSR in every vm-exit cased by CR3 accessing (in vmexit handler of vmx.c), we found the value had changed to be 0 on cpu 2 and cpu 3, while others' (cpu 0, 1, 4 ,5, 6, and 7) were still 1. Moreover, when we inserted some code (also in vmexit handler of vmx.c) to modify the values to be 1, somehow they sometimes just turned to 0 again when we read them in some CR3 access interceptions. So I was wondering if there are any mechanisms to clear all bits of the IA32_DEBUGCTL MSR in Xen?

Thanks a lot in advance.

- Weijie.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.