summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaslyn Tonelli <caslyn@google.com>2023-04-18 00:08:24 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-04-18 00:08:24 +0000
commit66ad769252199b2acb782f977d6f4c9b733516de (patch)
tree57695395c07bff7bfa0d9634cccd814b4f811242
parent8bd1e976c42af6ab2d6bd6b2cdaac62cc948f138 (diff)
parente5722f4e973e3ebe06bfd0f1959106c0f5c2a4ba (diff)
downloadscudo-66ad769252199b2acb782f977d6f4c9b733516de.tar.gz
[scudo] Tune FuchsiaConfig for RiscV am: e5722f4e97
Original change: https://android-review.googlesource.com/c/platform/external/scudo/+/2541712 Change-Id: I2d0d74c28f68cf42b8c378fbb690dbaceefd555c Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--standalone/allocator_config.h6
-rw-r--r--standalone/platform.h6
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