All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kai Luo <kluo@vmware.com>
To: xen-devel@lists.xensource.com
Subject: Question about intercept debug breakpoint in the Guest OS
Date: Sun, 10 Nov 2013 01:03:11 -0800 (PST)	[thread overview]
Message-ID: <1769008706.26655832.1384074191540.JavaMail.root@vmware.com> (raw)
In-Reply-To: <704310110.26649484.1384072884934.JavaMail.root@vmware.com>


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

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 




...... 

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

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

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

           reply	other threads:[~2013-11-10  9:03 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <704310110.26649484.1384072884934.JavaMail.root@vmware.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1769008706.26655832.1384074191540.JavaMail.root@vmware.com \
    --to=kluo@vmware.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.