qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] exec: Restrict memory-internal.h to system/
@ 2025-03-17 16:13 Philippe Mathieu-Daudé
  2025-03-17 16:13 ` [PATCH 1/2] accel/tcg: Remove unnecesary inclusion of memory-internal.h in cputlb.c Philippe Mathieu-Daudé
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-17 16:13 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Xu, Pierrick Bouvier, David Hildenbrand, Paolo Bonzini,
	Richard Henderson, Philippe Mathieu-Daudé

Only file units within the system/ directory need access to
"memory-internal.h". Move it to system/ to restrict its scope.

Based-on: <20250314173139.2122904-1-pierrick.bouvier@linaro.org>

Philippe Mathieu-Daudé (2):
  accel/tcg: Remove unnecesary inclusion of memory-internal.h in
    cputlb.c
  exec: Restrict memory-internal.h to system/

 MAINTAINERS                                | 2 +-
 {include/exec => system}/memory-internal.h | 6 ------
 accel/tcg/cputlb.c                         | 1 -
 system/memory.c                            | 3 ++-
 system/physmem.c                           | 3 ++-
 5 files changed, 5 insertions(+), 10 deletions(-)
 rename {include/exec => system}/memory-internal.h (88%)

-- 
2.47.1



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

* [PATCH 1/2] accel/tcg: Remove unnecesary inclusion of memory-internal.h in cputlb.c
  2025-03-17 16:13 [PATCH 0/2] exec: Restrict memory-internal.h to system/ Philippe Mathieu-Daudé
@ 2025-03-17 16:13 ` Philippe Mathieu-Daudé
  2025-03-17 16:23   ` Pierrick Bouvier
  2025-03-17 16:13 ` [PATCH 2/2] exec: Restrict memory-internal.h to system/ Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-17 16:13 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Xu, Pierrick Bouvier, David Hildenbrand, Paolo Bonzini,
	Richard Henderson, Philippe Mathieu-Daudé

At some point cputlb.c stopped depending on the
"exec/memory-internal.h" header. Clean that now.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 accel/tcg/cputlb.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index fb22048876e..5007bdbcd75 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -26,7 +26,6 @@
 #include "exec/cpu_ldst.h"
 #include "exec/cputlb.h"
 #include "exec/tb-flush.h"
-#include "exec/memory-internal.h"
 #include "exec/ram_addr.h"
 #include "exec/mmu-access-type.h"
 #include "exec/tlb-common.h"
-- 
2.47.1



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

* [PATCH 2/2] exec: Restrict memory-internal.h to system/
  2025-03-17 16:13 [PATCH 0/2] exec: Restrict memory-internal.h to system/ Philippe Mathieu-Daudé
  2025-03-17 16:13 ` [PATCH 1/2] accel/tcg: Remove unnecesary inclusion of memory-internal.h in cputlb.c Philippe Mathieu-Daudé
@ 2025-03-17 16:13 ` Philippe Mathieu-Daudé
  2025-03-17 16:15 ` [PATCH 0/2] " David Hildenbrand
  2025-03-17 18:06 ` Richard Henderson
  3 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-17 16:13 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Xu, Pierrick Bouvier, David Hildenbrand, Paolo Bonzini,
	Richard Henderson, Philippe Mathieu-Daudé

Only file units within the system/ directory need access to
"memory-internal.h". Restrict its scope by moving it there.

