* QEMU Compatibility for Cortex-A55 AArch32 Firmware
@ 2024-03-06 9:02 yb liu
2024-03-06 15:24 ` Peter Maydell
0 siblings, 1 reply; 4+ messages in thread
From: yb liu @ 2024-03-06 9:02 UTC (permalink / raw)
To: qemu-discuss, qemu-devel, qemu-arm
[-- Attachment #1: Type: text/plain, Size: 658 bytes --]
Dear QEMU developers
I hope this email finds you well. We are currently facing an issue related
to QEMU and the Cortex-A55 architecture. Specifically, we have compiled a
firmware for Cortex-A55 and would like it to run smoothly on QEMU A55 in
AArch32 mode.
Despite our numerous attempts, we continue to encounter an "undefined
instruction" error when running the firmware in QEMU. Our question is
whether QEMU supports this particular use case—specifically, whether it can
handle A55 running AArch32 firmware.
Any insights or guidance you can provide would be greatly appreciated.
Thank you for your assistance.
Best regards,
Eric Lau
[-- Attachment #2: Type: text/html, Size: 1031 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: QEMU Compatibility for Cortex-A55 AArch32 Firmware
2024-03-06 9:02 QEMU Compatibility for Cortex-A55 AArch32 Firmware yb liu
@ 2024-03-06 15:24 ` Peter Maydell
2024-03-07 1:03 ` yb liu
0 siblings, 1 reply; 4+ messages in thread
From: Peter Maydell @ 2024-03-06 15:24 UTC (permalink / raw)
To: yb liu; +Cc: qemu-discuss, qemu-devel, qemu-arm
On Wed, 6 Mar 2024 at 14:33, yb liu <liuyb845@gmail.com> wrote:
>
>
> Dear QEMU developers
>
> I hope this email finds you well. We are currently facing an issue related to QEMU and the Cortex-A55 architecture. Specifically, we have compiled a firmware for Cortex-A55 and would like it to run smoothly on QEMU A55 in AArch32 mode.
>
> Despite our numerous attempts, we continue to encounter an "undefined instruction" error when running the firmware in QEMU. Our question is whether QEMU supports this particular use case—specifically, whether it can handle A55 running AArch32 firmware.
We have Cortex-A55 emulation, but you may be running into one
of a few problems:
* we might have a bug
* firmware sometimes does very low level stuff that no other guest
code does, so it might run into something we didn't get round
to implementing (eg it is trying to touch one of the implementation
specific system registers: we tend to implement these as "does
nothing" stubs, but it looks like we didn't bother for the A55,
presumably because Linux didn't care)
* your guest code might be doing something that works on the
real A55 hardware but which is architecturally UNPREDICTABLE:
QEMU doesn't try to exactly match device-specific IMPDEF
and UNPREDICTABLE things
* your guest code might be assuming the presence of some feature
that your real A55 has but which QEMU doesn't implement
(for instance we implement only the absolute minimum RAS
support required by the architecture, not the full RAS
that hardware implements)
The thing you'd need to do is look at exactly what the UNDEF
instruction is (and what the guest code that causes it is
trying to do) to figure out which of these is the problem.
Some of these might be easy to fix; some would be harder.
If you're in a position to be able to modify the firmware
image then that would also allow you to work around missing
QEMU functionality if necessary.
The more usual reason guest firmware not working in QEMU is
not the CPU emulation itself but lack of a model of the
device/SoC/etc hardware that the firmware assumes it's
running on.
-- PMM
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: QEMU Compatibility for Cortex-A55 AArch32 Firmware
2024-03-06 15:24 ` Peter Maydell
@ 2024-03-07 1:03 ` yb liu
2024-03-07 10:59 ` Peter Maydell
0 siblings, 1 reply; 4+ messages in thread
From: yb liu @ 2024-03-07 1:03 UTC (permalink / raw)
To: Peter Maydell; +Cc: qemu-discuss, qemu-devel, qemu-arm
[-- Attachment #1: Type: text/plain, Size: 2817 bytes --]
Thanks a lot for you respond me soon!
The exact instruction is mrc, and the exception happended in early boot
process. I have no idea to how to debug this error because it happended in
code_gen_prologue.
I need to comform that whether QEMU A55 fully supports aarch32 mode. If it
need me to add addition instructions to support this function, I will
suspend this task for now.
I hope to get your respond as soon as possible.
Best regards!
Peter Maydell <peter.maydell@linaro.org> 于 2024年3月6日周三 23:24写道:
> On Wed, 6 Mar 2024 at 14:33, yb liu <liuyb845@gmail.com> wrote:
> >
> >
> > Dear QEMU developers
> >
> > I hope this email finds you well. We are currently facing an issue
> related to QEMU and the Cortex-A55 architecture. Specifically, we have
> compiled a firmware for Cortex-A55 and would like it to run smoothly on
> QEMU A55 in AArch32 mode.
> >
> > Despite our numerous attempts, we continue to encounter an "undefined
> instruction" error when running the firmware in QEMU. Our question is
> whether QEMU supports this particular use case—specifically, whether it can
> handle A55 running AArch32 firmware.
>
> We have Cortex-A55 emulation, but you may be running into one
> of a few problems:
> * we might have a bug
> * firmware sometimes does very low level stuff that no other guest
> code does, so it might run into something we didn't get round
> to implementing (eg it is trying to touch one of the implementation
> specific system registers: we tend to implement these as "does
> nothing" stubs, but it looks like we didn't bother for the A55,
> presumably because Linux didn't care)
> * your guest code might be doing something that works on the
> real A55 hardware but which is architecturally UNPREDICTABLE:
> QEMU doesn't try to exactly match device-specific IMPDEF
> and UNPREDICTABLE things
> * your guest code might be assuming the presence of some feature
> that your real A55 has but which QEMU doesn't implement
> (for instance we implement only the absolute minimum RAS
> support required by the architecture, not the full RAS
> that hardware implements)
>
> The thing you'd need to do is look at exactly what the UNDEF
> instruction is (and what the guest code that causes it is
> trying to do) to figure out which of these is the problem.
> Some of these might be easy to fix; some would be harder.
> If you're in a position to be able to modify the firmware
> image then that would also allow you to work around missing
> QEMU functionality if necessary.
>
> The more usual reason guest firmware not working in QEMU is
> not the CPU emulation itself but lack of a model of the
> device/SoC/etc hardware that the firmware assumes it's
> running on.
>
> -- PMM
>
[-- Attachment #2: Type: text/html, Size: 3402 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: QEMU Compatibility for Cortex-A55 AArch32 Firmware
2024-03-07 1:03 ` yb liu
@ 2024-03-07 10:59 ` Peter Maydell
0 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2024-03-07 10:59 UTC (permalink / raw)
To: yb liu; +Cc: qemu-discuss, qemu-devel, qemu-arm
On Thu, 7 Mar 2024 at 01:03, yb liu <liuyb845@gmail.com> wrote:
>
> Thanks a lot for you respond me soon!
> The exact instruction is mrc, and the exception happended in early boot process. I have no idea to how to debug this error because it happended in code_gen_prologue.
That's a system register access. If you can tell us
the entire instruction (in particular with all the
opn/crn/crm/etc arguments) we can look at what register
it is.
thanks
-- PMM
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-03-07 11:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-06 9:02 QEMU Compatibility for Cortex-A55 AArch32 Firmware yb liu
2024-03-06 15:24 ` Peter Maydell
2024-03-07 1:03 ` yb liu
2024-03-07 10:59 ` Peter Maydell
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).