Title: [265113] trunk/Source
Revision
265113
Author
keith_mil...@apple.com
Date
2020-07-30 15:26:01 -0700 (Thu, 30 Jul 2020)

Log Message

Compute number of PAC bits from what the OS says its address space is
https://bugs.webkit.org/show_bug.cgi?id=214986

Reviewed by Saam Barati.

Source/_javascript_Core:

* assembler/MacroAssemblerARM64E.h:

Source/WTF:

* wtf/CagedPtr.h:
* wtf/PtrTag.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (265112 => 265113)


--- trunk/Source/_javascript_Core/ChangeLog	2020-07-30 22:17:10 UTC (rev 265112)
+++ trunk/Source/_javascript_Core/ChangeLog	2020-07-30 22:26:01 UTC (rev 265113)
@@ -1,3 +1,12 @@
+2020-07-30  Keith Miller  <keith_mil...@apple.com>
+
+        Compute number of PAC bits from what the OS says its address space is
+        https://bugs.webkit.org/show_bug.cgi?id=214986
+
+        Reviewed by Saam Barati.
+
+        * assembler/MacroAssemblerARM64E.h:
+
 2020-07-30  Caio Lima  <ticaiol...@gmail.com>
 
         [JSC][32-bits] interator_next should check for EmptyValue instead of undefined to execute LLInt fast path

Modified: trunk/Source/_javascript_Core/assembler/MacroAssemblerARM64E.h (265112 => 265113)


--- trunk/Source/_javascript_Core/assembler/MacroAssemblerARM64E.h	2020-07-30 22:17:10 UTC (rev 265112)
+++ trunk/Source/_javascript_Core/assembler/MacroAssemblerARM64E.h	2020-07-30 22:26:01 UTC (rev 265113)
@@ -39,7 +39,7 @@
 
 class MacroAssemblerARM64E : public MacroAssemblerARM64 {
 public:
-    static constexpr unsigned numberOfPACBits = 25;
+    static constexpr unsigned numberOfPACBits = WTF::maximumNumberOfPointerAuthenticationBits;
     static constexpr uintptr_t nonPACBitsMask = (1ull << (64 - numberOfPACBits)) - 1;
 
     ALWAYS_INLINE void tagReturnAddress()

Modified: trunk/Source/WTF/ChangeLog (265112 => 265113)


--- trunk/Source/WTF/ChangeLog	2020-07-30 22:17:10 UTC (rev 265112)
+++ trunk/Source/WTF/ChangeLog	2020-07-30 22:26:01 UTC (rev 265113)
@@ -1,3 +1,13 @@
+2020-07-30  Keith Miller  <keith_mil...@apple.com>
+
+        Compute number of PAC bits from what the OS says its address space is
+        https://bugs.webkit.org/show_bug.cgi?id=214986
+
+        Reviewed by Saam Barati.
+
+        * wtf/CagedPtr.h:
+        * wtf/PtrTag.h:
+
 2020-07-29  Fujii Hironori  <hironori.fu...@sony.com>
 
         [Win Debug] Unreviewed build fix

Modified: trunk/Source/WTF/wtf/CagedPtr.h (265112 => 265113)


--- trunk/Source/WTF/wtf/CagedPtr.h	2020-07-30 22:17:10 UTC (rev 265112)
+++ trunk/Source/WTF/wtf/CagedPtr.h	2020-07-30 22:26:01 UTC (rev 265113)
@@ -39,7 +39,7 @@
 class CagedPtr {
 public:
     static constexpr Gigacage::Kind kind = passedKind;
-    static constexpr unsigned numberOfPACBits = 25;
+    static constexpr unsigned numberOfPACBits = maximumNumberOfPointerAuthenticationBits;
     static constexpr uintptr_t nonPACBitsMask = (1ull << ((sizeof(T*) * CHAR_BIT) - numberOfPACBits)) - 1;
 
     CagedPtr() : CagedPtr(nullptr) { }

Modified: trunk/Source/WTF/wtf/PtrTag.h (265112 => 265113)


--- trunk/Source/WTF/wtf/PtrTag.h	2020-07-30 22:17:10 UTC (rev 265112)
+++ trunk/Source/WTF/wtf/PtrTag.h	2020-07-30 22:26:01 UTC (rev 265113)
@@ -27,9 +27,17 @@
 
 #include <wtf/Assertions.h>
 #include <wtf/DataLog.h>
+#include <wtf/MathExtras.h>
 
 namespace WTF {
 
+#if CPU(ARM64E)
+constexpr unsigned maximumNumberOfPointerAuthenticationBits = 64 - OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH);
+#else // CPU(ARM64E)
+constexpr unsigned maximumNumberOfPointerAuthenticationBits = 0;
+#endif // CPU(ARM64E)
+
+
 #define FOR_EACH_BASE_WTF_PTRTAG(v) \
     v(NoPtrTag) \
     v(CFunctionPtrTag) \
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to