The comment from commit 9d70618c684 ("memory-internal.h:
Remove obsolete claim that header is obsolete") is now obsolete,
remove it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 MAINTAINERS                                | 2 +-
 {include/exec => system}/memory-internal.h | 6 ------
 system/memory.c                            | 3 ++-
 system/physmem.c                           | 3 ++-
 4 files changed, 5 insertions(+), 9 deletions(-)
 rename {include/exec => system}/memory-internal.h (88%)

diff --git a/MAINTAINERS b/MAINTAINERS
index 8f470a1c9b7..b9f6c3cf15c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3115,7 +3115,7 @@ F: system/ioport.c
 F: system/memory.c
 F: system/memory_mapping.c
 F: system/physmem.c
-F: include/exec/memory-internal.h
+F: system/memory-internal.h
 F: scripts/coccinelle/memory-region-housekeeping.cocci
 
 Memory devices
diff --git a/include/exec/memory-internal.h b/system/memory-internal.h
similarity index 88%
rename from include/exec/memory-internal.h
rename to system/memory-internal.h
index c75178a3d6b..085e81a9fe4 100644
--- a/include/exec/memory-internal.h
+++ b/system/memory-internal.h
@@ -11,12 +11,6 @@
  *
  */
 
-/*
- * This header is for use by exec.c, memory.c and accel/tcg/cputlb.c ONLY,
- * for declarations which are shared between the memory subsystem's
- * internals and the TCG TLB code. Do not include it from elsewhere.
- */
-
 #ifndef MEMORY_INTERNAL_H
 #define MEMORY_INTERNAL_H
 
diff --git a/system/memory.c b/system/memory.c
index eddd21a6cdb..f9b34cf4254 100644
--- a/system/memory.c
+++ b/system/memory.c
@@ -25,7 +25,6 @@
 #include "qom/object.h"
 #include "trace.h"
 
-#include "exec/memory-internal.h"
 #include "exec/ram_addr.h"
 #include "system/kvm.h"
 #include "system/runstate.h"
@@ -35,6 +34,8 @@
 #include "migration/vmstate.h"
 #include "exec/address-spaces.h"
 
+#include "memory-internal.h"
+
 //#define DEBUG_UNASSIGNED
 
 static unsigned memory_region_transaction_depth;
diff --git a/system/physmem.c b/system/physmem.c
index e97de3ef65c..d4fbda9310d 100644
--- a/system/physmem.c
+++ b/system/physmem.c
@@ -66,7 +66,6 @@
 #include "qemu/main-loop.h"
 #include "system/replay.h"
 
-#include "exec/memory-internal.h"
 #include "exec/ram_addr.h"
 
 #include "qemu/pmem.h"
@@ -88,6 +87,8 @@
 #include <daxctl/libdaxctl.h>
 #endif
 
+#include "memory-internal.h"
+
 //#define DEBUG_SUBPAGE
 
 /* ram_list is read under rcu_read_lock()/rcu_read_unlock().  Writes
-- 
2.47.1



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

* Re: [PATCH 0/2] exec: Restrict memory-internal.h to system/
  2025-03-17 16:13 [PATCH 0/2] exec: Restrict memory-internal.h to system/ Philippe Mathieu-Daudé
  2025-03-17 16:13 ` [PATCH 1/2] accel/tcg: Remove unnecesary inclusion of memory-internal.h in cputlb.c Philippe Mathieu-Daudé
  2025-03-17 16:13 ` [PATCH 2/2] exec: Restrict memory-internal.h to system/ Philippe Mathieu-Daudé
@ 2025-03-17 16:15 ` David Hildenbrand
  2025-03-17 18:06 ` Richard Henderson
  3 siblings, 0 replies; 6+ messages in thread
From: David Hildenbrand @ 2025-03-17 16:15 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Xu, Pierrick Bouvier, Paolo Bonzini, Richard Henderson

On 17.03.25 17:13, Philippe Mathieu-Daudé wrote:
> Only file units within the system/ directory need access to
> "memory-internal.h". Move it to system/ to restrict its scope.
> 
> Based-on: <20250314173139.2122904-1-pierrick.bouvier@linaro.org>

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Cheers,

David / dhildenb



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

* Re: [PATCH 1/2] accel/tcg: Remove unnecesary inclusion of memory-internal.h in cputlb.c
  2025-03-17 16:13 ` [PATCH 1/2] accel/tcg: Remove unnecesary inclusion of memory-internal.h in cputlb.c Philippe Mathieu-Daudé
@ 2025-03-17 16:23   ` Pierrick Bouvier
  0 siblings, 0 replies; 6+ messages in thread
From: Pierrick Bouvier @ 2025-03-17 16:23 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Xu, David Hildenbrand, Paolo Bonzini, Richard Henderson

On 3/17/25 09:13, Philippe Mathieu-Daudé wrote:
> At some point cputlb.c stopped depending on the
> "exec/memory-internal.h" header. Clean that now.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   accel/tcg/cputlb.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
> index fb22048876e..5007bdbcd75 100644
> --- a/accel/tcg/cputlb.c
> +++ b/accel/tcg/cputlb.c
> @@ -26,7 +26,6 @@
>   #include "exec/cpu_ldst.h"
>   #include "exec/cputlb.h"
>   #include "exec/tb-flush.h"
> -#include "exec/memory-internal.h"
>   #include "exec/ram_addr.h"
>   #include "exec/mmu-access-type.h"
>   #include "exec/tlb-common.h"

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>


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

* Re: [PATCH 0/2] exec: Restrict memory-internal.h to system/
  2025-03-17 16:13 [PATCH 0/2] exec: Restrict memory-internal.h to system/ Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2025-03-17 16:15 ` [PATCH 0/2] " David Hildenbrand
@ 2025-03-17 18:06 ` Richard Henderson
  3 siblings, 0 replies; 6+ messages in thread
From: Richard Henderson @ 2025-03-17 18:06 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Xu, Pierrick Bouvier, David Hildenbrand, Paolo Bonzini

On 3/17/25 09:13, Philippe Mathieu-Daudé wrote:
> Only file units within the system/ directory need access to
> "memory-internal.h". Move it to system/ to restrict its scope.
> 
> Based-on: <20250314173139.2122904-1-pierrick.bouvier@linaro.org>
> 
> Philippe Mathieu-Daudé (2):
>    accel/tcg: Remove unnecesary inclusion of memory-internal.h in
>      cputlb.c
>    exec: Restrict memory-internal.h to system/
> 
>   MAINTAINERS                                | 2 +-
>   {include/exec => system}/memory-internal.h | 6 ------
>   accel/tcg/cputlb.c                         | 1 -
>   system/memory.c                            | 3 ++-
>   system/physmem.c                           | 3 ++-
>   5 files changed, 5 insertions(+), 10 deletions(-)
>   rename {include/exec => system}/memory-internal.h (88%)
> 

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


r~


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

end of thread, other threads:[~2025-03-17 18:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-17 16:13 [PATCH 0/2] exec: Restrict memory-internal.h to system/ Philippe Mathieu-Daudé
2025-03-17 16:13 ` [PATCH 1/2] accel/tcg: Remove unnecesary inclusion of memory-internal.h in cputlb.c Philippe Mathieu-Daudé
2025-03-17 16:23   ` Pierrick Bouvier
2025-03-17 16:13 ` [PATCH 2/2] exec: Restrict memory-internal.h to system/ Philippe Mathieu-Daudé
2025-03-17 16:15 ` [PATCH 0/2] " David Hildenbrand
2025-03-17 18: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).