From: Aurelien Jarno <aurelien@aurel32.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 0/7] target-arm: Translate based on TB flags, not CPUState
Date: Fri, 7 Jan 2011 17:01:17 +0100 [thread overview]
Message-ID: <20110107160117.GA25630@hall.aurel32.net> (raw)
In-Reply-To: <1294412794-25573-1-git-send-email-peter.maydell@linaro.org>
Hi,
On Fri, Jan 07, 2011 at 03:06:27PM +0000, Peter Maydell wrote:
> This patchset corrects a number of places in the ARM translation code
> which were generating code which was dependent on values in the CPUState
> structure which might change at runtime. This is a bad idea for two
> reasons. Firstly, we might try to reuse the generated code later when
> the assumptions baked into the generated code were no longer valid.
> Secondly, we might try to retranslate the same TB (eg when an exception
> results in our calling cpu_restore_state()) but get different generated
> code, which could result in qemu crashing.
>
> Bug https://bugs.launchpad.net/bugs/604872 is a particular example
> of the latter case involving the IT bits; this patchset fixes that bug.
>
> I believe that this patchset deals with all the problems. Remaining
> CPUState fields referred to in translate.c are either constant after
> system init or trigger flushing of affected TBs when they are changed.
>
> Peter Maydell (7):
> target-arm: Don't generate code specific to current CPU mode for SRS
> target-arm: Translate with VFP-enabled from TB flags, not CPUState
> target-arm: Translate with VFP len/stride from TB flags, not CPUState
> target-arm: Translate with Thumb state from TB flags, not CPUState
> target-arm: Translate with condexec bits from TB flags, not CPUState
> target-arm: Set privileged bit in TB flags correctly for M profile
> target-arm: Translate with user-state from TB flags, not CPUState
>
> target-arm/cpu.h | 17 +++++++++-
> target-arm/helper.c | 12 +++++-
> target-arm/translate.c | 88 ++++++++++++++++++-----------------------------
> 3 files changed, 60 insertions(+), 57 deletions(-)
>
Commenting here as it concerns all patches.
In overall I think it's the correct approach to fix the issue, this is
a really good cleanup. I have tested this patch series, and it clearly
improve armv7 support. However I am surprised it doesn't fix the issue
mentioned in https://bugs.launchpad.net/qemu/+bug/581335 , which seems
to be the same issue. Executing the testcase still returns 1 instead of
0 on QEMU.
My other concern is about the definition of the individual bits in the
flags. I have seen that you have tried to summarize the usage in the
patch 6, but the masks and shifts are still duplicated in different
files, which may leads to mistakes if the flags definition are changed.
Have you considered using #define as for example in the MIPS target?
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
next prev parent reply other threads:[~2011-01-07 16:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-07 15:06 [Qemu-devel] [PATCH 0/7] target-arm: Translate based on TB flags, not CPUState Peter Maydell
2011-01-07 15:06 ` [Qemu-devel] [PATCH 1/7] target-arm: Don't generate code specific to current CPU mode for SRS Peter Maydell
2011-01-07 16:01 ` Aurelien Jarno
2011-01-07 16:25 ` Peter Maydell
2011-01-07 15:06 ` [Qemu-devel] [PATCH 2/7] target-arm: Translate with VFP-enabled from TB flags, not CPUState Peter Maydell
2011-01-07 15:06 ` [Qemu-devel] [PATCH 3/7] target-arm: Translate with VFP len/stride " Peter Maydell
2011-01-07 15:06 ` [Qemu-devel] [PATCH 4/7] target-arm: Translate with Thumb state " Peter Maydell
2011-01-07 15:06 ` [Qemu-devel] [PATCH 5/7] target-arm: Translate with condexec bits " Peter Maydell
2011-01-07 15:06 ` [Qemu-devel] [PATCH 6/7] target-arm: Set privileged bit in TB flags correctly for M profile Peter Maydell
2011-01-07 15:06 ` [Qemu-devel] [PATCH 7/7] target-arm: Translate with user-state from TB flags, not CPUState Peter Maydell
2011-01-07 16:01 ` Aurelien Jarno [this message]
2011-01-07 16:12 ` [Qemu-devel] [PATCH 0/7] target-arm: Translate based on " Peter Maydell
2011-01-07 16:25 ` David Turner
2011-01-07 16:18 ` Peter Maydell
2011-01-07 17:50 ` Peter Maydell
2011-01-08 15:00 ` Aurelien Jarno
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=20110107160117.GA25630@hall.aurel32.net \
--to=aurelien@aurel32.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.