src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/SpeculativeExecutionAttacksMitigations.java
author dlong
Tue, 24 Sep 2019 12:47:15 -0400
changeset 58299 6df94ce3ab2f
parent 55509 d58442b8abc1
child 58679 9c3209ff7550
permissions -rw-r--r--
8229201: Update Graal Reviewed-by: kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
52578
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
     1
/*
58299
6df94ce3ab2f 8229201: Update Graal
dlong
parents: 55509
diff changeset
     2
 * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
52578
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
     4
 *
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
     7
 * published by the Free Software Foundation.
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
     8
 *
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    13
 * accompanied this code).
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    14
 *
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    18
 *
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    21
 * questions.
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    22
 */
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    23
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    24
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    25
package org.graalvm.compiler.core.common;
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    26
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    27
import org.graalvm.compiler.options.EnumOptionKey;
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    28
import org.graalvm.compiler.options.Option;
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    29
import org.graalvm.compiler.options.OptionKey;
55509
d58442b8abc1 8225497: Update Graal
jwilhelm
parents: 54084
diff changeset
    30
import org.graalvm.compiler.options.OptionStability;
52578
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    31
import org.graalvm.compiler.options.OptionType;
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    32
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    33
public enum SpeculativeExecutionAttacksMitigations {
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    34
    None,
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    35
    AllTargets,
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    36
    GuardTargets,
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    37
    NonDeoptGuardTargets;
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    38
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    39
    public static class Options {
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    40
        // @formatter:off
54084
84f10bbf993f 8218074: Update Graal
jwilhelm
parents: 52910
diff changeset
    41
        @Option(help = "file:doc-files/MitigateSpeculativeExecutionAttacksHelp.txt")
52578
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    42
        public static final EnumOptionKey<SpeculativeExecutionAttacksMitigations> MitigateSpeculativeExecutionAttacks = new EnumOptionKey<>(None);
55509
d58442b8abc1 8225497: Update Graal
jwilhelm
parents: 54084
diff changeset
    43
        @Option(help = "Use index masking after bounds check to mitigate speculative execution attacks.", type = OptionType.User, stability = OptionStability.STABLE)
52578
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    44
        public static final OptionKey<Boolean> UseIndexMasking = new OptionKey<>(false);
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    45
        // @formatter:on
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    46
    }
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    47
}