qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* microblazeel-linux-user regression
@ 2025-08-24 20:18 Edgar E. Iglesias
  2025-09-30 10:24 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 3+ messages in thread
From: Edgar E. Iglesias @ 2025-08-24 20:18 UTC (permalink / raw)
  To: philmd; +Cc: qemu-devel, richard.henderson

Hi Phil,

While trying microblazeel-linux-user on the master branch I hit this:

$ qemu-microblazeel ctest
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault (core dumped)

Bisect found this commit:
415aae543edad19eda8f66955dde386c7fd7c680 is the first bad commit
commit 415aae543edad19eda8f66955dde386c7fd7c680
Author: Philippe Mathieu-Daudé <philmd@linaro.org>
Date:   Tue Sep 24 23:45:54 2024 +0200

    target/microblaze: Consider endianness while translating code
    
    Consider the CPU ENDI bit, swap instructions when the CPU
    endianness doesn't match the binary one.
    
    Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20241105130431.22564-17-philmd@linaro.org>

 target/microblaze/cpu.h       | 7 +++++++
 target/microblaze/translate.c | 5 +++--
 2 files changed, 10 insertions(+), 2 deletions(-)
bisect found first bad commit


It looks like we're getting the endianness wrong in this case.

This works:
qemu-microblazeel -cpu microblaze,little-endian=on ctest

Was this intended while moving towards single binary?

If yes, I wonder if we also should change the default to little-endian.
Big-endian MB is discontinued from newer Microblaze versions.
I'd rather have to type -cpu microblaze,little-endian=off for big-endian.

Cheers,
Edgar


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

* Re: microblazeel-linux-user regression
  2025-08-24 20:18 microblazeel-linux-user regression Edgar E. Iglesias
@ 2025-09-30 10:24 ` Philippe Mathieu-Daudé
  2025-10-02  8:31   ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-09-30 10:24 UTC (permalink / raw)
  To: Edgar E. Iglesias; +Cc: qemu-devel, richard.henderson, Gustavo Romero

Hi Edgar,

(sorry for the delay)

On 24/8/25 22:18, Edgar E. Iglesias wrote:
> Hi Phil,
> 
> While trying microblazeel-linux-user on the master branch I hit this:
> 
> $ qemu-microblazeel ctest
> qemu: uncaught target signal 11 (Segmentation fault) - core dumped
> Segmentation fault (core dumped)
> 
> Bisect found this commit:
> 415aae543edad19eda8f66955dde386c7fd7c680 is the first bad commit
> commit 415aae543edad19eda8f66955dde386c7fd7c680
> Author: Philippe Mathieu-Daudé <philmd@linaro.org>
> Date:   Tue Sep 24 23:45:54 2024 +0200
> 
>      target/microblaze: Consider endianness while translating code
>      
>      Consider the CPU ENDI bit, swap instructions when the CPU
>      endianness doesn't match the binary one.
>      
>      Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>      Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>      Message-Id: <20241105130431.22564-17-philmd@linaro.org>
> 
>   target/microblaze/cpu.h       | 7 +++++++
>   target/microblaze/translate.c | 5 +++--
>   2 files changed, 10 insertions(+), 2 deletions(-)
> bisect found first bad commit
> 
> 
> It looks like we're getting the endianness wrong in this case.
> 
> This works:
> qemu-microblazeel -cpu microblaze,little-endian=on ctest
> 
> Was this intended while moving towards single binary?

Yes!

> If yes, I wonder if we also should change the default to little-endian.
> Big-endian MB is discontinued from newer Microblaze versions.
> I'd rather have to type -cpu microblaze,little-endian=off for big-endian.

I suspect it is just a matter of updating get_elf_cpu_model() in
linux-user/microblaze/elfload.c to not use 'any' CPU by default.

I wonder why our CI didn't bark, since we run:

  $ make run-tcg-tests-microblaze-linux-user

Oh, now I see, the log is filled with:

   SKIPPED gdbstub test $FOO on microblaze because need working gdb with 
microblaze support
   ...

So we aren't testing microblaze user-mode...

$ ./qemu-microblaze tests/tcg/microblaze-linux-user/sha1
SHA1=70f1d4d65eb47309ffacc5a28ff285ad826006da
$ ./qemu-microblazeel tests/tcg/microblaze-linux-user/sha1
qemu-microblazeel: tests/tcg/microblaze-linux-user/sha1: Invalid ELF 
image for this architecture

Do you mind sharing your ctest binary? (Also consider adding it
to tests/tcg/microblaze/).

Regards,

Phil.


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

* Re: microblazeel-linux-user regression
  2025-09-30 10:24 ` Philippe Mathieu-Daudé
