2 * RISC-V translation routines for the Svinval Standard Instruction Set.
4 * Copyright (c) 2020-2022 PLCT lab
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2 or later, as published by the Free Software Foundation.
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * You should have received a copy of the GNU General Public License along with
16 * this program. If not, see <http://www.gnu.org/licenses/>.
19 #define REQUIRE_SVINVAL(ctx) do { \
20 if (!ctx->cfg_ptr->ext_svinval) { \
25 static bool trans_sinval_vma(DisasContext *ctx, arg_sinval_vma *a)
28 /* Do the same as sfence.vma currently */
29 REQUIRE_EXT(ctx, RVS);
30 #ifndef CONFIG_USER_ONLY
31 gen_helper_tlb_flush(cpu_env);
37 static bool trans_sfence_w_inval(DisasContext *ctx, arg_sfence_w_inval *a)
40 REQUIRE_EXT(ctx, RVS);
41 /* Do nothing currently */
45 static bool trans_sfence_inval_ir(DisasContext *ctx, arg_sfence_inval_ir *a)
48 REQUIRE_EXT(ctx, RVS);
49 /* Do nothing currently */
53 static bool trans_hinval_vvma(DisasContext *ctx, arg_hinval_vvma *a)
56 /* Do the same as hfence.vvma currently */
57 REQUIRE_EXT(ctx, RVH);
58 #ifndef CONFIG_USER_ONLY
59 gen_helper_hyp_tlb_flush(cpu_env);
65 static bool trans_hinval_gvma(DisasContext *ctx, arg_hinval_gvma *a)
68 /* Do the same as hfence.gvma currently */
69 REQUIRE_EXT(ctx, RVH);
70 #ifndef CONFIG_USER_ONLY
71 gen_helper_hyp_gvma_tlb_flush(cpu_env);