From nobody Wed Feb 11 00:59:50 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.41 as permitted sender) client-ip=209.85.221.41; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f41.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1619972282; cv=none; d=zohomail.com; s=zohoarc; b=UTRcOSCAzRlLZUlP/c9/bB5RoF5dHBlZ1E+A4AILRqJk4Igq6ilfThJ/SQ5x6O8a+qWEwQNcrLa9NPTjmIaLgLwyX0s7AuQnYeVHTFCHiKbmO95kdhTMHC8UpURqL7hkA14b7NhA0i/6xamMVJw0QvoPh1EKTSzauVR7x56IjB4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619972282; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZETGpx4nbZfkaug+OflFl89N3mWc3Om9YqwBm01M7wo=; b=AKWq9L742g6l1hlrVqELHlqxXwFHw9PQ6KvWtrwEYRwR/dr/LWcGR7BcXSNra97Cd/s5LPaMZpKa1EzO2lB8PIG6Va79LMBRS0Xb6yGRHxlcEi1/yzOwyEXbhdFMCmAoGxYTMh5Pxgi2YA6ansMptjF8CR6fkUCJE+ozXANi4p0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by mx.zohomail.com with SMTPS id 1619972282468411.77125088904756; Sun, 2 May 2021 09:18:02 -0700 (PDT) Received: by mail-wr1-f41.google.com with SMTP id v12so3094492wrq.6 for ; Sun, 02 May 2021 09:18:01 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (anancy-651-1-208-144.w109-217.abo.wanadoo.fr. [109.217.237.144]) by smtp.gmail.com with ESMTPSA id b6sm17735676wmj.2.2021.05.02.09.17.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 May 2021 09:18:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZETGpx4nbZfkaug+OflFl89N3mWc3Om9YqwBm01M7wo=; b=kaEi/DPSsdIDlQQdGBQDEHlHP28upTUjCWZE2JCjjRRvaZkxK8ErFtsHElkiv1plKm xUyuJz4qrYOBXlaXjRlyoiOrLKm88yERmcIR7NlYtvCYp8cTtsUe7Xn1LWXbSa72Cz/a XFxfvG5CGYV+Gs8u90FZrdfD87LtLtMUKQvyfl7Zw9Gf27xfuvY2M03yPmHbdkduEoZh mNIdwMKpDuvOmWk7JpRuZb1qYY1jJ2Y6LqgczIEp1EZQ7ShQGzd1lwov4w5Epz3zoG5H ng1SUrk3+S0sB4bp2yjMT213iB8sKbasga/HhxY6qQc5X+Yxdy26iOAvoJKljnd/qDd1 LmsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ZETGpx4nbZfkaug+OflFl89N3mWc3Om9YqwBm01M7wo=; b=MvXw79SKnWmQnoubdcJNpkzP5CpMDCYB9ZFotHfyGN1biF6TbgVG6YRTMU9YeuKqKB ac+OWNdQQC7rqiuEniEx96joM42zT/G78qzGAwziaDsNSWvI77tDlyvfYRC996fw5w3h PsLkMw4aqRK8fmTAsuOILATBVs1hGxM2/p5j4sojyaZEhjw1hkdKvCUIJLMMiqk4kAhy e0VRdlrJBN6P/njA1BUnvwbVyZWR4+y2LECPrUotlR26IMvMWZOT6sQpYGqnLzTe5uyI 33MCIA88DpKlKeTinHmS4d5cTGmPHhnrgQXwhNnFmbsbspmqQVkIXw+TMsjF5hyeAcCe sz6A== X-Gm-Message-State: AOAM531TU1qezMcZKb7miwGKtqbT1QDL3g4NqlM1LIbtSc9eAsp6zud7 yZkDqasu3ksDjHwXyeZbDZw= X-Google-Smtp-Source: ABdhPJwulmc+QzUi061YtUWveAy93AK4kEHrf45Vlm2IgKs5W8kcyrDlexGRfkGzdigloJvFAL62Mw== X-Received: by 2002:adf:f502:: with SMTP id q2mr20100401wro.171.1619972280737; Sun, 02 May 2021 09:18:00 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Aurelien Jarno , Aleksandar Rikalo , Huacai Chen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 27/36] target/mips: Move tlb_helper.c to tcg/sysemu/ Date: Sun, 2 May 2021 18:15:29 +0200 Message-Id: <20210502161538.534038-28-f4bug@amsat.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210502161538.534038-1-f4bug@amsat.org> References: <20210502161538.534038-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Move tlb_helper.c to the tcg/sysemu/ subdir, along with the following 3 declarations to tcg-internal.h: - cpu_mips_tlb_flush() - cpu_mips_translate_address() - r4k_invalidate_tlb() Simplify tlb_helper.c #ifdef'ry because files in tcg/sysemu/ are only build when sysemu mode is configured. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20210428170410.479308-22-f4bug@amsat.org> --- target/mips/internal.h | 5 ----- target/mips/tcg/tcg-internal.h | 5 +++++ target/mips/{ =3D> tcg/sysemu}/tlb_helper.c | 3 --- target/mips/meson.build | 1 - target/mips/tcg/sysemu/meson.build | 1 + 5 files changed, 6 insertions(+), 9 deletions(-) rename target/mips/{ =3D> tcg/sysemu}/tlb_helper.c (99%) diff --git a/target/mips/internal.h b/target/mips/internal.h index 2c9666905df..558cdca4e84 100644 --- a/target/mips/internal.h +++ b/target/mips/internal.h @@ -164,16 +164,12 @@ void r4k_helper_tlbp(CPUMIPSState *env); void r4k_helper_tlbr(CPUMIPSState *env); void r4k_helper_tlbinv(CPUMIPSState *env); void r4k_helper_tlbinvf(CPUMIPSState *env); -void r4k_invalidate_tlb(CPUMIPSState *env, int idx, int use_extra); =20 void mips_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr, unsigned size, MMUAccessType access_type, int mmu_idx, MemTxAttrs attrs, MemTxResult response, uintptr_t retadd= r); -hwaddr cpu_mips_translate_address(CPUMIPSState *env, target_ulong address, - MMUAccessType access_type, uintptr_t ret= addr); - extern const VMStateDescription vmstate_mips_cpu; =20 #endif /* !CONFIG_USER_ONLY */ @@ -423,7 +419,6 @@ static inline void compute_hflags(CPUMIPSState *env) } } =20 -void cpu_mips_tlb_flush(CPUMIPSState *env); void sync_c0_status(CPUMIPSState *env, CPUMIPSState *cpu, int tc); void cpu_mips_store_status(CPUMIPSState *env, target_ulong val); void cpu_mips_store_cause(CPUMIPSState *env, target_ulong val); diff --git a/target/mips/tcg/tcg-internal.h b/target/mips/tcg/tcg-internal.h index 70655bab45c..a39ff45d58f 100644 --- a/target/mips/tcg/tcg-internal.h +++ b/target/mips/tcg/tcg-internal.h @@ -24,8 +24,13 @@ void mmu_init(CPUMIPSState *env, const mips_def_t *def); =20 void update_pagemask(CPUMIPSState *env, target_ulong arg1, int32_t *pagema= sk); =20 +void r4k_invalidate_tlb(CPUMIPSState *env, int idx, int use_extra); uint32_t cpu_mips_get_random(CPUMIPSState *env); =20 +hwaddr cpu_mips_translate_address(CPUMIPSState *env, target_ulong address, + MMUAccessType access_type, uintptr_t ret= addr); +void cpu_mips_tlb_flush(CPUMIPSState *env); + #endif /* !CONFIG_USER_ONLY */ =20 #endif diff --git a/target/mips/tlb_helper.c b/target/mips/tcg/sysemu/tlb_helper.c similarity index 99% rename from target/mips/tlb_helper.c rename to target/mips/tcg/sysemu/tlb_helper.c index bfb08eaf506..bf242f5e65a 100644 --- a/target/mips/tlb_helper.c +++ b/target/mips/tcg/sysemu/tlb_helper.c @@ -25,8 +25,6 @@ #include "exec/log.h" #include "hw/mips/cpudevs.h" =20 -#if !defined(CONFIG_USER_ONLY) - /* no MMU emulation */ int no_mmu_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, target_ulong address, MMUAccessType access_type) @@ -1072,4 +1070,3 @@ void r4k_invalidate_tlb(CPUMIPSState *env, int idx, i= nt use_extra) } } } -#endif /* !CONFIG_USER_ONLY */ diff --git a/target/mips/meson.build b/target/mips/meson.build index a55af1cd6cf..ff5eb210dfd 100644 --- a/target/mips/meson.build +++ b/target/mips/meson.build @@ -31,7 +31,6 @@ 'msa_translate.c', 'op_helper.c', 'rel6_translate.c', - 'tlb_helper.c', 'translate.c', 'translate_addr_const.c', 'txx9_translate.c', diff --git a/target/mips/tcg/sysemu/meson.build b/target/mips/tcg/sysemu/me= son.build index 5c3024e7760..73ab9571ba6 100644 --- a/target/mips/tcg/sysemu/meson.build +++ b/target/mips/tcg/sysemu/meson.build @@ -1,4 +1,5 @@ mips_softmmu_ss.add(files( 'cp0_helper.c', 'mips-semi.c', + 'tlb_helper.c', )) --=20 2.26.3