Skip to contentSkip to conversation

hw: Remove 'exec/exec-all.h' header when unused

PATCH In review Philippe Mathieu-Daudé 6 participants 16 messages Dec 12, 2023 – Dec 26, 2023

lore
Share & tools
lore
#0 lore raw

cover hw: Remove 'exec/exec-all.h' header when unused

Philippe Mathieu-Daudé (4):
hw/ppc/spapr_hcall: Remove unused 'exec/exec-all.h' included header hw/misc/mips_itu: Remove unnecessary 'exec/exec-all.h' header hw/s390x/ipl: Remove unused 'exec/exec-all.h' included header
target: Restrict 'sysemu/reset.h' to system emulation

 hw/misc/mips_itu.c     | 3 ++-
 hw/ppc/spapr_hcall.c   | 1 -
 hw/s390x/ipl.c         | 1 -
 target/i386/cpu.c      | 2 +-
 target/loongarch/cpu.c | 2 ++
 5 files changed, 5 insertions(+), 4 deletions(-)
Signature · 1 line
2.41.0
#1 lore raw

PATCH 1/4 hw/ppc/spapr_hcall: Remove unused 'exec/exec-all.h' included header

---
 hw/ppc/spapr_hcall.c | 1 -
 1 file changed, 1 deletion(-)
hw/ppc/spapr_hcall.c +0 -1
index 522a2396c7..fcefd1d1c7 100644
@@ -8,7 +8,6 @@
 #include "qemu/main-loop.h"
 #include "qemu/module.h"
 #include "qemu/error-report.h"
-#include "exec/exec-all.h"
 #include "exec/tb-flush.h"
 #include "helper_regs.h"
 #include "hw/ppc/ppc.h"
Signature · 1 line
2.41.0
Reviewed-by on v1 1/4
#2 lore raw

Re: [PATCH 1/4] hw/ppc/spapr_hcall: Remove unused 'exec/exec-all.h' included header

Quoted 10 lines · Philippe Mathieu-Daudé
---
  hw/ppc/spapr_hcall.c | 1 -
  1 file changed, 1 deletion(-)
hw/ppc/spapr_hcall.c +0 -0
index 522a2396c7..fcefd1d1c7 100644

hw/ppc/spapr_hcall.c line 13

Quoted 7 lines
hw/ppc/spapr_hcall.c +0 -1
@@ -8,7 +8,6 @@
  #include "qemu/main-loop.h"
  #include "qemu/module.h"
  #include "qemu/error-report.h"
-#include "exec/exec-all.h"
  #include "exec/tb-flush.h"
  #include "helper_regs.h"
  #include "hw/ppc/ppc.h"
#4 lore raw

PATCH 2/4 hw/misc/mips_itu: Remove unnecessary 'exec/exec-all.h' header

In reply to Philippe Mathieu-Daudé

mips_itu.c only requires declarations from "hw/core/cpu.h" and "cpu.h". Avoid including the huge "exec/exec-all.h" header.

---
 hw/misc/mips_itu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/misc/mips_itu.c +2 -1
index 5a83ccc4e8..37aea0e737 100644
@@ -22,9 +22,10 @@
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "qapi/error.h"
-#include "exec/exec-all.h"
+#include "hw/core/cpu.h"
 #include "hw/misc/mips_itu.h"
 #include "hw/qdev-properties.h"
