* [RFC PATCH] arm64: mm: Export __sync_icache_dcache() for xen-privcmd
@ 2018-07-11 23:18 Ben Hutchings
2018-07-27 12:06 ` Catalin Marinas
0 siblings, 1 reply; 5+ messages in thread
From: Ben Hutchings @ 2018-07-11 23:18 UTC (permalink / raw)
To: linux-arm-kernel
The xen-privcmd driver, which can be modular, calls set_pte_at()
which in turn may call __sync_icache_dcache().
The call to __sync_icache_dcache() may be optimised out because it is
conditional on !pte_special(), and xen-privcmd calls pte_mkspecial().
But it seems unwise to rely on this optimisation.
Fixes: 3ad0876554ca ("xen/privcmd: add IOCTL_PRIVCMD_MMAP_RESOURCE")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
This is an RFC since I haven't found an actual build failure. Using
Debian's gcc 7.3 with either CC_OPTIMIZE_FOR_PERFORMANCE or
CC_OPTIMIZE_FOR_SIZE, the call *is* optimised away.
Ben.
arch/arm64/mm/flush.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/mm/flush.c b/arch/arm64/mm/flush.c
index 1059884f9a6f..a76f0b983294 100644
--- a/arch/arm64/mm/flush.c
+++ b/arch/arm64/mm/flush.c
@@ -66,6 +66,7 @@ void __sync_icache_dcache(pte_t pte)
sync_icache_aliases(page_address(page),
PAGE_SIZE << compound_order(page));
}
+EXPORT_SYMBOL_GPL(__sync_icache_dcache);
/*
* This function is called when a page has been modified by the kernel. Mark
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [RFC PATCH] arm64: mm: Export __sync_icache_dcache() for xen-privcmd
2018-07-11 23:18 [RFC PATCH] arm64: mm: Export __sync_icache_dcache() for xen-privcmd Ben Hutchings
@ 2018-07-27 12:06 ` Catalin Marinas
2018-07-27 13:22 ` Will Deacon
0 siblings, 1 reply; 5+ messages in thread
From: Catalin Marinas @ 2018-07-27 12:06 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Jul 12, 2018 at 12:18:22AM +0100, Ben Hutchings wrote:
> The xen-privcmd driver, which can be modular, calls set_pte_at()
> which in turn may call __sync_icache_dcache().
>
> The call to __sync_icache_dcache() may be optimised out because it is
> conditional on !pte_special(), and xen-privcmd calls pte_mkspecial().
> But it seems unwise to rely on this optimisation.
>
> Fixes: 3ad0876554ca ("xen/privcmd: add IOCTL_PRIVCMD_MMAP_RESOURCE")
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> ---
> This is an RFC since I haven't found an actual build failure. Using
> Debian's gcc 7.3 with either CC_OPTIMIZE_FOR_PERFORMANCE or
> CC_OPTIMIZE_FOR_SIZE, the call *is* optimised away.
Since apply_to_page_range() is EXPORT_SYMBOL_GPL() and a
pte_fn_t function would likely use set_pte_at(), I'm fine with this
patch for consistency.
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [RFC PATCH] arm64: mm: Export __sync_icache_dcache() for xen-privcmd
2018-07-27 12:06 ` Catalin Marinas
@ 2018-07-27 13:22 ` Will Deacon
2018-07-30 6:46 ` Geert Uytterhoeven
0 siblings, 1 reply; 5+ messages in thread
From: Will Deacon @ 2018-07-27 13:22 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Jul 27, 2018 at 01:06:33PM +0100, Catalin Marinas wrote:
> On Thu, Jul 12, 2018 at 12:18:22AM +0100, Ben Hutchings wrote:
> > The xen-privcmd driver, which can be modular, calls set_pte_at()
> > which in turn may call __sync_icache_dcache().
> >
> > The call to __sync_icache_dcache() may be optimised out because it is
> > conditional on !pte_special(), and xen-privcmd calls pte_mkspecial().
> > But it seems unwise to rely on this optimisation.
> >
> > Fixes: 3ad0876554ca ("xen/privcmd: add IOCTL_PRIVCMD_MMAP_RESOURCE")
> > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> > ---
> > This is an RFC since I haven't found an actual build failure. Using
> > Debian's gcc 7.3 with either CC_OPTIMIZE_FOR_PERFORMANCE or
> > CC_OPTIMIZE_FOR_SIZE, the call *is* optimised away.
>
> Since apply_to_page_range() is EXPORT_SYMBOL_GPL() and a
> pte_fn_t function would likely use set_pte_at(), I'm fine with this
> patch for consistency.
>
> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Okey doke, I'll pick this up for 4.19.
Will
^ permalink raw reply [flat|nested] 5+ messages in thread
* [RFC PATCH] arm64: mm: Export __sync_icache_dcache() for xen-privcmd
2018-07-27 13:22 ` Will Deacon
@ 2018-07-30 6:46 ` Geert Uytterhoeven
2018-07-30 6:50 ` Geert Uytterhoeven
0 siblings, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2018-07-30 6:46 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Jul 27, 2018 at 3:23 PM Will Deacon <will.deacon@arm.com> wrote:
> On Fri, Jul 27, 2018 at 01:06:33PM +0100, Catalin Marinas wrote:
> > On Thu, Jul 12, 2018 at 12:18:22AM +0100, Ben Hutchings wrote:
> > > The xen-privcmd driver, which can be modular, calls set_pte_at()
> > > which in turn may call __sync_icache_dcache().
> > >
> > > The call to __sync_icache_dcache() may be optimised out because it is
> > > conditional on !pte_special(), and xen-privcmd calls pte_mkspecial().
> > > But it seems unwise to rely on this optimisation.
> > >
> > > Fixes: 3ad0876554ca ("xen/privcmd: add IOCTL_PRIVCMD_MMAP_RESOURCE")
> > > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> > > ---
> > > This is an RFC since I haven't found an actual build failure. Using
> > > Debian's gcc 7.3 with either CC_OPTIMIZE_FOR_PERFORMANCE or
> > > CC_OPTIMIZE_FOR_SIZE, the call *is* optimised away.
> >
> > Since apply_to_page_range() is EXPORT_SYMBOL_GPL() and a
> > pte_fn_t function would likely use set_pte_at(), I'm fine with this
> > patch for consistency.
> >
> > Acked-by: Catalin Marinas <catalin.marinas@arm.com>
>
> Okey doke, I'll pick this up for 4.19.
Note that this is a build regression in v4.18-rc4 and later:
http://kisskb.ellerman.id.au/kisskb/buildresult/13450058/
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [RFC PATCH] arm64: mm: Export __sync_icache_dcache() for xen-privcmd
2018-07-30 6:46 ` Geert Uytterhoeven
@ 2018-07-30 6:50 ` Geert Uytterhoeven
0 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2018-07-30 6:50 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Jul 30, 2018 at 8:46 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Fri, Jul 27, 2018 at 3:23 PM Will Deacon <will.deacon@arm.com> wrote:
> > On Fri, Jul 27, 2018 at 01:06:33PM +0100, Catalin Marinas wrote:
> > > On Thu, Jul 12, 2018 at 12:18:22AM +0100, Ben Hutchings wrote:
> > > > The xen-privcmd driver, which can be modular, calls set_pte_at()
> > > > which in turn may call __sync_icache_dcache().
> > > >
> > > > The call to __sync_icache_dcache() may be optimised out because it is
> > > > conditional on !pte_special(), and xen-privcmd calls pte_mkspecial().
> > > > But it seems unwise to rely on this optimisation.
> > > >
> > > > Fixes: 3ad0876554ca ("xen/privcmd: add IOCTL_PRIVCMD_MMAP_RESOURCE")
> > > > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> > > > ---
> > > > This is an RFC since I haven't found an actual build failure. Using
> > > > Debian's gcc 7.3 with either CC_OPTIMIZE_FOR_PERFORMANCE or
> > > > CC_OPTIMIZE_FOR_SIZE, the call *is* optimised away.
> > >
> > > Since apply_to_page_range() is EXPORT_SYMBOL_GPL() and a
> > > pte_fn_t function would likely use set_pte_at(), I'm fine with this
> > > patch for consistency.
> > >
> > > Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> >
> > Okey doke, I'll pick this up for 4.19.
>
> Note that this is a build regression in v4.18-rc4 and later:
> http://kisskb.ellerman.id.au/kisskb/buildresult/13450058/
s/is/fixes (presumably)/
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at 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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-07-30 6:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-11 23:18 [RFC PATCH] arm64: mm: Export __sync_icache_dcache() for xen-privcmd Ben Hutchings
2018-07-27 12:06 ` Catalin Marinas
2018-07-27 13:22 ` Will Deacon
2018-07-30 6:46 ` Geert Uytterhoeven
2018-07-30 6:50 ` Geert Uytterhoeven
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.