All of lore.kernel.org
 help / color / mirror / Atom feed
* Modify cr0 at dom0
@ 2014-10-17  1:47 machi1271
  2014-10-17  6:25 ` Razvan Cojocaru
  0 siblings, 1 reply; 7+ messages in thread
From: machi1271 @ 2014-10-17  1:47 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1120 bytes --]

hi,
Background:
I want to hook the syscalls for dom0. So, I get the syscall_enter address by calling HYPERVISOR_domctl, with xen_domctl.cmd = XEN_DOMCTL_getvcpucontext.
The returned ctx.syscall_callback_eip is correct, and I find the syscall_table address from the syscall_callback_eip.
Now, my target is to modify the original syscall_table, and I know I should clear the CR0.WP bit before modify.

However, when I try to set cr0 back to hypervisor after the cr0.WP being cleared through HYPERVISOR_domctl(with xen_domctl.cmd = XEN_DOMCTL_setvcpucontext), 
dom0 DEAD. 

I traced into the hypercall, and I find the program dead in the following while loop:
void vcpu_sleep_sync(struct vcpu *v)
{
    vcpu_sleep_nosync(v);

    while ( !vcpu_runnable(v) && v->is_running )
        cpu_relax();

    sync_vcpu_execstate(v);
}
in domain_pause.

Why? Is Calling XEN_DOMCTL_setvcpucontext from dom0 not allowed? Or, is there another way to make the memory area protected by WP to be writable?

I am running my code on 2.6.18-194.el5xen., no domain is running except dom0.

Regards~




machi1271

[-- Attachment #1.2: Type: text/html, Size: 2729 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-10-17  9:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-17  1:47 Modify cr0 at dom0 machi1271
2014-10-17  6:25 ` Razvan Cojocaru
2014-10-17  6:34   ` machi1271
2014-10-17  6:48     ` Razvan Cojocaru
2014-10-17  7:14       ` machi1271
2014-10-17  8:01         ` Razvan Cojocaru
2014-10-17  9:16           ` machi1271

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.