All of lore.kernel.org
 help / color / mirror / Atom feed
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 11/11] exec: Restrict confidential-guest-support.h to sysemu/
Date: Mon, 17 May 2021 13:11:11 +0200	[thread overview]
Message-ID: <20210517111111.1068153-12-f4bug@amsat.org> (raw)
In-Reply-To: <20210517111111.1068153-1-f4bug@amsat.org>

To make it clearer the confidential-guest-support.h header is
sysemu specific, move it to the sysemu/ directory.

Patch created mechanically using:

  $ sed -i s,exec/confidential-guest-support.h,sysemu/confidential-guest-support.h, \
    $(git grep -l exec/confidential-guest-support.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}/confidential-guest-support.h | 6 +++---
 backends/confidential-guest-support.c                 | 2 +-
 hw/core/machine.c                                     | 2 +-
 hw/ppc/pef.c                                          | 2 +-
 hw/s390x/pv.c                                         | 2 +-
 softmmu/vl.c                                          | 2 +-
 target/i386/sev.c                                     | 2 +-
 7 files changed, 9 insertions(+), 9 deletions(-)
 rename include/{exec => sysemu}/confidential-guest-support.h (95%)

diff --git a/include/exec/confidential-guest-support.h b/include/sysemu/confidential-guest-support.h
similarity index 95%
rename from include/exec/confidential-guest-support.h
rename to include/sysemu/confidential-guest-support.h
index ba2dd4b5dfc..3b52d086642 100644
--- a/include/exec/confidential-guest-support.h
+++ b/include/sysemu/confidential-guest-support.h
@@ -18,7 +18,9 @@
 #ifndef QEMU_CONFIDENTIAL_GUEST_SUPPORT_H
 #define QEMU_CONFIDENTIAL_GUEST_SUPPORT_H
 
-#ifndef CONFIG_USER_ONLY
+#ifdef CONFIG_USER_ONLY
+#error Cannot include sysemu specific header from user emulation
+#endif
 
 #include "qom/object.h"
 
@@ -57,6 +59,4 @@ typedef struct ConfidentialGuestSupportClass {
     ObjectClass parent;
 } ConfidentialGuestSupportClass;
 
-#endif /* !CONFIG_USER_ONLY */
-
 #endif /* QEMU_CONFIDENTIAL_GUEST_SUPPORT_H */
diff --git a/backends/confidential-guest-support.c b/backends/confidential-guest-support.c
index 052fde8db04..bc141504451 100644
--- a/backends/confidential-guest-support.c
+++ b/backends/confidential-guest-support.c
@@ -13,7 +13,7 @@
 
 #include "qemu/osdep.h"
 
-#include "exec/confidential-guest-support.h"
+#include "sysemu/confidential-guest-support.h"
 
 OBJECT_DEFINE_ABSTRACT_TYPE(ConfidentialGuestSupport,
                             confidential_guest_support,
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 1bf0e687b94..6ab11140ef0 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -32,7 +32,7 @@
 #include "hw/mem/nvdimm.h"
 #include "migration/global_state.h"
 #include "migration/vmstate.h"
-#include "exec/confidential-guest-support.h"
+#include "sysemu/confidential-guest-support.h"
 #include "hw/virtio/virtio.h"
 #include "hw/virtio/virtio-pci.h"
 
diff --git a/hw/ppc/pef.c b/hw/ppc/pef.c
index 573be3ed79b..d469326a480 100644
--- a/hw/ppc/pef.c
+++ b/hw/ppc/pef.c
@@ -14,7 +14,7 @@
 #include "qom/object_interfaces.h"
 #include "sysemu/kvm.h"
 #include "migration/blocker.h"
-#include "exec/confidential-guest-support.h"
+#include "sysemu/confidential-guest-support.h"
 #include "hw/ppc/pef.h"
 
 #define TYPE_PEF_GUEST "pef-guest"
diff --git a/hw/s390x/pv.c b/hw/s390x/pv.c
index 401b63d6cb6..799d8b047b2 100644
--- a/hw/s390x/pv.c
+++ b/hw/s390x/pv.c
@@ -17,7 +17,7 @@
 #include "qemu/error-report.h"
 #include "sysemu/kvm.h"
 #include "qom/object_interfaces.h"
-#include "exec/confidential-guest-support.h"
+#include "sysemu/confidential-guest-support.h"
 #include "hw/s390x/ipl.h"
 #include "hw/s390x/pv.h"
 
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 93e78469bce..d79c15cd4dc 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -102,7 +102,7 @@
 #include "qemu/plugin.h"
 #include "qemu/queue.h"
 #include "sysemu/arch_init.h"
-#include "exec/confidential-guest-support.h"
+#include "sysemu/confidential-guest-support.h"
 
 #include "ui/qemu-spice.h"
 #include "qapi/string-input-visitor.h"
diff --git a/target/i386/sev.c b/target/i386/sev.c
index 41f7800b5f7..f2a92cf9126 100644
--- a/target/i386/sev.c
+++ b/target/i386/sev.c
@@ -31,7 +31,7 @@
 #include "migration/blocker.h"
 #include "qom/object.h"
 #include "monitor/monitor.h"
-#include "exec/confidential-guest-support.h"
+#include "sysemu/confidential-guest-support.h"
 #include "hw/i386/pc.h"
 
 #define TYPE_SEV_GUEST "sev-guest"
-- 
2.26.3



  parent reply	other threads:[~2021-05-17 11:17 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 ` [PATCH 03/11] exec: Restrict cputlb.h " Philippe Mathieu-Daudé
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 ` Philippe Mathieu-Daudé [this message]
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-12-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.