From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: Re: [questions] about using vfio to assign sr-iov vf to vm Date: Thu, 14 Aug 2014 06:44:27 -0600 Message-ID: <1408020267.9800.247.camel@ul30vt.home> References: <201408141622244965425@sangfor.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: qemu-devel , kvm To: Zhang Haoyu Return-path: Received: from mx1.redhat.com ([209.132.183.28]:25326 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754329AbaHNMog (ORCPT ); Thu, 14 Aug 2014 08:44:36 -0400 In-Reply-To: <201408141622244965425@sangfor.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, 2014-08-14 at 16:22 +0800, Zhang Haoyu wrote: > Hi, all > I'm using VFIO to assign intel 82599 VF to VM, now I encounter a problem, > 82599 PF and its VFs belong to the same iommu_group, but I only want to assign some VFs to one VM, and some other VFs to another VM, ..., > so how to only unbind (part of) the VFs but PF? > I read the kernel doc vfio.txt, I'm not sure should I unbind all of the devices which belong to one iommu_group? > If so, because PF and its VFs belong to the same iommu_group, if I unbind the PF, its VFs also diappeared. > I think I misunderstand someting, > any advises? This occurs when the PF is installed behind components in the system that do not support PCIe Access Control Services (ACS). The IOMMU group contains both the PF and the VF because upstream transactions can be re-routed downstream by these non-ACS components before being translated by the IOMMU. Please provide 'sudo lspci -vvv', 'lspci -n', and kernel version and we might be able to give you some advise on how to work around the problem. Thanks, Alex From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHuOT-000746-R2 for qemu-devel@nongnu.org; Thu, 14 Aug 2014 08:44:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHuON-0002T1-LN for qemu-devel@nongnu.org; Thu, 14 Aug 2014 08:44:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24328) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHuON-0002Sx-DP for qemu-devel@nongnu.org; Thu, 14 Aug 2014 08:44:31 -0400 Message-ID: <1408020267.9800.247.camel@ul30vt.home> From: Alex Williamson Date: Thu, 14 Aug 2014 06:44:27 -0600 In-Reply-To: <201408141622244965425@sangfor.com> References: <201408141622244965425@sangfor.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [questions] about using vfio to assign sr-iov vf to vm List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Zhang Haoyu Cc: qemu-devel , kvm On Thu, 2014-08-14 at 16:22 +0800, Zhang Haoyu wrote: > Hi, all > I'm using VFIO to assign intel 82599 VF to VM, now I encounter a problem, > 82599 PF and its VFs belong to the same iommu_group, but I only want to assign some VFs to one VM, and some other VFs to another VM, ..., > so how to only unbind (part of) the VFs but PF? > I read the kernel doc vfio.txt, I'm not sure should I unbind all of the devices which belong to one iommu_group? > If so, because PF and its VFs belong to the same iommu_group, if I unbind the PF, its VFs also diappeared. > I think I misunderstand someting, > any advises? This occurs when the PF is installed behind components in the system that do not support PCIe Access Control Services (ACS). The IOMMU group contains both the PF and the VF because upstream transactions can be re-routed downstream by these non-ACS components before being translated by the IOMMU. Please provide 'sudo lspci -vvv', 'lspci -n', and kernel version and we might be able to give you some advise on how to work around the problem. Thanks, Alex