Received: by 10.192.165.148 with SMTP id m20csp65848imm; Wed, 9 May 2018 08:53:08 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoqKzd9GrtJvLZmq0ht9F8ohKDovjWomC+2NwhJiCBrbtFpzgwRCDINMjsDhm9t78/Tu9QP X-Received: by 2002:a17:902:6b09:: with SMTP id o9-v6mr47094030plk.256.1525881188930; Wed, 09 May 2018 08:53:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525881188; cv=none; d=google.com; s=arc-20160816; b=XdDVRjZceSY0jI8LwRLWjwE60UwHKXapzKsqVfmD2cQHe/3iMN/egAcTwz7O0WgnFV YuqkNh7cPxU5AXjgtv1PMtzLbNhVbWonAXAqXtl+Ad5ELNxUrXAaL6wL0yfgEH0qI6pG tqvqzPJDPkWwzbK7IU+3bv0jgviDuMtBymNDVyFlc6Rg7A/tVQvjm+k27/fdFQcA5aqC jlrVp5+oRqD2cmWc2xQFr98GEuumPUpzM79ftARIBhyZC+W9a5NyK4OrN07behWFJOgG 9GgEAjx6hZ2++KwM1FaYkYIGgmf+Azstr3MhNbdx3MexDcqb/nIN4paKhGNgYUtS6SKx 8Z4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=OhDJIKlJKnOm8KPLRe4akQ1/SpvQRMuI9HTH3dQ+DQY=; b=wkrVL63kN5Z9CmfTRrpFKwGw6+IswwFgg9AagtRrV8uBAsJE8ffkbPxyeKC02XRoWE lj5lBOvfXHIlAuabBwFSfvIMrCfCheR+yNJPQ9Z7CmtvpwkUyrBEwfVoFOoIjgSTrMn/ LNqZhPrB5OsywJHx0SqsMJz8IZXNcUEwfq4VF34GD67iLQEbq2n212M+A63pdoutDhor SocvH87rwOc7R/ffnALTdc0yVnKxrdRjlYbslaC0ARQ2Qw9mFKYy+iRXO1yTf+6fCcIY Bmw9feWYcmOl+tHBidMCyMrnET8KIv8dRH5k9lb03XfVGoUQ/n8u0sEhAKJN65lTs6QL axCA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w71-v6si14186600pgd.1.2018.05.09.08.52.51; Wed, 09 May 2018 08:53:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965218AbeEIPwI (ORCPT + 99 others); Wed, 9 May 2018 11:52:08 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:52014 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S964984AbeEIPwG (ORCPT ); Wed, 9 May 2018 11:52:06 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9B1B7818F6EB; Wed, 9 May 2018 15:52:05 +0000 (UTC) Received: from [10.18.17.89] (dhcp-17-89.bos.redhat.com [10.18.17.89]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D3DC2166BAD; Wed, 9 May 2018 15:52:04 +0000 (UTC) Subject: Re: [PATCH v4 04/14] PCI/P2PDMA: Clear ACS P2P flags for all devices behind switches To: Alex Williamson , Stephen Bates Cc: Dan Williams , Logan Gunthorpe , Linux Kernel Mailing List , "linux-pci@vger.kernel.org" , "linux-nvme@lists.infradead.org" , linux-rdma , linux-nvdimm , "linux-block@vger.kernel.org" , Christoph Hellwig , Jens Axboe , Keith Busch , Sagi Grimberg , Bjorn Helgaas , Jason Gunthorpe , Max Gurtovoy , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Benjamin Herrenschmidt , =?UTF-8?Q?Christian_K=c3=b6nig?= References: <20180423233046.21476-1-logang@deltatee.com> <20180423233046.21476-5-logang@deltatee.com> <64C231F5-DE36-415F-B308-3A423B0BBACB@raithlin.com> <15433946-f7f5-f610-4e80-380fb59920e5@redhat.com> <3C9FB262-A93C-4C8F-B1E0-85C6D6F78BC2@raithlin.com> <20180508180157.7c7b393f@w520.home> <20180509084445.626d2732@w520.home> From: Don Dutile Message-ID: <1c5b4a06-25bc-457a-8569-a5ae5eaa6e00@redhat.com> Date: Wed, 9 May 2018 11:52:04 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180509084445.626d2732@w520.home> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 09 May 2018 15:52:05 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 09 May 2018 15:52:05 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'ddutile@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/09/2018 10:44 AM, Alex Williamson wrote: > On Wed, 9 May 2018 12:35:56 +0000 > "Stephen Bates" wrote: > >> Hi Alex and Don >> >>> Correct, the VM has no concept of the host's IOMMU groups, only >>> the hypervisor knows about the groups, >> >> But as I understand it these groups are usually passed through to VMs >> on a pre-group basis by the hypervisor? So IOMMU group 1 might be >> passed to VM A and IOMMU group 2 passed to VM B. So I agree the VM is >> not aware of IOMMU groupings but it is impacted by them in the sense >> that if the groupings change the PCI topology presented to the VM >> needs to change too. > > Hypervisors don't currently expose any topology based on the grouping, > the only case where such a concept even makes sense is when a vIOMMU is > present as devices within the same group cannot have separate address > spaces. Our options for exposing such information is also limited, our > only real option would seem to be placing devices within the same group > together on a conventional PCI bus to denote the address space > granularity. Currently we strongly recommend singleton groups for this > case and leave any additional configuration constraints to the admin. > > The case you note of a group passed to VM A and another passed to VM B > is exactly an example of why any sort of dynamic routing change needs to > have the groups fully released, such as via hot-unplug. For instance, > a routing change at a shared node above groups 1 & 2 could result in > the merging of these groups and there is absolutely no way to handle > that with portions of the group being owned by two separate VMs after > the merge. Thanks, > > Alex > The above is why I stated the host/HV has to do p2p setup *before* device-assignment is done. Now, that could be done at boot time (with a mod.conf-like config in host/HV, before VM startup) as well. Dynamically, if such a feature is needed, requires a hot-unplug/plug cycling as Alex states.