All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Yang Zhong" <yang.zhong@intel.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: [PATCH 3/4] hw/i386/sgx: Move qmp_query_sgx_capabilities() to hw/i386/sgx.c
Date: Thu,  7 Oct 2021 19:56:11 +0200	[thread overview]
Message-ID: <20211007175612.496366-4-philmd@redhat.com> (raw)
In-Reply-To: <20211007175612.496366-1-philmd@redhat.com>

Move qmp_query_sgx_capabilities() from target/i386/monitor.c to
hw/i386/sgx.c, removing the sgx_get_capabilities() indirection.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 include/hw/i386/sgx.h | 1 -
 hw/i386/sgx-stub.c    | 4 +++-
 hw/i386/sgx.c         | 3 ++-
 target/i386/monitor.c | 5 -----
 4 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/include/hw/i386/sgx.h b/include/hw/i386/sgx.h
index 16fc25725c4..2bf90b3f4fe 100644
--- a/include/hw/i386/sgx.h
+++ b/include/hw/i386/sgx.h
@@ -7,6 +7,5 @@
 #include "qapi/qapi-types-misc-target.h"
 
 SGXInfo *sgx_get_info(Error **errp);
-SGXInfo *sgx_get_capabilities(Error **errp);
 
 #endif
diff --git a/hw/i386/sgx-stub.c b/hw/i386/sgx-stub.c
index 45c473119ef..3749656db1a 100644
--- a/hw/i386/sgx-stub.c
+++ b/hw/i386/sgx-stub.c
@@ -2,6 +2,8 @@
 #include "hw/i386/pc.h"
 #include "hw/i386/sgx-epc.h"
 #include "hw/i386/sgx.h"
+#include "qapi/error.h"
+#include "qapi/qapi-commands-misc-target.h"
 
 SGXInfo *sgx_get_info(Error **errp)
 {
@@ -9,7 +11,7 @@ SGXInfo *sgx_get_info(Error **errp)
     return NULL;
 }
 
-SGXInfo *sgx_get_capabilities(Error **errp)
+SGXInfo *qmp_query_sgx_capabilities(Error **errp)
 {
     error_setg(errp, "SGX support is not compiled in");
     return NULL;
diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c
index 29724ff8f08..713f1363433 100644
--- a/hw/i386/sgx.c
+++ b/hw/i386/sgx.c
@@ -16,6 +16,7 @@
 #include "hw/mem/memory-device.h"
 #include "monitor/qdev.h"
 #include "qapi/error.h"
+#include "qapi/qapi-commands-misc-target.h"
 #include "exec/address-spaces.h"
 #include "hw/i386/sgx.h"
 #include "sysemu/hw_accel.h"
@@ -57,7 +58,7 @@ static uint64_t sgx_calc_host_epc_section_size(void)
     return size;
 }
 
-SGXInfo *sgx_get_capabilities(Error **errp)
+SGXInfo *qmp_query_sgx_capabilities(Error **errp)
 {
     SGXInfo *info = NULL;
     uint32_t eax, ebx, ecx, edx;
diff --git a/target/i386/monitor.c b/target/i386/monitor.c
index 680d282591c..84fba47f193 100644
--- a/target/i386/monitor.c
+++ b/target/i386/monitor.c
@@ -700,8 +700,3 @@ void hmp_info_sgx(Monitor *mon, const QDict *qdict)
     monitor_printf(mon, "size: %" PRIu64 "\n",
                    info->section_size);
 }
-
-SGXInfo *qmp_query_sgx_capabilities(Error **errp)
-{
-    return sgx_get_capabilities(errp);
-}
-- 
2.31.1



  parent reply	other threads:[~2021-10-07 18:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-07 17:56 [PATCH 0/4] hw/i386/sgx: Housekeeping around SGX Philippe Mathieu-Daudé
2021-10-07 17:56 ` [PATCH 1/4] MAINTAINERS: Cover SGX documentation file with X86/KVM section Philippe Mathieu-Daudé
2021-10-07 17:56 ` [PATCH 2/4] hw/i386/sgx: Have sgx_epc_get_section() return a boolean Philippe Mathieu-Daudé
2021-10-09  6:14   ` Yang Zhong
2021-10-07 17:56 ` Philippe Mathieu-Daudé [this message]
2021-10-07 17:56 ` [PATCH 4/4] hw/i386/sgx: Move qmp_query_sgx() and hmp_info_sgx() to hw/i386/sgx.c 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=20211007175612.496366-4-philmd@redhat.com \
    --to=philmd@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=yang.zhong@intel.com \
    /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.