From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Peter Xu" <peterx@redhat.com>,
"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
"David Hildenbrand" <david@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH 2/2] exec: Restrict memory-internal.h to system/
Date: Mon, 17 Mar 2025 17:13:29 +0100 [thread overview]
Message-ID: <20250317161329.40300-3-philmd@linaro.org> (raw)
In-Reply-To: <20250317161329.40300-1-philmd@linaro.org>
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
next prev parent reply other threads:[~2025-03-17 16:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Philippe Mathieu-Daudé [this message]
2025-03-17 16:15 ` [PATCH 0/2] exec: Restrict memory-internal.h to system/ David Hildenbrand
2025-03-17 18:06 ` Richard Henderson
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=20250317161329.40300-3-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=david@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=pierrick.bouvier@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).