All of lore.kernel.org
 help / color / mirror / Atom feed
From: "strongerwill" <strongerwill@gmail.com>
To: Keir Fraser <keir.fraser@eu.citrix.com>
Cc: Xen-devel <Xen-devel@lists.xensource.com>
Subject: instrction emulation problem
Date: Fri, 13 Aug 2010 22:51:28 +0800	[thread overview]
Message-ID: <201008132251253586411@gmail.com> (raw)


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

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@lists.xensource.com 
抄送: 
主题: [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@lists.xensource.com
http://lists.xensource.com/xen-devel

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

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

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

                 reply	other threads:[~2010-08-13 14:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=201008132251253586411@gmail.com \
    --to=strongerwill@gmail.com \
    --cc=Xen-devel@lists.xensource.com \
    --cc=keir.fraser@eu.citrix.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.