* Using the ldp instruction to access the I/O address space in KVM mode causes an exception
@ 2024-11-25 0:11 赖株锋
2024-11-25 17:16 ` Marc Zyngier
0 siblings, 1 reply; 2+ messages in thread
From: 赖株锋 @ 2024-11-25 0:11 UTC (permalink / raw)
To: kvm@vger.kernel.org
I am running ARM64 emulation using QEMU’s KVM mode on an ARM64 device, but I encountered the following exception when booting the guest Linux kernel.
error: kvm run failed Function not implemented
PC=ffff800008e201e0 X00=ffff00208a63b000 X01=0000000000000000
And the instruction pointed to by the PC register is 0xffff800008e201e0: ldp q11, q12, [x22], where the address held by the x22 register belongs to the address space of the nic.
After testing, it was found that using the ldp instruction to access peripheral address spaces causes issues, but accessing RAM works normally. What could be the cause of this issue, and are there any solutions to resolve this problem?
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Using the ldp instruction to access the I/O address space in KVM mode causes an exception
2024-11-25 0:11 Using the ldp instruction to access the I/O address space in KVM mode causes an exception 赖株锋
@ 2024-11-25 17:16 ` Marc Zyngier
0 siblings, 0 replies; 2+ messages in thread
From: Marc Zyngier @ 2024-11-25 17:16 UTC (permalink / raw)
To: 赖株锋; +Cc: kvm@vger.kernel.org, kvmarm
+ kvmarm
On Mon, 25 Nov 2024 00:11:22 +0000,
赖株锋 <csumushu@gmail.com> wrote:
>
> I am running ARM64 emulation using QEMU’s KVM mode on an ARM64 device, but I encountered the following exception when booting the guest Linux kernel.
> error: kvm run failed Function not implemented
> PC=ffff800008e201e0 X00=ffff00208a63b000 X01=0000000000000000
> And the instruction pointed to by the PC register is
> 0xffff800008e201e0: ldp q11, q12, [x22], where the address held by
> the x22 register belongs to the address space of the nic.
> After testing, it was found that using the ldp instruction to access
> peripheral address spaces causes issues, but accessing RAM works
> normally. What could be the cause of this issue, and are there any
> solutions to resolve this problem?
The cause of the issue is that such an instruction is not emulatable,
because it uses more than a single register. In your case, it is even
worse, as you are using FP registers to access emulated MMIO,
something that is unlikely to work correctly on real HW (depending on
the alignment of the address in x22).
What QEMU *could* do is to implement enough instruction emulation (by
reading the offending instruction from guest memory), and emulating it
(see how KVM_CAP_ARM_NISV_TO_USER can be used for this purpose).
But frankly, you are asking for trouble here, and you really should
fix your code.
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-11-25 17:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-25 0:11 Using the ldp instruction to access the I/O address space in KVM mode causes an exception 赖株锋
2024-11-25 17:16 ` Marc Zyngier
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.