All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: pat: Do not compile stubbed functions when X86_PAT is off
@ 2020-02-06 14:55 Jan Kiszka
  2020-02-07 14:50 ` Thomas Gleixner
  0 siblings, 1 reply; 9+ messages in thread
From: Jan Kiszka @ 2020-02-06 14:55 UTC (permalink / raw)
  To: Dave Hansen, Andy Lutomirski, Peter Zijlstra, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, H. Peter Anvin
  Cc: x86, Linux Kernel Mailing List

From: Jan Kiszka <jan.kiszka@siemens.com>

Those are already provided by linux/io.h as stubs.

The conflict remains invisible until someone would pull {linux,asm}/io.h
into memtype.c.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 arch/x86/mm/pat/memtype.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/mm/pat/memtype.c b/arch/x86/mm/pat/memtype.c
index 394be8611748..a695e17bd4c7 100644
--- a/arch/x86/mm/pat/memtype.c
+++ b/arch/x86/mm/pat/memtype.c
@@ -801,6 +801,7 @@ void memtype_free_io(resource_size_t start, resource_size_t end)
 	memtype_free(start, end);
 }
 
+#ifdef CONFIG_X86_PAT
 int arch_io_reserve_memtype_wc(resource_size_t start, resource_size_t size)
 {
 	enum page_cache_mode type = _PAGE_CACHE_MODE_WC;
@@ -814,6 +815,7 @@ void arch_io_free_memtype_wc(resource_size_t start, resource_size_t size)
 	memtype_free_io(start, start + size);
 }
 EXPORT_SYMBOL(arch_io_free_memtype_wc);
+#endif
 
 pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
 				unsigned long size, pgprot_t vma_prot)
-- 
2.16.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] x86: pat: Do not compile stubbed functions when X86_PAT is off
  2020-02-06 14:55 [PATCH] x86: pat: Do not compile stubbed functions when X86_PAT is off Jan Kiszka
@ 2020-02-07 14:50 ` Thomas Gleixner
  2020-02-07 15:02   ` Jan Kiszka
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Gleixner @ 2020-02-07 14:50 UTC (permalink / raw)
  To: Jan Kiszka, Dave Hansen, Andy Lutomirski, Peter Zijlstra,
	Ingo Molnar, Borislav Petkov, H. Peter Anvin
  Cc: x86, Linux Kernel Mailing List

Jan Kiszka <jan.kiszka@siemens.com> writes:

> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> Those are already provided by linux/io.h as stubs.
>
> The conflict remains invisible until someone would pull {linux,asm}/io.h
> into memtype.c.

Err. memtype.c includes asm/io.h already. So it's just the PAT=n case
which is broken.

Thanks,

        tglx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] x86: pat: Do not compile stubbed functions when X86_PAT is off
  2020-02-07 14:50 ` Thomas Gleixner
@ 2020-02-07 15:02   ` Jan Kiszka
  2020-10-26 17:39     ` [PATCH v2] " Jan Kiszka
  0 siblings, 1 reply; 9+ messages in thread
From: Jan Kiszka @ 2020-02-07 15:02 UTC (permalink / raw)
  To: Thomas Gleixner, Dave Hansen, Andy Lutomirski, Peter Zijlstra,
	Ingo Molnar, Borislav Petkov, H. Peter Anvin
  Cc: x86, Linux Kernel Mailing List

On 07.02.20 15:50, Thomas Gleixner wrote:
> Jan Kiszka <jan.kiszka@siemens.com> writes:
> 
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> Those are already provided by linux/io.h as stubs.
>>
>> The conflict remains invisible until someone would pull {linux,asm}/io.h
>> into memtype.c.
> 
> Err. memtype.c includes asm/io.h already. So it's just the PAT=n case
> which is broken.

Ah, right, my comment must read "until someone would pull linux/io.h"
because only that header carries the stubs.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2] x86: pat: Do not compile stubbed functions when X86_PAT is off
  2020-02-07 15:02   ` Jan Kiszka
@ 2020-10-26 17:39     ` Jan Kiszka
  2021-04-11  8:22       ` Jan Kiszka
  2021-04-14  7:36       ` [tip: x86/cleanups] x86/pat: " tip-bot2 for Jan Kiszka
  0 siblings, 2 replies; 9+ messages in thread
