Using virtual IOMMU in guest hypervisors other than KVM and Xen?

2019-10-14 Thread Jintack Lim
Hi, I'm trying to pass through a physical network device to a nested VM using virtual IOMMU. While I was able to do it successfully using KVM and Xen guest hypervisors running in a VM respectively, I couldn't do it with Hyper-V as I described below. I wonder if anyone have successfully used virtua

Re: Using virtual IOMMU in guest hypervisors other than KVM and Xen?

2019-10-16 Thread Jintack Lim
On Mon, Oct 14, 2019 at 7:50 PM Peter Xu wrote: > > On Mon, Oct 14, 2019 at 01:28:49PM -0700, Jintack Lim wrote: > > Hi, > > Hello, Jintack, > Hi Peter, > > > > I'm trying to pass through a physical network device to a nested VM > > using virtual I

Re: Using virtual IOMMU in guest hypervisors other than KVM and Xen?

2019-10-18 Thread Jintack Lim
On Fri, Oct 18, 2019 at 8:37 PM Peter Xu wrote: > > On Wed, Oct 16, 2019 at 03:01:22PM -0700, Jintack Lim wrote: > > On Mon, Oct 14, 2019 at 7:50 PM Peter Xu wrote: > > > > > > On Mon, Oct 14, 2019 at 01:28:49PM -0700, Jintack Lim wrote: > > > > Hi, >

Re: [Qemu-devel] [PATCH] intel_iommu: make sure its init before PCI dev

2017-02-22 Thread Jintack Lim
On Wed, Feb 22, 2017 at 12:49 AM, Peter Xu wrote: > Intel vIOMMU devices are created with "-device" parameter, while here > actually we need to make sure this device will be created before some > other PCI devices (like vfio-pci devices) so that we know iommu_fn will > be setup correctly before r

Re: [Qemu-devel] [PATCH] vfio/pci: Improve extended capability comments, skip masked caps

2017-02-22 Thread Jintack Lim
lity. > > */ > > pci_set_long(pdev->config + PCI_CONFIG_SPACE_SIZE, > > PCI_EXT_CAP(0x, 0, 0)); > > @@ -1915,6 +1925,7 @@ static void vfio_add_ext_cap(VFIOPCIDevice *vdev) > > PCI_EXT_CAP_NEXT_MASK);

Re: [Qemu-devel] [PATCH] intel_iommu: make sure its init before PCI dev

2017-02-22 Thread Jintack Lim
On Wed, Feb 22, 2017 at 6:42 AM, Jintack Lim wrote: > > > On Wed, Feb 22, 2017 at 12:49 AM, Peter Xu wrote: > >> Intel vIOMMU devices are created with "-device" parameter, while here >> actually we need to make sure this device will be created before some &

Re: [Qemu-devel] iommu emulation

2017-02-23 Thread Jintack Lim
[cc Bandan] On Tue, Feb 21, 2017 at 5:33 AM, Jintack Lim wrote: > > > On Wed, Feb 15, 2017 at 9:47 PM, Alex Williamson < > alex.william...@redhat.com> wrote: > >> On Thu, 16 Feb 2017 10:28:39 +0800 >> Peter Xu wrote: >> >> > On Wed, Feb 15,

Re: [Qemu-devel] iommu emulation

2017-03-02 Thread Jintack Lim
On Thu, Mar 2, 2017 at 5:20 PM, Bandan Das wrote: > Jintack Lim writes: > >> [cc Bandan] >> >> On Tue, Feb 21, 2017 at 5:33 AM, Jintack Lim >> wrote: >> >>> >>> >>> On Wed, Feb 15, 2017 at 9:47 PM, Alex Williamson < >>

Re: [Qemu-devel] iommu emulation

2017-02-09 Thread Jintack Lim
On Wed, Feb 8, 2017 at 10:52 PM, Peter Xu wrote: > (cc qemu-devel and Alex) > > On Wed, Feb 08, 2017 at 09:14:03PM -0500, Jintack Lim wrote: >> On Wed, Feb 8, 2017 at 10:49 AM, Jintack Lim wrote: >> > Hi Peter, >> > >> > On Tue, Feb 7, 2017 at 10:12

Re: [Qemu-devel] iommu emulation

