qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] exec: Header cleanups around memory.h/address-spaces.h
@ 2023-06-19  7:41 Philippe Mathieu-Daudé
  2023-06-19  7:41 ` [PATCH 1/4] hw/net/i82596: Include missing 'exec/address-spaces.h' header Philippe Mathieu-Daudé
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-06-19  7:41 UTC (permalink / raw)
  To: qemu-devel
  Cc: kvm, Edgar E. Iglesias, Helge Deller, Paolo Bonzini,
	Richard Henderson, Jason Wang, Philippe Mathieu-Daudé

Trivial header cleanups extracted from bigger series.
Sending separately since somehow unrelated to its goal.

Philippe Mathieu-Daudé (4):
  hw/net/i82596: Include missing 'exec/address-spaces.h' header
  hw/dma/etraxfs: Include missing 'exec/memory.h' header
  exec/address-spaces.h: Remove unuseful 'exec/memory.h' include
  sysemu/kvm: Re-include "exec/memattrs.h" header

 include/exec/address-spaces.h | 2 --
 include/sysemu/kvm.h          | 1 +
 hw/dma/etraxfs_dma.c          | 1 +
 hw/net/i82596.c               | 1 +
 4 files changed, 3 insertions(+), 2 deletions(-)

-- 
2.38.1



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/4] hw/net/i82596: Include missing 'exec/address-spaces.h' header
  2023-06-19  7:41 [PATCH 0/4] exec: Header cleanups around memory.h/address-spaces.h Philippe Mathieu-Daudé
@ 2023-06-19  7:41 ` Philippe Mathieu-Daudé
  2023-06-19  8:05   ` Richard Henderson
  2023-06-19  7:41 ` [PATCH 2/4] hw/dma/etraxfs: Include missing 'exec/memory.h' header Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-06-19  7:41 UTC (permalink / raw)
  To: qemu-devel
  Cc: kvm, Edgar E. Iglesias, Helge Deller, Paolo Bonzini,
	Richard Henderson, Jason Wang, Philippe Mathieu-Daudé

hw/net/i82596.c access the global 'address_space_memory'
calling the ld/st_phys() API. address_space_memory is
declared in "exec/address-spaces.h". Currently this header
is indirectly pulled in via another header. Explicitly include
it to avoid when refactoring unrelated headers:

  hw/net/i82596.c:91:23: error: use of undeclared identifier 'address_space_memory'; did you mean 'address_space_destroy'?
    return ldub_phys(&address_space_memory, addr);
                      ^~~~~~~~~~~~~~~~~~~~
                      address_space_destroy

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/net/i82596.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/net/i82596.c b/hw/net/i82596.c
index ec21e2699a..9b9e3aa792 100644
--- a/hw/net/i82596.c
+++ b/hw/net/i82596.c
@@ -15,6 +15,7 @@
 #include "hw/irq.h"
 #include "hw/qdev-properties.h"
 #include "migration/vmstate.h"
+#include "exec/address-spaces.h"
 #include "qemu/module.h"
 #include "trace.h"
 #include "i82596.h"
