qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: casmac <climber.cui@qq.com>
Cc: "Peter&nbsp; Maydell" <peter.maydell@linaro.org>,
	qemu-devel <qemu-devel@nongnu.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: Re: 回复: Why QEMU translates one instruction to a TB?
Date: Fri, 18 Sep 2020 11:04:28 +0100	[thread overview]
Message-ID: <871rizxuxf.fsf@linaro.org> (raw)
In-Reply-To: <tencent_6FBC0FD37CA798D4766FE6B2822DAC3E2908@qq.com>


casmac <climber.cui@qq.com> writes:

> Hello , 
>
> &nbsp; thanks for the hints. I modified one parameter of&nbsp; memory_region_init_ram() call ,and the slow-path problem disappeared. 
>
> &nbsp; What I did is , change the RAM size from the exact memory size needed to hold the object file section(s), to the size that TI C3X user manual memory mapping specifies. 
>
> &nbsp; The former size is significantly smaller. But I did not specify the memory mapping else where in the program, so still unsure about the cause of conflict. 
>

Well you should be modelling the system - not what is actually loaded.

<snip>
> &gt; &nbsp; &nbsp; One intresting fact is that this somehow depends on the linker
> &gt; command file. The object file generated by the following linker command
> &gt; file(per_instr.lds)
> &gt; will "trigger" the problem. But QEMU work well with the object file
> &gt; linked by the other linker command file (ok.lds).
> &gt; &nbsp; &nbsp; What cause get_page_addr_code_hostp() function to return -1? I have
> &gt; no clue at all. Any advise is appreciated!!
>
> Maybe the "execute from small-MMU-region RAM" problem?
>
> See:
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg549660.html

That is the change that introduced the ability to do this. On some SoCs
you often run small amounts of boot code from device memory (or on-chip
chache) while the main system memory is setup. Usually it's not a large
amount of code so doing it one instruction at a time isn't a massive
burden.

You have to do it this way because the underlying instruction may change
each time you read that memory. In normal system RAM we have
architectural hints such as flushing events which eventually end up as
tlb-flush events that ensure code is re-translated when needed.

-- 
Alex Bennée


  parent reply	other threads:[~2020-09-18 10:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <tencent_EAC696641F035EB7E9885302EAAE37455907@qq.com>
2020-09-17  7:38 ` Why QEMU translates one instruction to a TB? Philippe Mathieu-Daudé
2020-09-17  7:45 ` Philippe Mathieu-Daudé
     [not found]   ` <tencent_6FBC0FD37CA798D4766FE6B2822DAC3E2908@qq.com>
2020-09-18  9:39     ` Peter Maydell
2020-09-18 10:04     ` Alex Bennée [this message]
2020-09-17  8:41 ` 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=871rizxuxf.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=climber.cui@qq.com \
    --cc=f4bug@amsat.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).