2017-02-14 Thread Jintack Lim
On Tue, Feb 14, 2017 at 2:35 AM, Peter Xu wrote: > On Thu, Feb 09, 2017 at 08:01:14AM -0500, Jintack Lim wrote: > > On Wed, Feb 8, 2017 at 10:52 PM, Peter Xu wrote: > > > (cc qemu-devel and Alex) > > > > > > On Wed, Feb 08, 2017 at 09:14:03PM -0500, Jintack L

Re: [Qemu-devel] iommu emulation

2017-02-15 Thread Jintack Lim
On Tue, Feb 14, 2017 at 9:52 PM, Peter Xu wrote: > On Tue, Feb 14, 2017 at 07:50:39AM -0500, Jintack Lim wrote: > > [...] > > > > > >> > I misunderstood what you said? > > > > > > > > > > I failed to understand why an vIOMMU coul

Re: [Qemu-devel] iommu emulation

2017-02-15 Thread Jintack Lim
On Wed, Feb 15, 2017 at 5:50 PM, Alex Williamson wrote: > On Wed, 15 Feb 2017 17:05:35 -0500 > Jintack Lim wrote: > > > On Tue, Feb 14, 2017 at 9:52 PM, Peter Xu wrote: > > > > > On Tue, Feb 14, 2017 at 07:50:39AM -0500, Jintack Lim wrote: > > &g

Re: [Qemu-devel] iommu emulation

2017-02-21 Thread Jintack Lim
On Wed, Feb 15, 2017 at 9:47 PM, Alex Williamson wrote: > On Thu, 16 Feb 2017 10:28:39 +0800 > Peter Xu wrote: > > > On Wed, Feb 15, 2017 at 11:15:52AM -0700, Alex Williamson wrote: > > > > [...] > > > > > > Alex, do you like something like below to fix above issue that > Jintack > > > > has enc

[Qemu-devel] Logging dirty pages from vhost-net in-kernel with vIOMMU

2018-12-04 Thread Jintack Lim
Hi, I'm wondering how the current implementation works when logging dirty pages during migration from vhost-net (in kernel) when used vIOMMU. I understand how vhost-net logs GPAs when not using vIOMMU. But when we use vhost with vIOMMU, then shouldn't vhost-net need to log the translated address

Re: [Qemu-devel] Logging dirty pages from vhost-net in-kernel with vIOMMU

2018-12-05 Thread Jintack Lim
On Tue, Dec 4, 2018 at 8:30 PM Jason Wang wrote: > > > On 2018/12/5 上午2:37, Jintack Lim wrote: > > Hi, > > > > I'm wondering how the current implementation works when logging dirty > > pages during migration from vhost-net (in kernel) when used vIOMMU. > &

Re: [Qemu-devel] Logging dirty pages from vhost-net in-kernel with vIOMMU

2018-12-06 Thread Jintack Lim
On Thu, Dec 6, 2018 at 2:33 AM Jason Wang wrote: > > > On 2018/12/5 下午10:47, Jintack Lim wrote: > > On Tue, Dec 4, 2018 at 8:30 PM Jason Wang wrote: > >> > >> On 2018/12/5 上午2:37, Jintack Lim wrote: > >>> Hi, > >>> > >>>

Re: [Qemu-devel] Logging dirty pages from vhost-net in-kernel with vIOMMU

2018-12-09 Thread Jintack Lim
On Fri, Dec 7, 2018 at 7:37 AM Jason Wang wrote: > > > On 2018/12/6 下午8:44, Jason Wang wrote: > > > > On 2018/12/6 下午8:11, Jintack Lim wrote: > >> On Thu, Dec 6, 2018 at 2:33 AM Jason Wang wrote: > >>> > >>> On 2018/12/5 下午10:47, Jintack

[Qemu-devel] Virtual IOMMU is working for Windows VM?

2018-10-21 Thread Jintack Lim
Hi, I wonder if vIOMMU is working for Windows VM? I tried it with v2.11.0, but it didn't seem to work. I assume that seaBIOS sets IOMMU on by default as is the case when I launched a Linux VM. But I might be missing something. Can somebody shed some light on it? Thanks, Jintack

Re: [Qemu-devel] Virtual IOMMU is working for Windows VM?

