* Handling a MEM_EVENT_REASON_CR3
@ 2012-12-12 14:16 Razvan Cojocaru
2012-12-13 13:22 ` Tim Deegan
0 siblings, 1 reply; 2+ messages in thread
From: Razvan Cojocaru @ 2012-12-12 14:16 UTC (permalink / raw)
To: xen-devel@lists.xen.org
Hello,
a few questions about receiving a MEM_EVENT_REASON_CR3 even in dom0
userspace:
1. If I call
xc_set_hvm_param(xci, domain_id,
HVM_PARAM_MEMORY_EVENT_CR3,
HVMPME_onchangeonly);
that only triggers a CR3 event if the new value that the guest writes to
CR3 is different from the existing value, is that assumption correct?
2. mem_event.h says that if "CR3 was hit: gfn is CR3 value". I'm
assuming that gfn is the _new_ value, and that the old value is
unavailable, is that also correct?
3. Is it possible to, upon intercepting the CR3 write, write a
_different_ value to CR3, instead of gfn?
Thanks,
Razvan Cojocaru
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: Handling a MEM_EVENT_REASON_CR3
2012-12-12 14:16 Handling a MEM_EVENT_REASON_CR3 Razvan Cojocaru
@ 2012-12-13 13:22 ` Tim Deegan
0 siblings, 0 replies; 2+ messages in thread
From: Tim Deegan @ 2012-12-13 13:22 UTC (permalink / raw)
To: Razvan Cojocaru; +Cc: xen-devel@lists.xen.org
At 16:16 +0200 on 12 Dec (1355329007), Razvan Cojocaru wrote:
> Hello,
>
> a few questions about receiving a MEM_EVENT_REASON_CR3 even in dom0
> userspace:
>
> 1. If I call
>
> xc_set_hvm_param(xci, domain_id,
> HVM_PARAM_MEMORY_EVENT_CR3,
> HVMPME_onchangeonly);
>
> that only triggers a CR3 event if the new value that the guest writes to
> CR3 is different from the existing value, is that assumption correct?
Yes, I think so. That's what HVMPME_onchangeonly ought to do.
Did you try it?
> 2. mem_event.h says that if "CR3 was hit: gfn is CR3 value". I'm
> assuming that gfn is the _new_ value, and that the old value is
> unavailable, is that also correct?
Yes.
> 3. Is it possible to, upon intercepting the CR3 write, write a
> _different_ value to CR3, instead of gfn?
Yes. you can use either xc_vcpu_getcontext()/xc_vcpu_setcontext()
or xc_domain_hvm_getcontext_partial()/xc_domain_hvm_setcontext() to read
and write the vCPU registers.
Cheers,
Tim.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-12-13 13:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-12 14:16 Handling a MEM_EVENT_REASON_CR3 Razvan Cojocaru
2012-12-13 13:22 ` Tim Deegan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.