* [Qemu-devel] [PATCH] This patch fixes processing of rfi instructions in icount mode.
@ 2018-10-30 12:21 Pavel Dovgalyuk
2018-11-07 18:25 ` Mark Cave-Ayland
0 siblings, 1 reply; 3+ messages in thread
From: Pavel Dovgalyuk @ 2018-10-30 12:21 UTC (permalink / raw)
To: qemu-devel; +Cc: maria.klimushenkova, dovgaluk, agraf, pavel.dovgaluk, david
From: Maria Klimushenkova <maria.klimushenkova@ispras.ru>
In this mode writing to interrupt/peripheral state is controlled
by can_do_io flag. This flag must be set explicitly before helper
function invocation.
Signed-off-by: Maria Klimushenkova <maria.klimushenkova@ispras.ru>
Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
---
target/ppc/translate.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index 987ce6e..980862c 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -3878,9 +3878,15 @@ static void gen_rfi(DisasContext *ctx)
}
/* Restore CPU state */
CHK_SV;
+ if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) {
+ gen_io_start();
+ }
gen_update_cfar(ctx, ctx->base.pc_next - 4);
gen_helper_rfi(cpu_env);
gen_sync_exception(ctx);
+ if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) {
+ gen_io_end();
+ }
#endif
}
@@ -3892,9 +3898,15 @@ static void gen_rfid(DisasContext *ctx)
#else
/* Restore CPU state */
CHK_SV;
+ if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) {
+ gen_io_start();
+ }
gen_update_cfar(ctx, ctx->base.pc_next - 4);
gen_helper_rfid(cpu_env);
gen_sync_exception(ctx);
+ if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) {
+ gen_io_end();
+ }
#endif
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] This patch fixes processing of rfi instructions in icount mode.
2018-10-30 12:21 [Qemu-devel] [PATCH] This patch fixes processing of rfi instructions in icount mode Pavel Dovgalyuk
@ 2018-11-07 18:25 ` Mark Cave-Ayland
2018-11-08 1:09 ` David Gibson
0 siblings, 1 reply; 3+ messages in thread
From: Mark Cave-Ayland @ 2018-11-07 18:25 UTC (permalink / raw)
To: Pavel Dovgalyuk, qemu-devel; +Cc: maria.klimushenkova, dovgaluk, agraf, david
On 30/10/2018 12:21, Pavel Dovgalyuk wrote:
> From: Maria Klimushenkova <maria.klimushenkova@ispras.ru>
>
> In this mode writing to interrupt/peripheral state is controlled
> by can_do_io flag. This flag must be set explicitly before helper
> function invocation.
>
> Signed-off-by: Maria Klimushenkova <maria.klimushenkova@ispras.ru>
> Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
> ---
> target/ppc/translate.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/target/ppc/translate.c b/target/ppc/translate.c
> index 987ce6e..980862c 100644
> --- a/target/ppc/translate.c
> +++ b/target/ppc/translate.c
> @@ -3878,9 +3878,15 @@ static void gen_rfi(DisasContext *ctx)
> }
> /* Restore CPU state */
> CHK_SV;
> + if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) {
> + gen_io_start();
> + }
> gen_update_cfar(ctx, ctx->base.pc_next - 4);
> gen_helper_rfi(cpu_env);
> gen_sync_exception(ctx);
> + if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) {
> + gen_io_end();
> + }
> #endif
> }
>
> @@ -3892,9 +3898,15 @@ static void gen_rfid(DisasContext *ctx)
> #else
> /* Restore CPU state */
> CHK_SV;
> + if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) {
> + gen_io_start();
> + }
> gen_update_cfar(ctx, ctx->base.pc_next - 4);
> gen_helper_rfid(cpu_env);
> gen_sync_exception(ctx);
> + if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) {
> + gen_io_end();
> + }
> #endif
> }
I've given this patch a spin on top of ppc-for-3.1 and it allows my test images to
boot with icount enabled without asserting, so:
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
ATB,
Mark.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] This patch fixes processing of rfi instructions in icount mode.
2018-11-07 18:25 ` Mark Cave-Ayland
@ 2018-11-08 1:09 ` David Gibson
0 siblings, 0 replies; 3+ messages in thread
From: David Gibson @ 2018-11-08 1:09 UTC (permalink / raw)
To: Mark Cave-Ayland
Cc: Pavel Dovgalyuk, qemu-devel, maria.klimushenkova, dovgaluk, agraf
[-- Attachment #1: Type: text/plain, Size: 2174 bytes --]
On Wed, Nov 07, 2018 at 06:25:19PM +0000, Mark Cave-Ayland wrote:
> On 30/10/2018 12:21, Pavel Dovgalyuk wrote:
>
> > From: Maria Klimushenkova <maria.klimushenkova@ispras.ru>
> >
> > In this mode writing to interrupt/peripheral state is controlled
> > by can_do_io flag. This flag must be set explicitly before helper
> > function invocation.
> >
> > Signed-off-by: Maria Klimushenkova <maria.klimushenkova@ispras.ru>
> > Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
> > ---
> > target/ppc/translate.c | 12 ++++++++++++
> > 1 file changed, 12 insertions(+)
> >
> > diff --git a/target/ppc/translate.c b/target/ppc/translate.c
> > index 987ce6e..980862c 100644
> > --- a/target/ppc/translate.c
> > +++ b/target/ppc/translate.c
> > @@ -3878,9 +3878,15 @@ static void gen_rfi(DisasContext *ctx)
> > }
> > /* Restore CPU state */
> > CHK_SV;
> > + if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) {
> > + gen_io_start();
> > + }
> > gen_update_cfar(ctx, ctx->base.pc_next - 4);
> > gen_helper_rfi(cpu_env);
> > gen_sync_exception(ctx);
> > + if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) {
> > + gen_io_end();
> > + }
> > #endif
> > }
> >
> > @@ -3892,9 +3898,15 @@ static void gen_rfid(DisasContext *ctx)
> > #else
> > /* Restore CPU state */
> > CHK_SV;
> > + if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) {
> > + gen_io_start();
> > + }
> > gen_update_cfar(ctx, ctx->base.pc_next - 4);
> > gen_helper_rfid(cpu_env);
> > gen_sync_exception(ctx);
> > + if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) {
> > + gen_io_end();
> > + }
> > #endif
> > }
>
> I've given this patch a spin on top of ppc-for-3.1 and it allows my test images to
> boot with icount enabled without asserting, so:
>
> Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Good enough for me. Applied to ppc-for-3.1.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-11-08 1:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-30 12:21 [Qemu-devel] [PATCH] This patch fixes processing of rfi instructions in icount mode Pavel Dovgalyuk
2018-11-07 18:25 ` Mark Cave-Ayland
2018-11-08 1:09 ` David Gibson
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).