qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] x86 segment limits enforcement with TCG


From: Peter Maydell
Subject: Re: [Qemu-devel] x86 segment limits enforcement with TCG
Date: Sun, 24 Feb 2019 19:46:27 +0000

On Sun, 24 Feb 2019 at 19:37, Stephen Checkoway
<address@hidden> wrote:
> I think that something about adding the tcg_gen_brcond_tl is causing values 
> to become dead and then qemu aborts.

Yep -- all "TCG temporaries" are dead at the end
of a basic block, and brcond ends a basic block.
Only globals and "local temporaries" stay live
across brcond. This is documented in tcg/README,
though it doesn't spell it out very explicitly.

This makes brcond pretty painful to use and
almost impossible to introduce into the middle
of some existing sequence of generated code.
I haven't looked at what the best way to do what
you're trying to do here is, though.

By the way, don't do this:
+    dc->A1 = tcg_temp_new();

The current use of a small number of tcg temps
in the i386 translate.c code is an antipattern
that is a relic from a very old version of the
code. It's much better to simply create new
temporaries in the code at the point where you
need them and then free them once you're done.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]