+#include "target/mips/cpu.h"
 
 #define ITC_TAG_ADDRSPACE_SZ (ITC_ADDRESSMAP_NUM * 8)
 /* Initialize as 4kB area to fit all 32 cells with default 128B grain.
Signature · 1 line
2.41.0
Reviewed-by on v1 2/4
#5 lore raw

Re: [PATCH 2/4] hw/misc/mips_itu: Remove unnecessary 'exec/exec-all.h' header

Quoted 14 lines · Philippe Mathieu-Daudé

mips_itu.c only requires declarations from "hw/core/cpu.h" and "cpu.h". Avoid including the huge "exec/exec-all.h" header.

---
  hw/misc/mips_itu.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
hw/misc/mips_itu.c +0 -0
index 5a83ccc4e8..37aea0e737 100644
@@ -22,9 +22,10 @@
  #include "qemu/log.h"

hw/misc/mips_itu.c line 31

Quoted 10 lines
hw/misc/mips_itu.c +2 -1
  #include "qemu/module.h"
  #include "qapi/error.h"
-#include "exec/exec-all.h"
+#include "hw/core/cpu.h"
  #include "hw/misc/mips_itu.h"
  #include "hw/qdev-properties.h"
+#include "target/mips/cpu.h"
 
  #define ITC_TAG_ADDRSPACE_SZ (ITC_ADDRESSMAP_NUM * 8)
  /* Initialize as 4kB area to fit all 32 cells with default 128B grain.
#6 lore raw

PATCH 3/4 hw/s390x/ipl: Remove unused 'exec/exec-all.h' included header

In reply to Philippe Mathieu-Daudé
---
 hw/s390x/ipl.c | 1 -
 1 file changed, 1 deletion(-)
hw/s390x/ipl.c +0 -1
index 515dcf51b5..62182d81a0 100644
@@ -35,7 +35,6 @@
 #include "qemu/cutils.h"
 #include "qemu/option.h"
 #include "standard-headers/linux/virtio_ids.h"
-#include "exec/exec-all.h"
 
 #define KERN_IMAGE_START                0x010000UL
 #define LINUX_MAGIC_ADDR                0x010008UL
Signature · 1 line
2.41.0
#7 lore raw

Re: [PATCH 3/4] hw/s390x/ipl: Remove unused 'exec/exec-all.h' included header

Am 12.12.23 um 12:36 schrieb Philippe Mathieu-Daudé:

Quoted 10 lines
---
  hw/s390x/ipl.c | 1 -
  1 file changed, 1 deletion(-)
hw/s390x/ipl.c +0 -0
index 515dcf51b5..62182d81a0 100644

hw/s390x/ipl.c line 38

Quoted 4 lines
hw/s390x/ipl.c +0 -1
@@ -35,7 +35,6 @@
  #include "qemu/cutils.h"
  #include "qemu/option.h"
  #include "standard-headers/linux/virtio_ids.h"
-#include "exec/exec-all.h"

Philippe,

This include came with
commit a30fb811cbe940020a498d2cdac9326cac38b4d9

Author:     David Hildenbrand <[email protected]>
AuthorDate: Tue Apr 24 12:18:59 2018 +0200
Commit:     Cornelia Huck <[email protected]>
CommitDate: Mon May 14 17:10:02 2018 +0200
    s390x: refactor reset/reipl handling

And I think one reason was

cpu_loop_exit

This is still part of ipl.c

a30fb811cbe (David Hildenbrand      2018-04-24 12:18:59 +0200 664)     /* as this is triggered by a CPU, make sure to exit the loop */
a30fb811cbe (David Hildenbrand      2018-04-24 12:18:59 +0200 665)     if (tcg_enabled()) {
a30fb811cbe (David Hildenbrand      2018-04-24 12:18:59 +0200 666)         cpu_loop_exit(cs);
a30fb811cbe (David Hildenbrand      2018-04-24 12:18:59 +0200 667)     }

So why do you think exec-all.h is unused?

#8 lore raw

Re: [PATCH 3/4] hw/s390x/ipl: Remove unused 'exec/exec-all.h' included header

Quoted 45 lines · Christian Borntraeger

Am 12.12.23 um 12:36 schrieb Philippe Mathieu-Daudé:

Quoted 10 lines

---
  hw/s390x/ipl.c | 1 -

  1 file changed, 1 deletion(-)
hw/s390x/ipl.c +0 -0
index 515dcf51b5..62182d81a0 100644

hw/s390x/ipl.c line 38

