qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Naman patel <naman321@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
	"QEMU Developers" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Call Trace for QEMU functions
Date: Tue, 4 Aug 2015 11:34:16 +0530	[thread overview]
Message-ID: <CAAhtxhtkPADTCetjE0OVVE=a7hz2Sb6Su9manpHaR2NqJK49Eg@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA9BHZOO9Epwx8CCcEgsrvrgyrqCEP-nCf=bmbinqRunMg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1773 bytes --]

On Fri, Jul 31, 2015 at 3:32 PM, Peter Maydell <peter.maydell@linaro.org>
wrote:

> On 31 July 2015 at 10:29, Naman patel <naman321@gmail.com> wrote:
> > Can someone explain me what happens when a guest OS calls "invlpg" on say
> > page swap out or a context switch? What exactly is the call flow and how
> > QEMU handles this instruction?
>
> When we see the instruction during translation, we emit code
> which will
>
​In which function does the translation takes place?​


>  * get the argument to invlpg (extracting it from the
> relevant register, adding any constant offset required for
> the addressing mode, etc)
>
​Where exactly is it done?​


>  * make a call to helper_inlvpg().
> (target-i386/translate.c has the C code that does this codegen --
> search for invlpg)
>
​Thanks I got this function.​


>
> Later when that generated code is run, we call the helper, which
> does what it needs to do (in this case flush a page from QEMU's
> TLB cache). When the call returns we'll carry on executing whatever
> guest instruction comes next.
>
> > Also is there anyway QEMU can send some data
> > back to the guest OS?
>
> ​​
> INVLPG is just an x86 instruction that performs an operation;
> it doesn't modify any registers or flags. So there's no way
> for it to tell the guest OS anything.
>
​True that ​
​
INVLPG only invalidates a TLB entry but in general how can one send a data
structure(DS) back to guest OS from QEMU? I want to write my own function
that can send a DS back to the guest OS. Are there any similar functions
already present that sends back DS to guest? Or is it feasible?

>
> -- PMM
>


​Thanks a lot for this information. It helped a lot.

Regards,
Naman​

[-- Attachment #2: Type: text/html, Size: 3721 bytes --]

      reply	other threads:[~2015-08-04  6:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-30 12:20 [Qemu-devel] Call Trace for QEMU functions Naman patel
2015-07-30 13:59 ` Peter Maydell
2015-07-30 15:04   ` Alex Bennée
2015-07-31  9:29     ` Naman patel
2015-07-31 10:02       ` Peter Maydell
2015-08-04  6:04         ` Naman patel [this message]

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='CAAhtxhtkPADTCetjE0OVVE=a7hz2Sb6Su9manpHaR2NqJK49Eg@mail.gmail.com' \
    --to=naman321@gmail.com \
    --cc=alex.bennee@linaro.org \
    --cc=peter.maydell@linaro.org \
    --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).