* [Qemu-devel] [PATCH 2/2][SPARC] Fix TA0_Shutdown feature
[not found] <BANLkTikeSfsp537pf-unOyR4ftxctmfP2w@mail.gmail.com>
@ 2011-05-17 15:32 ` Julien Grall
2011-05-17 19:57 ` Blue Swirl
0 siblings, 1 reply; 4+ messages in thread
From: Julien Grall @ 2011-05-17 15:32 UTC (permalink / raw)
To: qemu-devel; +Cc: Fabien Chouteau
Fix TA0_SHUTDOWN feature
Signed-off-by: Julien Grall <julien.grall@gmail.com>
---
target-sparc/op_helper.c | 13 +++++++++++--
target-sparc/translate.c | 9 +--------
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c
index a6fabad..cb775f5 100644
--- a/target-sparc/op_helper.c
+++ b/target-sparc/op_helper.c
@@ -326,8 +326,17 @@ void HELPER(raise_exception)(int tt)
void HELPER(trap_always)(int tt)
{
- env->exception_index = tt;
- do_interrupt(env);
+ if (tt == TT_TRAP
+ && env->def->features & CPU_FEATURE_TA0_SHUTDOWN
+#ifndef TARGET_SPARC64
+ && env->psret == 0
+#endif
+ ) {
+ helper_shutdown();
+ } else {
+ env->exception_index = tt;
+ do_interrupt(env);
+ }
}
void helper_shutdown(void)
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index b30003b..a47a2de 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -2009,14 +2009,7 @@ static void disas_sparc_insn(DisasContext * dc)
tcg_gen_addi_tl(cpu_dst, cpu_dst, TT_TRAP);
tcg_gen_trunc_tl_i32(cpu_tmp32, cpu_dst);
- if (rs2 == 0 &&
- dc->def->features & CPU_FEATURE_TA0_SHUTDOWN) {
-
- gen_helper_shutdown();
-
- } else {
- gen_helper_trap_always(cpu_tmp32);
- }
+ gen_helper_trap_always(cpu_tmp32);
} else if (cond != 0) {
TCGv r_cond = tcg_temp_new();
int l1;
--
1.7.4.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2][SPARC] Fix TA0_Shutdown feature
2011-05-17 15:32 ` [Qemu-devel] [PATCH 2/2][SPARC] Fix TA0_Shutdown feature Julien Grall
@ 2011-05-17 19:57 ` Blue Swirl
2011-05-18 13:17 ` Julien Grall
0 siblings, 1 reply; 4+ messages in thread
From: Blue Swirl @ 2011-05-17 19:57 UTC (permalink / raw)
To: Julien Grall; +Cc: qemu-devel, Fabien Chouteau
On Tue, May 17, 2011 at 6:32 PM, Julien Grall <julien.grall@gmail.com> wrote:
> Fix TA0_SHUTDOWN feature
But what would be the bug?
> Signed-off-by: Julien Grall <julien.grall@gmail.com>
> ---
> target-sparc/op_helper.c | 13 +++++++++++--
> target-sparc/translate.c | 9 +--------
> 2 files changed, 12 insertions(+), 10 deletions(-)
>
> diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c
> index a6fabad..cb775f5 100644
> --- a/target-sparc/op_helper.c
> +++ b/target-sparc/op_helper.c
> @@ -326,8 +326,17 @@ void HELPER(raise_exception)(int tt)
>
> void HELPER(trap_always)(int tt)
> {
> - env->exception_index = tt;
> - do_interrupt(env);
> + if (tt == TT_TRAP
> + && env->def->features & CPU_FEATURE_TA0_SHUTDOWN
> +#ifndef TARGET_SPARC64
> + && env->psret == 0
> +#endif
> + ) {
> + helper_shutdown();
> + } else {
> + env->exception_index = tt;
> + do_interrupt(env);
> + }
> }
>
> void helper_shutdown(void)
> diff --git a/target-sparc/translate.c b/target-sparc/translate.c
> index b30003b..a47a2de 100644
> --- a/target-sparc/translate.c
> +++ b/target-sparc/translate.c
> @@ -2009,14 +2009,7 @@ static void disas_sparc_insn(DisasContext * dc)
> tcg_gen_addi_tl(cpu_dst, cpu_dst, TT_TRAP);
> tcg_gen_trunc_tl_i32(cpu_tmp32, cpu_dst);
>
> - if (rs2 == 0 &&
> - dc->def->features & CPU_FEATURE_TA0_SHUTDOWN) {
> -
> - gen_helper_shutdown();
> -
> - } else {
> - gen_helper_trap_always(cpu_tmp32);
> - }
> + gen_helper_trap_always(cpu_tmp32);
No, this would actually be just opposite to how QEMU works.
Performance comes from doing more work at translation time in order to
save time during executing the generated code.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2][SPARC] Fix TA0_Shutdown feature
2011-05-17 19:57 ` Blue Swirl
@ 2011-05-18 13:17 ` Julien Grall
2011-05-20 16:03 ` Blue Swirl
0 siblings, 1 reply; 4+ messages in thread
From: Julien Grall @ 2011-05-18 13:17 UTC (permalink / raw)
To: Blue Swirl; +Cc: qemu-devel, Fabien Chouteau
On Tue, May 17, 2011 at 9:57 PM, Blue Swirl <blauwirbel@gmail.com> wrote:
> On Tue, May 17, 2011 at 6:32 PM, Julien Grall <julien.grall@gmail.com> wrote:
>> Fix TA0_SHUTDOWN feature
>
> But what would be the bug?
We try to add RTEMS's support on leon platform for QEMU. RTEMS uses
software trap 0 for various syscall.
The current implementation of TA0_SHUTDOWN breaks the RTEMS boot.
> No, this would actually be just opposite to how QEMU works.
> Performance comes from doing more work at translation time in order to
> save time during executing the generated code.
I agree, this solution slows down the execution, but I didn't find
another solution to fix this bug.
--
Grall Julien
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2][SPARC] Fix TA0_Shutdown feature
2011-05-18 13:17 ` Julien Grall
@ 2011-05-20 16:03 ` Blue Swirl
0 siblings, 0 replies; 4+ messages in thread
From: Blue Swirl @ 2011-05-20 16:03 UTC (permalink / raw)
To: Julien Grall; +Cc: qemu-devel, Fabien Chouteau
On Wed, May 18, 2011 at 4:17 PM, Julien Grall <julien.grall@gmail.com> wrote:
> On Tue, May 17, 2011 at 9:57 PM, Blue Swirl <blauwirbel@gmail.com> wrote:
>> On Tue, May 17, 2011 at 6:32 PM, Julien Grall <julien.grall@gmail.com> wrote:
>>> Fix TA0_SHUTDOWN feature
>>
>> But what would be the bug?
>
> We try to add RTEMS's support on leon platform for QEMU. RTEMS uses
> software trap 0 for various syscall.
> The current implementation of TA0_SHUTDOWN breaks the RTEMS boot.
>
>> No, this would actually be just opposite to how QEMU works.
>> Performance comes from doing more work at translation time in order to
>> save time during executing the generated code.
>
> I agree, this solution slows down the execution, but I didn't find
> another solution to fix this bug.
You should retain the feature check in translate.c but add a leon
specific helper in place of helper_shutdown, which can check for
psret.
It would be also possible to generate code for the psret check if the
helper overhead were an issue.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-05-20 16:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <BANLkTikeSfsp537pf-unOyR4ftxctmfP2w@mail.gmail.com>
2011-05-17 15:32 ` [Qemu-devel] [PATCH 2/2][SPARC] Fix TA0_Shutdown feature Julien Grall
2011-05-17 19:57 ` Blue Swirl
2011-05-18 13:17 ` Julien Grall
2011-05-20 16:03 ` 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).