qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Daniel Henrique Barboza" <danielhb413@gmail.com>,
	"David Gibson" <david@gibson.dropbear.id.au>,
	"Xiaojuan Yang" <yangxiaojuan@loongson.cn>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Bin Meng" <bin.meng@windriver.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Artyom Tarasenko" <atar4qemu@gmail.com>,
	"Cédric Le Goater" <clg@kaod.org>,
	"Song Gao" <gaosong@loongson.cn>,
	"Alistair Francis" <alistair.francis@wdc.com>,
	qemu-ppc@nongnu.org, "Laurent Vivier" <laurent@vivier.eu>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Taylor Simpson" <tsimpson@quicinc.com>,
	"Greg Kurz" <groug@kaod.org>,
	qemu-riscv@nongnu.org, "Max Filippov" <jcmvbkbc@gmail.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH 08/10] target/riscv/cpu: Restrict sysemu-specific fields from CPUArchState
Date: Fri, 16 Dec 2022 23:05:37 +0100	[thread overview]
Message-ID: <20221216220539.7065-9-philmd@linaro.org> (raw)
In-Reply-To: <20221216220539.7065-1-philmd@linaro.org>

The 'hwaddr' type is only available / meaningful on system emulation.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/riscv/cpu.h | 34 ++++++++++++++++++----------------
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index fc1f72e5c3..bd4e16d946 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -368,16 +368,6 @@ struct CPUArchState {
     uint64_t menvcfg;
     target_ulong senvcfg;
     uint64_t henvcfg;
-#endif
-    target_ulong cur_pmmask;
-    target_ulong cur_pmbase;
-
-    float_status fp_status;
-
-    /* Fields from here on are preserved across CPU reset. */
-    QEMUTimer *stimer; /* Internal timer for S-mode interrupt */
-    QEMUTimer *vstimer; /* Internal timer for VS-mode interrupt */
-    bool vstime_irq;
 
     hwaddr kernel_addr;
     hwaddr fdt_addr;
@@ -388,6 +378,16 @@ struct CPUArchState {
     uint64_t kvm_timer_compare;
     uint64_t kvm_timer_state;
     uint64_t kvm_timer_frequency;
+#endif
+    target_ulong cur_pmmask;
+    target_ulong cur_pmbase;
+
+    float_status fp_status;
+
+    /* Fields from here on are preserved across CPU reset. */
+    QEMUTimer *stimer; /* Internal timer for S-mode interrupt */
+    QEMUTimer *vstimer; /* Internal timer for VS-mode interrupt */
+    bool vstime_irq;
 };
 
 OBJECT_DECLARE_CPU_TYPE(RISCVCPU, RISCVCPUClass, RISCV_CPU)
@@ -553,12 +553,20 @@ bool riscv_cpu_virt_enabled(CPURISCVState *env);
 void riscv_cpu_set_virt_enabled(CPURISCVState *env, bool enable);
 bool riscv_cpu_two_stage_lookup(int mmu_idx);
 int riscv_cpu_mmu_index(CPURISCVState *env, bool ifetch);
+#ifndef CONFIG_USER_ONLY
+hwaddr riscv_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
 G_NORETURN void  riscv_cpu_do_unaligned_access(CPUState *cs, vaddr addr,
                                                MMUAccessType access_type, int mmu_idx,
                                                uintptr_t retaddr);
 bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
                         MMUAccessType access_type, int mmu_idx,
                         bool probe, uintptr_t retaddr);
+void riscv_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr,
+                                     vaddr addr, unsigned size,
+                                     MMUAccessType access_type,
+                                     int mmu_idx, MemTxAttrs attrs,
+                                     MemTxResult response, uintptr_t retaddr);
+#endif
 char *riscv_isa_string(RISCVCPU *cpu);
 void riscv_cpu_list(void);
 
@@ -566,12 +574,6 @@ void riscv_cpu_list(void);
 #define cpu_mmu_index riscv_cpu_mmu_index
 
 #ifndef CONFIG_USER_ONLY
-void riscv_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr,
-                                     vaddr addr, unsigned size,
-                                     MMUAccessType access_type,
-                                     int mmu_idx, MemTxAttrs attrs,
-                                     MemTxResult response, uintptr_t retaddr);
-hwaddr riscv_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
 bool riscv_cpu_exec_interrupt(CPUState *cs, int interrupt_request);
 void riscv_cpu_swap_hypervisor_regs(CPURISCVState *env);
 int riscv_cpu_claim_interrupts(RISCVCPU *cpu, uint64_t interrupts);
-- 
2.38.1



  parent reply	other threads:[~2022-12-16 22:12 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16 22:05 [PATCH 00/10] target/misc: Header cleanups around "cpu.h" Philippe Mathieu-Daudé
2022-12-16 22:05 ` [PATCH 01/10] target/hppa/helper: Include missing "cpu.h" header Philippe Mathieu-Daudé
2022-12-17  0:30   ` Richard Henderson
2022-12-16 22:05 ` [PATCH 02/10] target/hexagon: Declare hexagon_regnames[] in "cpu.h" Philippe Mathieu-Daudé
2022-12-16 22:48   ` Taylor Simpson
2022-12-17  0:33   ` Richard Henderson
2022-12-16 22:05 ` [PATCH 03/10] target/loongarch/cpu: Remove unused "sysbus.h" header Philippe Mathieu-Daudé
2022-12-17  0:34   ` Richard Henderson
2022-12-17 12:26   ` Bernhard Beschow
2022-12-17 13:26     ` Philippe Mathieu-Daudé
2022-12-16 22:05 ` [PATCH 04/10] target/loongarch/cpu: Restrict "memory.h" header to sysemu Philippe Mathieu-Daudé
2022-12-17  0:37   ` Richard Henderson
2022-12-16 22:05 ` [PATCH 05/10] target/m68k/helper: Include missing "cpu.h" header Philippe Mathieu-Daudé
2022-12-17  0:37   ` Richard Henderson
2022-12-16 22:05 ` [PATCH 06/10] target/ppc/helper: " Philippe Mathieu-Daudé
2022-12-17  0:37   ` Richard Henderson
2022-12-16 22:05 ` [PATCH 07/10] target/ppc/internal: Restrict MMU declarations to sysemu Philippe Mathieu-Daudé
2022-12-17  0:38   ` Richard Henderson
2022-12-17 10:53     ` Philippe Mathieu-Daudé
2022-12-16 22:05 ` Philippe Mathieu-Daudé [this message]
2022-12-17  0:40   ` [PATCH 08/10] target/riscv/cpu: Restrict sysemu-specific fields from CPUArchState Richard Henderson
2022-12-16 22:05 ` [PATCH 09/10] target/sparc/sysemu: Remove pointless CONFIG_USER_ONLY guard Philippe Mathieu-Daudé
2022-12-16 22:05 ` [PATCH 10/10] target/xtensa/cpu: Include missing "memory.h" header Philippe Mathieu-Daudé
2022-12-17  0:41   ` Richard Henderson

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=20221216220539.7065-9-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=alistair.francis@wdc.com \
    --cc=atar4qemu@gmail.com \
    --cc=bin.meng@windriver.com \
    --cc=clg@kaod.org \
    --cc=danielhb413@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=gaosong@loongson.cn \
    --cc=groug@kaod.org \
    --cc=jcmvbkbc@gmail.com \
    --cc=laurent@vivier.eu \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=palmer@dabbelt.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=tsimpson@quicinc.com \
    --cc=yangxiaojuan@loongson.cn \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).