[wasm] Disable memory protection with mprotect for lazy compilation [v8/v8 : main]

124 views
Skip to first unread message

Andreas Haas (Gerrit)

unread,
May 4, 2022, 9:57:33 AM5/4/22
to Stephen Röttger, V8 LUCI CQ, Michael Hablich, v8-re...@googlegroups.com

Attention is currently required from: Stephen Röttger.

View Change

1 comment:

To view, visit change 3627596. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I4c56d4021a7b594e24a4d3d28a130a309c56de38
Gerrit-Change-Number: 3627596
Gerrit-PatchSet: 1
Gerrit-Owner: Andreas Haas <ah...@chromium.org>
Gerrit-Reviewer: Andreas Haas <ah...@chromium.org>
Gerrit-Reviewer: Stephen Röttger <sroe...@google.com>
Gerrit-CC: Michael Hablich <hab...@chromium.org>
Gerrit-Attention: Stephen Röttger <sroe...@google.com>
Gerrit-Comment-Date: Wed, 04 May 2022 13:57:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Stephen Röttger (Gerrit)

unread,
May 5, 2022, 4:06:34 AM5/5/22
to Andreas Haas, V8 LUCI CQ, Michael Hablich, v8-re...@googlegroups.com

Attention is currently required from: Andreas Haas.

View Change

1 comment:

  • Patchset:

To view, visit change 3627596. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I4c56d4021a7b594e24a4d3d28a130a309c56de38
Gerrit-Change-Number: 3627596
Gerrit-PatchSet: 1
Gerrit-Owner: Andreas Haas <ah...@chromium.org>
Gerrit-Reviewer: Andreas Haas <ah...@chromium.org>
Gerrit-Reviewer: Stephen Röttger <sroe...@google.com>
Gerrit-CC: Michael Hablich <hab...@chromium.org>
Gerrit-Attention: Andreas Haas <ah...@chromium.org>
Gerrit-Comment-Date: Thu, 05 May 2022 08:06:21 +0000

Andreas Haas (Gerrit)

unread,
May 5, 2022, 11:43:15 AM5/5/22
to Clemens Backes, Stephen Röttger, V8 LUCI CQ, Michael Hablich, v8-re...@googlegroups.com

Attention is currently required from: Clemens Backes.

View Change

1 comment:

To view, visit change 3627596. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I4c56d4021a7b594e24a4d3d28a130a309c56de38
Gerrit-Change-Number: 3627596
Gerrit-PatchSet: 1
Gerrit-Owner: Andreas Haas <ah...@chromium.org>
Gerrit-Reviewer: Andreas Haas <ah...@chromium.org>
Gerrit-Reviewer: Clemens Backes <clem...@chromium.org>
Gerrit-Reviewer: Stephen Röttger <sroe...@google.com>
Gerrit-CC: Michael Hablich <hab...@chromium.org>
Gerrit-Attention: Clemens Backes <clem...@chromium.org>
Gerrit-Comment-Date: Thu, 05 May 2022 15:43:05 +0000

Clemens Backes (Gerrit)

unread,
May 5, 2022, 11:52:25 AM5/5/22
to Andreas Haas, Stephen Röttger, V8 LUCI CQ, Michael Hablich, v8-re...@googlegroups.com

Attention is currently required from: Andreas Haas.

View Change

1 comment:

  • File src/flags/flag-definitions.h:

    • Patch Set #1, Line 1121: DEFINE_NEG_IMPLICATION(wasm_lazy_compilation, wasm_write_protect_code_memory)

      Can we make this a weak implication, so we can still overwrite it explicitly via passing --wasm-write-protect-code-memory?

To view, visit change 3627596. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I4c56d4021a7b594e24a4d3d28a130a309c56de38
Gerrit-Change-Number: 3627596
Gerrit-PatchSet: 1
Gerrit-Owner: Andreas Haas <ah...@chromium.org>
Gerrit-Reviewer: Andreas Haas <ah...@chromium.org>
Gerrit-Reviewer: Clemens Backes <clem...@chromium.org>
Gerrit-Reviewer: Stephen Röttger <sroe...@google.com>
Gerrit-CC: Michael Hablich <hab...@chromium.org>
Gerrit-Attention: Andreas Haas <ah...@chromium.org>
Gerrit-Comment-Date: Thu, 05 May 2022 15:52:16 +0000

