Re: [PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation

2021-04-15 Thread Max Filippov
On Thu, Apr 15, 2021 at 8:03 AM Peter Maydell wrote: > > On Thu, 15 Apr 2021 at 02:24, Max Filippov wrote: > > I see a few places where target/xtensa may do that. E.g. it does that on > > entry > > to an exception handler to allow for debugging its first instruction. > > That should now be handl

Re: [PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation

2021-04-15 Thread Peter Maydell
On Thu, 15 Apr 2021 at 02:24, Max Filippov wrote: > I see a few places where target/xtensa may do that. E.g. it does that on entry > to an exception handler to allow for debugging its first instruction. That should now be handled by the common code, I think (see commits a7ba744f4082ab and ba3c35d

Re: [PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation

2021-04-15 Thread Richard Henderson
On 4/14/21 6:23 PM, Max Filippov wrote: I see a few places where target/xtensa may do that. E.g. it does that on entry to an exception handler to allow for debugging its first instruction. No guest code is consumed to make this decision, would size 1 work in that case? I'll take a look. Yes, an

Re: [PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation

2021-04-15 Thread Ilya Leoshkevich
On Wed, 2021-04-14 at 18:23 -0700, Max Filippov wrote: > On Wed, Apr 14, 2021 at 12:43 PM Richard Henderson > wrote: > > > > On 4/14/21 11:03 AM, Max Filippov wrote: > > > On Wed, Apr 14, 2021 at 9:51 AM Ilya Leoshkevich < > > > i...@linux.ibm.com> wrote: > > > > On Wed, 2021-04-14 at 16:48 +0200

Re: [PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation

2021-04-14 Thread Max Filippov
On Wed, Apr 14, 2021 at 12:43 PM Richard Henderson wrote: > > On 4/14/21 11:03 AM, Max Filippov wrote: > > On Wed, Apr 14, 2021 at 9:51 AM Ilya Leoshkevich wrote: > >> On Wed, 2021-04-14 at 16:48 +0200, David Hildenbrand wrote: > >>> Did you double-check the xtensa issue? > >> > >> Oh, I'm sorry,

Re: [PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation

2021-04-14 Thread Richard Henderson
On 4/14/21 11:03 AM, Max Filippov wrote: On Wed, Apr 14, 2021 at 9:51 AM Ilya Leoshkevich wrote: On Wed, 2021-04-14 at 16:48 +0200, David Hildenbrand wrote: Did you double-check the xtensa issue? Oh, I'm sorry, I completely forgot about that one. I just ran the test locally, and apparently i

Re: [PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation

2021-04-14 Thread Max Filippov
On Wed, Apr 14, 2021 at 9:51 AM Ilya Leoshkevich wrote: > On Wed, 2021-04-14 at 16:48 +0200, David Hildenbrand wrote: > > Did you double-check the xtensa issue? > > Oh, I'm sorry, I completely forgot about that one. I just ran the > test locally, and apparently it fails because of this new assert,

Re: [PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation

2021-04-14 Thread Ilya Leoshkevich
On Wed, 2021-04-14 at 16:48 +0200, David Hildenbrand wrote: > On 14.04.21 15:41, Ilya Leoshkevich wrote: > > If arch-specific code generates a translation block of size 0, > > tb_gen_code() may generate a spurious exception. Add an assertion > > in > > order to catch such situations early. > > > >

Re: [PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation

2021-04-14 Thread David Hildenbrand
On 14.04.21 15:41, Ilya Leoshkevich wrote: If arch-specific code generates a translation block of size 0, tb_gen_code() may generate a spurious exception. Add an assertion in order to catch such situations early. Signed-off-by: Ilya Leoshkevich --- accel/tcg/translate-all.c | 1 + 1 file cha

[PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation

2021-04-14 Thread Ilya Leoshkevich
If arch-specific code generates a translation block of size 0, tb_gen_code() may generate a spurious exception. Add an assertion in order to catch such situations early. Signed-off-by: Ilya Leoshkevich --- accel/tcg/translate-all.c | 1 + 1 file changed, 1 insertion(+) diff --git a/accel/tcg/tr