* [Qemu-devel] [PATCH 1.1] target-xtensa: fix CCOUNT for conditional branches
@ 2012-05-27 23:18 Max Filippov
2012-06-09 11:30 ` Blue Swirl
0 siblings, 1 reply; 2+ messages in thread
From: Max Filippov @ 2012-05-27 23:18 UTC (permalink / raw)
To: qemu-devel; +Cc: Blue Swirl, Max Filippov, Anthony Liguori
Taken conditional branches fail to update CCOUNT register because
accumulated ccount_delta is reset during translation of non-taken
branch. To fix it only update CCOUNT once per conditional branch
instruction translation.
This fixes guest linux freeze on LTP waitpid06 test.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
target-xtensa/translate.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c
index 521c0e6..a542a31 100644
--- a/target-xtensa/translate.c
+++ b/target-xtensa/translate.c
@@ -388,6 +388,7 @@ static bool gen_check_loop_end(DisasContext *dc, int slot)
dc->next_pc == dc->lend) {
int label = gen_new_label();
+ gen_advance_ccount(dc);
tcg_gen_brcondi_i32(TCG_COND_EQ, cpu_SR[LCOUNT], 0, label);
tcg_gen_subi_i32(cpu_SR[LCOUNT], cpu_SR[LCOUNT], 1);
gen_jumpi(dc, dc->lbeg, slot);
@@ -410,6 +411,7 @@ static void gen_brcond(DisasContext *dc, TCGCond cond,
{
int label = gen_new_label();
+ gen_advance_ccount(dc);
tcg_gen_brcond_i32(cond, t0, t1, label);
gen_jumpi_check_loop_end(dc, 0);
gen_set_label(label);
--
1.7.7.6
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH 1.1] target-xtensa: fix CCOUNT for conditional branches
2012-05-27 23:18 [Qemu-devel] [PATCH 1.1] target-xtensa: fix CCOUNT for conditional branches Max Filippov
@ 2012-06-09 11:30 ` Blue Swirl
0 siblings, 0 replies; 2+ messages in thread
From: Blue Swirl @ 2012-06-09 11:30 UTC (permalink / raw)
To: Max Filippov; +Cc: Anthony Liguori, qemu-devel
Thanks, applied.
On Sun, May 27, 2012 at 11:18 PM, Max Filippov <jcmvbkbc@gmail.com> wrote:
> Taken conditional branches fail to update CCOUNT register because
> accumulated ccount_delta is reset during translation of non-taken
> branch. To fix it only update CCOUNT once per conditional branch
> instruction translation.
>
> This fixes guest linux freeze on LTP waitpid06 test.
>
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
> ---
> target-xtensa/translate.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c
> index 521c0e6..a542a31 100644
> --- a/target-xtensa/translate.c
> +++ b/target-xtensa/translate.c
> @@ -388,6 +388,7 @@ static bool gen_check_loop_end(DisasContext *dc, int slot)
> dc->next_pc == dc->lend) {
> int label = gen_new_label();
>
> + gen_advance_ccount(dc);
> tcg_gen_brcondi_i32(TCG_COND_EQ, cpu_SR[LCOUNT], 0, label);
> tcg_gen_subi_i32(cpu_SR[LCOUNT], cpu_SR[LCOUNT], 1);
> gen_jumpi(dc, dc->lbeg, slot);
> @@ -410,6 +411,7 @@ static void gen_brcond(DisasContext *dc, TCGCond cond,
> {
> int label = gen_new_label();
>
> + gen_advance_ccount(dc);
> tcg_gen_brcond_i32(cond, t0, t1, label);
> gen_jumpi_check_loop_end(dc, 0);
> gen_set_label(label);
> --
> 1.7.7.6
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-06-09 11:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-27 23:18 [Qemu-devel] [PATCH 1.1] target-xtensa: fix CCOUNT for conditional branches Max Filippov
2012-06-09 11:30 ` Blue Swirl
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).