From: Jan Kiszka @ 2020-10-26 17:39 UTC (permalink / raw)
  To: Thomas Gleixner, Dave Hansen, Andy Lutomirski, Peter Zijlstra,
	Ingo Molnar, Borislav Petkov, H. Peter Anvin
  Cc: x86, Linux Kernel Mailing List

From: Jan Kiszka <jan.kiszka@siemens.com>

Those are already provided by linux/io.h as stubs.

The conflict remains invisible until someone would pull linux/io.h into
memtype.c.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

Change in v2:
 - correct commit message

 arch/x86/mm/pat/memtype.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/mm/pat/memtype.c b/arch/x86/mm/pat/memtype.c
index 8f665c352bf0..41a4ac585af3 100644
--- a/arch/x86/mm/pat/memtype.c
+++ b/arch/x86/mm/pat/memtype.c
@@ -800,6 +800,7 @@ void memtype_free_io(resource_size_t start, resource_size_t end)
 	memtype_free(start, end);
 }
 
+#ifdef CONFIG_X86_PAT
 int arch_io_reserve_memtype_wc(resource_size_t start, resource_size_t size)
 {
 	enum page_cache_mode type = _PAGE_CACHE_MODE_WC;
@@ -813,6 +814,7 @@ void arch_io_free_memtype_wc(resource_size_t start, resource_size_t size)
 	memtype_free_io(start, start + size);
 }
 EXPORT_SYMBOL(arch_io_free_memtype_wc);
+#endif
 
 pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
 				unsigned long size, pgprot_t vma_prot)
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] x86: pat: Do not compile stubbed functions when X86_PAT is off
  2020-10-26 17:39     ` [PATCH v2] " Jan Kiszka
@ 2021-04-11  8:22       ` Jan Kiszka
  2021-04-11  9:10         ` Borislav Petkov
  2021-04-14  7:36       ` [tip: x86/cleanups] x86/pat: " tip-bot2 for Jan Kiszka
  1 sibling, 1 reply; 9+ messages in thread
From: Jan Kiszka @ 2021-04-11  8:22 UTC (permalink / raw)
  To: Thomas Gleixner, Dave Hansen, Andy Lutomirski, Peter Zijlstra,
	Ingo Molnar, Borislav Petkov, H. Peter Anvin
  Cc: x86, Linux Kernel Mailing List

On 26.10.20 18:39, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> Those are already provided by linux/io.h as stubs.
>
> The conflict remains invisible until someone would pull linux/io.h into
> memtype.c.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>
> Change in v2:
>  - correct commit message
>
>  arch/x86/mm/pat/memtype.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/arch/x86/mm/pat/memtype.c b/arch/x86/mm/pat/memtype.c
> index 8f665c352bf0..41a4ac585af3 100644
> --- a/arch/x86/mm/pat/memtype.c
> +++ b/arch/x86/mm/pat/memtype.c
> @@ -800,6 +800,7 @@ void memtype_free_io(resource_size_t start, resource_size_t end)
>  	memtype_free(start, end);
>  }
>
> +#ifdef CONFIG_X86_PAT
>  int arch_io_reserve_memtype_wc(resource_size_t start, resource_size_t size)
>  {
>  	enum page_cache_mode type = _PAGE_CACHE_MODE_WC;
> @@ -813,6 +814,7 @@ void arch_io_free_memtype_wc(resource_size_t start, resource_size_t size)
>  	memtype_free_io(start, start + size);
>  }
>  EXPORT_SYMBOL(arch_io_free_memtype_wc);
> +#endif
>
>  pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
>  				unsigned long size, pgprot_t vma_prot)
>

What happened to this?