-- 
2.38.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/4] hw/dma/etraxfs: Include missing 'exec/memory.h' header
  2023-06-19  7:41 [PATCH 0/4] exec: Header cleanups around memory.h/address-spaces.h Philippe Mathieu-Daudé
  2023-06-19  7:41 ` [PATCH 1/4] hw/net/i82596: Include missing 'exec/address-spaces.h' header Philippe Mathieu-Daudé
@ 2023-06-19  7:41 ` Philippe Mathieu-Daudé
  2023-06-19  8:05   ` Richard Henderson
  2023-06-19  7:41 ` [PATCH 3/4] exec/address-spaces.h: Remove unuseful 'exec/memory.h' include Philippe Mathieu-Daudé
  2023-06-19  7:41 ` [PATCH 4/4] sysemu/kvm: Re-include "exec/memattrs.h" header Philippe Mathieu-Daudé
  3 siblings, 1 reply; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-06-19  7:41 UTC (permalink / raw)
  To: qemu-devel
  Cc: kvm, Edgar E. Iglesias, Helge Deller, Paolo Bonzini,
	Richard Henderson, Jason Wang, Philippe Mathieu-Daudé

The 'fs_dma_ctrl' structure has a MemoryRegion 'mmio' field
which is initialized in etraxfs_dmac_init() calling
memory_region_init_io() and memory_region_add_subregion().

These functions are declared in "exec/memory.h", along with
the MemoryRegion structure. Include the missing header.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/dma/etraxfs_dma.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/dma/etraxfs_dma.c b/hw/dma/etraxfs_dma.c
index a1068b19ea..9c0003de51 100644
--- a/hw/dma/etraxfs_dma.c
+++ b/hw/dma/etraxfs_dma.c
@@ -28,6 +28,7 @@
 #include "qemu/main-loop.h"
 #include "sysemu/runstate.h"
 #include "exec/address-spaces.h"
+#include "exec/memory.h"
 
 #include "hw/cris/etraxfs_dma.h"
 
-- 
2.38.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/4] exec/address-spaces.h: Remove unuseful 'exec/memory.h' include
  2023-06-19  7:41 [PATCH 0/4] exec: Header cleanups around memory.h/address-spaces.h Philippe Mathieu-Daudé
  2023-06-19  7:41 ` [PATCH 1/4] hw/net/i82596: Include missing 'exec/address-spaces.h' header Philippe Mathieu-Daudé
  2023-06-19  7:41 ` [PATCH 2/4] hw/dma/etraxfs: Include missing 'exec/memory.h' header Philippe Mathieu-Daudé
@ 2023-06-19  7:41 ` Philippe Mathieu-Daudé
  2023-06-19  8:06   ` Richard Henderson
  2023-06-19  7:41 ` [PATCH 4/4] sysemu/kvm: Re-include "exec/memattrs.h" header Philippe Mathieu-Daudé
  3 siblings, 1 reply; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-06-19  7:41 UTC (permalink / raw)
  To: qemu-devel
  Cc: kvm, Edgar E. Iglesias, Helge Deller, Paolo Bonzini,
	Richard Henderson, Jason Wang, Philippe Mathieu-Daudé

"exec/address-spaces.h" declares get_system_io() and
get_system_memory(), both returning a MemoryRegion pointer.
MemoryRegion is forward declared in "qemu/typedefs.h", so
we don't need any declaration from "exec/memory.h" here.
Remove it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/exec/address-spaces.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/exec/address-spaces.h b/include/exec/address-spaces.h
index db8bfa9a92..0d0aa61d68 100644
--- a/include/exec/address-spaces.h
+++ b/include/exec/address-spaces.h
@@ -19,8 +19,6 @@
  * you're one of them.
  */
 
