Title: [275007] branches/safari-612.1.8-branch/Source/WTF
Revision
275007
Author
[email protected]
Date
2021-03-24 20:23:35 -0700 (Wed, 24 Mar 2021)

Log Message

Cherry-pick r274898. rdar://problem/75819592

    Don't require VM_FLAGS_PERMANENT on the simulator builds
    https://bugs.webkit.org/show_bug.cgi?id=223649
    <rdar://problem/75747788>

    Reviewed by Alexey Proskuryakov.

    Since VM_FLAGS_PERMANENT must be supported by the kernel, let's make
    it so that the vm_map that passes this flag in can fail when running
    on the simulator. This is to support the use case of running a newer
    simulator on an older OS. When the call to vm_map fails when running
    on the simulator, we try again without the VM_FLAGS_PERMANENT flag.

    * wtf/WTFConfig.cpp:
    (WTF::setPermissionsOfConfigPage):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274898 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-612.1.8-branch/Source/WTF/ChangeLog (275006 => 275007)


--- branches/safari-612.1.8-branch/Source/WTF/ChangeLog	2021-03-25 02:58:53 UTC (rev 275006)
+++ branches/safari-612.1.8-branch/Source/WTF/ChangeLog	2021-03-25 03:23:35 UTC (rev 275007)
@@ -1,3 +1,42 @@
+2021-03-24  Russell Epstein  <[email protected]>
+
+        Cherry-pick r274898. rdar://problem/75819592
+
+    Don't require VM_FLAGS_PERMANENT on the simulator builds
+    https://bugs.webkit.org/show_bug.cgi?id=223649
+    <rdar://problem/75747788>
+    
+    Reviewed by Alexey Proskuryakov.
+    
+    Since VM_FLAGS_PERMANENT must be supported by the kernel, let's make
+    it so that the vm_map that passes this flag in can fail when running
+    on the simulator. This is to support the use case of running a newer
+    simulator on an older OS. When the call to vm_map fails when running
+    on the simulator, we try again without the VM_FLAGS_PERMANENT flag.
+    
+    * wtf/WTFConfig.cpp:
+    (WTF::setPermissionsOfConfigPage):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274898 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-03-23  Saam Barati  <[email protected]>
+
+            Don't require VM_FLAGS_PERMANENT on the simulator builds
+            https://bugs.webkit.org/show_bug.cgi?id=223649
+            <rdar://problem/75747788>
+
+            Reviewed by Alexey Proskuryakov.
+
+            Since VM_FLAGS_PERMANENT must be supported by the kernel, let's make
+            it so that the vm_map that passes this flag in can fail when running
+            on the simulator. This is to support the use case of running a newer
+            simulator on an older OS. When the call to vm_map fails when running
+            on the simulator, we try again without the VM_FLAGS_PERMANENT flag.
+
+            * wtf/WTFConfig.cpp:
+            (WTF::setPermissionsOfConfigPage):
+
 2021-03-22  Devin Rousso  <[email protected]>
 
         Remove unused JS and CSS files of media controls

Modified: branches/safari-612.1.8-branch/Source/WTF/wtf/WTFConfig.cpp (275006 => 275007)


--- branches/safari-612.1.8-branch/Source/WTF/wtf/WTFConfig.cpp	2021-03-25 02:58:53 UTC (rev 275006)
+++ branches/safari-612.1.8-branch/Source/WTF/wtf/WTFConfig.cpp	2021-03-25 03:23:35 UTC (rev 275007)
@@ -71,7 +71,20 @@
         flags |= VM_FLAGS_PERMANENT;
 #endif
 
-        auto result = mach_vm_map(mach_task_self(), &addr, ConfigSizeToProtect, pageSize() - 1, flags, MEMORY_OBJECT_NULL, 0, false, VM_PROT_READ | VM_PROT_WRITE, VM_PROT_READ | VM_PROT_WRITE, VM_INHERIT_DEFAULT);
+        auto attemptVMMapping = [&] {
+            return mach_vm_map(mach_task_self(), &addr, ConfigSizeToProtect, pageSize() - 1, flags, MEMORY_OBJECT_NULL, 0, false, VM_PROT_READ | VM_PROT_WRITE, VM_PROT_READ | VM_PROT_WRITE, VM_INHERIT_DEFAULT);
+        };
+
+        auto result = attemptVMMapping();
+
+#if HAVE(VM_FLAGS_PERMANENT) && PLATFORM(IOS_FAMILY_SIMULATOR)
+        // FIXME: Remove this when the oldest OS we support simulator on has VM_FLAGS_PERMANENT
+        if (result != KERN_SUCCESS) {
+            flags &= ~VM_FLAGS_PERMANENT;
+            result = attemptVMMapping();
+        }
+#endif
+
         RELEASE_ASSERT(result == KERN_SUCCESS);
     });
 #endif // OS(DARWIN)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to