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

Re: [Xen-devel] [VMI] How to add support for MOV-TO-DRx events ?



On 5/9/19 11:57 PM, Mathieu Tarral wrote:
> Hi,
> 
> following a previous conversation, i would like to catch MOV-TO-DRx VMI 
> events to prevent the guest from disabling my hardware breakpoints.
> 
> @Tamas pointed me to this header:
> https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/include/public/vm_event.h;h=b2bafc0d77f9758e42b0d53c05a7e6bb86c86686;hb=HEAD#l154
> 
> And, as far as I can tell, I have to
> - add a new REASON
> #define VM_EVENT_REASON_WRITE_DEBUGREG      15
> 
> - add a new struct
> struct vm_event_write_debugreg {
>     uint32_t index;
>     uint32_t _pad;
>     uint64_t new_value;
>     uint64_t old_value;
> };
> 
> - insert it into the vm_event_st union
> 
> Can you give me more pointer and guidance how to implement this into Xen ?

You probably want to change the write_debugreg() macro into a function
that does what's currently being done + send out the vm_event. You also
probably need to think about whether you want the write to be
preemptable or not (I'm guessing you don't, in which case it's all simpler).

> I have never submitted a patch, nor looked into Xen source code.

https://wiki.xenproject.org/wiki/Submitting_Xen_Project_Patches

> Should we create a single event for MOV-TO-REGx VMI events ?
> It would void copy pasting and duplicating code.

I don't understand this question.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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