Re: Why does the vmovdqu works for passthrough device but crashes for emulated device with "illegal operand" error (in x86_64 QEMU, -accel = kvm) ?

2024-03-05 Thread Xu Liu
Thanks Jim! > On Mar 4, 2024, at 10:10 PM, Jim Mattson wrote: > > !---| > This Message Is From an External Sender > > |---! > > On Mon, M

Re: Why does the vmovdqu works for passthrough device but crashes for emulated device with "illegal operand" error (in x86_64 QEMU, -accel = kvm) ?

2024-03-04 Thread Xu Liu
Hey Alex and Paolo, I saw there is some code related to AVX https://elixir.bootlin.com/linux/latest/source/arch/x86/kvm/emulate.c#L668 Does that mean in some special cases, kvm supports AVX instructions ? I didn’t really know the big picture, so just guess what it is doing . Thanks, Xu > On M

Re: Why does the vmovdqu works for passthrough device but crashes for emulated device with "illegal operand" error (in x86_64 QEMU, -accel = kvm) ?

2024-03-04 Thread Xu Liu
Hey Paolo, Thanks for confirming that the AVX is not supported for MMIO space. So for the emulated device, basically I have to force the compiler avoid using vmovdqu . I am curious about how kvm emulates those instructions. Do you mind sharing some related code pointer ? Thanks, Xu On Mar 4,

Re: Why does the vmovdqu works for passthrough device but crashes for emulated device with "illegal operand" error (in x86_64 QEMU, -accel = kvm) ?

2024-03-04 Thread Xu Liu
M, Alex Williamson wrote: !---| This Message Is From an External Sender |---! On Sun, 3 Mar 2024 22:20:33 + Xu Liu mailto:li...@meta.com>> wrote: Hello, Recently I am running my

Re: Why does the vmovdqu works for passthrough device but crashes for emulated device with "illegal operand" error (in x86_64 QEMU, -accel = kvm) ?

2024-03-04 Thread Xu Liu
4:59 PM, Alex Williamson wrote: !---| This Message Is From an External Sender |---! On Sun, 3 Mar 2024 22:20:33 + Xu Liu mailto:li...@meta.com>> wrote: H

Why does the vmovdqu works for passthrough device but crashes for emulated device with "illegal operand" error (in x86_64 QEMU, -accel = kvm) ?

2024-03-03 Thread Xu Liu
Hello, Recently I am running my programs in QEMU (x86_64) with “-accel=kvm”. The QEMU version is 6.0.0. I run my programs in two ways: 1. I pass through my device through vfio-pci to QEMU, this way works well. 2. I write an emulated PCI device for QEMU, and run my programs on the emulat

Fwd: How do I make my emulated device's DMA go through viommu ?

2024-02-14 Thread Xu Liu
Begin forwarded message: From: Xu Liu Subject: How do I make my emulated device's DMA go through viommu ? Date: February 14, 2024 at 11:46:04 AM EST To: "qemu-disc...@nongnu.org" Cc: 刘旭 , Xu Liu Hello, All I am working a project, which has a custom emulated PCI device for