Andreas Haas (Gerrit)

unread,
May 5, 2022, 1:00:25 PM5/5/22
to Clemens Backes, Stephen Röttger, V8 LUCI CQ, Michael Hablich, v8-re...@googlegroups.com

Attention is currently required from: Clemens Backes.

View Change

1 comment:

  • File src/flags/flag-definitions.h:

    • Can we make this a weak implication, so we can still overwrite it explicitly via passing --wasm-writ […]

      Done

To view, visit change 3627596. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I4c56d4021a7b594e24a4d3d28a130a309c56de38
Gerrit-Change-Number: 3627596
Gerrit-PatchSet: 2
Gerrit-Owner: Andreas Haas <ah...@chromium.org>
Gerrit-Reviewer: Andreas Haas <ah...@chromium.org>
Gerrit-Reviewer: Clemens Backes <clem...@chromium.org>
Gerrit-Reviewer: Stephen Röttger <sroe...@google.com>
Gerrit-CC: Michael Hablich <hab...@chromium.org>
Gerrit-Attention: Clemens Backes <clem...@chromium.org>
Gerrit-Comment-Date: Thu, 05 May 2022 17:00:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Clemens Backes <clem...@chromium.org>
Gerrit-MessageType: comment

Clemens Backes (Gerrit)

unread,
May 5, 2022, 1:01:58 PM5/5/22
to Andreas Haas, Stephen Röttger, V8 LUCI CQ, Michael Hablich, v8-re...@googlegroups.com

Attention is currently required from: Andreas Haas.

Patch set 2:Code-Review +1

View Change

1 comment:

To view, visit change 3627596. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I4c56d4021a7b594e24a4d3d28a130a309c56de38
Gerrit-Change-Number: 3627596
Gerrit-PatchSet: 2
Gerrit-Owner: Andreas Haas <ah...@chromium.org>
Gerrit-Reviewer: Andreas Haas <ah...@chromium.org>
Gerrit-Reviewer: Clemens Backes <clem...@chromium.org>
Gerrit-Reviewer: Stephen Röttger <sroe...@google.com>
Gerrit-CC: Michael Hablich <hab...@chromium.org>
Gerrit-Attention: Andreas Haas <ah...@chromium.org>
Gerrit-Comment-Date: Thu, 05 May 2022 17:01:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Andreas Haas (Gerrit)

unread,
May 5, 2022, 1:04:08 PM5/5/22
to Clemens Backes, Stephen Röttger, V8 LUCI CQ, Michael Hablich, v8-re...@googlegroups.com

Attention is currently required from: Andreas Haas.

Patch set 2:Commit-Queue +2

