Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1937623imm; Sun, 15 Jul 2018 22:02:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdpdoX1Auo758dWnNB5ZRyAK8h7NayBE2bKY096u8Iyc7sNN9pQiMlP77GfXtJtshe8x44f X-Received: by 2002:a65:49c7:: with SMTP id t7-v6mr14377131pgs.23.1531717344377; Sun, 15 Jul 2018 22:02:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531717344; cv=none; d=google.com; s=arc-20160816; b=Y41Y83wzMt0ApObbaO2o6gmjhRL+vxfMac5tHjHEe5bz/ArSNZoPZetuNdL6oAkSTV 39kGyHyOfpU7K+W6zhXfccsn/B02YRKdmQ0X1cGzi8AXAsUnLYEki8iCVomk4blTjw5S DGZeA0dBkYi+D8nV0OzyGxVJX+BHuThzu09Q8vFa3+oA7JwQBrpig9X1eLC+q/8PVyL1 5PYi0mqKv2pUmEQEZ6sHX7xdm2bU3o/AipJqZ4WDHAiyJILvAiJ/Gm6JFq/xmzieEN3Z sdcUmFKqTGGmX/FRwpRCFf3Uc29hVFi5fsFvM5czPZqdHGhngbtMUraPPr6g+h98y2L6 8PSA== 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:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature:arc-authentication-results; bh=50YhrAuYg/CT46fNlm8kNLIw8KO5YacaRbRckxYOZPw=; b=IJQzIxarFCkOaCQHh3trXeAjUY5j1wnvr7jxr5RHPPhs1y4eVf1LElS6klD2idjekf r4qHIElD/B6fxZnePccVGUsCF8Onlrn96AzKZ0UG01jylJh4larkSJt5ySMxMwhL13H3 /xSqIZx5ophrvTsjC6fUMJpIxeRStH4oHrepKNtGeVxe2EKifg/kMmghVTWtMbZesHuI qL/UgQqbrrtbC0Hu5C8r9lBm4AxpFF2f3m3LqYdm6SOLskOtnK/ON4OeGF2RNDI4F8Nl sJOURVXFt4ig0MIbD555A9V2b/KfcEd9eb/P6+oXI8DL8rCFVx8LIdtJzSWdFECPtp/y uCuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ozlabs-ru.20150623.gappssmtp.com header.s=20150623 header.b=hrB4az4z; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x32-v6si28977470pld.330.2018.07.15.22.02.07; Sun, 15 Jul 2018 22:02:24 -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; dkim=pass header.i=@ozlabs-ru.20150623.gappssmtp.com header.s=20150623 header.b=hrB4az4z; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727214AbeGPF1D (ORCPT + 99 others); Mon, 16 Jul 2018 01:27:03 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:39721 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726343AbeGPF1D (ORCPT ); Mon, 16 Jul 2018 01:27:03 -0400 Received: by mail-pf0-f193.google.com with SMTP id j8-v6so1062345pff.6 for ; Sun, 15 Jul 2018 22:01:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ozlabs-ru.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=50YhrAuYg/CT46fNlm8kNLIw8KO5YacaRbRckxYOZPw=; b=hrB4az4zgw1utrIZhFYK+3FyPeWatikPuJX/oNPoJEVDn3ZbxM7ngRENRPVZ+Z5mTo 7+/SJm2hETi/ExqSIIRqXRiKQ5rAURDv7UzAEb+AtwVAZ7Rw5mqyZc5yr0wtkHxRMeM/ DpcxSvLAlfkEk+B4qYUIr1CA+KrAboPkqHN8S3/5IUWUhU4/D0X4Mo+ESokrsrE8KqJW /mYqCUyZf+vtGQ42DEXTtPCokmz/sLls1+4YIEEbwgJNHQEsPSfHIzA2MVYko0sBx+4V FVAGe+p1mr9WbfDgHBolgbSzxHG+kxNDcI1ljcfOfhkRkv0lvQFEZDUoVn4ViIVBaICP fYaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=50YhrAuYg/CT46fNlm8kNLIw8KO5YacaRbRckxYOZPw=; b=oGneO2ramThrMdPibg7Ur0CwfotZaxuMZvZgPEsurCkculdC3PgsEzC8D/4vgO6Ox5 mr/PPEV/fwaSm53BE8caC4liyHauFaPOSrVvhk2AX+xRCwVBweDboDb8TN2ozHpRw+hz 1z8Y1J3vxSkHQeBH7ijRp+HvdVt1nK2QsjQGtqKyanmveKKUW5R3E9AoObDqswBmHWvk vD10NbypJAl17DALzI/ItwsbftQ+Yo2NFOA49BNnX+W+NjAHhEGiQO5yfzK5HD/O74hF hTihzCsld5fietZZ0FV6Cn7vEyGHPEIiOCyQh4jxUFg9P8ML22HQFQ3L+wO9HJA7X86V uxQg== X-Gm-Message-State: AOUpUlHhJRmtdC0lwSHl2OKOfRCYF/jppgT70ttkmE8HPnBZaoibjl7f oQgmUipPyQNn/hhwNQ9MquUuEg== X-Received: by 2002:a63:8a41:: with SMTP id y62-v6mr13800408pgd.291.1531717290795; Sun, 15 Jul 2018 22:01:30 -0700 (PDT) Received: from [10.61.2.175] ([122.99.82.10]) by smtp.googlemail.com with ESMTPSA id f3-v6sm3749278pgq.49.2018.07.15.22.01.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Jul 2018 22:01:29 -0700 (PDT) Subject: Re: [PATCH v6 0/4] Add parameter for disabling ACS redirection for P2P To: Logan Gunthorpe , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-doc@vger.kernel.org Cc: Stephen Bates , Christoph Hellwig , Bjorn Helgaas , Jonathan Corbet , Ingo Molnar , Thomas Gleixner , "Paul E. McKenney" , Marc Zyngier , Kai-Heng Feng , Frederic Weisbecker , Dan Williams , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Benjamin Herrenschmidt , Alex Williamson , =?UTF-8?Q?Christian_K=c3=b6nig?= , Matthew Wilcox References: <20180713233158.19528-1-logang@deltatee.com> From: Alexey Kardashevskiy Openpgp: preference=signencrypt Autocrypt: addr=aik@ozlabs.ru; prefer-encrypt=mutual; keydata= xsFNBE+rT0sBEADFEI2UtPRsLLvnRf+tI9nA8T91+jDK3NLkqV+2DKHkTGPP5qzDZpRSH6mD EePO1JqpVuIow/wGud9xaPA5uvuVgRS1q7RU8otD+7VLDFzPRiRE4Jfr2CW89Ox6BF+q5ZPV /pS4v4G9eOrw1v09lEKHB9WtiBVhhxKK1LnUjPEH3ifkOkgW7jFfoYgTdtB3XaXVgYnNPDFo PTBYsJy+wr89XfyHr2Ev7BB3Xaf7qICXdBF8MEVY8t/UFsesg4wFWOuzCfqxFmKEaPDZlTuR tfLAeVpslNfWCi5ybPlowLx6KJqOsI9R2a9o4qRXWGP7IwiMRAC3iiPyk9cknt8ee6EUIxI6 t847eFaVKI/6WcxhszI0R6Cj+N4y+1rHfkGWYWupCiHwj9DjILW9iEAncVgQmkNPpUsZECLT WQzMuVSxjuXW4nJ6f4OFHqL2dU//qR+BM/eJ0TT3OnfLcPqfucGxubhT7n/CXUxEy+mvWwnm s9p4uqVpT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iemgclZcSgrxKSJhyFhmLr QEiEILTKn/pqJfhHU/7R7UtlDAmFMUp7ByywB4JLcyD10lTmrEJ0iyRRTVfDrfVP82aMBXgF tKQaCxcmLCaEtrSrYGzd1sSPwJne9ssfq0SE/LM1J7VdCjm6OWV33SwKrfd6rOtvOzgadrG6 3bgUVBw+bsXhWDd8tvuCXmdY4bnUblxF2B6GOwSY43v6suugBttIyW5Bl2tXSTwP+zQisOJo +dpVG2pRr39h+buHB3NY83NEPXm1kUOhduJUA17XUY6QQCAaN4sdwPqHq938S3EmtVhs Message-ID: <710e15b2-89f8-a658-656f-84492ef78898@ozlabs.ru> Date: Mon, 16 Jul 2018 15:01:21 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20180713233158.19528-1-logang@deltatee.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/7/18 9:31 am, Logan Gunthorpe wrote: > Changes since v5: > * Add a quirk to handle the Intel SPT PCH case (as pointed out by Alex) > * Warn in the case that we try to disable ACS redirect on a device > that doesn't have the ACS capability (also suggested by Alex) > * Collect reviewed-by tag from Alex > * Rebased onto v4.18-rc4 (no conflicts) > > Changes since v4: > * Fixed a couple documentation mistakes spotted by Randy > > Changes since v3: > * Removed some of the cruft that was copied from the resource_alignment > paramater (per Alex) > * A number of docuemntation fixes as noticed by Alex and Willy > > Changes since v2: > * Rebased onto v4.18-rc1 (no conflicts) > * Minor tweaks to the documentation per Andy > * Removed the "path:" prefix and use the path parsing code > for simple devices (as it works the same). Per a suggestion from Alex > > Changes since v1: > * Reworked pci_dev_str_match_path using strrchr as suggested by Alex > * Collected Christian's Acks > > -- > > Hi, > > As discussed in our PCI P2PDMA series, we'd like to add a kernel > parameter for selectively disabling ACS redirection for select > bridges. Seeing this turned out to be a small series in itself, we've > decided to send this separately from the P2P work. > > This series generalizes the code already done for the resource_alignment > option that already exists. The first patch creates a helper function > to match PCI devices against strings based on the code that already > existed in pci_specified_resource_alignment(). > > The second patch expands the new helper to optionally take a path of > PCI devfns. This is to address Alex's renumbering concern when using > simple bus-devfns. The implementation is essentially how he described it and > similar to the Intel VT-d spec (Section 8.3.1). > > The final patch adds the disable_acs_redir kernel parameter which takes > a list of PCI devices and will disable the ACS P2P Request Redirect, > ACS P2P Completion Redirect and ACS P2P Egress Control bits for the > selected devices. This allows P2P traffic between selected bridges and > seeing it's done at boot, before the IOMMU groups will be created, the > groups will match the security provided by ACS. I am pretty sure it's been discussed but just to make sure I understand the whole picture - why exactly does ACS have to be disabled at the boot time? We could enable it, for example, for 2 devices in the same VFIO container if there are in isolatable part of the PCI tree, or we just do not want to make VFIO containers or QEMU aware of PCI hierarchy (I can see why, just double checking)? Thanks. > > Thanks, > > Logan > > -- > > Logan Gunthorpe (4): > PCI: Make specifying PCI devices in kernel parameters reusable > PCI: Allow specifying devices using a base bus and path of devfns > PCI: Introduce disable_acs_redir quirk > PCI: Introduce the disable_acs_redir parameter > > Documentation/admin-guide/kernel-parameters.txt | 41 +++- > drivers/pci/pci.c | 310 +++++++++++++++++++----- > drivers/pci/quirks.c | 78 +++++- > include/linux/pci.h | 5 + > 4 files changed, 361 insertions(+), 73 deletions(-) > > -- > 2.11.0 > -- Alexey