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

[Xen-devel] Question about intercept debug breakpoint in the Guest OS


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: Kai Luo <kluo@xxxxxxxxxx>
  • Date: Sun, 10 Nov 2013 01:03:11 -0800 (PST)
  • Delivery-date: Sun, 10 Nov 2013 09:03:34 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: 0oMvFS7M/FzLBuDB+rk7VItXFlwh4w==
  • Thread-topic: Question about intercept debug breakpoint in the Guest OS

Hi:
    Recently I try to intercept a given kernel address-syscall address,for example- of the guest windows 7 to the hypervisor, I set the exception flag in the EXCEPTION_BITMAP as follows:
vmcs.c
void vmx_do_resume(vcpu * v)
{
......
        unsigned long intercepts = __vmread(EXCEPTION_BITMAP);
        unsigned long mask = (1UL << TRAP_debug);
        intercepts |= mask;
        __vmwrite(EXCEPTION_BITMAP, intercepts) 
        v->arch.guest_context.debugreg[0] = [Address of a syscall];
        v->arch.guest_context.debugreg[7] |= 2;
......
}
I do reveive the VMexit in the vmx_vmexit_handler in vmx.c  then I want  to let the guest os keep going as usual without concerning about the debug breakpoint so I set some flags as follows:
case TRAP_debug:
......
    regs->eflags |= X86_EFLAGS_RF;
    exit_qualification = __vmread(EXIT_QUALIFICATION);
    write_debug(6, exit_qualification | 0xffff0ff0);
......
The problem is the guest os seems trapped into an infinite loop and take the full vcpu capacity,  I find the RIP in the VCPU stay the same, EFLAGS value of the VCPU is 0x2 and the guest os can't respond to any movement of  mouse or keyboard,.
        Do I missed some flag when restoring the guest context?Or there are some other reasons that lead to this issue?Could you give me any suggestions?

Jone




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

 


Rackspace

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