From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Claudio Fontana" <cfontana@suse.de>,
"Laurent Vivier" <laurent@vivier.eu>
Subject: [PATCH 03/11] exec: Restrict cputlb.h to sysemu/
Date: Mon, 17 May 2021 13:11:03 +0200 [thread overview]
Message-ID: <20210517111111.1068153-4-f4bug@amsat.org> (raw)
In-Reply-To: <20210517111111.1068153-1-f4bug@amsat.org>
To make it clearer the cputlb.h header is sysemu specific,
move it to the sysemu/ directory.
Patch created mechanically using:
$ sed -i s,exec/cputlb.h,exec/sysemu/cputlb.h, $(git grep -l exec/cputlb.h)
Then the #ifdef'ry conditional on CONFIG_USER_ONLY has
been replaced by an #error.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
include/exec/{ => sysemu}/cputlb.h | 11 +++++++----
accel/tcg/cputlb.c | 2 +-
accel/tcg/translate-all.c | 6 +++---
MAINTAINERS | 1 +
4 files changed, 12 insertions(+), 8 deletions(-)
rename include/exec/{ => sysemu}/cputlb.h (86%)
diff --git a/include/exec/cputlb.h b/include/exec/sysemu/cputlb.h
similarity index 86%
rename from include/exec/cputlb.h
rename to include/exec/sysemu/cputlb.h
index 19b16e58f84..5a37a870343 100644
--- a/include/exec/cputlb.h
+++ b/include/exec/sysemu/cputlb.h
@@ -17,15 +17,18 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef CPUTLB_H
-#define CPUTLB_H
+#ifndef EXEC_SYSEMU_CPUTLB_H
+#define EXEC_SYSEMU_CPUTLB_H
+
+#ifdef CONFIG_USER_ONLY
+#error Cannot include sysemu specific header from user emulation
+#endif
#include "exec/cpu-common.h"
-#if !defined(CONFIG_USER_ONLY)
/* cputlb.c */
void tlb_protect_code(ram_addr_t ram_addr);
void tlb_unprotect_code(ram_addr_t ram_addr);
void tlb_flush_counts(size_t *full, size_t *part, size_t *elide);
-#endif
+
#endif
diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index 84e7d91a5ca..452029e8193 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -23,7 +23,7 @@
#include "exec/exec-all.h"
#include "exec/memory.h"
#include "exec/cpu_ldst.h"
-#include "exec/cputlb.h"
+#include "exec/sysemu/cputlb.h"
#include "exec/tb-hash.h"
#include "exec/memory-internal.h"
#include "exec/ram_addr.h"
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index ae7e873713a..98a07ce4e4e 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -42,11 +42,11 @@
#include <libutil.h>
#endif
#endif
-#else
+#else /* !CONFIG_USER_ONLY */
+#include "exec/sysemu/cputlb.h"
#include "exec/ram_addr.h"
-#endif
+#endif /* CONFIG_USER_ONLY */
-#include "exec/cputlb.h"
#include "exec/tb-hash.h"
#include "exec/translate-all.h"
#include "qemu/bitmap.h"
diff --git a/MAINTAINERS b/MAINTAINERS
index f1ae9934349..4378ec47a2c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -131,6 +131,7 @@ F: include/exec/helper*.h
F: include/exec/tb-hash.h
F: include/exec/sysemu/hwaddr.h
F: include/sysemu/cpus.h
+F: include/exec/sysemu/cputlb.h
F: include/sysemu/tcg.h
F: include/hw/core/tcg-cpu-ops.h
--
2.26.3
next prev parent reply other threads:[~2021-05-17 11:40 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-17 11:11 [PATCH 00/11] exec: Restrict various system emulation specific headers (to sysemu) Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 01/11] NOTFORMERGE target/arm: Restrict KVM files to softmmu Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 02/11] exec: Restrict hwaddr.h to sysemu/ Philippe Mathieu-Daudé
2021-05-26 18:15 ` Richard Henderson
2022-12-06 14:32 ` Philippe Mathieu-Daudé
2022-12-06 14:40 ` Philippe Mathieu-Daudé
2022-12-06 14:53 ` Claudio Fontana
2022-12-06 15:38 ` Claudio Fontana
2022-12-06 17:09 ` Philippe Mathieu-Daudé
2022-12-06 17:17 ` Richard Henderson
2022-12-07 10:09 ` Claudio Fontana
2022-12-06 15:01 ` Peter Maydell
2021-05-17 11:11 ` Philippe Mathieu-Daudé [this message]
2021-05-17 11:11 ` [PATCH 04/11] exec: Restrict memory.h " Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 05/11] exec: Restrict memory-internal.h " Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 06/11] exec: Restrict address-spaces.h " Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 07/11] exec: Extract CPU I/O instructions to "cpu-io.h" Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 08/11] exec: Restrict ioport.h to sysemu/ Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 09/11] exec: Restrict ram_addr.h " Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 10/11] exec: Restrict ramblock.h " Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 11/11] exec: Restrict confidential-guest-support.h " Philippe Mathieu-Daudé
2021-05-25 14:13 ` [PATCH 00/11] exec: Restrict various system emulation specific headers (to sysemu) Philippe Mathieu-Daudé
2021-11-06 14:58 ` Philippe Mathieu-Daudé
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=20210517111111.1068153-4-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=cfontana@suse.de \
--cc=laurent@vivier.eu \
--cc=pbonzini@redhat.com \
--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).