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

[Xen-devel] instrction emulation problem


  • To: "Keir Fraser" <keir.fraser@xxxxxxxxxxxxx>
  • From: "strongerwill" <strongerwill@xxxxxxxxx>
  • Date: Fri, 13 Aug 2010 22:51:28 +0800
  • Cc: Xen-devel <Xen-devel@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 13 Aug 2010 07:52:15 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:x-mailer:mime-version :content-type; b=t3fTBlujQJ1t57MxbXvYUgDW0cb5kIiwf7iPEF5lrCk9OVycYOFms1fNyrV4frVVaS YqMd8FDWDFPHTWcaCtQaVpRjdfArXFnsaxdr/k4SwYXu6MKbY/8Te2Yd4E8+1IUXZD3m iZrzYUQndRVpmRQvsWMbQiiUgxEib8kOk1oMI=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

Hi Keir:
   I am sorry trouble you again. I want to emulate instruction "push %ebp" in Xen. I found the function emulate_privilege_op does not satisfy this requirement.
Then I resort to x86_emulate. I construct the x86_emulate_ctxt and reuse the "ptwr_emulate_ops".
code like this:
 
extern const struct x86_emulate_ops ptwr_emulate_ops;
in do_general_protection {
....
struct x86_emulate_ctxt ctxt;
ctxt.regs = regs;
ctxt.force_writeback = 1; // 0 is the same
ctxt.addr_size = 32;
ctxt.sp_size   = 32;
ret = x86_emulate(&ctxt, &ptwr_emulate_ops);
...
}
 
the error message is:
(XEN) mm.c:5235:d0 ptwr_emulate: bad access (cr2=553a4000, addr=e81b5fac, bytes=4)
 
 
I have another idea, I directly update the stack and change the EIP and ESP
like this:
 
regs->esp -= 4;
__raw_copy_to_guest((void*)regs->esp, &regs->ebp, sizeof(unsigned int));
regs->eip += 1;
 
I am not sure it works like this way. Please give me some tips. Thanks
 
Cheers,
 
Yueqiang
 
 
2010-08-13

strongerwill

发件人: Keir Fraser
发送时间: 2010-08-13  16:52:24
收件人: xen-devel@xxxxxxxxxxxxxxxxxxx
抄送:
主题: [Xen-devel] FINAL release candidate for Xen 4.0.1
 
Folks,
The sixth release candidate for 4.0.1 is tagged as 4.0.1-rc6 at
http://xenbits.xen.org/staging/xen-4.0-testing.hg
We expect this to be the final RC, with no changes except for regression
fixes ahead of final release late next week. So please test this RC!
 Thanks,
 Keir
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

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