arm64: mm: Export __sync_icache_dcache() for xen-privcmd
RFC PATCH 1/1 arm64: mm: Export __sync_icache_dcache() for xen-privcmd
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.
---
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(+)
arch/arm64/mm/flush.c +1 -0
@@ -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
Catalin Marinas
maintainerRFC PATCH 1/1 arm64: mm: Export __sync_icache_dcache() for xen-privcmd
Quoted 7 lines · Ben Hutchings
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 callspte_mkspecial(). But it seems unwise to rely on this optimisation.
Quoted 6 lines
Fixes 3ad0876554ca ("xen/privcmd: add IOCTL_PRIVCMD_MMAP_RESOURCE")Signed-off-by Ben Hutchings <[email protected]>---
This is an RFC since I haven't found an actual build failure. Using Debian's gcc 7.3 with eitherCC_OPTIMIZE_FOR_PERFORMANCEorCC_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.
RFC PATCH 1/1 arm64: mm: Export __sync_icache_dcache() for xen-privcmd
Quoted 15 lines · Catalin Marinas
Quoted 7 lines · Ben Hutchings
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 callspte_mkspecial(). But it seems unwise to rely on this optimisation.Quoted 6 lines
Fixes 3ad0876554ca ("xen/privcmd: add IOCTL_PRIVCMD_MMAP_RESOURCE")Signed-off-by Ben Hutchings <[email protected]>---
This is an RFC since I haven't found an actual build failure. Using Debian's gcc 7.3 with eitherCC_OPTIMIZE_FOR_PERFORMANCEorCC_OPTIMIZE_FOR_SIZE, the call *is* optimised away.
Quoted 5 lines
Since
apply_to_page_range()isEXPORT_SYMBOL_GPL()and apte_fn_tfunction would likely useset_pte_at(), I'm fine with this patch for consistency.Acked-by Catalin Marinas <[email protected]>
Okey doke, I'll pick this up for 4.19.
Will
RFC PATCH 1/1 arm64: mm: Export __sync_icache_dcache() for xen-privcmd
Quoted 16 lines · Will Deacon
Quoted 15 lines · Catalin Marinas
Quoted 13 lines · Ben Hutchings
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 callspte_mkspecial(). But it seems unwise to rely on this optimisation.Fixes 3ad0876554ca ("xen/privcmd: add IOCTL_PRIVCMD_MMAP_RESOURCE")Signed-off-by Ben Hutchings <[email protected]>---
This is an RFC since I haven't found an actual build failure. Using Debian's gcc 7.3 with eitherCC_OPTIMIZE_FOR_PERFORMANCEorCC_OPTIMIZE_FOR_SIZE, the call *is* optimised away.
Quoted 7 lines
Quoted 5 lines
Since
apply_to_page_range()isEXPORT_SYMBOL_GPL()and apte_fn_tfunction would likely useset_pte_at(), I'm fine with this patch for consistency.Acked-by Catalin Marinas <[email protected]>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
Signature · 5 lines
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 TorvaldsRFC PATCH 1/1 arm64: mm: Export __sync_icache_dcache() for xen-privcmd
Quoted 21 lines · Geert Uytterhoeven
Quoted 20 lines · Will Deacon
Quoted 19 lines · Catalin Marinas
Quoted 7 lines · Ben Hutchings
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 callspte_mkspecial(). But it seems unwise to rely on this optimisation.Quoted 6 lines
Fixes 3ad0876554ca ("xen/privcmd: add IOCTL_PRIVCMD_MMAP_RESOURCE")Signed-off-by Ben Hutchings <[email protected]>---
This is an RFC since I haven't found an actual build failure. Using Debian's gcc 7.3 with eitherCC_OPTIMIZE_FOR_PERFORMANCEorCC_OPTIMIZE_FOR_SIZE, the call *is* optimised away.Since
apply_to_page_range()isEXPORT_SYMBOL_GPL()and apte_fn_tfunction would likely useset_pte_at(), I'm fine with this patch for consistency.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Acked-by Catalin Marinas <[email protected]>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
Signature · 5 lines
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