deps: V8: cherry-pick 9ab40592f697

Original commit message:

    [riscv] Flush icache in both local and remote harts

    Fix the I-Cache flush flag according to the implementation of flush_icache_mm in Linux kernel.

    Change-Id: I6e6b1f56c377c2c0a629e170737bfac6c357ce8d
    Reviewed-on: 6080611
    Commit-Queue: Yahan Lu (LuYahan) <yahan@iscas.ac.cn>
    Reviewed-by: Ji Qiu <qiuji@iscas.ac.cn>
    Cr-Commit-Position: refs/heads/main@{#97673}

Refs: 9ab40592f6
PR-URL: https://github.com/nodejs/node/pull/56781
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
This commit is contained in:
Levi Zim 2025-02-04 17:11:38 +01:00 committed by GitHub
parent c4fb331390
commit c889b85498
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 7 deletions

View file

@ -37,7 +37,7 @@
# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.10',
'v8_embedder_string': '-node.11',
##### V8 defaults for Node.js #####

View file

@ -15,16 +15,12 @@ namespace internal {
void CpuFeatures::FlushICache(void* start, size_t size) {
#if !defined(USE_SIMULATOR)
char* end = reinterpret_cast<char*>(start) + size;
// The definition of this syscall is equal to
// SYSCALL_DEFINE3(riscv_flush_icache, uintptr_t, start,
// uintptr_t, end, uintptr_t, flags)
// The flag here is set to be SYS_RISCV_FLUSH_ICACHE_LOCAL, which is
// defined as 1 in the Linux kernel.
// SYS_riscv_flush_icache is a symbolic constant used in user-space code to
// identify the flush_icache system call, while __NR_riscv_flush_icache is the
// corresponding system call number used in the kernel to dispatch the system
// call.
syscall(__NR_riscv_flush_icache, start, end, 1);
// The flag set to zero will flush all cpu cores.
syscall(__NR_riscv_flush_icache, start, end, 0);
#endif // !USE_SIMULATOR.
}