[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/4] xen/pci: Introduce new CONFIG_PCI_ATS flag for PCI ATS functionality.


  • To: Rahul Singh <Rahul.Singh@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 4 Nov 2020 14:16:10 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WdZV61D42+JzDO6v5TD8Ky4gogrHQlvrlqdfGNG1gxU=; b=k63VxCrZslhrZOo3Dzea+lFcLr1CjwaBxi6ikkON5VaAlOy0dyPKvn5beHyIh0ytL9+4cOhkHgv/e6mr1+FKo3mRbf4XqZYerSe753TRJYAH6GY0bfNCTP3MB6F3CYvFudRteGxVz5OB1/5r+mj7mjDInXX67pZsOPON9ry7iTzmiDDvz92lFjPqhcnTClhdBXUSj5gvUIcG9fo8L+ZsXRoAJbB21Yjj3SASnAibjDZvy8I1crKhhsmi1kpHnnnG9NdFJUGcLvFgueusNzkdognviOBhCisKUS3y6ssciZjSKc7F9fNOdnM0XILEgPh2oxEz7RTm6PoJpbuoiSUV4w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iGfDi2kS/85oXy7IUIGwy98d3aHlaSXapth/4e9PAGB4TZG/VKbxTt7Qz5n4HpMdaK5IFCCTCsXHcovIWtXdIbtkJKymcXmp3ZVv5yabJKqYCj7VepabFsmAtx0sAQkBzG11GSJi780ADJ8TPNLOrciULWL159v3biP7swi+8d0FvI36Wjx9CPSTYvZsoVqq0BKEiLcGHTCkEeGySwAbGOXbW1t2uQ02UfqYi7Q4aWCbrR20K/A0geZTP4l5WbShrvZ2YCJg40jhJrwCKDwdtPBmxVT2ktIHLjEzjokhV97iZK7DfVuzTFzW3fnoTnvpVaRIVihm5Y9Oqfxl2kFzeg==
  • Authentication-results-original: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com;
  • Cc: "open list:X86" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Wed, 04 Nov 2020 14:16:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHWsfp0TD99XuDgWkm6r9S7pNFSjKm4BiEA
  • Thread-topic: [PATCH v2 2/4] xen/pci: Introduce new CONFIG_PCI_ATS flag for PCI ATS functionality.


> On 3 Nov 2020, at 15:59, Rahul Singh <Rahul.Singh@xxxxxxx> wrote:
> 
> PCI ATS functionality is not enabled and tested for ARM architecture
> but it is enabled for x86 and referenced in common passthrough/pci.c
> code.
> 
> Therefore introducing the new flag to enable the ATS functionality for
> x86 only to avoid issues for ARM architecture.
> 
> No functional change.
> 
> Signed-off-by: Rahul Singh <rahul.singh@xxxxxxx>
Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Cheers
Bertrand

> ---
> 
> Changes in v2:
> - Fixed return value of PCI ATS related functions when PCI_ATS is not enabled.
> - Make PCI_ATS user selectable kconfig option.
> 
> ---
> xen/drivers/passthrough/ats.h        | 26 ++++++++++++++++++++++++++
> xen/drivers/passthrough/x86/Makefile |  2 +-
> xen/drivers/pci/Kconfig              |  9 +++++++++
> 3 files changed, 36 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/drivers/passthrough/ats.h b/xen/drivers/passthrough/ats.h
> index 22ae209b37..3a71fedcb4 100644
> --- a/xen/drivers/passthrough/ats.h
> +++ b/xen/drivers/passthrough/ats.h
> @@ -17,6 +17,8 @@
> 
> #include <xen/pci_regs.h>
> 
> +#ifdef CONFIG_PCI_ATS
> +
> #define ATS_REG_CAP    4
> #define ATS_REG_CTL    6
> #define ATS_QUEUE_DEPTH_MASK     0x1f
> @@ -48,5 +50,29 @@ static inline int pci_ats_device(int seg, int bus, int 
> devfn)
>     return pci_find_ext_capability(seg, bus, devfn, PCI_EXT_CAP_ID_ATS);
> }
> 
> +#else
> +
> +#define ats_enabled (false)
> +
> +static inline int enable_ats_device(struct pci_dev *pdev,
> +                                    struct list_head *ats_list)
> +{
> +    return -EOPNOTSUPP;
> +}
> +
> +static inline void disable_ats_device(struct pci_dev *pdev) { }
> +
> +static inline int pci_ats_enabled(int seg, int bus, int devfn)
> +{
> +    return 0;
> +}
> +
> +static inline int pci_ats_device(int seg, int bus, int devfn)
> +{
> +    return 0;
> +}
> +
> +#endif /* CONFIG_PCI_ATS */
> +
> #endif /* _ATS_H_ */
> 
> diff --git a/xen/drivers/passthrough/x86/Makefile 
> b/xen/drivers/passthrough/x86/Makefile
> index a70cf9460d..aa515c680d 100644
> --- a/xen/drivers/passthrough/x86/Makefile
> +++ b/xen/drivers/passthrough/x86/Makefile
> @@ -1,2 +1,2 @@
> -obj-y += ats.o
> +obj-$(CONFIG_PCI_ATS) += ats.o
> obj-y += iommu.o
> diff --git a/xen/drivers/pci/Kconfig b/xen/drivers/pci/Kconfig
> index 7da03fa13b..3cb79ea954 100644
> --- a/xen/drivers/pci/Kconfig
> +++ b/xen/drivers/pci/Kconfig
> @@ -1,3 +1,12 @@
> 
> config HAS_PCI
>       bool
> +
> +config PCI_ATS
> +     bool "PCI ATS support"
> +     default y
> +     depends on X86 && HAS_PCI
> +     ---help---
> +      Enable PCI Address Translation Services.
> +
> +      If unsure, say Y.
> -- 
> 2.17.1
> 




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.