2018-10-22 Thread Jintack Lim
On Mon, Oct 22, 2018 at 5:27 AM Peter Xu wrote: > > On Mon, Oct 22, 2018 at 12:22:02AM -0400, Jintack Lim wrote: > > Hi, > > > > I wonder if vIOMMU is working for Windows VM? > > > > I tried it with v2.11.0, but it didn't seem to work. I assume that seaBI

Re: [Qemu-devel] Virtual IOMMU is working for Windows VM?

2018-10-23 Thread Jintack Lim
On Tue, Oct 23, 2018 at 9:25 AM Peter Xu wrote: > > On Mon, Oct 22, 2018 at 10:43:32AM -0400, Jintack Lim wrote: > > On Mon, Oct 22, 2018 at 5:27 AM Peter Xu wrote: > > > > > > On Mon, Oct 22, 2018 at 12:22:02AM -0400, Jintack Lim wrote: > > > > Hi, >

[Qemu-devel] Have multiple virtio-net devices, but only one of them receives all traffic

2018-10-01 Thread Jintack Lim
Hi, I'm using QEMU 3.0.0 and Linux kernel 4.15.0 on x86 machines. I'm observing pretty weird behavior when I have multiple virtio-net devices. My KVM VM has two virtio-net devices (vhost=off) and I'm using a Linux bridge in the host. The two devices have different MAC/IP addresses. When I tried t

[Qemu-devel] Why one virtio-pci device has two different DeviceState?

2019-01-04 Thread Jintack Lim
Hi, I was wondering why one virtio-pci device has two different DeviceState? - one directly from VirtIOPCIProxy and the other from VirtIO such as VirtIONet. As an example, they are denoted as qdev and vdev respectively in virtio_net_pci_realize(). I thought that just one DeviceState is enough for

Re: [Qemu-devel] Why one virtio-pci device has two different DeviceState?

2019-01-06 Thread Jintack Lim
On Sat, Jan 5, 2019 at 10:42 AM Peter Maydell wrote: > > On Fri, 4 Jan 2019 at 20:23, Jintack Lim wrote: > > I was wondering why one virtio-pci device has two different > > DeviceState? - one directly from VirtIOPCIProxy and the other from > > VirtIO such as VirtIONet.

Re: [Qemu-devel] [PATCH v3 00/12] intel-iommu: nested vIOMMU, cleanups, bug fixes

2018-05-17 Thread Jintack Lim
table() helper to do the page sync. I checked that the scp problem I had (i.e. scp from the host to the guest having virtual IOMMU and an assigned network device) was gone with this patch series. Cool! Please feel free to move this tag if this is not the right place! Tested-by: Jintack Lim Than

[Qemu-devel] Virtual IOMMU + Virtio-net devices in a Windows VM doesn't work

2018-07-23 Thread Jintack Lim
Hi, I'm running a Windows VM on top of KVM on x86, and one of virtio-net device in the Windows VM doesn't seem to work. I provided virtual IOMMU and two virtio-net devices to the VM: one bypassing the virtual IOMMU and the other one behind the virtual IOMMU[1]. It turned out that the virtio-net de

[Qemu-devel] How to check if Vt-d is capable of posted-interrupt?

2018-04-30 Thread Jintack Lim
Hi, I wonder how to check if Vt-d is capable of posted-interrupt? I'm using Intel E5-2630 v3. I was once told that APICv and posted-interrupt capability always come together. But it seems like my cpu support APICv (/sys/module/kvm_intel/parameters/enable_apicv is Y), but posted-interrupt capabili

Re: [Qemu-devel] How to check if Vt-d is capable of posted-interrupt?

2018-04-30 Thread Jintack Lim
Add iommu mailing list since this question might be more related to iommu. On Mon, Apr 30, 2018 at 10:11 AM, Jintack Lim wrote: > Hi, > > I wonder how to check if Vt-d is capable of posted-interrupt? I'm > using Intel E5-2630 v3. > > I was once told that APICv and post

Re: [Qemu-devel] How to check if Vt-d is capable of posted-interrupt?

