[PATCH] D123908: Add LLVM_SYS_PAGE_SIZE option to support 4K/8K/16K/64K page size system
Xiaodong Liu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 20 05:24:38 PDT 2022
XiaodongLoong updated this revision to Diff 423876.
XiaodongLoong added a comment.
Herald added a subscriber: hiraditya.
update revision that doesn't change CMakeLists.txt
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D123908/new/
https://reviews.llvm.org/D123908
Files:
llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
Index: llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
===================================================================
--- llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
+++ llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
@@ -78,6 +78,11 @@
static const unsigned kShadowBaseAlignment = 32;
+static cl::opt<std::string> ClSystemPageSize(
+ "hwasan-sys-page-size",
+ cl::desc("System page size for ring buffer, such as 4K/8K/16K/64K"),
+ cl::Hidden, cl::init("4k"));
+
static cl::opt<std::string>
ClMemoryAccessCallbackPrefix("hwasan-memory-access-callback-prefix",
cl::desc("Prefix for memory access callbacks"),
@@ -246,6 +251,20 @@
return ClUseAfterScope && shouldInstrumentStack(TargetTriple);
}
+static uint64_t getSystemPageSizeBits() {
+ StringRef PageSizeStr(ClSystemPageSize.getValue());
+ if (PageSizeStr.equals_insensitive("4k"))
+ return 12;
+ else if (PageSizeStr.equals_insensitive("8k"))
+ return 13;
+ else if (PageSizeStr.equals_insensitive("16k"))
+ return 14;
+ else if (PageSizeStr.equals_insensitive("64k"))
+ return 16;
+ else
+ report_fatal_error("unsupported page size: " + PageSizeStr);
+}
+
/// An instrumentation pass implementing detection of addressability bugs
/// using tagged pointers.
class HWAddressSanitizer {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123908.423876.patch
Type: text/x-patch
Size: 1365 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220420/595028c1/attachment.bin>
More information about the llvm-commits
mailing list