All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: Rahul Singh <rahul.singh@arm.com>
Cc: xen-devel@lists.xenproject.org, bertrand.marquis@arm.com,
	"Jan Beulich" <jbeulich@suse.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
	"George Dunlap" <george.dunlap@citrix.com>,
	"Ian Jackson" <iwj@xenproject.org>,
	"Julien Grall" <julien@xen.org>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Paul Durrant" <paul@xen.org>,
	"Kevin Tian" <kevin.tian@intel.com>
Subject: Re: [PATCH v1 2/4] xen/pci: Introduce new CONFIG_HAS_PCI_ATS flag for PCI ATS functionality.
Date: Tue, 27 Oct 2020 16:55:52 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.21.2010271640280.12247@sstabellini-ThinkPad-T480s> (raw)
In-Reply-To: <1bb971bed3f5a56b0691fbcfd0346ae721ba049f.1603731279.git.rahul.singh@arm.com>

On Mon, 26 Oct 2020, Rahul Singh 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@arm.com>
> ---
>  xen/arch/x86/Kconfig                     |  1 +
>  xen/drivers/passthrough/ats.h            | 24 ++++++++++++++++++++++++
>  xen/drivers/passthrough/vtd/x86/Makefile |  2 +-
>  xen/drivers/passthrough/x86/Makefile     |  2 +-
>  xen/drivers/pci/Kconfig                  |  3 +++
>  5 files changed, 30 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
> index 24868aa6ad..31906e9c97 100644
> --- a/xen/arch/x86/Kconfig
> +++ b/xen/arch/x86/Kconfig
> @@ -20,6 +20,7 @@ config X86
>  	select HAS_NS16550
>  	select HAS_PASSTHROUGH
>  	select HAS_PCI
> +	select HAS_PCI_ATS
>  	select HAS_PDX
>  	select HAS_SCHED_GRANULARITY
>  	select HAS_UBSAN
> diff --git a/xen/drivers/passthrough/ats.h b/xen/drivers/passthrough/ats.h
> index 22ae209b37..a0af07b287 100644
> --- a/xen/drivers/passthrough/ats.h
> +++ b/xen/drivers/passthrough/ats.h
> @@ -17,6 +17,8 @@
>  
>  #include <xen/pci_regs.h>
>  
> +#ifdef CONFIG_HAS_PCI_ATS
> +
>  #define ATS_REG_CAP    4
>  #define ATS_REG_CTL    6
>  #define ATS_QUEUE_DEPTH_MASK     0x1f
> @@ -48,5 +50,27 @@ 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
> +
> +static inline int enable_ats_device(struct pci_dev *pdev,
> +                                    struct list_head *ats_list)
> +{
> +    return -ENODEV;
> +}
> +
> +static inline void disable_ats_device(struct pci_dev *pdev) { }
> +
> +static inline int pci_ats_enabled(int seg, int bus, int devfn)
> +{
> +    return -ENODEV;
> +}

pci_ats_enabled returns 0 when ATS is not enabled


> +static inline int pci_ats_device(int seg, int bus, int devfn)
> +{
> +    return -ENODEV;

also returns 0 when ATS is not enabled


> +}
> +
> +#endif /* CONFIG_HAS_PCI_ATS */
> +
>  #endif /* _ATS_H_ */
>  
> diff --git a/xen/drivers/passthrough/vtd/x86/Makefile b/xen/drivers/passthrough/vtd/x86/Makefile
> index 4ef00a4c5b..60f79fe263 100644
> --- a/xen/drivers/passthrough/vtd/x86/Makefile
> +++ b/xen/drivers/passthrough/vtd/x86/Makefile
> @@ -1,3 +1,3 @@
> -obj-y += ats.o
> +obj-$(CONFIG_HAS_PCI_ATS) += ats.o
>  obj-$(CONFIG_HVM) += hvm.o
>  obj-y += vtd.o
> diff --git a/xen/drivers/passthrough/x86/Makefile b/xen/drivers/passthrough/x86/Makefile
> index a70cf9460d..05e6f51f25 100644
> --- a/xen/drivers/passthrough/x86/Makefile
> +++ b/xen/drivers/passthrough/x86/Makefile
> @@ -1,2 +1,2 @@
> -obj-y += ats.o
> +obj-$(CONFIG_HAS_PCI_ATS) += ats.o
>  obj-y += iommu.o
> diff --git a/xen/drivers/pci/Kconfig b/xen/drivers/pci/Kconfig
> index 7da03fa13b..1588d4a91e 100644
> --- a/xen/drivers/pci/Kconfig
> +++ b/xen/drivers/pci/Kconfig
> @@ -1,3 +1,6 @@
>  
>  config HAS_PCI
>  	bool
> +
> +config HAS_PCI_ATS
> +	bool
> -- 
> 2.17.1
> 


  reply	other threads:[~2020-10-27 23:56 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26 17:17 [PATCH v1 0/4] xen/arm: Make PCI passthrough code non-x86 specific Rahul Singh
2020-10-26 17:17 ` [PATCH v1 1/4] xen/ns16550: solve compilation error on ARM with CONFIG_HAS_PCI enabled Rahul Singh
2020-10-27 23:32   ` Stefano Stabellini
2020-10-28  7:18     ` Jan Beulich
2020-10-28 10:41       ` Rahul Singh
2020-10-28 11:32         ` Julien Grall
2020-10-28 15:47           ` Rahul Singh
2020-10-28 15:49             ` Jan Beulich
2020-10-28 10:38     ` Rahul Singh
2020-10-26 17:17 ` [PATCH v1 2/4] xen/pci: Introduce new CONFIG_HAS_PCI_ATS flag for PCI ATS functionality Rahul Singh
2020-10-27 23:55   ` Stefano Stabellini [this message]
2020-10-28  7:22     ` Jan Beulich
2020-10-28  7:25   ` Jan Beulich
2020-10-26 17:17 ` [PATCH v1 3/4] xen/pci: Move x86 specific code to x86 directory Rahul Singh
2020-10-28  0:15   ` Stefano Stabellini
2020-10-28 11:51   ` Jan Beulich
2020-10-28 11:58     ` Julien Grall
2020-10-28 15:20     ` Rahul Singh
2020-10-28 15:37       ` Jan Beulich
2020-10-26 17:17 ` [PATCH v1 4/4] xen/pci: solve compilation error when memory paging is not enabled Rahul Singh
2020-10-28 11:56   ` Jan Beulich
2020-10-28 15:13     ` Rahul Singh
2020-10-29 16:58       ` Rahul Singh
2020-10-29 17:16         ` Jan Beulich
2020-10-30 13:59           ` Rahul Singh
2020-10-28  0:04 ` [PATCH v1 0/4] xen/arm: Make PCI passthrough code non-x86 specific Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.21.2010271640280.12247@sstabellini-ThinkPad-T480s \
    --to=sstabellini@kernel.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=bertrand.marquis@arm.com \
    --cc=george.dunlap@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=paul@xen.org \
    --cc=rahul.singh@arm.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.