View Change

    To view, visit change 3627596. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: I4c56d4021a7b594e24a4d3d28a130a309c56de38
    Gerrit-Change-Number: 3627596
    Gerrit-PatchSet: 2
    Gerrit-Owner: Andreas Haas <ah...@chromium.org>
    Gerrit-Reviewer: Andreas Haas <ah...@chromium.org>
    Gerrit-Reviewer: Clemens Backes <clem...@chromium.org>
    Gerrit-Reviewer: Stephen Röttger <sroe...@google.com>
    Gerrit-CC: Michael Hablich <hab...@chromium.org>
    Gerrit-Attention: Andreas Haas <ah...@chromium.org>
    Gerrit-Comment-Date: Thu, 05 May 2022 17:03:55 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    V8 LUCI CQ (Gerrit)

    unread,
    May 5, 2022, 1:07:32 PM5/5/22
    to Andreas Haas, Clemens Backes, Stephen Röttger, Michael Hablich, v8-re...@googlegroups.com

    V8 LUCI CQ submitted this change.

    View Change


    Approvals: Andreas Haas: Commit Clemens Backes: Looks good to me
    [wasm] Disable memory protection with mprotect for lazy compilation

    The write protection of code memory with mprotect is too expensive for
    lazy compilation. As the usefulness of this memory protection is
    limited anyways, this CL disables the memory protection in case lazy
    compilation is enabled.

    Bug: v8:12852
    Change-Id: I4c56d4021a7b594e24a4d3d28a130a309c56de38
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3627596
    Reviewed-by: Clemens Backes <clem...@chromium.org>
    Commit-Queue: Andreas Haas <ah...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#80377}
    ---
    M src/flags/flag-definitions.h
    1 file changed, 27 insertions(+), 1 deletion(-)

    diff --git a/src/flags/flag-definitions.h b/src/flags/flag-definitions.h
    index a8c59eb..cf559b8 100644
    --- a/src/flags/flag-definitions.h
    +++ b/src/flags/flag-definitions.h
    @@ -20,6 +20,9 @@
    #define DEFINE_WEAK_IMPLICATION(whenflag, thenflag) \
    DEFINE_WEAK_VALUE_IMPLICATION(whenflag, thenflag, true)

    +#define DEFINE_WEAK_NEG_IMPLICATION(whenflag, thenflag) \
    + DEFINE_WEAK_VALUE_IMPLICATION(whenflag, thenflag, false)
    +
    #define DEFINE_NEG_IMPLICATION(whenflag, thenflag) \
    DEFINE_VALUE_IMPLICATION(whenflag, thenflag, false)

    @@ -524,7 +527,7 @@
    #if V8_SHORT_BUILTIN_CALLS
    DEFINE_WEAK_IMPLICATION(future, short_builtin_calls)
    #endif
    -DEFINE_WEAK_VALUE_IMPLICATION(future, write_protect_code_memory, false)
    +DEFINE_WEAK_NEG_IMPLICATION(future, write_protect_code_memory)
    DEFINE_WEAK_IMPLICATION(future, compact_maps)

    DEFINE_BOOL_READONLY(dict_property_const_tracking,
    @@ -1120,6 +1123,9 @@
    DEFINE_IMPLICATION(validate_asm, asm_wasm_lazy_compilation)
    DEFINE_BOOL(wasm_lazy_compilation, false,
    "enable lazy compilation for all wasm modules")
    +// Write protect code causes too much overhead for lazy compilation.
    +DEFINE_WEAK_NEG_IMPLICATION(wasm_lazy_compilation,
    + wasm_write_protect_code_memory)
    DEFINE_DEBUG_BOOL(trace_wasm_lazy_compilation, false,
    "trace lazy compilation of wasm functions")
    DEFINE_BOOL(wasm_lazy_validation, false,
    @@ -2264,6 +2270,7 @@
    #undef DEFINE_FLOAT
    #undef DEFINE_IMPLICATION
    #undef DEFINE_WEAK_IMPLICATION
    +#undef DEFINE_WEAK_NEG_IMPLICATION
    #undef DEFINE_NEG_IMPLICATION
    #undef DEFINE_NEG_VALUE_IMPLICATION
    #undef DEFINE_VALUE_IMPLICATION

    To view, visit change 3627596. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: I4c56d4021a7b594e24a4d3d28a130a309c56de38
    Gerrit-Change-Number: 3627596
    Gerrit-PatchSet: 3
    Gerrit-Owner: Andreas Haas <ah...@chromium.org>
    Gerrit-Reviewer: Andreas Haas <ah...@chromium.org>
    Gerrit-Reviewer: Clemens Backes <clem...@chromium.org>
    Gerrit-Reviewer: Stephen Röttger <sroe...@google.com>
    Gerrit-CC: Michael Hablich <hab...@chromium.org>
    Gerrit-MessageType: merged

    Zone Realties Nagpur (Gerrit)

    unread,
    Jan 8, 2023, 10:27:43 PM1/8/23
    to V8 LUCI CQ, Andreas Haas, Clemens Backes, Stephen Röttger, Michael Hablich, v8-re...@googlegroups.com

    View Change

    1 comment:

    To view, visit change 3627596. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: I4c56d4021a7b594e24a4d3d28a130a309c56de38
    Gerrit-Change-Number: 3627596
    Gerrit-PatchSet: 3
    Gerrit-Owner: Andreas Haas <ah...@chromium.org>
    Gerrit-Reviewer: Andreas Haas <ah...@chromium.org>
    Gerrit-Reviewer: Clemens Backes <clem...@chromium.org>
    Gerrit-Reviewer: Stephen Röttger <sroe...@google.com>
    Gerrit-CC: Michael Hablich <hab...@chromium.org>
    Gerrit-CC: Zone Realties Nagpur <zonere...@gmail.com>
    Gerrit-Comment-Date: Mon, 09 Jan 2023 03:26:58 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment
    Reply all
    Reply to author
    Forward
    0 new messages