Quoted 4 lines
hw/s390x/ipl.c +0 -1
@@ -35,7 +35,6 @@
   #include "qemu/cutils.h"
   #include "qemu/option.h"
   #include "standard-headers/linux/virtio_ids.h"
-#include "exec/exec-all.h"

Philippe,

This include came with
commit a30fb811cbe940020a498d2cdac9326cac38b4d9
Author:     David Hildenbrand <[email protected]>
AuthorDate: Tue Apr 24 12:18:59 2018 +0200
Commit:     Cornelia Huck <[email protected]>
CommitDate: Mon May 14 17:10:02 2018 +0200

     s390x: refactor reset/reipl handling

And I think one reason was

cpu_loop_exit

This is still part of ipl.c

a30fb811cbe (David Hildenbrand      2018-04-24 12:18:59 +0200 664)     /* as this is triggered by a CPU, make sure to exit the loop */
a30fb811cbe (David Hildenbrand      2018-04-24 12:18:59 +0200 665)     if (tcg_enabled()) {
a30fb811cbe (David Hildenbrand      2018-04-24 12:18:59 +0200 666)         cpu_loop_exit(cs);
a30fb811cbe (David Hildenbrand      2018-04-24 12:18:59 +0200 667)     }

Quoted 3 lines

So why do you think exec-all.h is unused?

I think because that got moved out of exec-all.h a few months ago, via

commit 3549118b498873c84b442bc280a5edafbb61e0a4

Author: Philippe Mathieu-Daudé <[email protected]>
Date:   Thu Sep 14 20:57:08 2023 +0200

exec: Move cpu_loop_foo() target agnostic functions to 'cpu-
common.h'

While these functions are not TCG specific, they are not target specific. Move them to "exec/cpu-common.h" so their callers don't have to be tainted as target specific.

#9 lore raw

Re: [PATCH 3/4] hw/s390x/ipl: Remove unused 'exec/exec-all.h' included header

Am 12.12.23 um 16:28 schrieb Eric Farman:

Quoted 10 lines
Quoted 3 lines

So why do you think exec-all.h is unused?

I think because that got moved out of exec-all.h a few months ago, via

commit 3549118b498873c84b442bc280a5edafbb61e0a4

Author: Philippe Mathieu-Daudé <[email protected]>
Date:   Thu Sep 14 20:57:08 2023 +0200
Quoted 7 lines

exec: Move cpu_loop_foo() target agnostic functions to 'cpu-
common.h'

While these functions are not TCG specific, they are not target specific. Move them to "exec/cpu-common.h" so their callers don't have to be tainted as target specific.

Ah right, I was looking at an old QEMU version....

#10 lore raw

Re: [PATCH 3/4] hw/s390x/ipl: Remove unused 'exec/exec-all.h' included header

Quoted 13 lines · Christian Borntraeger

Am 12.12.23 um 16:28 schrieb Eric Farman:

Quoted 12 lines
Quoted 1 line

So why do you think exec-all.h is unused?

I think because that got moved out of exec-all.h a few months ago, via

commit 3549118b498873c84b442bc280a5edafbb61e0a4
Author: Philippe Mathieu-Daudé <[email protected]> Date:   Thu Sep 14 20:57:08 2023 +0200

     exec: Move cpu_loop_foo() target agnostic functions to 'cpu- common.h'
     While these functions are not TCG specific, they are not target specific. Move them to "exec/cpu-common.h" so their callers don't have to be tainted as target specific.

Indeed, thanks Eric for justifying this patch.

Quoted 1 line

Ah right, I was looking at an old QEMU version....

FYI I tried to clarify a bit these header patterns here:
https://lore.kernel.org/qemu-devel/[email protected]/

#12 lore raw

PATCH 4/4 target: Restrict 'sysemu/reset.h' to system emulation

In reply to Philippe Mathieu-Daudé

vCPU "reset" is only possible with system emulation.

---
 target/i386/cpu.c      | 2 +-
 target/loongarch/cpu.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