2018-04-30 Thread Jintack Lim
On Mon, Apr 30, 2018 at 2:09 PM, Alex Williamson wrote: > On Mon, 30 Apr 2018 13:44:23 -0400 > Jintack Lim wrote: > >> Add iommu mailing list since this question might be more related to iommu. >> >> On Mon, Apr 30, 2018 at 10:11 AM, Jintack Lim >> wrote: &

[Qemu-devel] vIOMMU Posted-interrupt implementation - atomic operation?

2018-05-31 Thread Jintack Lim
Hi, I'm implementing Posted-interrupt functionality in vIOMMU. According to Vt-d spec 5.2.3, IOMMU performs a coherent atomic read-modify-write operation of the posted-interrupt descriptor. I wonder how can we achieve this considering the guest can modify the same posted-interrupt descriptor anyti

Re: [Qemu-devel] vIOMMU Posted-interrupt implementation - atomic operation?

2018-06-05 Thread Jintack Lim
Thanks, Kevin. On Tue, Jun 5, 2018 at 2:54 AM, Tian, Kevin wrote: >> From: Jintack Lim >> Sent: Friday, June 1, 2018 11:47 AM >> >> Hi, >> >> I'm implementing Posted-interrupt functionality in vIOMMU. According >> to Vt-d spec 5.2.3, IOM

Re: [Qemu-devel] vIOMMU Posted-interrupt implementation - atomic operation?

2018-06-06 Thread Jintack Lim
On Wed, Jun 6, 2018 at 2:56 AM, Tian, Kevin wrote: >> From: Jintack Lim [mailto:jint...@cs.columbia.edu] >> Sent: Tuesday, June 5, 2018 8:57 PM >> >> Thanks, Kevin. >> >> On Tue, Jun 5, 2018 at 2:54 AM, Tian, Kevin wrote: >> >> From: Jinta

Re: [Qemu-devel] Virtual IOMMU + Virtio-net devices in a Windows VM doesn't work

2018-07-25 Thread Jintack Lim
Hi Peter, On Tue, Jul 24, 2018 at 1:55 AM Peter Xu wrote: > > On Mon, Jul 23, 2018 at 04:13:18PM -0400, Jintack Lim wrote: > > Hi, > > > > I'm running a Windows VM on top of KVM on x86, and one of virtio-net > > device in the Windows VM doesn't seem to wo

Re: [Qemu-devel] Virtual IOMMU + Virtio-net devices in a Windows VM doesn't work

2018-07-29 Thread Jintack Lim
Thanks, Yan. On Sun, Jul 29, 2018 at 7:44 AM Yan Vugenfirer wrote: > > > > > On 26 Jul 2018, at 05:53, Jintack Lim wrote: > > > > Hi Peter, > > > > On Tue, Jul 24, 2018 at 1:55 AM Peter Xu wrote: > >> > >> On Mon, Jul 23, 2018 at 04:13

[Qemu-devel] Assigning network devices to nested VMs results in driver errors in nested VMs

2018-02-13 Thread Jintack Lim
Hi, I'm trying to assign network devices to nested VMs on x86 using KVM, but I got network device driver errors in the nested VMs. (I've tried this about an year ago when vIOMMU patches were not upstreamed, and I got similar errors at that time.) This could be network driver issues, but I'd like

Re: [Qemu-devel] Assigning network devices to nested VMs results in driver errors in nested VMs

2018-02-14 Thread Jintack Lim
On Wed, Feb 14, 2018 at 12:36 AM, Peter Xu wrote: > On Tue, Feb 13, 2018 at 11:44:09PM -0500, Jintack Lim wrote: >> Hi, >> >> I'm trying to assign network devices to nested VMs on x86 using KVM, >> but I got network device driver errors in the nested VMs. (I&#x

Re: [Qemu-devel] Assigning network devices to nested VMs results in driver errors in nested VMs

2018-02-14 Thread Jintack Lim
On Tue, Feb 13, 2018 at 11:44 PM, Jintack Lim wrote: > Hi, > > I'm trying to assign network devices to nested VMs on x86 using KVM, > but I got network device driver errors in the nested VMs. (I've tried > this about an year ago when vIOMMU patches were not upstreamed, a

[Qemu-devel] intel-iommu and vhost: Do we need 'device-iotlb' and 'ats'?

