Skip to contentSkip to conversation

arm64: mm: Export __sync_icache_dcache() for xen-privcmd

RFC PATCH New Ben Hutchings 4 participants 5 messages Jul 11, 2018 – Jul 30, 2018 arm64

lore
Share & tools
lore
#0 lore raw

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.

Fixes 3ad0876554ca ("xen/privcmd: add IOCTL_PRIVCMD_MMAP_RESOURCE")

---
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
index 1059884f9a6f..a76f0b983294 100644
@@ -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
maintainer
#1 lore raw

RFC 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 calls pte_mkspecial(). But it seems unwise to rely on this optimisation.

Quoted 6 lines
Fixes 3ad0876554ca ("xen/privcmd: add IOCTL_PRIVCMD_MMAP_RESOURCE")

---
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.

#2 lore raw

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 calls pte_mkspecial(). But it seems unwise to rely on this optimisation.

Quoted 6 lines
Fixes 3ad0876554ca ("xen/privcmd: add IOCTL_PRIVCMD_MMAP_RESOURCE")

---
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.

Quoted 5 lines

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.

Okey doke, I'll pick this up for 4.19.

Will

#3 lore raw

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 calls pte_mkspecial(). But it seems unwise to rely on this optimisation.

Fixes 3ad0876554ca ("xen/privcmd: add IOCTL_PRIVCMD_MMAP_RESOURCE")

---
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.

Quoted 7 lines
Quoted 5 lines

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.

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 Torvalds
#4 lore raw

RFC 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 calls pte_mkspecial(). But it seems unwise to rely on this optimisation.

Quoted 6 lines
Fixes 3ad0876554ca ("xen/privcmd: add IOCTL_PRIVCMD_MMAP_RESOURCE")

---
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.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

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