From nobody Tue Nov 26 15:38:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1706944065; cv=none; d=zohomail.com; s=zohoarc; b=DFxIU149CT7p/5tKVJRzkOKyrOM6uuBHXHzmVk9saENNj+Uv3ANYsXy4oVv44TxoNFHoZkHLCpWleCCsZLjbKqZXpL8mJ3eqxBsXh8ahpHhiGUn/YecQY4OgPsFFsvTowFW8PmqpMyj9J71dd068DEJsAm19vqUDDuIgxw+C6qs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706944065; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=feIMwZZuJaZeuQQNwrSNZ0xC8edpfaps/dCYuWi4Jd8=; b=LaDD7I/lBFNLSnyv2WuY8BGSPlTf0Tr7HfvvqU9nX+dY5yP2ogEXfmQZmFoCeO5q1sxEZef1p59ZZ73OkXZXBr2uajrMkflS5mI35bykIw/icAgSp6bKdl40xiccLJNuYyWE3wdl+syRtduQSOWMYBE0JQOzNrKg32DfYbgZK1E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706944065339389.1632325667987; Fri, 2 Feb 2024 23:07:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rWA7H-0007Fj-Ce; Sat, 03 Feb 2024 02:07:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rWA7F-0007FJ-CD for qemu-devel@nongnu.org; Sat, 03 Feb 2024 02:07:05 -0500 Received: from mail-oo1-xc31.google.com ([2607:f8b0:4864:20::c31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rWA7D-0002Ye-Gv for qemu-devel@nongnu.org; Sat, 03 Feb 2024 02:07:04 -0500 Received: by mail-oo1-xc31.google.com with SMTP id 006d021491bc7-59a31c14100so1647302eaf.0 for ; Fri, 02 Feb 2024 23:07:02 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id v11-20020a170902d08b00b001d94665e9d3sm2658034plv.45.2024.02.02.23.06.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 23:07:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706944021; x=1707548821; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=feIMwZZuJaZeuQQNwrSNZ0xC8edpfaps/dCYuWi4Jd8=; b=hOxkuPaPI6jCscsWV/ZDWfhMxIDR9ZiDNJDu+9nTBBN2gws6nOqFRbJOtS5c09bJkm qDh/clPq9aDpLQBGCkJ10wC+eLrC895a+x83wODwjJLBKn7RwnvZYFA4wHEugZXAja6y NdTbc/mnjTxrnvUD5jq/TIz8r+X53FbS615Vr0ac5pROwNL59x5YIWw/+pTZqazyVJbU TX0Kv9gJAnLap0liUCTs6j54oKi/Noq6f5LaxRoJ5yq2gzvw6/IcLrTxT2PpjhIiXIMF 2U8nzneF209MSx0gLysRjEVCLx/7ki4CcZ+osYpP2F9CJ0TTklFCBuybkDXoyM817Ihl oX7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706944021; x=1707548821; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=feIMwZZuJaZeuQQNwrSNZ0xC8edpfaps/dCYuWi4Jd8=; b=LSXlj4DPSqOJknCHuzA7S1rJ8SUqeZQPdCH1on1PCvTmsvcaWp6oYWgREmuCfOmu79 dVmZrdhQvwXmykvVZkdBhQjLl6f1WLTVQJTeqyZILMoiRnZNSvwdJ+Co/Jh5OKZfp0Cq 7WZtq1+yJemSPVj0K+tUFUcUEr60LNjOl3HSGXO7Ph6hnt7eDbseCUbhJlTeIi6YlfbL h8XxdOOy0P9Yazo7xEEkQTMvFY1rpC9rrnAS9cwEghOzThgjMyXEFQrn6q38OybidUbw wa0lIVEPHHTDDpbGHu0I3/nJafBsUFzOzjeQl7qN+VRTmQZr2eZSKn3QyaXaiKOW7leI W0Iw== X-Gm-Message-State: AOJu0Yy5DRNtPK8QzWCvVQiCDxOE+nicj7wh0Vqx3tj+ZQ7CTRD3L26E vPjJMW1w9iCpqm2DmBU1o7JrYLSc5B1AGDneJhopA1ebvr8V+N31jN01JPwaCNo5X+0kvVQEERL eB0s= X-Google-Smtp-Source: AGHT+IF/hNzPldqsGZJETSACJ3XlFwVZKE4LOh4DjswToTzR5ENW4v9TzblXp74i5RYLScuJWHfCLA== X-Received: by 2002:a05:6359:4c0b:b0:176:543c:8ef0 with SMTP id kj11-20020a0563594c0b00b00176543c8ef0mr11682486rwc.21.1706944021428; Fri, 02 Feb 2024 23:07:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL v2 12/58] target/loongarch: Rename MMU_IDX_* Date: Sat, 3 Feb 2024 17:06:52 +1000 Message-Id: <20240203070654.982407-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240203070654.982407-1-richard.henderson@linaro.org> References: <20240203070654.982407-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::c31; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc31.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706944067250100003 The expected form is MMU_FOO_IDX, not MMU_IDX_FOO. Rename to match generic code. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- target/loongarch/cpu.h | 8 ++++---- target/loongarch/cpu.c | 2 +- target/loongarch/cpu_helper.c | 4 ++-- target/loongarch/tcg/translate.c | 2 +- target/loongarch/tcg/insn_trans/trans_privileged.c.inc | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h index 5dfcfeb3a4..47fd110e81 100644 --- a/target/loongarch/cpu.h +++ b/target/loongarch/cpu.h @@ -404,15 +404,15 @@ struct LoongArchCPUClass { */ #define MMU_PLV_KERNEL 0 #define MMU_PLV_USER 3 -#define MMU_IDX_KERNEL MMU_PLV_KERNEL -#define MMU_IDX_USER MMU_PLV_USER -#define MMU_IDX_DA 4 +#define MMU_KERNEL_IDX MMU_PLV_KERNEL +#define MMU_USER_IDX MMU_PLV_USER +#define MMU_DA_IDX 4 =20 int loongarch_cpu_mmu_index(CPUState *cs, bool ifetch); static inline int cpu_mmu_index(CPULoongArchState *env, bool ifetch) { #ifdef CONFIG_USER_ONLY - return MMU_IDX_USER; + return MMU_USER_IDX; #else return loongarch_cpu_mmu_index(env_cpu(env), ifetch); #endif diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index e96159943a..49ced9888e 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -382,7 +382,7 @@ int loongarch_cpu_mmu_index(CPUState *cs, bool ifetch) if (FIELD_EX64(env->CSR_CRMD, CSR_CRMD, PG)) { return FIELD_EX64(env->CSR_CRMD, CSR_CRMD, PLV); } - return MMU_IDX_DA; + return MMU_DA_IDX; } =20 static void loongarch_la464_initfn(Object *obj) diff --git a/target/loongarch/cpu_helper.c b/target/loongarch/cpu_helper.c index f68d63f466..b0658773b0 100644 --- a/target/loongarch/cpu_helper.c +++ b/target/loongarch/cpu_helper.c @@ -171,8 +171,8 @@ int get_physical_address(CPULoongArchState *env, hwaddr= *physical, int *prot, target_ulong address, MMUAccessType access_type, int mmu_idx) { - int user_mode =3D mmu_idx =3D=3D MMU_IDX_USER; - int kernel_mode =3D mmu_idx =3D=3D MMU_IDX_KERNEL; + int user_mode =3D mmu_idx =3D=3D MMU_USER_IDX; + int kernel_mode =3D mmu_idx =3D=3D MMU_KERNEL_IDX; uint32_t plv, base_c, base_v; int64_t addr_high; uint8_t da =3D FIELD_EX64(env->CSR_CRMD, CSR_CRMD, DA); diff --git a/target/loongarch/tcg/translate.c b/target/loongarch/tcg/transl= ate.c index 235515c629..58674cb268 100644 --- a/target/loongarch/tcg/translate.c +++ b/target/loongarch/tcg/translate.c @@ -125,7 +125,7 @@ static void loongarch_tr_init_disas_context(DisasContex= tBase *dcbase, if (ctx->base.tb->flags & HW_FLAGS_CRMD_PG) { ctx->mem_idx =3D ctx->plv; } else { - ctx->mem_idx =3D MMU_IDX_DA; + ctx->mem_idx =3D MMU_DA_IDX; } =20 /* Bound the number of insns to execute to those left on the page. */ diff --git a/target/loongarch/tcg/insn_trans/trans_privileged.c.inc b/targe= t/loongarch/tcg/insn_trans/trans_privileged.c.inc index 01d457212b..7e4ec93edb 100644 --- a/target/loongarch/tcg/insn_trans/trans_privileged.c.inc +++ b/target/loongarch/tcg/insn_trans/trans_privileged.c.inc @@ -323,7 +323,7 @@ TRANS(iocsrwr_d, IOCSR, gen_iocsrwr, gen_helper_iocsrwr= _d) =20 static void check_mmu_idx(DisasContext *ctx) { - if (ctx->mem_idx !=3D MMU_IDX_DA) { + if (ctx->mem_idx !=3D MMU_DA_IDX) { tcg_gen_movi_tl(cpu_pc, ctx->base.pc_next + 4); ctx->base.is_jmp =3D DISAS_EXIT; } --=20 2.34.1