Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1730322 > unrolled thread

[PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to fix iommmu build

Started byGeert Uytterhoeven <geert@linux-m68k.org>
First post2017-09-11 14:30 +0200
Last post2017-09-25 18:20 +0200
Articles 7 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to fix iommmu build Geert Uytterhoeven <geert@linux-m68k.org> - 2017-09-11 14:30 +0200
    Re: [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to  fix iommmu build Joerg Roedel <jroedel@suse.de> - 2017-09-20 14:20 +0200
    Re: [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to  fix iommmu build Alex Williamson <alex.williamson@redhat.com> - 2017-09-20 18:20 +0200
    Re: [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to  fix iommmu build Bjorn Helgaas <helgaas@kernel.org> - 2017-09-22 18:00 +0200
      Re: [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to  fix iommmu build Joerg Roedel <jroedel@suse.de> - 2017-09-22 20:00 +0200
      Re: [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to  fix iommmu build Geert Uytterhoeven <geert@linux-m68k.org> - 2017-09-22 20:20 +0200
        Re: [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to  fix iommmu build Bjorn Helgaas <helgaas@kernel.org> - 2017-09-25 18:20 +0200

#1730322 — [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to fix iommmu build

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2017-09-11 14:30 +0200
Subject[PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to fix iommmu build
Message-ID<uow0G-3dr-13@gated-at.bofh.it>
If CONFIG_PCI=n, and gcc (e.g. 4.1.2) decides not to inline
get_pci_function_alias_group(), the build fails with:

    drivers/iommu/iommu.o: In function `get_pci_function_alias_group':
    iommu.c:(.text+0xfdc): undefined reference to `pci_acs_enabled'

Due to the various dummies for PCI calls in the CONFIG_PCI=n case,
pci_acs_enabled() isn't actually ever called, but not all versions of
gcc are smart enough to realize that.

While explicitly marking get_pci_function_alias_group() inline would fix
the build, this would inflate the code for the CONFIG_PCI=y case, as
get_pci_function_alias_group() is a not-so-small function called from
two places.

Hence fix the issue by introducing a dummy for pci_acs_enabled()
instead.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 include/linux/pci.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/pci.h b/include/linux/pci.h
index f68c58a93dd045b9..f4f8ee5a7362e982 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1685,6 +1685,8 @@ static inline int pci_get_new_domain_nr(void) { return -ENOSYS; }
 
 #define dev_is_pci(d) (false)
 #define dev_is_pf(d) (false)
+static inline bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags)
+{ return false; }
 #endif /* CONFIG_PCI */
 
 /* Include architecture-dependent settings and functions */
-- 
2.7.4

[toc] | [next] | [standalone]


#1735745 — Re: [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to fix iommmu build

FromJoerg Roedel <jroedel@suse.de>
Date2017-09-20 14:20 +0200
SubjectRe: [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to fix iommmu build
Message-ID<urM8V-2U6-7@gated-at.bofh.it>
In reply to#1730322
Hey Bjorn,

On Mon, Sep 11, 2017 at 02:29:15PM +0200, Geert Uytterhoeven wrote:
> If CONFIG_PCI=n, and gcc (e.g. 4.1.2) decides not to inline
> get_pci_function_alias_group(), the build fails with:
> 
>     drivers/iommu/iommu.o: In function `get_pci_function_alias_group':
>     iommu.c:(.text+0xfdc): undefined reference to `pci_acs_enabled'
> 
> Due to the various dummies for PCI calls in the CONFIG_PCI=n case,
> pci_acs_enabled() isn't actually ever called, but not all versions of
> gcc are smart enough to realize that.
> 
> While explicitly marking get_pci_function_alias_group() inline would fix
> the build, this would inflate the code for the CONFIG_PCI=y case, as
> get_pci_function_alias_group() is a not-so-small function called from
> two places.
> 
> Hence fix the issue by introducing a dummy for pci_acs_enabled()
> instead.
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
>  include/linux/pci.h | 2 ++
>  1 file changed, 2 insertions(+)

I am sending iommu-fixes upstream this week, and this would fit into it.
Can you have a look please and ack it if you are okay with that?

Thanks,

	Joerg

> 
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index f68c58a93dd045b9..f4f8ee5a7362e982 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1685,6 +1685,8 @@ static inline int pci_get_new_domain_nr(void) { return -ENOSYS; }
>  
>  #define dev_is_pci(d) (false)
>  #define dev_is_pf(d) (false)
> +static inline bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags)
> +{ return false; }
>  #endif /* CONFIG_PCI */
>  
>  /* Include architecture-dependent settings and functions */
> -- 
> 2.7.4

[toc] | [prev] | [next] | [standalone]


#1735881 — Re: [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to fix iommmu build

FromAlex Williamson <alex.williamson@redhat.com>
Date2017-09-20 18:20 +0200
SubjectRe: [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to fix iommmu build
Message-ID<urPTc-5ov-25@gated-at.bofh.it>
In reply to#1730322
On Mon, 11 Sep 2017 14:29:15 +0200
Geert Uytterhoeven <geert@linux-m68k.org> wrote:

> If CONFIG_PCI=n, and gcc (e.g. 4.1.2) decides not to inline
> get_pci_function_alias_group(), the build fails with:
> 
>     drivers/iommu/iommu.o: In function `get_pci_function_alias_group':
>     iommu.c:(.text+0xfdc): undefined reference to `pci_acs_enabled'
> 
> Due to the various dummies for PCI calls in the CONFIG_PCI=n case,
> pci_acs_enabled() isn't actually ever called, but not all versions of
> gcc are smart enough to realize that.
> 
> While explicitly marking get_pci_function_alias_group() inline would fix
> the build, this would inflate the code for the CONFIG_PCI=y case, as
> get_pci_function_alias_group() is a not-so-small function called from
> two places.
> 
> Hence fix the issue by introducing a dummy for pci_acs_enabled()
> instead.
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
>  include/linux/pci.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index f68c58a93dd045b9..f4f8ee5a7362e982 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1685,6 +1685,8 @@ static inline int pci_get_new_domain_nr(void) { return -ENOSYS; }
>  
>  #define dev_is_pci(d) (false)
>  #define dev_is_pf(d) (false)
> +static inline bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags)
> +{ return false; }
>  #endif /* CONFIG_PCI */
>  
>  /* Include architecture-dependent settings and functions */

Reviewed-by: Alex Williamson <alex.williamson@redhat.com>

[toc] | [prev] | [next] | [standalone]


#1737592 — Re: [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to fix iommmu build

FromBjorn Helgaas <helgaas@kernel.org>
Date2017-09-22 18:00 +0200
SubjectRe: [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to fix iommmu build
Message-ID<usywV-7Vf-5@gated-at.bofh.it>
In reply to#1730322
On Mon, Sep 11, 2017 at 02:29:15PM +0200, Geert Uytterhoeven wrote:
> If CONFIG_PCI=n, and gcc (e.g. 4.1.2) decides not to inline
> get_pci_function_alias_group(), the build fails with:
> 
>     drivers/iommu/iommu.o: In function `get_pci_function_alias_group':
>     iommu.c:(.text+0xfdc): undefined reference to `pci_acs_enabled'
> 
> Due to the various dummies for PCI calls in the CONFIG_PCI=n case,
> pci_acs_enabled() isn't actually ever called, but not all versions of
> gcc are smart enough to realize that.
> 
> While explicitly marking get_pci_function_alias_group() inline would fix
> the build, this would inflate the code for the CONFIG_PCI=y case, as
> get_pci_function_alias_group() is a not-so-small function called from
> two places.
> 
> Hence fix the issue by introducing a dummy for pci_acs_enabled()
> instead.
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

Joerg, if you pick this up, would you mind capitalizing the subject
line to match the PCI convention, e.g.,

  PCI: Add dummy pci_acs_enabled() for CONFIG_PCI=n build

If it's too late for you to pick this up this week, I can include it
next week.  I assume this is not related to a specific change, i.e.,
it's not a regression?  Should it be marked for stable?

> ---
>  include/linux/pci.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index f68c58a93dd045b9..f4f8ee5a7362e982 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1685,6 +1685,8 @@ static inline int pci_get_new_domain_nr(void) { return -ENOSYS; }
>  
>  #define dev_is_pci(d) (false)
>  #define dev_is_pf(d) (false)
> +static inline bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags)
> +{ return false; }
>  #endif /* CONFIG_PCI */
>  
>  /* Include architecture-dependent settings and functions */
> -- 
> 2.7.4
> 

[toc] | [prev] | [next] | [standalone]


#1737719 — Re: [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to fix iommmu build

FromJoerg Roedel <jroedel@suse.de>
Date2017-09-22 20:00 +0200
SubjectRe: [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to fix iommmu build
Message-ID<usAp4-Bi-15@gated-at.bofh.it>
In reply to#1737592
Hey Bjorn,

On Fri, Sep 22, 2017 at 10:56:05AM -0500, Bjorn Helgaas wrote:
> Joerg, if you pick this up, would you mind capitalizing the subject
> line to match the PCI convention, e.g.,
> 
>   PCI: Add dummy pci_acs_enabled() for CONFIG_PCI=n build
> 
> If it's too late for you to pick this up this week, I can include it
> next week.  I assume this is not related to a specific change, i.e.,
> it's not a regression?  Should it be marked for stable?

I sent iommu fixes out today, this was not included. So if you are
sending fixes upstream next week anyway, please pick it up. I am not
sure if I have anything to send next week, so you are probably faster.

I think its stable material too.

Thanks,

	Joerg

[toc] | [prev] | [next] | [standalone]


#1737724 — Re: [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to fix iommmu build

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2017-09-22 20:20 +0200
SubjectRe: [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to fix iommmu build
Message-ID<usAIq-WQ-5@gated-at.bofh.it>
In reply to#1737592
Hi Björn,

On Fri, Sep 22, 2017 at 5:56 PM, Bjorn Helgaas <helgaas@kernel.org> wrote:
> On Mon, Sep 11, 2017 at 02:29:15PM +0200, Geert Uytterhoeven wrote:
>> If CONFIG_PCI=n, and gcc (e.g. 4.1.2) decides not to inline
>> get_pci_function_alias_group(), the build fails with:
>>
>>     drivers/iommu/iommu.o: In function `get_pci_function_alias_group':
>>     iommu.c:(.text+0xfdc): undefined reference to `pci_acs_enabled'
>>
>> Due to the various dummies for PCI calls in the CONFIG_PCI=n case,
>> pci_acs_enabled() isn't actually ever called, but not all versions of
>> gcc are smart enough to realize that.
>>
>> While explicitly marking get_pci_function_alias_group() inline would fix
>> the build, this would inflate the code for the CONFIG_PCI=y case, as
>> get_pci_function_alias_group() is a not-so-small function called from
>> two places.
>>
>> Hence fix the issue by introducing a dummy for pci_acs_enabled()
>> instead.
>>
>> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
>
> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
>
> Joerg, if you pick this up, would you mind capitalizing the subject
> line to match the PCI convention, e.g.,
>
>   PCI: Add dummy pci_acs_enabled() for CONFIG_PCI=n build
>
> If it's too late for you to pick this up this week, I can include it
> next week.  I assume this is not related to a specific change, i.e.,
> it's not a regression?  Should it be marked for stable?

It was introduced by commit 0ae349a0f33fb040 ("iommu/qcom: Add qcom_iommu"),
which enabled IOMMU support for compile-testing in e.g. allmodconfig on
platforms that don't have IOMMUs.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

[toc] | [prev] | [next] | [standalone]


#1739146 — Re: [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to fix iommmu build

FromBjorn Helgaas <helgaas@kernel.org>
Date2017-09-25 18:20 +0200
SubjectRe: [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to fix iommmu build
Message-ID<utEgW-iV-5@gated-at.bofh.it>
In reply to#1737724
On Fri, Sep 22, 2017 at 08:12:46PM +0200, Geert Uytterhoeven wrote:
> Hi Björn,
> 
> On Fri, Sep 22, 2017 at 5:56 PM, Bjorn Helgaas <helgaas@kernel.org> wrote:
> > On Mon, Sep 11, 2017 at 02:29:15PM +0200, Geert Uytterhoeven wrote:
> >> If CONFIG_PCI=n, and gcc (e.g. 4.1.2) decides not to inline
> >> get_pci_function_alias_group(), the build fails with:
> >>
> >>     drivers/iommu/iommu.o: In function `get_pci_function_alias_group':
> >>     iommu.c:(.text+0xfdc): undefined reference to `pci_acs_enabled'
> >>
> >> Due to the various dummies for PCI calls in the CONFIG_PCI=n case,
> >> pci_acs_enabled() isn't actually ever called, but not all versions of
> >> gcc are smart enough to realize that.
> >>
> >> While explicitly marking get_pci_function_alias_group() inline would fix
> >> the build, this would inflate the code for the CONFIG_PCI=y case, as
> >> get_pci_function_alias_group() is a not-so-small function called from
> >> two places.
> >>
> >> Hence fix the issue by introducing a dummy for pci_acs_enabled()
> >> instead.
> >>
> >> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> >
> > Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> >
> > Joerg, if you pick this up, would you mind capitalizing the subject
> > line to match the PCI convention, e.g.,
> >
> >   PCI: Add dummy pci_acs_enabled() for CONFIG_PCI=n build
> >
> > If it's too late for you to pick this up this week, I can include it
> > next week.  I assume this is not related to a specific change, i.e.,
> > it's not a regression?  Should it be marked for stable?
> 
> It was introduced by commit 0ae349a0f33fb040 ("iommu/qcom: Add qcom_iommu"),
> which enabled IOMMU support for compile-testing in e.g. allmodconfig on
> platforms that don't have IOMMUs.

I put this on my for-linus branch for v4.14 with Alex's reviewed-by.

Since 0ae349a0f33f was merged in the v4.14 merge window (it first
appeared in v4.14-rc1), I don't think we need to mark it for stable.

Bjorn

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web