From patchwork Wed Feb 21 03:19:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Feng Kan X-Patchwork-Id: 875933 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=apm.com header.i=@apm.com header.b="LPKIdZUf"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zmN595fVpz9rxq for ; Wed, 21 Feb 2018 14:19:41 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751300AbeBUDTj (ORCPT ); Tue, 20 Feb 2018 22:19:39 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:43802 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751039AbeBUDTi (ORCPT ); Tue, 20 Feb 2018 22:19:38 -0500 Received: by mail-pf0-f195.google.com with SMTP id z14so141100pfe.10 for ; Tue, 20 Feb 2018 19:19:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apm.com; s=apm; h=from:to:cc:subject:date:message-id; bh=k4wVXgvYEMiLcBkYMvrCLRViHbCXzViBzV+jeSHrf3Y=; b=LPKIdZUfAC73/P7y6kzPyz2kA4I4ESObTOC8fpz9OEOWKly/q3egMlF23IbM7jjRqe tQjjyZItgwXSmD6dYGo52zAUO7mqrN1iy1YpNbaNub/OEbXT/+dRhHjBPCX3QKMEBfQj 34+vpx6/1b/n/shFUHnGw3GMHHt2JcHT4g0fo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=k4wVXgvYEMiLcBkYMvrCLRViHbCXzViBzV+jeSHrf3Y=; b=XdXSKVhkff35Wmyd+N0cAvQmErv4NPjyMyN+Ye25lcx0uQR2o9eoUH6UlYoVtMLUX8 APPr70Hgg2Aj+5bXuSAG5HtguIX/LGVLqRQjV/gccJtg4KvzlulRd+i7/9x5Bukz2QNT sG6CZXJ1ouxAizRtpLOEyQbc2Fb4Pp9oM+idUnuxzNJbN7DSmZdxVV24UTfnEbxM21YF bq493dgHrxwutNBE2R8S4vK+q6KeVT6fh6u2FYDPhPfozct8vGjvlZlH03Wj6CVcBPN1 /9bTXRbMXOsFWWFVrwklXKXvizruO8Dc2peNNfZXVwHh/Yhus0GT/uQAOPl/+H3kZ8tx io3g== X-Gm-Message-State: APf1xPD2CEVxHNXN/uKfIk4nSuxSwU6kMU9eYOumgPu7PDIa7LI9tgxU YTG1IV+zaAF/3K0vOYDx/zcmjQ== X-Google-Smtp-Source: AH8x227WZW/1HsEBqH2C1wgFGURx5VmnW/WZJe5nFqGhPA/RpOd+39JLLy7MrtLnRXbo7f7Z692rPA== X-Received: by 10.98.112.70 with SMTP id l67mr1812250pfc.196.1519183178379; Tue, 20 Feb 2018 19:19:38 -0800 (PST) Received: from goldengate.amcc.com ([206.80.4.98]) by smtp.gmail.com with ESMTPSA id p4sm58117475pgn.81.2018.02.20.19.19.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Feb 2018 19:19:37 -0800 (PST) From: Feng Kan To: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, alex.williamson@redhat.com, bhelgaas@google.com Cc: Feng Kan Subject: [PATCH V2] PCI: Add ACS quirk for Ampere root ports Date: Tue, 20 Feb 2018 19:19:27 -0800 Message-Id: <1519183167-17716-1-git-send-email-fkan@apm.com> X-Mailer: git-send-email 2.7.4 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The Ampere Computing PCIe root port does not support ACS at this point. However, the hardware provides isolation and source validation through the SMMU. The stream ID generated by the PCIe ports contain both the bus/device/function number as well as the port ID in its 3 most significant bits. Turn on ACS but disable all the peer-to-peer features. Signed-off-by: Feng Kan --- V2 - Correct patch summary as per Bjorn's comment This is a rebranding of APM to Ampere, it is a change of vendor id and device id, all functionality stays the same as before. drivers/pci/quirks.c | 9 +++++++++ include/linux/pci_ids.h | 1 + 2 files changed, 10 insertions(+) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index fc73401..57748a3 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -4514,6 +4514,15 @@ static const struct pci_dev_acs_enabled { { PCI_VENDOR_ID_CAVIUM, PCI_ANY_ID, pci_quirk_cavium_acs }, /* APM X-Gene */ { PCI_VENDOR_ID_AMCC, 0xE004, pci_quirk_xgene_acs }, + /* Ampere Computing */ + { PCI_VENDOR_ID_AMPERE, 0xE005, pci_quirk_xgene_acs }, + { PCI_VENDOR_ID_AMPERE, 0xE006, pci_quirk_xgene_acs }, + { PCI_VENDOR_ID_AMPERE, 0xE007, pci_quirk_xgene_acs }, + { PCI_VENDOR_ID_AMPERE, 0xE008, pci_quirk_xgene_acs }, + { PCI_VENDOR_ID_AMPERE, 0xE009, pci_quirk_xgene_acs }, + { PCI_VENDOR_ID_AMPERE, 0xE00A, pci_quirk_xgene_acs }, + { PCI_VENDOR_ID_AMPERE, 0xE00B, pci_quirk_xgene_acs }, + { PCI_VENDOR_ID_AMPERE, 0xE00C, pci_quirk_xgene_acs }, { 0 } }; diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index a6b3066..c875d42 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -1333,6 +1333,7 @@ #define PCI_DEVICE_ID_IMS_TT3D 0x9135 #define PCI_VENDOR_ID_AMCC 0x10e8 +#define PCI_VENDOR_ID_AMPERE 0x1def #define PCI_VENDOR_ID_INTERG 0x10ea #define PCI_DEVICE_ID_INTERG_1682 0x1682