Received: by 10.192.165.148 with SMTP id m20csp5611110imm; Wed, 9 May 2018 07:45:45 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrO8+VKde+QYVjZusbvUykTWuOGNBLSioQG1WgeelR59Xxb3+StAGDbUTd/4jd0c01pIhe8 X-Received: by 2002:a63:b908:: with SMTP id z8-v6mr36144781pge.436.1525877145690; Wed, 09 May 2018 07:45:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525877145; cv=none; d=google.com; s=arc-20160816; b=RMnsW1rv7ABWBdCuZ1otcTcsN/v8dfXre6b/MBQNAEKRIFE5mvpzdOX8lFyR44uqTj avXRZPqsO6zb22/wlVAttbB1cF42MG/13aT1HL1WeYzeSZgfH+Far9gg2V7r3iJcJV1z d5KRA9ZmS0gp7y3yxeslsIOvwATsBf0xKwSq02rAsODxA2cgK+vAOY7VQO8TEkR8aQlg LBzWCV266QseEAeZRhyONr4a152oA6n7BmNA9X5cfLZn5cjxtUoqT7kcIoXowJddMzbD WAkisifNa4dYQdmTu5BW26ESGB3E7p1iHEfZB6MfmHm4V5ycV84gBrFz66/1L/w4Kcxy D/Pg== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=ZtSD9MVyVEcgWPiF51pGDXID4NDkFZ3GHF3rMUcDw94=; b=fsEBqkzREjC4eCURkLOuOAIolyX9wiqkoQYXb32HU44+1zkHunCqPncS9sRnDZD+1J 0HAPo32+6umyhEs99BhxApwkQPzUQPEiKGelkIctEoAizH5zeth2JImSEpM+CVFny7JE VischQ243kwoPkHECApbt28J+5M+Go04mjyePr/W70gFwFTADCf7R8KyBFQemO5sKTkr dnaXGRaIlxtedh3Aj1NHH2y7vp6qHgl7n+EMV17SLEFg68o1L2QanlA0vj7+yeQrDoSF a95mXbgHUWUoFX6Ww8ZxUjLPL48Sh6zdhkZR31jMqmIkvXixf20hISGSAMSudKfZMIQs KGRQ== 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 j62-v6si19132678pgd.242.2018.05.09.07.45.30; Wed, 09 May 2018 07:45:45 -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 S935199AbeEIOot (ORCPT + 99 others); Wed, 9 May 2018 10:44:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42500 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934770AbeEIOor (ORCPT ); Wed, 9 May 2018 10:44:47 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 909AB300372D; Wed, 9 May 2018 14:44:47 +0000 (UTC) Received: from w520.home (ovpn-116-103.phx2.redhat.com [10.3.116.103]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4D09130012C4; Wed, 9 May 2018 14:44:46 +0000 (UTC) Date: Wed, 9 May 2018 08:44:45 -0600 From: Alex Williamson To: "Stephen Bates" Cc: Don Dutile , 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?SsOpcsO0?= =?UTF-8?B?bWU=?= Glisse , Benjamin Herrenschmidt , Christian =?UTF-8?B?S8O2bmln?= Subject: Re: [PATCH v4 04/14] PCI/P2PDMA: Clear ACS P2P flags for all devices behind switches Message-ID: <20180509084445.626d2732@w520.home> In-Reply-To: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Wed, 09 May 2018 14:44:47 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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