From: Richard Henderson <richard.henderson@linaro.org>
To: BitFriends <commandspider12@gmail.com>, qemu-devel@nongnu.org
Subject: Re: access guest address from within instruction
Date: Sat, 1 Oct 2022 13:23:37 -0700 [thread overview]
Message-ID: <3ca717d7-fbc9-b2f9-71cc-01ef459da257@linaro.org> (raw)
In-Reply-To: <CABVhSWP7XjNvCXUvawXLcOkP4vXQ8wbMObKbxc+jN6gv0wzawQ@mail.gmail.com>
On 10/1/22 13:10, BitFriends wrote:
> Hello,
>
> I am trying to create a custom instruction that accesses guest memory specified by an
> address in a register. I specifically want to read from that address. So I tried to do
> that using "tcg_gen_qemu_ld_i64(&res, env->regs[R_EDI], 0, MO_LEUQ);", but that doesn't
> save any result in res.
This statement should have given you compilation errors, so I don't know what you mean by
"doesn't save any result". There's clearly a disconnect between what you describe and
what you actually attempted.
Anyway, by the name you can see that function "gen"erates a "tcg" operation, which is then
later compiled by the jit, the output of which is later executed to produce a result.
Which is, in general, what you want for implementing a custom instruction.
r~
next prev parent reply other threads:[~2022-10-01 20:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-01 20:10 access guest address from within instruction BitFriends
2022-10-01 20:23 ` Richard Henderson [this message]
2022-10-01 20:59 ` BitFriends
2022-10-02 9:20 ` BitFriends
2022-10-02 14:40 ` Richard Henderson
2022-10-02 14:52 ` BitFriends
2022-10-02 17:13 ` Richard Henderson
2022-10-02 14:45 ` Peter Maydell
2022-10-02 14:57 ` BitFriends
2022-10-02 13:56 ` Alex Bennée
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=3ca717d7-fbc9-b2f9-71cc-01ef459da257@linaro.org \
--to=richard.henderson@linaro.org \
--cc=commandspider12@gmail.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).