diff options
author | Caslyn Tonelli <caslyn@google.com> | 2023-04-18 02:04:07 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-04-18 02:04:07 +0000 |
commit | 2a861eda74dd9412c1a9a5e0a1da16a6d42b8170 (patch) | |
tree | 57695395c07bff7bfa0d9634cccd814b4f811242 | |
parent | 829dd83100dac24e7a537b71fb10ebb5a10b420b (diff) | |
parent | f312eb75e88182622abf4d304fc5444a72080897 (diff) | |
download | scudo-2a861eda74dd9412c1a9a5e0a1da16a6d42b8170.tar.gz |
[scudo] Tune FuchsiaConfig for RiscV am: e5722f4e97 am: 66ad769252 am: f7e315ba98 am: f312eb75e8
Original change: https://android-review.googlesource.com/c/platform/external/scudo/+/2541712
Change-Id: I6506d36ff2d86d6d0eb35cf283905208a97376fc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | standalone/allocator_config.h | 6 | ||||
-rw-r--r-- | standalone/platform.h | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/standalone/allocator_config.h b/standalone/allocator_config.h index 64306066123..d06f6dfe4e0 100644 --- a/standalone/allocator_config.h +++ b/standalone/allocator_config.h @@ -169,8 +169,14 @@ struct FuchsiaConfig { static const bool MaySupportMemoryTagging = false; typedef SizeClassAllocator64<FuchsiaConfig> Primary; +// Support 39-bit VMA for riscv-64 +#if SCUDO_RISCV64 + static const uptr PrimaryRegionSizeLog = 28U; + static const uptr PrimaryGroupSizeLog = 19U; +#else static const uptr PrimaryRegionSizeLog = 30U; static const uptr PrimaryGroupSizeLog = 21U; +#endif typedef u32 PrimaryCompactPtrT; static const bool PrimaryEnableRandomOffset = true; static const uptr PrimaryMapSizeIncrement = 1UL << 18; diff --git a/standalone/platform.h b/standalone/platform.h index db4217ddab9..aae3b9ab876 100644 --- a/standalone/platform.h +++ b/standalone/platform.h @@ -37,6 +37,12 @@ #define SCUDO_TRUSTY 0 #endif +#if defined(__riscv) && (__riscv_xlen == 64) +#define SCUDO_RISCV64 1 +#else +#define SCUDO_RISCV64 0 +#endif + #if defined(__LP64__) #define SCUDO_WORDSIZE 64U #else |