2018-02-20 Thread Jintack Lim
Hi, I'm using vhost with the virtual intel-iommu, and this page[1] shows the QEMU command line example. qemu-system-x86_64 -M q35,accel=kvm,kernel-irqchip=split -m 2G \ -device intel-iommu,intremap=on,device-iotlb=on \ -device ioh3420,id=pcie.1,chassis=1 \

Re: [Qemu-devel] intel-iommu and vhost: Do we need 'device-iotlb' and 'ats'?

2018-02-22 Thread Jintack Lim
Hi Peter, Hope you had great holidays! On Thu, Feb 22, 2018 at 10:55 PM, Peter Xu wrote: > On Tue, Feb 20, 2018 at 11:03:46PM -0500, Jintack Lim wrote: >> Hi, >> >> I'm using vhost with the virtual intel-iommu, and this page[1] shows >> the QEMU command line exam

Re: [Qemu-devel] intel-iommu and vhost: Do we need 'device-iotlb' and 'ats'?

2018-02-22 Thread Jintack Lim
On Fri, Feb 23, 2018 at 1:10 AM Peter Xu wrote: > On Fri, Feb 23, 2018 at 12:32:13AM -0500, Jintack Lim wrote: > > Hi Peter, > > > > Hope you had great holidays! > > > > On Thu, Feb 22, 2018 at 10:55 PM, Peter Xu wrote: > > > On Tue, Feb 20, 2

Re: [Qemu-devel] intel-iommu and vhost: Do we need 'device-iotlb' and 'ats'?

2018-02-23 Thread Jintack Lim
On Fri, Feb 23, 2018 at 2:09 AM, Peter Xu wrote: > On Fri, Feb 23, 2018 at 06:34:04AM +0000, Jintack Lim wrote: >> On Fri, Feb 23, 2018 at 1:10 AM Peter Xu wrote: >> >> > On Fri, Feb 23, 2018 at 12:32:13AM -0500, Jintack Lim wrote: >> > > Hi Peter, >&

Re: [Qemu-devel] intel-iommu and vhost: Do we need 'device-iotlb' and 'ats'?

2018-02-23 Thread Jintack Lim
Hi Kevin, On Fri, Feb 23, 2018 at 2:34 AM, Tian, Kevin wrote: >> From: Peter Xu >> Sent: Friday, February 23, 2018 3:09 PM >> >> > >> > Right. I think my question was not clear. My question was that why don’t >> > IOMMU invalidate device-iotlb along with its mappings in one go. Then >> IOMMU >> >

Re: [Qemu-devel] intel-iommu and vhost: Do we need 'device-iotlb' and 'ats'?

2018-02-26 Thread Jintack Lim
Hi Eric, On Mon, Feb 26, 2018 at 5:14 AM, Auger Eric wrote: > Hi Jintack, > > On 21/02/18 05:03, Jintack Lim wrote: >> Hi, >> >> I'm using vhost with the virtual intel-iommu, and this page[1] shows >> the QEMU command line example. >> >> qemu-s

Migration failure when running nested VMs

2019-09-20 Thread Jintack Lim
Hi, I'm seeing VM live migration failure when a VM is running a nested VM. I'm using latest Linux kernel (v5.3) and QEMU (v4.1.0). I also tried v5.2, but the result was the same. Kernel versions in L1 and L2 VM are v4.18, but I don't think that matters. The symptom is that L2 VM kernel crashes in

Re: Migration failure when running nested VMs

2019-09-23 Thread Jintack Lim
On Mon, Sep 23, 2019 at 4:48 AM Paolo Bonzini wrote: > > On 23/09/19 12:42, Dr. David Alan Gilbert wrote: > > > > With those two clues, I guess maybe some dirty pages made by L2 are > > not transferred to the destination correctly, but I'm not really sure. > > > > 3) It happens on Intel(R) Xeon(R)

Re: Migration failure when running nested VMs

2019-09-23 Thread Jintack Lim
On Mon, Sep 23, 2019 at 3:42 AM Dr. David Alan Gilbert wrote: > > * Jintack Lim (incredible.t...@gmail.com) wrote: > > Hi, > > Copying in Paolo, since he recently did work to fix nested migration - > it was expected to be broken until pretty recently; but 4.1.0 qemu on >