@ 2025-10-02  8:31   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-10-02  8:31 UTC (permalink / raw)
  To: Edgar E. Iglesias
  Cc: qemu-devel, richard.henderson, Gustavo Romero, Edgar E. Iglesias

(Cc'ing to Edgar work's address)

On 30/9/25 12:24, Philippe Mathieu-Daudé wrote:
> Hi Edgar,
> 
> (sorry for the delay)
> 
> On 24/8/25 22:18, Edgar E. Iglesias wrote:
>> Hi Phil,
>>
>> While trying microblazeel-linux-user on the master branch I hit this:
>>
>> $ qemu-microblazeel ctest
>> qemu: uncaught target signal 11 (Segmentation fault) - core dumped
>> Segmentation fault (core dumped)
>>
>> Bisect found this commit:
>> 415aae543edad19eda8f66955dde386c7fd7c680 is the first bad commit
>> commit 415aae543edad19eda8f66955dde386c7fd7c680
>> Author: Philippe Mathieu-Daudé <philmd@linaro.org>
>> Date:   Tue Sep 24 23:45:54 2024 +0200
>>
>>      target/microblaze: Consider endianness while translating code
>>      Consider the CPU ENDI bit, swap instructions when the CPU
>>      endianness doesn't match the binary one.
>>      Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>      Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>>      Message-Id: <20241105130431.22564-17-philmd@linaro.org>
>>
>>   target/microblaze/cpu.h       | 7 +++++++
>>   target/microblaze/translate.c | 5 +++--
>>   2 files changed, 10 insertions(+), 2 deletions(-)
>> bisect found first bad commit
>>
>>
>> It looks like we're getting the endianness wrong in this case.
>>
>> This works:
>> qemu-microblazeel -cpu microblaze,little-endian=on ctest
>>
>> Was this intended while moving towards single binary?
> 
> Yes!
> 
>> If yes, I wonder if we also should change the default to little-endian.
>> Big-endian MB is discontinued from newer Microblaze versions.
>> I'd rather have to type -cpu microblaze,little-endian=off for big-endian.
> 
> I suspect it is just a matter of updating get_elf_cpu_model() in
> linux-user/microblaze/elfload.c to not use 'any' CPU by default.
> 
> I wonder why our CI didn't bark, since we run:
> 
>   $ make run-tcg-tests-microblaze-linux-user
> 
> Oh, now I see, the log is filled with:
> 
>    SKIPPED gdbstub test $FOO on microblaze because need working gdb with 
> microblaze support
>    ...
> 
> So we aren't testing microblaze user-mode...
> 
> $ ./qemu-microblaze tests/tcg/microblaze-linux-user/sha1
> SHA1=70f1d4d65eb47309ffacc5a28ff285ad826006da
> $ ./qemu-microblazeel tests/tcg/microblaze-linux-user/sha1
> qemu-microblazeel: tests/tcg/microblaze-linux-user/sha1: Invalid ELF 
> image for this architecture
> 
> Do you mind sharing your ctest binary? (Also consider adding it
> to tests/tcg/microblaze/).
> 
> Regards,
> 
> Phil.



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

end of thread, other threads:[~2025-10-02  8:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-24 20:18 microblazeel-linux-user regression Edgar E. Iglesias
2025-09-30 10:24 ` Philippe Mathieu-Daudé
2025-10-02  8:31   ` Philippe Mathieu-Daudé

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