* [Qemu-devel] Cooperative BBL execution due to binary translation
@ 2011-10-16 2:19 felix.matenaar@rwth-aachen
2011-10-16 12:06 ` Blue Swirl
0 siblings, 1 reply; 3+ messages in thread
From: felix.matenaar@rwth-aachen @ 2011-10-16 2:19 UTC (permalink / raw)
To: qemu-devel
Hi *,
I have the following question regarding qemu binary translation of
target-i386 (and maybe other targets):
As far as I understood the code, when a basic block is executed, there
is no event which can interrupt the execution until the bbl reaches its
end and the control flow is then back at qemu. Is this right? Stumbled
over this when asking me why basic blocks are sometimes divided even if
there is no branch in it.
If so, is the reason for this that some application like that could
cause timing problems:
c = get_executable_memory(1Gb)
set(c, OPCODE_NOP, sizeof c)
jmp_into c
Regards,
Felix
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] Cooperative BBL execution due to binary translation
2011-10-16 2:19 [Qemu-devel] Cooperative BBL execution due to binary translation felix.matenaar@rwth-aachen
@ 2011-10-16 12:06 ` Blue Swirl
2011-10-16 14:30 ` Avi Kivity
0 siblings, 1 reply; 3+ messages in thread
From: Blue Swirl @ 2011-10-16 12:06 UTC (permalink / raw)
To: felix.matenaar@rwth-aachen; +Cc: qemu-devel
On Sun, Oct 16, 2011 at 2:19 AM, felix.matenaar@rwth-aachen
<felix.matenaar@rwth-aachen.de> wrote:
> Hi *,
>
> I have the following question regarding qemu binary translation of
> target-i386 (and maybe other targets):
>
> As far as I understood the code, when a basic block is executed, there
> is no event which can interrupt the execution until the bbl reaches its
> end and the control flow is then back at qemu. Is this right? Stumbled
> over this when asking me why basic blocks are sometimes divided even if
> there is no branch in it.
>
> If so, is the reason for this that some application like that could
> cause timing problems:
>
> c = get_executable_memory(1Gb)
> set(c, OPCODE_NOP, sizeof c)
> jmp_into c
Not really, we don't care very much about such timing problems.
Translation is limited so that the intermediate buffer does not
overflow, also page boundaries may not be crossed. If an instruction
may cause a fault, it will terminate the block.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] Cooperative BBL execution due to binary translation
2011-10-16 12:06 ` Blue Swirl
@ 2011-10-16 14:30 ` Avi Kivity
0 siblings, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2011-10-16 14:30 UTC (permalink / raw)
To: Blue Swirl; +Cc: felix.matenaar@rwth-aachen, qemu-devel
On 10/16/2011 02:06 PM, Blue Swirl wrote:
> >
> > c = get_executable_memory(1Gb)
> > set(c, OPCODE_NOP, sizeof c)
> > jmp_into c
>
> Not really, we don't care very much about such timing problems.
> Translation is limited so that the intermediate buffer does not
> overflow, also page boundaries may not be crossed. If an instruction
> may cause a fault, it will terminate the block.
On x86 an instruction may cross page boundary. So an instruction that
begins in one page may be interpreted differently depending on the
contents of the second page. But I see that the code handles it cleverly.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-10-16 14:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-16 2:19 [Qemu-devel] Cooperative BBL execution due to binary translation felix.matenaar@rwth-aachen
2011-10-16 12:06 ` Blue Swirl
2011-10-16 14:30 ` Avi Kivity
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).