qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Subject: Re: [PATCH 09/21] semihosting/uaccess: Avoid including 'cpu.h'
Date: Thu, 18 Apr 2024 12:59:56 +0200	[thread overview]
Message-ID: <42c6471e-8383-45e0-85ee-e20ca32ecbad@linaro.org> (raw)
In-Reply-To: <48f21287-d741-4936-9395-88356260c93b@linaro.org>

On 17/4/24 21:14, Richard Henderson wrote:
> On 4/17/24 11:27, Philippe Mathieu-Daudé wrote:
>> "semihosting/uaccess.h" only requires declarations
>> from "exec/cpu-defs.h". Avoid including the huge "cpu.h".
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>> Message-Id: <20231211212003.21686-6-philmd@linaro.org>
>> ---
>>   include/semihosting/uaccess.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/semihosting/uaccess.h 
>> b/include/semihosting/uaccess.h
>> index 3963eafc3e..6c8835fbcb 100644
>> --- a/include/semihosting/uaccess.h
>> +++ b/include/semihosting/uaccess.h
>> @@ -14,7 +14,7 @@
>>   #error Cannot include semihosting/uaccess.h from user emulation
>>   #endif
>> -#include "cpu.h"
>> +#include "exec/cpu-defs.h"
>>   #define get_user_u64(val, 
>> addr)                                         \
>>       ({ uint64_t val_ = 
>> 0;                                               \
> 
> 
> Does this actually need anything besides exec/tswap.h?

Actually what is needed is:

#include "exec/cpu-common.h" // cpu_memory_rw_debug
#include "exec/cpu-defs.h"   // target_ulong
#include "exec/tswap.h"      // tswap32

Fixed locally as:

-- >8 --
Author: Philippe Mathieu-Daudé <philmd@linaro.org>
Date:   Wed Dec 6 16:11:15 2023 +0100

     semihosting/uaccess: Avoid including 'cpu.h'

     "semihosting/uaccess.h" only requires the following headers:

       - "exec/cpu-defs.h" for target_ulong,
       - "exec/cpu-common.h" for cpu_memory_rw_debug()
       - "exec/tswap.h" for tswap32() and tswap64().

     Include them instead of the huge "cpu.h".

     Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
     Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

diff --git a/include/semihosting/uaccess.h b/include/semihosting/uaccess.h
index 3963eafc3e..dd289af8dd 100644
--- a/include/semihosting/uaccess.h
+++ b/include/semihosting/uaccess.h
@@ -17 +17,3 @@
-#include "cpu.h"
+#include "exec/cpu-common.h"
+#include "exec/cpu-defs.h"
+#include "exec/tswap.h"
---


  reply	other threads:[~2024-04-18 11:00 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17 18:27 [PATCH 00/21] exec/next for 9.1 Philippe Mathieu-Daudé
2024-04-17 18:27 ` [PATCH 01/21] gdbstub: Simplify #ifdef'ry in helpers.h Philippe Mathieu-Daudé
2024-04-17 18:27 ` [PATCH 02/21] hw/core: Remove check on NEED_CPU_H in tcg-cpu-ops.h Philippe Mathieu-Daudé
2024-04-17 18:27 ` [PATCH 03/21] exec: Rename NEED_CPU_H -> COMPILING_PER_TARGET Philippe Mathieu-Daudé
2024-04-17 18:27 ` [PATCH 04/21] exec: Include 'cpu.h' before validating CPUArchState placement Philippe Mathieu-Daudé
2024-04-17 18:27 ` [PATCH 05/21] exec: Expose 'target_page.h' API to user emulation Philippe Mathieu-Daudé
2024-04-17 18:27 ` [PATCH 06/21] target: Define TCG_GUEST_DEFAULT_MO in 'cpu-param.h' Philippe Mathieu-Daudé
2024-04-17 18:27 ` [PATCH 07/21] accel: Include missing 'exec/cpu_ldst.h' header Philippe Mathieu-Daudé
2024-04-17 18:27 ` [PATCH 08/21] gdbstub: Include missing 'hw/core/cpu.h' header Philippe Mathieu-Daudé
2024-04-17 19:10   ` Richard Henderson
2024-04-17 18:27 ` [PATCH 09/21] semihosting/uaccess: Avoid including 'cpu.h' Philippe Mathieu-Daudé
2024-04-17 19:14   ` Richard Henderson
2024-04-18 10:59     ` Philippe Mathieu-Daudé [this message]
2024-04-17 18:27 ` [PATCH 10/21] semihosting/guestfd: Remove unused 'semihosting/uaccess.h' header Philippe Mathieu-Daudé
2024-04-17 19:17   ` Richard Henderson
2024-04-17 18:27 ` [PATCH 11/21] exec/cpu-all: Reduce 'qemu/rcu.h' header inclusion Philippe Mathieu-Daudé
2024-04-17 18:27 ` [PATCH 12/21] target/ppc/excp_helper: Avoid 'abi_ptr' in system emulation Philippe Mathieu-Daudé
2024-04-17 19:18   ` Richard Henderson
2024-04-17 18:27 ` [PATCH 13/21] accel/tcg: Un-inline retaddr helpers to 'user-retaddr.h' Philippe Mathieu-Daudé
2024-04-17 19:30   ` Richard Henderson
2024-04-18 10:45     ` Philippe Mathieu-Daudé
2024-04-17 18:27 ` [PATCH 14/21] target/i386: Include missing 'exec/exec-all.h' header Philippe Mathieu-Daudé
2024-04-17 18:28 ` [PATCH 15/21] accel/tcg: Include missing 'hw/core/cpu.h' header Philippe Mathieu-Daudé
2024-04-17 19:25   ` Richard Henderson
2024-04-17 18:28 ` [PATCH 16/21] exec/cpu-all: Remove unused 'qemu/thread.h' header Philippe Mathieu-Daudé
2024-04-17 19:25   ` Richard Henderson
2024-04-17 18:28 ` [PATCH 17/21] exec/cpu-all: Remove unused tswapls() definitions Philippe Mathieu-Daudé
2024-04-17 19:26   ` Richard Henderson
2024-04-17 18:28 ` [PATCH 18/21] exec: Declare target_words_bigendian() in 'exec/tswap.h' Philippe Mathieu-Daudé
2024-04-17 19:32   ` Richard Henderson
2024-04-17 18:28 ` [PATCH 19/21] exec: Move [b]tswapl() declarations to 'exec/user/tswap-target.h' Philippe Mathieu-Daudé
2024-04-17 19:33   ` Richard Henderson
2024-04-17 18:28 ` [PATCH 20/21] exec/user: Do not include 'cpu.h' in 'abitypes.h' Philippe Mathieu-Daudé
2024-04-17 19:35   ` Richard Henderson
2024-04-17 18:28 ` [PATCH 21/21] exec: Declare abi_ptr type in its own 'abi_ptr.h' header 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=42c6471e-8383-45e0-85ee-e20ca32ecbad@linaro.org \
    --to=philmd@linaro.org \
    --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 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).