Jan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] x86: pat: Do not compile stubbed functions when X86_PAT is off
  2021-04-11  8:22       ` Jan Kiszka
@ 2021-04-11  9:10         ` Borislav Petkov
  2021-04-11  9:12           ` Jan Kiszka
  0 siblings, 1 reply; 9+ messages in thread
From: Borislav Petkov @ 2021-04-11  9:10 UTC (permalink / raw)
  To: Jan Kiszka
  Cc: Thomas Gleixner, Dave Hansen, Andy Lutomirski, Peter Zijlstra,
	Ingo Molnar, H. Peter Anvin, x86, Linux Kernel Mailing List

On Sun, Apr 11, 2021 at 10:22:19AM +0200, Jan Kiszka wrote:
> On 26.10.20 18:39, Jan Kiszka wrote:
> > From: Jan Kiszka <jan.kiszka@siemens.com>
> >
> > Those are already provided by linux/io.h as stubs.
> >
> > The conflict remains invisible until someone would pull linux/io.h into
> > memtype.c.
> >
> > Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> > ---
> >
> > Change in v2:
> >  - correct commit message
> >
> >  arch/x86/mm/pat/memtype.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/arch/x86/mm/pat/memtype.c b/arch/x86/mm/pat/memtype.c
> > index 8f665c352bf0..41a4ac585af3 100644
> > --- a/arch/x86/mm/pat/memtype.c
> > +++ b/arch/x86/mm/pat/memtype.c
> > @@ -800,6 +800,7 @@ void memtype_free_io(resource_size_t start, resource_size_t end)
> >  	memtype_free(start, end);
> >  }
> >
> > +#ifdef CONFIG_X86_PAT
> >  int arch_io_reserve_memtype_wc(resource_size_t start, resource_size_t size)
> >  {
> >  	enum page_cache_mode type = _PAGE_CACHE_MODE_WC;
> > @@ -813,6 +814,7 @@ void arch_io_free_memtype_wc(resource_size_t start, resource_size_t size)
> >  	memtype_free_io(start, start + size);
> >  }
> >  EXPORT_SYMBOL(arch_io_free_memtype_wc);
> > +#endif
> >
> >  pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
> >  				unsigned long size, pgprot_t vma_prot)
> >
> 
> What happened to this?

What is this patch and your other asm/proto.h thing fixing?

Looks like you're using kernel headers in something else and don't want
to include the whole world thus those fixes... so that you can include
upstream kernel headers without having to touch them...

Or am I way off base here?

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] x86: pat: Do not compile stubbed functions when X86_PAT is off
  2021-04-11  9:10         ` Borislav Petkov
@ 2021-04-11  9:12           ` Jan Kiszka
  2021-04-11  9:25             ` Borislav Petkov
  0 siblings, 1 reply; 9+ messages in thread
From: Jan Kiszka @ 2021-04-11  9:12 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Thomas Gleixner, Dave Hansen, Andy Lutomirski, Peter Zijlstra,
	Ingo Molnar, H. Peter Anvin, x86, Linux Kernel Mailing List

On 11.04.21 11:10, Borislav Petkov wrote:
> On Sun, Apr 11, 2021 at 10:22:19AM +0200, Jan Kiszka wrote:
>> On 26.10.20 18:39, Jan Kiszka wrote:
>>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>>
>>> Those are already provided by linux/io.h as stubs.
>>>
>>> The conflict remains invisible until someone would pull linux/io.h into
>>> memtype.c.
>>>
>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>>> ---
>>>
>>> Change in v2:
>>>  - correct commit message
>>>
>>>  arch/x86/mm/pat/memtype.c | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>
>>> diff --git a/arch/x86/mm/pat/memtype.c b/arch/x86/mm/pat/memtype.c
>>> index 8f665c352bf0..41a4ac585af3 100644
>>> --- a/arch/x86/mm/pat/memtype.c
>>> +++ b/arch/x86/mm/pat/memtype.c
>>> @@ -800,6 +800,7 @@ void memtype_free_io(resource_size_t start, resource_size_t end)
>>>  	memtype_free(start, end);
>>>  }
>>>
>>> +#ifdef CONFIG_X86_PAT
>>>  int arch_io_reserve_memtype_wc(resource_size_t start, resource_size_t size)
>>>  {
>>>  	enum page_cache_mode type = _PAGE_CACHE_MODE_WC;
>>> @@ -813,6 +814,7 @@ void arch_io_free_memtype_wc(resource_size_t start, resource_size_t size)
>>>  	memtype_free_io(start, start + size);
>>>  }
>>>  EXPORT_SYMBOL(arch_io_free_memtype_wc);
>>> +#endif
>>>
>>>  pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
>>>  				unsigned long size, pgprot_t vma_prot)
>>>
>>
>> What happened to this?
>
> What is this patch and your other asm/proto.h thing fixing?
>
> Looks like you're using kernel headers in something else and don't want
> to include the whole world thus those fixes... so that you can include
> upstream kernel headers without having to touch them...
>
> Or am I way off base here?
>

