All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Aleksandar Rikalo" <aleksandar.rikalo@syrmia.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: [PATCH 5/9] target/mips: Restrict some system specific declarations to sysemu
Date: Thu, 17 Jun 2021 19:43:19 +0200	[thread overview]
Message-ID: <20210617174323.2900831-6-f4bug@amsat.org> (raw)
In-Reply-To: <20210617174323.2900831-1-f4bug@amsat.org>

Commit 043715d1e0f ("target/mips: Update ITU to utilize SAARI
and SAAR CP0 registers") declared itc_reconfigure() in public
namespace, while it is restricted to system emulation.

Similarly commit 5679479b9a1 ("target/mips: Move CP0 helpers
to sysemu/cp0.c") restricted cpu_mips_soft_irq() definition to
system emulation, but forgot to restrict its declaration.

Commit a2b0a27d33e ("target/mips: Move TCG source files under
tcg/ sub directory") restricted mips_cpu_do_unaligned_access()
to system emulation but forgot to guard the declaration.

To avoid polluting user-mode emulation with these declarations,
restrict them to sysemu. Also restrict the sysemu ITU/ITC/IRQ
fields from CPUMIPSState.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 target/mips/cpu.h              | 10 +++++++---
 target/mips/tcg/tcg-internal.h |  6 +++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/target/mips/cpu.h b/target/mips/cpu.h
index 075c24abdad..1dfe69c6c0c 100644
--- a/target/mips/cpu.h
+++ b/target/mips/cpu.h
@@ -1152,13 +1152,13 @@ struct CPUMIPSState {
     CPUMIPSMVPContext *mvp;
 #if !defined(CONFIG_USER_ONLY)
     CPUMIPSTLBContext *tlb;
+    void *irq[8];
+    struct MIPSITUState *itu;
+    MemoryRegion *itc_tag; /* ITC Configuration Tags */
 #endif
 
     const mips_def_t *cpu_model;
-    void *irq[8];
     QEMUTimer *timer; /* Internal timer */
-    struct MIPSITUState *itu;
-    MemoryRegion *itc_tag; /* ITC Configuration Tags */
     target_ulong exception_base; /* ExceptionBase input to the core */
     uint64_t cp0_count_ns; /* CP0_Count clock period (in nanoseconds) */
 };
@@ -1316,12 +1316,16 @@ uint64_t cpu_mips_phys_to_kseg1(void *opaque, uint64_t addr);
 bool mips_um_ksegs_enabled(void);
 void mips_um_ksegs_enable(void);
 
+#if !defined(CONFIG_USER_ONLY)
+
 /* mips_int.c */
 void cpu_mips_soft_irq(CPUMIPSState *env, int irq, int level);
 
 /* mips_itu.c */
 void itc_reconfigure(struct MIPSITUState *tag);
 
+#endif /* !CONFIG_USER_ONLY */
+
 /* helper.c */
 target_ulong exception_resume_pc(CPUMIPSState *env);
 
diff --git a/target/mips/tcg/tcg-internal.h b/target/mips/tcg/tcg-internal.h
index 81b14eb219e..11d98a717f2 100644
--- a/target/mips/tcg/tcg-internal.h
+++ b/target/mips/tcg/tcg-internal.h
@@ -23,9 +23,6 @@ bool mips_cpu_exec_interrupt(CPUState *cpu, int int_req);
 bool mips_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
                        MMUAccessType access_type, int mmu_idx,
                        bool probe, uintptr_t retaddr);
-void mips_cpu_do_unaligned_access(CPUState *cpu, vaddr addr,
-                                  MMUAccessType access_type,
-                                  int mmu_idx, uintptr_t retaddr);
 
 const char *mips_exception_name(int32_t exception);
 
@@ -57,6 +54,9 @@ void mips_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr,
                                     MMUAccessType access_type,
                                     int mmu_idx, MemTxAttrs attrs,
                                     MemTxResult response, uintptr_t retaddr);
+void mips_cpu_do_unaligned_access(CPUState *cpu, vaddr addr,
+                                  MMUAccessType access_type,
+                                  int mmu_idx, uintptr_t retaddr);
 void cpu_mips_tlb_flush(CPUMIPSState *env);
 
 #endif /* !CONFIG_USER_ONLY */
-- 
2.31.1



  parent reply	other threads:[~2021-06-17 17:53 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-17 17:43 [PATCH 0/9] target/mips: Various fixes & cleanups Philippe Mathieu-Daudé
2021-06-17 17:43 ` [PATCH 1/9] target/mips: Do not abort on invalid instruction Philippe Mathieu-Daudé
2021-06-18 22:30   ` Richard Henderson
2021-06-17 17:43 ` [PATCH 2/9] target/mips: Fix more TCG temporary leaks in gen_pool32a5_nanomips_insn Philippe Mathieu-Daudé
2021-06-18 22:32   ` Richard Henderson
2021-06-17 17:43 ` [PATCH 3/9] target/mips: Move TCG trace events to tcg/ sub directory Philippe Mathieu-Daudé
2021-06-18 22:32   ` Richard Henderson
2021-06-17 17:43 ` [PATCH 4/9] target/mips: Move translate.h " Philippe Mathieu-Daudé
2021-06-18 22:34   ` Richard Henderson
2021-06-17 17:43 ` Philippe Mathieu-Daudé [this message]
2021-06-18 22:38   ` [PATCH 5/9] target/mips: Restrict some system specific declarations to sysemu Richard Henderson
2021-06-19 14:44     ` Philippe Mathieu-Daudé
2021-06-17 17:43 ` [PATCH 6/9] target/mips: Remove SmartMIPS / MDMX unuseful comments Philippe Mathieu-Daudé
2021-06-18 22:39   ` Richard Henderson
2021-06-17 17:43 ` [PATCH 7/9] target/mips: Remove microMIPS BPOSGE32 / BPOSGE64 unuseful cases Philippe Mathieu-Daudé
2021-06-18  9:44   ` Philippe Mathieu-Daudé
2021-06-18 22:40   ` Richard Henderson
2021-06-17 17:43 ` [PATCH 8/9] target/mips: Constify host_to_mips_errno[] Philippe Mathieu-Daudé
2021-06-18 22:40   ` Richard Henderson
2021-06-17 17:43 ` [PATCH 9/9] target/mips: Optimize regnames[] arrays Philippe Mathieu-Daudé
2021-06-18 22:42   ` Richard Henderson
2021-06-19 18:05 ` [PATCH 0/9] target/mips: Various fixes & cleanups Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210617174323.2900831-6-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=aleksandar.rikalo@syrmia.com \
    --cc=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.