qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] target/nios2: fix page-fit instruction count
@ 2021-05-11  8:40 Pavel Dovgalyuk
  2021-05-25  6:40 ` Pavel Dovgalyuk
  0 siblings, 1 reply; 6+ messages in thread
From: Pavel Dovgalyuk @ 2021-05-11  8:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: marex, pbonzini, richard.henderson, crwulff, pavel.dovgalyuk

This patch fixes calculation of number of the instructions
that fit the current page. It prevents creation of the translation
blocks that cross the page boundaries. It is required for deterministic
exception generation in icount mode.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/nios2/translate.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/nios2/translate.c b/target/nios2/translate.c
index 9824544eb3..399f22d938 100644
--- a/target/nios2/translate.c
+++ b/target/nios2/translate.c
@@ -829,7 +829,7 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns)
     /* Set up instruction counts */
     num_insns = 0;
     if (max_insns > 1) {
-        int page_insns = (TARGET_PAGE_SIZE - (tb->pc & TARGET_PAGE_MASK)) / 4;
+        int page_insns = (TARGET_PAGE_SIZE - (tb->pc & ~TARGET_PAGE_MASK)) / 4;
         if (max_insns > page_insns) {
             max_insns = page_insns;
         }



^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [PATCH] target/nios2: fix page-fit instruction count
@ 2021-04-05  8:20 Pavel Dovgalyuk
  2021-04-05 14:44 ` Richard Henderson
  0 siblings, 1 reply; 6+ messages in thread
From: Pavel Dovgalyuk @ 2021-04-05  8:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: marex, pbonzini, crwulff, pavel.dovgalyuk

This patch fixes calculation of number of the instructions
that fit the current page. It prevents creation of the translation
blocks that cross the page boundaries. It is required for deterministic
exception generation in icount mode.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
---
 target/nios2/translate.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/nios2/translate.c b/target/nios2/translate.c
index 9824544eb3..399f22d938 100644
--- a/target/nios2/translate.c
+++ b/target/nios2/translate.c
@@ -829,7 +829,7 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns)
     /* Set up instruction counts */
     num_insns = 0;
     if (max_insns > 1) {
-        int page_insns = (TARGET_PAGE_SIZE - (tb->pc & TARGET_PAGE_MASK)) / 4;
+        int page_insns = (TARGET_PAGE_SIZE - (tb->pc & ~TARGET_PAGE_MASK)) / 4;
         if (max_insns > page_insns) {
             max_insns = page_insns;
         }



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-06-05 19:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-11  8:40 [PATCH] target/nios2: fix page-fit instruction count Pavel Dovgalyuk
2021-05-25  6:40 ` Pavel Dovgalyuk
2021-05-25 14:28   ` Richard Henderson
2021-06-05 19:17     ` Laurent Vivier
  -- strict thread matches above, loose matches on Subject: below --
2021-04-05  8:20 Pavel Dovgalyuk
2021-04-05 14:44 ` Richard Henderson

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).