aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2023-06-14 05:27:55 +0200
committerRichard Henderson <richard.henderson@linaro.org>2023-06-14 05:27:55 +0200
commitbe5e8563f737582276068c01f4dc4abfe484d0c3 (patch)
tree67840f4419f12bc9de0005d2cbd0af316f2c4a3d /util
parentfdd0df5340a8ebc8de88078387ebc85c5af7b40f (diff)
parentb0182e537e5aba38031a5009cb16d5e924342458 (diff)
Merge tag 'misc-20230613' of https://github.com/philmd/qemu into staging
Misc patches queue - user emulation: Preserve environment variable order - macos/darwin/hvf: Fix build warnings, slighly optimize DCache flush - target/i386: Minor cleanups, rename template headers with '.inc' suffix - target/hppa: Avoid building int_helper.o on user emulation - hw: Add 'name' property to pca954x, export ISAParallelState, silent warnings - hw/vfio: Trace number of bitmap dirty pages - exec/memory: Introduce RAM_NAMED_FILE to distinct block without named backing store # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmSINukACgkQ4+MsLN6t # wN5fEQ/+PEC2CoBtl5aIODSowEyaFVmNTHZWQFmRAUlBoPR2rU7NEpnh3j4BJWSS # aKc6MV4GDExKvMS5GujXiruS3kYMyWUHSG+nGUqrkBmbWn/2tZdWfIa0uT20CTr/ # nxu8TWM/EO+uzvYdyTNrXdkBOkU5eKfAqFGcWP7uLtRkjXpvu2YcPxrKswQUFpTh # XH5sCh6esaBkMZLfsl0I4ZQLxtBWpM3EmaDvlDxftMt4OZ3kwbzC55xhN1uk6KxY # iarkROM54vqU7ZC+vWH6fT18teLvKWXo+9F1iD/Qio88xRCH/kuQRWBM8+XR9IDe # CKuaRrJ1nOmPojG3Xngd99eM7FPjh1FR6bR+L62cm8/PzuzbQi5VBIdJvxXfvoTL # OjiXA3stOVB/jZg37IAeZB2X644d1GJXcjpExpU+mk7qdkaZC16HVOTRYYQF/wFF # QBUntZ9Oz0+XRtt4PC8ckynq0p0uEA/mZ14jMm04AJ3W8XtnOk2xp5rFTn/f4tsI # fJhqHxNhfet2sU17UI/pRw/h3Ulg0TmAdmMZnz3jUQ13/6E0//+a6dqQED/5HeG5 # 6UvUEUdGfvHuyE8l1UT4p93pBcyshMuaVFfutxKP9qYGPLhYeiCvms8KfdOWhTkA # NC1JlOScwdEqkn1hyMCeJHEUpnuZHZeiOtn4VV4J/SwyxkzVRS8= # =sUgM # -----END PGP SIGNATURE----- # gpg: Signature made Tue 13 Jun 2023 11:29:13 AM CEST # gpg: using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full] * tag 'misc-20230613' of https://github.com/philmd/qemu: exec/memory: Introduce RAM_NAMED_FILE flag hw/vfio: Add number of dirty pages to vfio_get_dirty_bitmap tracepoint exec/ram_addr: Return number of dirty pages in cpu_physical_memory_set_dirty_lebitmap() hw/char/parallel-isa: Export struct ISAParallelState hw/char/parallel: Export struct ParallelState hw/scsi/megasas: Silent GCC duplicated-cond warning hw/ide/ahci: Remove stray backslash hw/i2c: Enable an id for the pca954x devices target/i386: Rename helper template headers as '.h.inc' target/i386/helper: Shuffle do_cpu_init() target/i386/helper: Remove do_cpu_sipi() stub for user-mode emulation target/hppa/meson: Only build int_helper.o with system emulation accel/hvf: Report HV_DENIED error util/cacheflush: Avoid possible redundant dcache flush on Darwin util/cacheflush: Use declarations from <OSCacheControl.h> on Darwin cocoa: Fix warnings about invalid prototype declarations linux-user, bsd-user: Preserve incoming order of environment variables in the target Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'util')
-rw-r--r--util/cacheflush.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/util/cacheflush.c b/util/cacheflush.c
index 06c2333a60..a08906155a 100644
--- a/util/cacheflush.c
+++ b/util/cacheflush.c
@@ -237,11 +237,18 @@ static void __attribute__((constructor)) init_cache_info(void)
#ifdef CONFIG_DARWIN
/* Apple does not expose CTR_EL0, so we must use system interfaces. */
-extern void sys_icache_invalidate(void *start, size_t len);
-extern void sys_dcache_flush(void *start, size_t len);
+#include <libkern/OSCacheControl.h>
+
void flush_idcache_range(uintptr_t rx, uintptr_t rw, size_t len)
{
- sys_dcache_flush((void *)rw, len);
+ if (rx == rw) {
+ /*
+ * sys_icache_invalidate() syncs the dcache and icache,
+ * so no need to call sys_dcache_flush().
+ */
+ } else {
+ sys_dcache_flush((void *)rw, len);
+ }
sys_icache_invalidate((void *)rx, len);
}
#else