Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1482195imu; Tue, 11 Dec 2018 21:47:59 -0800 (PST) X-Google-Smtp-Source: AFSGD/XowfEydz/XfPk9J2DIIQ5bs/qZdGH0wZ5BizoP0iDWPXCSmblfoyAMyzzzoNmoXKuCFH+I X-Received: by 2002:a62:28c9:: with SMTP id o192mr19383411pfo.57.1544593679354; Tue, 11 Dec 2018 21:47:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544593679; cv=none; d=google.com; s=arc-20160816; b=0mtH5ZCQNnLa6leoBF+r+ikGAO0nfO57Hh56drqp0GA6zkh+DDt2HfbQ7mk2OUiCD5 zC8suKofES5GDGEIGD2CpsvmYQbRSrEJD3czmNyNaNhuSEWIimL1UEfkn8rxjADMLe/G tzuvHjoLP3L2gLU0cGqMLdlUWh7O/trPJs8+vgOAdyxoj4MRO76Tyx/FViIqMoViksof SNanEd6dW/OJkMtkIW0C8b3/ZpLEJCwMUWeDFwhiS9kHgvycKp8Vuw+3U8X/fWdxbLbl SYk3pjJ5IHQVdgfdaSI4QFnv4pa8h1KoKu4gxFwZaemn0MR2x2Dho38kAY6vgvA81U4g NPkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=TjZzoCV1HwcD3kCkPdW3dsnMfVHtjGYXi/74QDWB40A=; b=i9Sw2TLNvEVO5l1dJQigjYQYfnAig+poyGAaTTWFg/OXwOwctbSbicIRLxbXkrCutE z6ov3/skjkJ0Dl3ZN4b+TNKdDcS1AhsW+1e7Alle8a9rNwA3PdIYnjLSJRWB5zpDw/Oj +N9uoY9hXssboUr8geJBx1QfCleZRqQtPHQ7JQynBoZiLWhQWr4aTBDOMjXNaofQUphc R9JXJg7mR1Hf+giItAJy7JfUgkrvhF+G3AUyAsU85ayO94kmXBlS+W8s5CkDMUNXy1Ti nLzKuVA3YmrzDDXlgyDP5A/7FzzG26T1SuC+UpSa4aRtly1UFPXoD41rWBg90Y4sffyt ++Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=clm6fJBQ; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i198si15128281pfe.289.2018.12.11.21.47.43; Tue, 11 Dec 2018 21:47:59 -0800 (PST) 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=@broadcom.com header.s=google header.b=clm6fJBQ; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726516AbeLLFqh (ORCPT + 99 others); Wed, 12 Dec 2018 00:46:37 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:51987 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726500AbeLLFqh (ORCPT ); Wed, 12 Dec 2018 00:46:37 -0500 Received: by mail-wm1-f68.google.com with SMTP id s14so4471290wmh.1 for ; Tue, 11 Dec 2018 21:46:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TjZzoCV1HwcD3kCkPdW3dsnMfVHtjGYXi/74QDWB40A=; b=clm6fJBQpEqaNOrghAtBGe5lA/Ey3ak+GaomIJPn0+oIBqBXekIw6y/VKEUV43ii3E 7ygSkwgZOkNu3pqv6zcu7wwsHeY0a9dj8lB1QXoNclqQLeY2Qm5moIpYjPFZMq+xmAY8 8SWRfaoLIb+bHtcw9pH2i7eqPvwheNOfWsaWE= 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:in-reply-to :references; bh=TjZzoCV1HwcD3kCkPdW3dsnMfVHtjGYXi/74QDWB40A=; b=WIxGmCfSy+uC+sLv0IAHxI4dz7Mc9F6ACNadx1aVzmhmApdQxSvDwIsLugC5nVQdFJ /SQR29pdcEXtX89xJRnxzpIVQKx0zasLDH1ZPKCE7XKnIvUeAxeUBaUPSU2JaMsaMbbD IrJNtxADl+PWlqERGSSlkbeJtfVA2utBZwYSTDhu89mJJbHYfXTP9bRfoFDmEjXJ+naA IxtiMeun6TQCPGKpHrML9OKhk+cAUD6SaCZH226OrS5BfdWjP4fvKNTBHb59c6LZRvnB QIQZWTvZdSLdKIhOfZc+iBa8+fe8tDXBlrxzknC5yl4tmNieRtJDFxkUZZ+N/4SGe/P5 oh3A== X-Gm-Message-State: AA+aEWZ+eatjQLK6VcpPwbv8cI3VucTS72+Wp6o98QkQfXQ0xMFISRh/ +fDyqbcBu5B9DdhC6C27ZMafOw== X-Received: by 2002:a1c:2314:: with SMTP id j20mr4916307wmj.142.1544593594210; Tue, 11 Dec 2018 21:46:34 -0800 (PST) Received: from mannams-OptiPlex-7010.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id z206sm2015947wmc.18.2018.12.11.21.46.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Dec 2018 21:46:33 -0800 (PST) From: Srinath Mannam To: Bjorn Helgaas , Robin Murphy , Joerg Roedel , Lorenzo Pieralisi , Ray Jui Cc: bcm-kernel-feedback-list@broadcom.com, linux-pci@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Srinath Mannam Subject: [RFC PATCH 1/3] PCI: Add dma-resv window list Date: Wed, 12 Dec 2018 11:16:07 +0530 Message-Id: <1544593569-8923-2-git-send-email-srinath.mannam@broadcom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544593569-8923-1-git-send-email-srinath.mannam@broadcom.com> References: <1544593569-8923-1-git-send-email-srinath.mannam@broadcom.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a dma_resv parameter in pci host bridge structure to hold resource entries list of memory regions for which IOVAs has to reserve. IOMMU framework reserve IOVA for this list of address range while initializing IOMMU domain of corresponding PCI EP connected to the HOST. PCIe host driver will add resource entries to this list based on requirements. Few hosts can't use all inbound address, so those address regions will be add to this list to avoid IOMMU mapping. Signed-off-by: Srinath Mannam --- drivers/pci/probe.c | 3 +++ include/linux/pci.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index ec78400..bbed0e7 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -544,6 +544,7 @@ struct pci_host_bridge *pci_alloc_host_bridge(size_t priv) return NULL; INIT_LIST_HEAD(&bridge->windows); + INIT_LIST_HEAD(&bridge->dma_resv); bridge->dev.release = pci_release_host_bridge_dev; /* @@ -572,6 +573,7 @@ struct pci_host_bridge *devm_pci_alloc_host_bridge(struct device *dev, return NULL; INIT_LIST_HEAD(&bridge->windows); + INIT_LIST_HEAD(&bridge->dma_resv); bridge->dev.release = devm_pci_release_host_bridge_dev; return bridge; @@ -581,6 +583,7 @@ EXPORT_SYMBOL(devm_pci_alloc_host_bridge); void pci_free_host_bridge(struct pci_host_bridge *bridge) { pci_free_resource_list(&bridge->windows); + pci_free_resource_list(&bridge->dma_resv); kfree(bridge); } diff --git a/include/linux/pci.h b/include/linux/pci.h index e72ca8d..1f0a32a 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -472,6 +472,7 @@ struct pci_host_bridge { void *sysdata; int busnr; struct list_head windows; /* resource_entry */ + struct list_head dma_resv; /* reserv dma ranges */ u8 (*swizzle_irq)(struct pci_dev *, u8 *); /* Platform IRQ swizzler */ int (*map_irq)(const struct pci_dev *, u8, u8); void (*release_fn)(struct pci_host_bridge *); -- 2.7.4