-#include "exec/memory.h"
-
 #ifndef CONFIG_USER_ONLY
 
 /* Get the root memory region.  This interface should only be used temporarily
-- 
2.38.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/4] sysemu/kvm: Re-include "exec/memattrs.h" header
  2023-06-19  7:41 [PATCH 0/4] exec: Header cleanups around memory.h/address-spaces.h Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2023-06-19  7:41 ` [PATCH 3/4] exec/address-spaces.h: Remove unuseful 'exec/memory.h' include Philippe Mathieu-Daudé
@ 2023-06-19  7:41 ` Philippe Mathieu-Daudé
  2023-06-19  8:06   ` Richard Henderson
  3 siblings, 1 reply; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-06-19  7:41 UTC (permalink / raw)
  To: qemu-devel
  Cc: kvm, Edgar E. Iglesias, Helge Deller, Paolo Bonzini,
	Richard Henderson, Jason Wang, Philippe Mathieu-Daudé

Commit 1e05888ab5 ("sysemu/kvm: Remove unused headers") was
a bit overzealous while cleaning "sysemu/kvm.h" headers:
kvm_arch_post_run() returns a MemTxAttrs type, so depends on
"exec/memattrs.h" for its definition.

Fixes: 1e05888ab5 ("sysemu/kvm: Remove unused headers")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/sysemu/kvm.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index 88f5ccfbce..528966b5a8 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -14,6 +14,7 @@
 #ifndef QEMU_KVM_H
 #define QEMU_KVM_H
 
+#include "exec/memattrs.h"
 #include "qemu/accel.h"
 #include "qom/object.h"
 
-- 
2.38.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/4] hw/net/i82596: Include missing 'exec/address-spaces.h' header
  2023-06-19  7:41 ` [PATCH 1/4] hw/net/i82596: Include missing 'exec/address-spaces.h' header Philippe Mathieu-Daudé
@ 2023-06-19  8:05   ` Richard Henderson
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Henderson @ 2023-06-19  8:05 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: kvm, Edgar E. Iglesias, Helge Deller, Paolo Bonzini, Jason Wang

On 6/19/23 09:41, Philippe Mathieu-Daudé wrote:
> hw/net/i82596.c access the global 'address_space_memory'
> calling the ld/st_phys() API. address_space_memory is
> declared in "exec/address-spaces.h". Currently this header
> is indirectly pulled in via another header. Explicitly include
> it to avoid when refactoring unrelated headers:
> 
>    hw/net/i82596.c:91:23: error: use of undeclared identifier 'address_space_memory'; did you mean 'address_space_destroy'?
>      return ldub_phys(&address_space_memory, addr);
>                        ^~~~~~~~~~~~~~~~~~~~
>                        address_space_destroy
> 
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   hw/net/i82596.c | 1 +
>   1 file changed, 1 insertion(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/4] hw/dma/etraxfs: Include missing 'exec/memory.h' header
  2023-06-19  7:41 ` [PATCH 2/4] hw/dma/etraxfs: Include missing 'exec/memory.h' header Philippe Mathieu-Daudé
@ 2023-06-19  8:05   ` Richard Henderson
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Henderson @ 2023-06-19  8:05 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: kvm, Edgar E. Iglesias, Helge Deller, Paolo Bonzini, Jason Wang

On 6/19/23 09:41, Philippe Mathieu-Daudé wrote:
> The 'fs_dma_ctrl' structure has a MemoryRegion 'mmio' field
> which is initialized in etraxfs_dmac_init() calling
> memory_region_init_io() and memory_region_add_subregion().
> 
> These functions are declared in "exec/memory.h", along with
> the MemoryRegion structure. Include the missing header.
> 
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   hw/dma/etraxfs_dma.c | 1 +
>   1 file changed, 1 insertion(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/4] exec/address-spaces.h: Remove unuseful 'exec/memory.h' include
  2023-06-19  7:41 ` [PATCH 3/4] exec/address-spaces.h: Remove unuseful 'exec/memory.h' include Philippe Mathieu-Daudé
@ 2023-06-19  8:06   ` Richard Henderson
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Henderson @ 2023-06-19  8:06 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: kvm, Edgar E. Iglesias, Helge Deller, Paolo Bonzini, Jason Wang

On 6/19/23 09:41, Philippe Mathieu-Daudé wrote:
> "exec/address-spaces.h" declares get_system_io() and
> get_system_memory(), both returning a MemoryRegion pointer.
> MemoryRegion is forward declared in "qemu/typedefs.h", so
> we don't need any declaration from "exec/memory.h" here.
> Remove it.
> 
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   include/exec/address-spaces.h | 2 --
>   1 file changed, 2 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 4/4] sysemu/kvm: Re-include "exec/memattrs.h" header
  2023-06-19  7:41 ` [PATCH 4/4] sysemu/kvm: Re-include "exec/memattrs.h" header Philippe Mathieu-Daudé
@ 2023-06-19  8:06   ` Richard Henderson
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Henderson @ 2023-06-19  8:06 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: kvm, Edgar E. Iglesias, Helge Deller, Paolo Bonzini, Jason Wang

On 6/19/23 09:41, Philippe Mathieu-Daudé wrote:
> Commit 1e05888ab5 ("sysemu/kvm: Remove unused headers") was
> a bit overzealous while cleaning "sysemu/kvm.h" headers:
> kvm_arch_post_run() returns a MemTxAttrs type, so depends on
> "exec/memattrs.h" for its definition.
> 
> Fixes: 1e05888ab5 ("sysemu/kvm: Remove unused headers")
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   include/sysemu/kvm.h | 1 +
>   1 file changed, 1 insertion(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-06-19  8:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-19  7:41 [PATCH 0/4] exec: Header cleanups around memory.h/address-spaces.h Philippe Mathieu-Daudé
2023-06-19  7:41 ` [PATCH 1/4] hw/net/i82596: Include missing 'exec/address-spaces.h' header Philippe Mathieu-Daudé
2023-06-19  8:05   ` Richard Henderson
2023-06-19  7:41 ` [PATCH 2/4] hw/dma/etraxfs: Include missing 'exec/memory.h' header Philippe Mathieu-Daudé
2023-06-19  8:05   ` Richard Henderson
2023-06-19  7:41 ` [PATCH 3/4] exec/address-spaces.h: Remove unuseful 'exec/memory.h' include Philippe Mathieu-Daudé
2023-06-19  8:06   ` Richard Henderson
2023-06-19  7:41 ` [PATCH 4/4] sysemu/kvm: Re-include "exec/memattrs.h" header Philippe Mathieu-Daudé
2023-06-19  8:06   ` Richard Henderson

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).