Skip to content

Commit

Permalink
Revert "[fuchsia] Remove use of ambient VMEX capabilities"
Browse files Browse the repository at this point in the history
This reverts commit 32d1466.

Reason for revert: Change is incompatible with VmexResource security
policy in some configurations.

Original change's description:
> [fuchsia] Remove use of ambient VMEX capabilities
>
> - 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: I9e27afa869eaffb740f3501a972cafbc179346a9
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4566483
> Reviewed-by: David Dorwin <ddorwin@chromium.org>
> Auto-Submit: Wez <wez@chromium.org>
> Quick-Run: Wez <wez@chromium.org>
> Commit-Queue: Wez <wez@chromium.org>
> Owners-Override: Wez <wez@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1152660}

Bug: 1290907, 1185811, 1022542
Bug: fuchsia:128484
Change-Id: Id5c50bad99ddc867ab39fdcd838c6257cc6c7361
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4587379
Owners-Override: Wez <wez@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1153216}
  • Loading branch information
zijiehe-google-com authored and Chromium LUCI CQ committed Jun 5, 2023
1 parent 4227a3e commit a028996
Show file tree
Hide file tree
Showing 25 changed files with 77 additions and 43 deletions.
7 changes: 2 additions & 5 deletions cc/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -935,15 +935,12 @@ cc_test("cc_unittests") {
}

if (is_fuchsia) {
# TODO(https://crbug.com/1022542): Some of these tests use SwiftShader,
# which requires ambient VMEX.
# 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",
"//third_party/fuchsia-sdk/sdk/pkg/vulkan/client.shard.cml",
]
Expand Down
3 changes: 3 additions & 0 deletions chrome/app/chrome.cml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
// 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: [
{
Expand Down
9 changes: 6 additions & 3 deletions chrome/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4884,6 +4884,7 @@ if (!is_android) {
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",
Expand Down Expand Up @@ -9401,11 +9402,11 @@ test("unit_tests") {

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",
Expand Down Expand Up @@ -10940,6 +10941,7 @@ if (!is_android) {
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",
Expand Down Expand Up @@ -11008,6 +11010,7 @@ if (!is_android) {
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",
Expand Down
8 changes: 5 additions & 3 deletions components/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,12 @@ test("components_unittests") {
}

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",
Expand Down Expand Up @@ -1023,6 +1024,7 @@ if (use_blink) {
}

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",
Expand Down
4 changes: 2 additions & 2 deletions components/viz/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ viz_test("viz_unittests") {
}

if (is_fuchsia) {
# TODO(https://crbug.com/1022542): Some of these tests use SwiftShader,
# which requires ambient VMEX.
# 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 = [
Expand Down
2 changes: 1 addition & 1 deletion content/shell/fuchsia/content_shell.cml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
include: [
"syslog/client.shard.cml",
"vulkan/client.shard.cml",
"//build/config/fuchsia/test/elf_test_runner.shard.test-cml",
"//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml",
"//build/config/fuchsia/test/chromium_test_facet.shard.test-cml",
"//build/config/fuchsia/test/test_fonts.shard.test-cml",
],
Expand Down
8 changes: 5 additions & 3 deletions content/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2152,6 +2152,7 @@ test("content_browsertests") {
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",
Expand Down Expand Up @@ -2753,11 +2754,12 @@ test("content_unittests") {
"../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",
Expand Down
6 changes: 4 additions & 2 deletions extensions/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,11 @@ test("extensions_unittests") {
]

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",
Expand Down
2 changes: 2 additions & 0 deletions fuchsia_web/runners/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ test("cast_runner_browsertests") {
"//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",
Expand Down
2 changes: 1 addition & 1 deletion fuchsia_web/shell/cast_streaming_shell.cml
Original file line number Diff line number Diff line change
Expand Up @@ -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_runner.shard.test-cml",
"//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml",
"sys/component/realm_builder_absolute.shard.cml",

"syslog/client.shard.cml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
// 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: [
{
Expand Down
2 changes: 1 addition & 1 deletion fuchsia_web/shell/web_engine_shell.cml
Original file line number Diff line number Diff line change
Expand Up @@ -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_runner.shard.test-cml",
"//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml",
"sys/component/realm_builder_absolute.shard.cml",

"syslog/client.shard.cml",
Expand Down
3 changes: 3 additions & 0 deletions fuchsia_web/shell/web_engine_shell_for_web_instance_host.cml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
// 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.
Expand Down
2 changes: 2 additions & 0 deletions fuchsia_web/webengine/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,8 @@ test("web_engine_browsertests") {
"//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",
Expand Down
3 changes: 3 additions & 0 deletions fuchsia_web/webengine/web_instance-common.shard.cml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
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: [
{
Expand Down
3 changes: 3 additions & 0 deletions gin/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ test("gin_unittests") {
}

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" ]
}
Expand Down
7 changes: 4 additions & 3 deletions headless/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -751,11 +751,12 @@ test("headless_browsertests") {
}

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",
Expand Down
2 changes: 2 additions & 0 deletions services/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ test("services_unittests") {
}

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",
Expand Down
6 changes: 4 additions & 2 deletions third_party/blink/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,11 @@ test("blink_common_unittests") {
if (is_ios) {
bundle_deps = [ ":blink_common_unittests_pak_bundle_data" ]
}

if (is_fuchsia) {
additional_manifest_fragments =
[ "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml" ]
# 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"
}

data_deps = [ ":common_unittests_data" ]
Expand Down
6 changes: 3 additions & 3 deletions third_party/blink/renderer/controller/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,12 @@ test("blink_unittests") {
}

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",
]
}
Expand Down
5 changes: 5 additions & 0 deletions third_party/blink/renderer/platform/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1988,6 +1988,10 @@ test("blink_platform_unittests") {
"//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) {
Expand Down Expand Up @@ -2480,6 +2484,7 @@ test("blink_fuzzer_unittests") {
}

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",
Expand Down
8 changes: 5 additions & 3 deletions third_party/blink/renderer/platform/heap/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,12 @@ test("blink_heap_unittests") {
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"
}
}

Expand Down Expand Up @@ -194,6 +195,7 @@ test("blink_heap_perftests") {
# 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"
}
}

Expand Down
6 changes: 4 additions & 2 deletions ui/accessibility/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,11 @@ test("accessibility_unittests") {
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",
Expand Down
7 changes: 2 additions & 5 deletions ui/compositor/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,10 @@ test("compositor_unittests") {
}

if (is_fuchsia) {
# TODO(https://crbug.com/1022542): Some of these tests use SwiftShader,
# which requires ambient VMEX.
# 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/present_view.shard.test-cml",
"//third_party/fuchsia-sdk/sdk/pkg/vulkan/client.shard.cml",
Expand Down
6 changes: 2 additions & 4 deletions ui/snapshot/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,11 @@ test("snapshot_unittests") {
}

if (is_fuchsia) {
# TODO(https://crbug.com/1022542): Some of these tests use SwiftShader,
# which requires ambient VMEX.
# 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/present_view.shard.test-cml",
"//third_party/fuchsia-sdk/sdk/pkg/vulkan/client.shard.cml",
Expand Down

0 comments on commit a028996

Please sign in to comment.