Bug 214986 - Compute number of PAC bits from what the OS says its address space is
Summary: Compute number of PAC bits from what the OS says its address space is
Status: REOPENED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Keith Miller
URL:
Keywords: InRadar
Depends on: 215065
Blocks:
  Show dependency treegraph
 
Reported: 2020-07-30 13:41 PDT by Keith Miller
Modified: 2020-08-01 14:47 PDT (History)
10 users (show)

See Also:


Attachments
Patch (3.45 KB, patch)
2020-07-30 13:45 PDT, Keith Miller
no flags Details | Formatted Diff | Diff
Patch for landing (3.33 KB, patch)
2020-07-30 14:39 PDT, Keith Miller
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Miller 2020-07-30 13:41:36 PDT
Compute number of PAC bits from what the OS says its address space is
Comment 1 Keith Miller 2020-07-30 13:45:09 PDT
Created attachment 405609 [details]
Patch
Comment 2 Saam Barati 2020-07-30 14:11:57 PDT
Comment on attachment 405609 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=405609&action=review

> Source/WTF/wtf/PtrTag.h:34
> +#if CPU(ARM64E) && __has_include(<mach/arm/vm_param.h>)

I feel like this should be DARWIN based, w/ an assert we have the header
Comment 3 Saam Barati 2020-07-30 14:15:43 PDT
Comment on attachment 405609 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=405609&action=review

> Source/WTF/wtf/PtrTag.h:36
> +constexpr unsigned maximumNumberOfPointerAuthenticationBits = 64 - getMSBSetConstexpr(MACH_VM_MAX_ADDRESS_RAW);

is this off by 1?
Comment 4 Saam Barati 2020-07-30 14:36:21 PDT
I suggested to Keith to just do 64 - OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH)
Comment 5 Keith Miller 2020-07-30 14:39:58 PDT
Created attachment 405622 [details]
Patch for landing
Comment 6 Keith Miller 2020-07-30 14:40:05 PDT
(In reply to Saam Barati from comment #4)
> I suggested to Keith to just do 64 - OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH)

Done.
Comment 7 EWS 2020-07-30 15:26:06 PDT
Committed r265113: <https://trac.webkit.org/changeset/265113>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 405622 [details].
Comment 8 Radar WebKit Bug Importer 2020-07-30 15:27:24 PDT
<rdar://problem/66350659>
Comment 9 Ryan Haddad 2020-07-30 16:24:22 PDT
This change broke the Windows build, as EWS predicted:
C:\cygwin\worker\win10-release\build\WebKitBuild\Release\DerivedSources\ForwardingHeaders\wtf/CagedPtr.h(43,1): error C2220: the following warning is treated as an error [C:\cygwin\worker\win10-release\build\WebKitBuild\Release\Source\JavaScriptCore\LLIntOffsetsExtractor.vcxproj]
C:\cygwin\worker\win10-release\build\Source\JavaScriptCore\runtime\ArrayBuffer.h(61): message : see reference to class template instantiation 'WTF::CagedPtr<Gigacage::Primitive,void,true,WTF::DumbPtrTraits<T>>' being compiled [C:\cygwin\worker\win10-release\build\WebKitBuild\Release\Source\JavaScriptCore\LLIntOffsetsExtractor.vcxproj]
C:\cygwin\worker\win10-release\build\Source\JavaScriptCore\runtime\ArrayBuffer.h(61): message :         with [C:\cygwin\worker\win10-release\build\WebKitBuild\Release\Source\JavaScriptCore\LLIntOffsetsExtractor.vcxproj]
C:\cygwin\worker\win10-release\build\Source\JavaScriptCore\runtime\ArrayBuffer.h(61): message :         [ [C:\cygwin\worker\win10-release\build\WebKitBuild\Release\Source\JavaScriptCore\LLIntOffsetsExtractor.vcxproj]
C:\cygwin\worker\win10-release\build\Source\JavaScriptCore\runtime\ArrayBuffer.h(61): message :             T=void [C:\cygwin\worker\win10-release\build\WebKitBuild\Release\Source\JavaScriptCore\LLIntOffsetsExtractor.vcxproj]
C:\cygwin\worker\win10-release\build\Source\JavaScriptCore\runtime\ArrayBuffer.h(61): message :         ] [C:\cygwin\worker\win10-release\build\WebKitBuild\Release\Source\JavaScriptCore\LLIntOffsetsExtractor.vcxproj]
Comment 10 Keith Miller 2020-07-30 17:19:12 PDT
(In reply to Ryan Haddad from comment #9)
> This change broke the Windows build, as EWS predicted:
> C:\cygwin\worker\win10-
> release\build\WebKitBuild\Release\DerivedSources\ForwardingHeaders\wtf/
> CagedPtr.h(43,1): error C2220: the following warning is treated as an error
> [C:\cygwin\worker\win10-
> release\build\WebKitBuild\Release\Source\JavaScriptCore\LLIntOffsetsExtractor
> .vcxproj]
> C:\cygwin\worker\win10-
> release\build\Source\JavaScriptCore\runtime\ArrayBuffer.h(61): message : see
> reference to class template instantiation
> 'WTF::CagedPtr<Gigacage::Primitive,void,true,WTF::DumbPtrTraits<T>>' being
> compiled
> [C:\cygwin\worker\win10-
> release\build\WebKitBuild\Release\Source\JavaScriptCore\LLIntOffsetsExtractor
> .vcxproj]
> C:\cygwin\worker\win10-
> release\build\Source\JavaScriptCore\runtime\ArrayBuffer.h(61): message :    
> with
> [C:\cygwin\worker\win10-
> release\build\WebKitBuild\Release\Source\JavaScriptCore\LLIntOffsetsExtractor
> .vcxproj]
> C:\cygwin\worker\win10-
> release\build\Source\JavaScriptCore\runtime\ArrayBuffer.h(61): message :    
> [
> [C:\cygwin\worker\win10-
> release\build\WebKitBuild\Release\Source\JavaScriptCore\LLIntOffsetsExtractor
> .vcxproj]
> C:\cygwin\worker\win10-
> release\build\Source\JavaScriptCore\runtime\ArrayBuffer.h(61): message :    
> T=void
> [C:\cygwin\worker\win10-
> release\build\WebKitBuild\Release\Source\JavaScriptCore\LLIntOffsetsExtractor
> .vcxproj]
> C:\cygwin\worker\win10-
> release\build\Source\JavaScriptCore\runtime\ArrayBuffer.h(61): message :    
> ]
> [C:\cygwin\worker\win10-
> release\build\WebKitBuild\Release\Source\JavaScriptCore\LLIntOffsetsExtractor
> .vcxproj]

Should be fixed with r265122.
Comment 11 WebKit Commit Bot 2020-08-01 14:47:03 PDT
Re-opened since this is blocked by bug 215065