target/i386/cpu.c +1 -1
index dfb96217ad..17b6962d43 100644
@@ -24,7 +24,6 @@
 #include "qemu/hw-version.h"
 #include "cpu.h"
 #include "tcg/helper-tcg.h"
-#include "sysemu/reset.h"
 #include "sysemu/hvf.h"
 #include "hvf/hvf-i386.h"
 #include "kvm/kvm_i386.h"
@@ -37,6 +36,7 @@
 #include "hw/qdev-properties.h"
 #include "hw/i386/topology.h"
 #ifndef CONFIG_USER_ONLY
+#include "sysemu/reset.h"
 #include "qapi/qapi-commands-machine-target.h"
 #include "exec/address-spaces.h"
 #include "hw/boards.h"
target/loongarch/cpu.c +2 -0
index fc075952e6..b26187dfde 100644
@@ -17,7 +17,9 @@
 #include "internals.h"
 #include "fpu/softfloat-helpers.h"
 #include "cpu-csr.h"
+#ifndef CONFIG_USER_ONLY
 #include "sysemu/reset.h"
+#endif
 #include "tcg/tcg.h"
 #include "vec.h"
 
Signature · 1 line
2.41.0
Reviewed-by on v1 4/4
#13 lore raw

Re: [PATCH 4/4] target: Restrict 'sysemu/reset.h' to system emulation

Quoted 9 lines · Philippe Mathieu-Daudé

vCPU "reset" is only possible with system emulation.

---
  target/i386/cpu.c      | 2 +-
  target/loongarch/cpu.c | 2 ++
  2 files changed, 3 insertions(+), 1 deletion(-)
Reviewed-by on v1 4/4
#14 lore raw

Re: [PATCH 4/4] target: Restrict 'sysemu/reset.h' to system emulation

In reply to Philippe Mathieu-Daudé
Quoted 11 lines · Philippe Mathieu-Daudé

Date: Tue, 12 Dec 2023 12:36:40 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH 4/4] target: Restrict 'sysemu/reset.h' to system emulation
X-Mailer: git-send-email 2.41.0

vCPU "reset" is only possible with system emulation.

---

Quoted 42 lines
 target/i386/cpu.c      | 2 +-
 target/loongarch/cpu.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
target/i386/cpu.c +1 -1
index dfb96217ad..17b6962d43 100644
@@ -24,7 +24,6 @@
 #include "qemu/hw-version.h"
 #include "cpu.h"
 #include "tcg/helper-tcg.h"
-#include "sysemu/reset.h"
 #include "sysemu/hvf.h"
 #include "hvf/hvf-i386.h"
 #include "kvm/kvm_i386.h"
@@ -37,6 +36,7 @@
 #include "hw/qdev-properties.h"
 #include "hw/i386/topology.h"
 #ifndef CONFIG_USER_ONLY
+#include "sysemu/reset.h"
 #include "qapi/qapi-commands-machine-target.h"
 #include "exec/address-spaces.h"
 #include "hw/boards.h"
target/loongarch/cpu.c +2 -0
index fc075952e6..b26187dfde 100644
@@ -17,7 +17,9 @@
 #include "internals.h"
 #include "fpu/softfloat-helpers.h"
 #include "cpu-csr.h"
+#ifndef CONFIG_USER_ONLY
 #include "sysemu/reset.h"
+#endif
 #include "tcg/tcg.h"
 #include "vec.h"
 
Signature · 1 line
2.41.0
#15 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 5 lines · Philippe Mathieu-Daudé

Philippe Mathieu-Daudé (4):
hw/ppc/spapr_hcall: Remove unused 'exec/exec-all.h' included header hw/misc/mips_itu: Remove unnecessary 'exec/exec-all.h' header hw/s390x/ipl: Remove unused 'exec/exec-all.h' included header
target: Restrict 'sysemu/reset.h' to system emulation

Thanks Thomas for also merging these :)