[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v7 09/29] target/loongarch: Add TLB instruction support
From: |
Richard Henderson |
Subject: |
Re: [RFC PATCH v7 09/29] target/loongarch: Add TLB instruction support |
Date: |
Mon, 28 Mar 2022 14:12:42 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 |
On 3/28/22 06:57, Xiaojuan Yang wrote:
+static void output_empty(DisasContext *ctx, arg_empty *a,
+ const char *mnemonic)
+{
+}
No, you must still do
output(ctx, mnemonic, "");
+static bool trans_tlbwr(DisasContext *ctx, arg_tlbwr *a)
+{
+ if (check_plv(ctx)) {
+ return false;
+ }
+ gen_helper_tlbwr(cpu_env);
+
+ if (ctx->mem_idx != MMU_DA_IDX) {
+ tcg_gen_movi_tl(cpu_pc, ctx->base.pc_next + 4);
+ ctx->base.is_jmp = DISAS_EXIT;
+ }
You may want to create a helper function for this condition.
+static bool trans_tlbclr(DisasContext *ctx, arg_tlbclr *a)
+{
+ if (check_plv(ctx)) {
+ return false;
+ }
+ gen_helper_tlbclr(cpu_env);
+ tcg_gen_movi_tl(cpu_pc, ctx->base.pc_next + 4);
+ ctx->base.is_jmp = DISAS_EXIT;
Missing it here...
+static bool trans_tlbflush(DisasContext *ctx, arg_tlbflush *a)
+{
+ if (check_plv(ctx)) {
+ return false;
+ }
+ gen_helper_tlbflush(cpu_env);
+ tcg_gen_movi_tl(cpu_pc, ctx->base.pc_next + 4);
+ ctx->base.is_jmp = DISAS_EXIT;
+ return true;
+}
... and here.
r~
- Re: [RFC PATCH v7 08/29] target/loongarch: Add LoongArch IOCSR instruction, (continued)
- [RFC PATCH v7 01/29] target/loongarch: Add system emulation introduction, Xiaojuan Yang, 2022/03/28
- [RFC PATCH v7 12/29] target/loongarch: Add timer related instructions support., Xiaojuan Yang, 2022/03/28
- [RFC PATCH v7 04/29] target/loongarch: Implement qmp_query_cpu_definitions(), Xiaojuan Yang, 2022/03/28
- [RFC PATCH v7 05/29] target/loongarch: Add constant timer support, Xiaojuan Yang, 2022/03/28
- [RFC PATCH v7 09/29] target/loongarch: Add TLB instruction support, Xiaojuan Yang, 2022/03/28
- [RFC PATCH v7 14/29] hw/loongarch: Add support loongson3 virt machine type., Xiaojuan Yang, 2022/03/28
- [RFC PATCH v7 15/29] hw/loongarch: Add LoongArch cpu interrupt support(CPUINTC), Xiaojuan Yang, 2022/03/28
- [RFC PATCH v7 16/29] hw/loongarch: Add LoongArch ipi interrupt support(IPI), Xiaojuan Yang, 2022/03/28