Skip to contentSkip to conversation

target/hexagon: Drop include of qemu.h

PATCH In review Peter Maydell 4 participants 4 messages Jul 17, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/hexagon: Drop include of qemu.h

The qemu.h file is a CONFIG_USER_ONLY header; it doesn't appear on the include path for softmmu builds. Currently we include it unconditionally in target/hexagon/op_helper.c. We used to need it for the put_user_*() and get_user_*() functions, but now that we have removed the uses of those from op_helper.c, the only reason it's still there is that we're implicitly relying on it pulling in some other headers.

Explicitly include the headers we need for other functions, and drop the include of qemu.h.

---
Based-on: [email protected] ("[PATCH v3 0/2] SIGSEGV fixes")

I noticed this because it's the only place in the tree where we include qemu.h that isn't either (a) a linux-user specific file or (b) wrapping the #include line in an ifdef CONFIG_USER_ONLY.

 target/hexagon/op_helper.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
target/hexagon/op_helper.c +2 -1
index a959dba56ee..61d5cde939a 100644
@@ -16,7 +16,8 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu.h"
+#include "qemu/log.h"
+#include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
 #include "exec/helper-proto.h"
 #include "fpu/softfloat.h"
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Peter Maydell

The qemu.h file is a CONFIG_USER_ONLY header; it doesn't appear on the include path for softmmu builds. Currently we include it unconditionally in target/hexagon/op_helper.c. We used to need it for the put_user_*() and get_user_*() functions, but now that we have removed the uses of those from op_helper.c, the only reason it's still there is that we're implicitly relying on it pulling in some other headers.

Quoted 4 lines

Explicitly include the headers we need for other functions, and drop the include of qemu.h.

Signature · 1 line
Alex Bennée
Reviewed-by on v1 1/1
#2 lore raw
In reply to Peter Maydell
Quoted 8 lines · Peter Maydell

The qemu.h file is a CONFIG_USER_ONLY header; it doesn't appear on the include path for softmmu builds. Currently we include it unconditionally in target/hexagon/op_helper.c. We used to need it for the put_user_*() and get_user_*() functions, but now that we have removed the uses of those from op_helper.c, the only reason it's still there is that we're implicitly relying on it pulling in some other headers.

Quoted 7 lines

Explicitly include the headers we need for other functions, and drop the include of qemu.h.

---
Based-on:[email protected] ("[PATCH v3 0/2] SIGSEGV fixes")

r~

Reviewed-by on v1 1/1
#3 lore raw
In reply to Peter Maydell
Quoted 16 lines

-----Original Message-----
From: Peter Maydell <[email protected]>
Sent: Saturday, July 17, 2021 4:30 AM
To: [email protected]
Cc: Taylor Simpson <[email protected]>
Subject: [PATCH] target/hexagon: Drop include of qemu.h

The qemu.h file is a CONFIG_USER_ONLY header; it doesn't appear on the include path for softmmu builds. Currently we include it unconditionally in target/hexagon/op_helper.c. We used to need it for the put_user_*() and get_user_*() functions, but now that we have removed the uses of those from op_helper.c, the only reason it's still there is that we're implicitly relying on it pulling in some other headers.

Quoted 7 lines

Explicitly include the headers we need for other functions, and drop the include of qemu.h.

---
Based-on: [email protected] ("[PATCH v3 0/2] SIGSEGV fixes")

Thanks Peter,
I'll add this to the series and send you a pull request.

Taylor