Linux KVM/arm64 development list
 help / color / mirror / Atom feed
* Re: Using the ldp instruction to access the I/O address space in KVM mode causes an exception
       [not found] <SEZPR01MB4825C8FFB2994CC67225DB74A32E2@SEZPR01MB4825.apcprd01.prod.exchangelabs.com>
@ 2024-11-25 17:16 ` Marc Zyngier
  0 siblings, 0 replies; only message 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] only message in thread

only message in thread, other threads:[~2024-11-25 17:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <SEZPR01MB4825C8FFB2994CC67225DB74A32E2@SEZPR01MB4825.apcprd01.prod.exchangelabs.com>
2024-11-25 17:16 ` Using the ldp instruction to access the I/O address space in KVM mode causes an exception Marc Zyngier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox