[go: nahoru, domu]

Reland "[fuchsia] Remove use of ambient VMEX capabilities"

This is a second reland of
commit 32d1466c6def9112df62366e9d9872b282ba1f25, after addressing
security policy & routing issues up-stream.

- Remove job_policy_ambient_mark_vmo_exec from all component
  manifests.
- Remove most usage of the ambient-VMEX-capable ELF test runner.

Some use of the ambient-VMEX ELF runner remains, to support tests
which run SwiftShader in-process, which requires ambient-VMEX for its
shader JIT.

The test CML fragment for the VMEX-capable ELF test runner is also
still required by out-of-tree dependencies, notably ANGLE.

Bug: 1290907, 1185811, 1022542
Change-Id: I7bd4308469abf350ee8ea48a1e6371bc2f11284c
Cq-Include-Trybots: luci.chrome.try:fuchsia-smoke-astro,fuchsia-smoke-sherlock
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4626516
Owners-Override: Wez <wez@chromium.org>
Reviewed-by: David Dorwin <ddorwin@chromium.org>
Commit-Queue: David Dorwin <ddorwin@chromium.org>
Auto-Submit: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1161336}
diff --git a/cc/BUILD.gn b/cc/BUILD.gn
index f3dd9ce..182f2f1 100644
--- a/cc/BUILD.gn
+++ b/cc/BUILD.gn
@@ -930,12 +930,15 @@
   }
 
   if (is_fuchsia) {
-    # TODO(https://crbug.com/1185811): Investigate removing the requirement for
-    # job_policy_ambient_mark_vmo_exec for the sake of V8's allocator in tests.
+    # TODO(https://crbug.com/1022542): Some of these tests use SwiftShader,
+    # which requires ambient VMEX.
     test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
 
     additional_manifest_fragments = [
       "//build/config/fuchsia/test/fonts.shard.test-cml",
+
+      # TODO(https://crbug.com/1185811): Investigate removing the requirement
+      # for VmexResource.
       "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml",
       "//third_party/fuchsia-sdk/sdk/pkg/vulkan/client.shard.cml",
     ]
diff --git a/chrome/app/chrome.cml b/chrome/app/chrome.cml
index 8a005d1a..128a432 100644
--- a/chrome/app/chrome.cml
+++ b/chrome/app/chrome.cml
@@ -19,9 +19,6 @@
         // now.
         forward_stdout_to: "log",
         forward_stderr_to: "log",
-
-        // Required to allow JIT in child processes such as renderers.
-        job_policy_ambient_mark_vmo_exec: "true",
     },
     capabilities: [
         {
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index 7e47873..3f7f887 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -4924,7 +4924,6 @@
     if (is_fuchsia) {
       use_test_server = true
 
-      test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
       excluded_paths = fuchsia_package_exclusions
       additional_manifest_fragments = [
         "//build/config/fuchsia/test/audio_output.shard.test-cml",
@@ -9449,11 +9448,11 @@
 
     data += [ "//testing/buildbot/filters/fuchsia.unit_tests.filter" ]
 
-    # TODO(https://crbug.com/1185811): Investigate removing the requirement for
-    # job_policy_ambient_mark_vmo_exec for the sake of V8's allocator in tests.
-    test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
     additional_manifest_fragments = [
       "//build/config/fuchsia/test/fonts.shard.test-cml",
+
+      # TODO(https://crbug.com/1185811): Investigate removing the requirement
+      # for VmexResource.
       "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml",
       "//build/config/fuchsia/test/network.shard.test-cml",
       "//third_party/fuchsia-sdk/sdk/pkg/vulkan/client.shard.cml",
@@ -10983,7 +10982,6 @@
     if (is_fuchsia) {
       use_test_server = true
 
-      test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
       additional_manifest_fragments = [
         "//build/config/fuchsia/test/fonts.shard.test-cml",
         "//build/config/fuchsia/test/network.shard.test-cml",
@@ -11052,7 +11050,6 @@
     if (is_fuchsia) {
       use_test_server = true
 
-      test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
       additional_manifest_fragments = [
         "//build/config/fuchsia/test/network.shard.test-cml",
         "//build/config/fuchsia/test/present_view.shard.test-cml",
diff --git a/components/BUILD.gn b/components/BUILD.gn
index 966295f..317d6e6 100644
--- a/components/BUILD.gn
+++ b/components/BUILD.gn
@@ -106,12 +106,11 @@
   }
 
   if (is_fuchsia) {
-    # TODO(https://crbug.com/1185811): Investigate removing the requirement for
-    # job_policy_ambient_mark_vmo_exec for the sake of V8's allocator in tests.
-    test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
-
     additional_manifest_fragments = [
       "//build/config/fuchsia/test/fonts.shard.test-cml",
+
+      # TODO(https://crbug.com/1185811): Investigate removing the requirement
+      # for VmexResource.
       "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml",
       "//build/config/fuchsia/test/network.shard.test-cml",
       "//build/config/fuchsia/test/present_view.shard.test-cml",
@@ -1025,7 +1024,6 @@
     }
 
     if (is_fuchsia) {
-      test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
       additional_manifest_fragments = [
         "//build/config/fuchsia/test/present_view.shard.test-cml",
         "//build/config/fuchsia/test/fonts.shard.test-cml",
diff --git a/components/viz/BUILD.gn b/components/viz/BUILD.gn
index baaa563..b442a88 100644
--- a/components/viz/BUILD.gn
+++ b/components/viz/BUILD.gn
@@ -41,8 +41,8 @@
   }
 
   if (is_fuchsia) {
-    # TODO(https://crbug.com/1185811): Investigate removing the requirement for
-    # job_policy_ambient_mark_vmo_exec for the sake of V8's allocator in tests.
+    # TODO(https://crbug.com/1022542): Some of these tests use SwiftShader,
+    # which requires ambient VMEX.
     test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
 
     additional_manifest_fragments = [
diff --git a/content/shell/fuchsia/content_shell.cml b/content/shell/fuchsia/content_shell.cml
index 0d72dde6..9db13565c 100644
--- a/content/shell/fuchsia/content_shell.cml
+++ b/content/shell/fuchsia/content_shell.cml
@@ -5,7 +5,7 @@
   include: [
     "syslog/client.shard.cml",
     "vulkan/client.shard.cml",
-    "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml",
+    "//build/config/fuchsia/test/elf_test_runner.shard.test-cml",
     "//build/config/fuchsia/test/chromium_system_test_facet.shard.test-cml",
     "//build/config/fuchsia/test/test_fonts.shard.test-cml",
   ],
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
index 026845e..dc2d95b 100644
--- a/content/test/BUILD.gn
+++ b/content/test/BUILD.gn
@@ -2172,7 +2172,6 @@
   if (is_fuchsia) {
     use_test_server = true
 
-    test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
     additional_manifest_fragments = [
       "//build/config/fuchsia/test/audio_output.shard.test-cml",
       "//build/config/fuchsia/test/fonts.shard.test-cml",
@@ -2782,12 +2781,11 @@
       "../browser/renderer_host/media/fuchsia_media_codec_provider_impl_unittest.cc",
     ]
 
-    # TODO(https://crbug.com/1185811): Investigate removing the requirement for
-    # job_policy_ambient_mark_vmo_exec for the sake of V8's allocator in tests.
-    test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
-
     additional_manifest_fragments = [
       "//build/config/fuchsia/test/fonts.shard.test-cml",
+
+      # TODO(https://crbug.com/1185811): Investigate removing the requirement
+      # for VmexResource.
       "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml",
       "//build/config/fuchsia/test/network.shard.test-cml",
       "//build/config/fuchsia/test/platform_video_codecs.shard.test-cml",
diff --git a/extensions/BUILD.gn b/extensions/BUILD.gn
index 4624706..202801d 100644
--- a/extensions/BUILD.gn
+++ b/extensions/BUILD.gn
@@ -279,11 +279,9 @@
   ]
 
   if (is_fuchsia) {
-    # TODO(https://crbug.com/1185811): Investigate removing the requirement for
-    # job_policy_ambient_mark_vmo_exec for the sake of V8's allocator in tests.
-    test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
-
     additional_manifest_fragments = [
+      # TODO(https://crbug.com/1185811): Investigate removing the requirement
+      # for VmexResource.
       "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml",
       "//build/config/fuchsia/test/network.shard.test-cml",
       "//third_party/fuchsia-sdk/sdk/pkg/vulkan/client.shard.cml",
diff --git a/fuchsia_web/runners/BUILD.gn b/fuchsia_web/runners/BUILD.gn
index 3350b12..ead45ec 100644
--- a/fuchsia_web/runners/BUILD.gn
+++ b/fuchsia_web/runners/BUILD.gn
@@ -237,8 +237,6 @@
     "//testing/gtest",
     "//ui/ozone",
   ]
-  test_runner_shard =
-      "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
   additional_manifest_fragments = [
     "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml",
     "//build/config/fuchsia/test/network.shard.test-cml",
diff --git a/fuchsia_web/shell/cast_streaming_shell.cml b/fuchsia_web/shell/cast_streaming_shell.cml
index 9549936a..c8aba6d 100644
--- a/fuchsia_web/shell/cast_streaming_shell.cml
+++ b/fuchsia_web/shell/cast_streaming_shell.cml
@@ -10,7 +10,7 @@
     // to function correctly.
     // TODO(crbug.com/1410937): Run as a non-test component.
     "//build/config/fuchsia/test/chromium_system_test_facet.shard.test-cml",
-    "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml",
+    "//build/config/fuchsia/test/elf_test_runner.shard.test-cml",
     "sys/component/realm_builder_absolute.shard.cml",
 
     "syslog/client.shard.cml",
diff --git a/fuchsia_web/shell/cast_streaming_shell_for_web_instance_host.cml b/fuchsia_web/shell/cast_streaming_shell_for_web_instance_host.cml
index 78a0c4a5..4f91bf0 100644
--- a/fuchsia_web/shell/cast_streaming_shell_for_web_instance_host.cml
+++ b/fuchsia_web/shell/cast_streaming_shell_for_web_instance_host.cml
@@ -19,9 +19,6 @@
       // component is running only as a launcher of this child.
       "--no-relaunch",
     ],
-
-    // Required to allow JIT in child processes such as renderers.
-    job_policy_ambient_mark_vmo_exec: "true",
   },
   use: [
     {
diff --git a/fuchsia_web/shell/web_engine_shell.cml b/fuchsia_web/shell/web_engine_shell.cml
index 470c617..1342e84 100644
--- a/fuchsia_web/shell/web_engine_shell.cml
+++ b/fuchsia_web/shell/web_engine_shell.cml
@@ -10,7 +10,7 @@
     // to function correctly.
     // TODO(crbug.com/1410937): Run as a non-test component.
     "//build/config/fuchsia/test/chromium_system_test_facet.shard.test-cml",
-    "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml",
+    "//build/config/fuchsia/test/elf_test_runner.shard.test-cml",
     "sys/component/realm_builder_absolute.shard.cml",
 
     "syslog/client.shard.cml",
diff --git a/fuchsia_web/shell/web_engine_shell_for_web_instance_host.cml b/fuchsia_web/shell/web_engine_shell_for_web_instance_host.cml
index 535aef2..7a698b2 100644
--- a/fuchsia_web/shell/web_engine_shell_for_web_instance_host.cml
+++ b/fuchsia_web/shell/web_engine_shell_for_web_instance_host.cml
@@ -19,9 +19,6 @@
       // is running only as a launcher of this child.
       "--no-relaunch",
     ],
-
-    // Required to allow JIT in child processes such as renderers.
-    job_policy_ambient_mark_vmo_exec: "true",
   },
   use: [
     // Required if not run with --headless.
diff --git a/fuchsia_web/webengine/BUILD.gn b/fuchsia_web/webengine/BUILD.gn
index adf487b..652ff5e 100644
--- a/fuchsia_web/webengine/BUILD.gn
+++ b/fuchsia_web/webengine/BUILD.gn
@@ -616,8 +616,6 @@
     "//ui/ozone",
   ]
 
-  test_runner_shard =
-      "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
   additional_manifest_fragments = [
     "//build/config/fuchsia/test/fonts.shard.test-cml",
     "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml",
diff --git a/fuchsia_web/webengine/web_instance-common.shard.cml b/fuchsia_web/webengine/web_instance-common.shard.cml
index 9a55307..8bfefe3 100644
--- a/fuchsia_web/webengine/web_instance-common.shard.cml
+++ b/fuchsia_web/webengine/web_instance-common.shard.cml
@@ -5,9 +5,6 @@
   program: {
     runner: "elf",
     binary: "web_engine_exe",
-
-    // Required to allow JIT in child processes such as renderers.
-    job_policy_ambient_mark_vmo_exec: "true",
   },
   capabilities: [
     {
diff --git a/gin/BUILD.gn b/gin/BUILD.gn
index ece41634..56bf66a 100644
--- a/gin/BUILD.gn
+++ b/gin/BUILD.gn
@@ -247,9 +247,6 @@
   }
 
   if (is_fuchsia) {
-    # TODO(https://crbug.com/1185811): Investigate removing the requirement for
-    # job_policy_ambient_mark_vmo_exec for the sake of V8's allocator in tests.
-    test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
     additional_manifest_fragments =
         [ "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml" ]
   }
diff --git a/headless/BUILD.gn b/headless/BUILD.gn
index 079d739..87ff3ed9 100644
--- a/headless/BUILD.gn
+++ b/headless/BUILD.gn
@@ -749,12 +749,11 @@
   }
 
   if (is_fuchsia) {
-    # TODO(https://crbug.com/1185811): Investigate removing the requirement for
-    # job_policy_ambient_mark_vmo_exec for the sake of V8's allocator in tests.
-    test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
-
     additional_manifest_fragments = [
       "//build/config/fuchsia/test/fonts.shard.test-cml",
+
+      # TODO(https://crbug.com/1185811): Investigate removing the requirement
+      # for VmexResource.
       "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml",
       "//build/config/fuchsia/test/network.shard.test-cml",
       "//third_party/fuchsia-sdk/sdk/pkg/vulkan/client.shard.cml",
diff --git a/services/BUILD.gn b/services/BUILD.gn
index b6ed1db..489f41a 100644
--- a/services/BUILD.gn
+++ b/services/BUILD.gn
@@ -95,8 +95,6 @@
   }
 
   if (is_fuchsia) {
-    test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
-
     additional_manifest_fragments = [
       "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml",
       "//build/config/fuchsia/test/network.shard.test-cml",
diff --git a/third_party/blink/common/BUILD.gn b/third_party/blink/common/BUILD.gn
index 7110be03..ef9e9d1 100644
--- a/third_party/blink/common/BUILD.gn
+++ b/third_party/blink/common/BUILD.gn
@@ -382,11 +382,9 @@
   if (is_ios) {
     bundle_deps = [ ":blink_common_unittests_pak_bundle_data" ]
   }
-
   if (is_fuchsia) {
-    # TODO(https://crbug.com/1185811): Investigate removing the requirement for
-    # job_policy_ambient_mark_vmo_exec for the sake of V8's allocator in tests.
-    test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
+    additional_manifest_fragments =
+        [ "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml" ]
   }
 
   data_deps = [ ":common_unittests_data" ]
diff --git a/third_party/blink/renderer/controller/BUILD.gn b/third_party/blink/renderer/controller/BUILD.gn
index 53cc163..3bbda3d 100644
--- a/third_party/blink/renderer/controller/BUILD.gn
+++ b/third_party/blink/renderer/controller/BUILD.gn
@@ -177,12 +177,12 @@
   }
 
   if (is_fuchsia) {
-    # TODO(https://crbug.com/1185811): Investigate removing the requirement for
-    # job_policy_ambient_mark_vmo_exec for the sake of V8's allocator in tests.
-    test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
     additional_manifest_fragments = [
       "//build/config/fuchsia/test/fonts.shard.test-cml",
       "//build/config/fuchsia/test/network.shard.test-cml",
+
+      # TODO(https://crbug.com/1185811): Investigate removing the requirement
+      # for VmexResource.
       "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml",
     ]
   }
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn
index d36420b..c8afd89 100644
--- a/third_party/blink/renderer/platform/BUILD.gn
+++ b/third_party/blink/renderer/platform/BUILD.gn
@@ -1986,10 +1986,6 @@
       "//build/config/fuchsia/test/test_fonts.shard.test-cml",
       "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml",
     ]
-
-    # Oilpan reuses V8's v8::PageAllocator which generally requires JIT
-    # permissions.
-    test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
   }
 
   if (is_android) {
@@ -2486,7 +2482,6 @@
   }
 
   if (is_fuchsia) {
-    test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
     additional_manifest_fragments = [
       "//build/config/fuchsia/test/test_fonts.shard.test-cml",
       "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml",
diff --git a/third_party/blink/renderer/platform/heap/BUILD.gn b/third_party/blink/renderer/platform/heap/BUILD.gn
index ae0183e..c4b2b4b86 100644
--- a/third_party/blink/renderer/platform/heap/BUILD.gn
+++ b/third_party/blink/renderer/platform/heap/BUILD.gn
@@ -127,12 +127,11 @@
   if (is_fuchsia) {
     additional_manifest_fragments = [
       "//build/config/fuchsia/test/test_fonts.shard.test-cml",
+
+      # Oilpan reuses V8's v8::PageAllocator which generally requires JIT
+      # permissions.
       "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml",
     ]
-
-    # Oilpan reuses V8's v8::PageAllocator which generally requires JIT
-    # permissions.
-    test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
   }
 }
 
@@ -195,7 +194,6 @@
     # permissions.
     additional_manifest_fragments =
         [ "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml" ]
-    test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
   }
 }
 
diff --git a/ui/accessibility/BUILD.gn b/ui/accessibility/BUILD.gn
index 7377b4f..d01f664f 100644
--- a/ui/accessibility/BUILD.gn
+++ b/ui/accessibility/BUILD.gn
@@ -337,11 +337,9 @@
     configs += [ "//v8:external_startup_data" ]
 
     if (is_fuchsia) {
-      # TODO(https://crbug.com/1185811): Investigate removing the requirement for
-      # job_policy_ambient_mark_vmo_exec for the sake of V8's allocator in tests.
-      test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
-
       additional_manifest_fragments = [
+        # TODO(https://crbug.com/1185811): Investigate removing the requirement
+        # for VmexResource.
         "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml",
         "//build/config/fuchsia/test/network.shard.test-cml",
         "//third_party/fuchsia-sdk/sdk/pkg/vulkan/client.shard.cml",
diff --git a/ui/compositor/BUILD.gn b/ui/compositor/BUILD.gn
index 1aa852f3..b869209 100644
--- a/ui/compositor/BUILD.gn
+++ b/ui/compositor/BUILD.gn
@@ -276,10 +276,13 @@
   }
 
   if (is_fuchsia) {
-    # TODO(https://crbug.com/1185811): Investigate removing the requirement for
-    # job_policy_ambient_mark_vmo_exec for the sake of V8's allocator in tests.
+    # TODO(https://crbug.com/1022542): Some of these tests use SwiftShader,
+    # which requires ambient VMEX.
     test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
+
     additional_manifest_fragments = [
+      # TODO(https://crbug.com/1185811): Investigate removing the requirement
+      # for VmexResource.
       "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml",
       "//build/config/fuchsia/test/present_view.shard.test-cml",
       "//third_party/fuchsia-sdk/sdk/pkg/vulkan/client.shard.cml",
diff --git a/ui/snapshot/BUILD.gn b/ui/snapshot/BUILD.gn
index a6c710c8..2647905b 100644
--- a/ui/snapshot/BUILD.gn
+++ b/ui/snapshot/BUILD.gn
@@ -129,11 +129,13 @@
   }
 
   if (is_fuchsia) {
-    # TODO(https://crbug.com/1185811): Investigate removing the requirement for
-    # job_policy_ambient_mark_vmo_exec for the sake of V8's allocator in tests.
+    # TODO(https://crbug.com/1022542): Some of these tests use SwiftShader,
+    # which requires ambient VMEX.
     test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
 
     additional_manifest_fragments = [
+      # TODO(https://crbug.com/1185811): Investigate removing the requirement
+      # for VmexResource.
       "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml",
       "//build/config/fuchsia/test/present_view.shard.test-cml",
       "//third_party/fuchsia-sdk/sdk/pkg/vulkan/client.shard.cml",