The patches are coming from downstream usage, yes, but I think the
solutions are relevant cleanups for upstream as well.

Jan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] x86: pat: Do not compile stubbed functions when X86_PAT is off
  2021-04-11  9:12           ` Jan Kiszka
@ 2021-04-11  9:25             ` Borislav Petkov
  0 siblings, 0 replies; 9+ messages in thread
From: Borislav Petkov @ 2021-04-11  9:25 UTC (permalink / raw)
  To: Jan Kiszka
  Cc: Thomas Gleixner, Dave Hansen, Andy Lutomirski, Peter Zijlstra,
	Ingo Molnar, H. Peter Anvin, x86, Linux Kernel Mailing List

On Sun, Apr 11, 2021 at 11:12:32AM +0200, Jan Kiszka wrote:
> The patches are coming from downstream usage, yes,

Ok, for the future, it would be good to mention that in the commit
message so that a committer knows what they're for.

> but I think the solutions are relevant cleanups for upstream as well.

Yeah but you know that we generally don't do "preemptive" fixes like
that. But those are small enough so I don't see a problem...

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [tip: x86/cleanups] x86/pat: Do not compile stubbed functions when X86_PAT is off
  2020-10-26 17:39     ` [PATCH v2] " Jan Kiszka
  2021-04-11  8:22       ` Jan Kiszka
@ 2021-04-14  7:36       ` tip-bot2 for Jan Kiszka
  1 sibling, 0 replies; 9+ messages in thread
From: tip-bot2 for Jan Kiszka @ 2021-04-14  7:36 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Jan Kiszka, Borislav Petkov, x86, linux-kernel

The following commit has been merged into the x86/cleanups branch of tip:

Commit-ID:     16854b567dff767e5ec5e6dc23021271136733a5
Gitweb:        https://git.kernel.org/tip/16854b567dff767e5ec5e6dc23021271136733a5
Author:        Jan Kiszka <jan.kiszka@siemens.com>
AuthorDate:    Mon, 26 Oct 2020 18:39:06 +01:00
Committer:     Borislav Petkov <bp@suse.de>
CommitterDate: Wed, 14 Apr 2021 08:21:41 +02:00

x86/pat: Do not compile stubbed functions when X86_PAT is off

Those are already provided by linux/io.h as stubs.

The conflict remains invisible until someone would pull linux/io.h into
memtype.c. This fixes a build error when this file is used outside of
the kernel tree.

  [ bp: Massage commit message. ]

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/a9351615-7a0d-9d47-af65-d9e2fffe8192@siemens.com
---
 arch/x86/mm/pat/memtype.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/mm/pat/memtype.c b/arch/x86/mm/pat/memtype.c
index 6084d14..3112ca7 100644
--- a/arch/x86/mm/pat/memtype.c
+++ b/arch/x86/mm/pat/memtype.c
@@ -800,6 +800,7 @@ void memtype_free_io(resource_size_t start, resource_size_t end)
 	memtype_free(start, end);
 }
 
+#ifdef CONFIG_X86_PAT
 int arch_io_reserve_memtype_wc(resource_size_t start, resource_size_t size)
 {
 	enum page_cache_mode type = _PAGE_CACHE_MODE_WC;
@@ -813,6 +814,7 @@ void arch_io_free_memtype_wc(resource_size_t start, resource_size_t size)
 	memtype_free_io(start, start + size);
 }
 EXPORT_SYMBOL(arch_io_free_memtype_wc);
+#endif
 
 pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
 				unsigned long size, pgprot_t vma_prot)

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-04-14  7:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-06 14:55 [PATCH] x86: pat: Do not compile stubbed functions when X86_PAT is off Jan Kiszka
2020-02-07 14:50 ` Thomas Gleixner
2020-02-07 15:02   ` Jan Kiszka
2020-10-26 17:39     ` [PATCH v2] " Jan Kiszka
2021-04-11  8:22       ` Jan Kiszka
2021-04-11  9:10         ` Borislav Petkov
2021-04-11  9:12           ` Jan Kiszka
2021-04-11  9:25             ` Borislav Petkov
2021-04-14  7:36       ` [tip: x86/cleanups] x86/pat: " tip-bot2 for Jan Kiszka

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.