All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Zhong <yang.zhong@intel.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: yang.zhong@intel.com, pbonzini@redhat.com, eblake@redhat.com,
	qemu-devel@nongnu.org, seanjc@google.com
Subject: Re: [PATCH 5/7] qmp: Add the qmp_query_sgx_capabilities()
Date: Thu, 9 Sep 2021 20:06:46 +0800	[thread overview]
Message-ID: <20210909120646.GG21362@yangzhon-Virtual> (raw)
In-Reply-To: <a36ebd16-3cef-7287-9bd3-9a08b99ba1e9@redhat.com>

On Thu, Sep 09, 2021 at 11:36:58AM +0200, Philippe Mathieu-Daudé wrote:
> On 9/9/21 4:51 AM, Yang Zhong wrote:
> > On Wed, Sep 08, 2021 at 10:38:59AM +0200, Philippe Mathieu-Daudé wrote:
> >> On 9/8/21 10:19 AM, Yang Zhong wrote:
> >>> Libvirt can use qmp_query_sgx_capabilities() to get the host
> >>> sgx capabilities.
> >>>
> >>> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> >>> ---
> >>>  hw/i386/sgx.c              | 66 ++++++++++++++++++++++++++++++++++++++
> >>>  include/hw/i386/sgx.h      |  1 +
> >>>  qapi/misc-target.json      | 18 +++++++++++
> >>>  target/i386/monitor.c      |  5 +++
> >>>  tests/qtest/qmp-cmd-test.c |  1 +
> >>>  5 files changed, 91 insertions(+)
> >>
> >>> +SGXInfo *sgx_get_capabilities(Error **errp)
> >>> +{
> >>> +    SGXInfo *info = NULL;
> >>> +    uint32_t eax, ebx, ecx, edx;
> >>> +
> >>> +    int fd = qemu_open_old("/dev/sgx_vepc", O_RDWR);
> >>> +    if (fd < 0) {
> >>> +        error_setg(errp, "SGX is not enabled in KVM");
> >>> +        return NULL;
> >>> +    }
> >>
> >> Is this Linux specific?
> > 
> >   Philippe, The /dev/sgx_vepc node is used for KVM side to expose the SGX
> >   EPC section to guest. Libvirt then use the '-machine none' qemu command 
> >   to query host SGX capabilities(especially for host SGX EPC section size)
> >   to decide how many SGX VMs will be started in server. If this node doesn't
> >   exist, the reason is host can't support SGX or SGX KVM module is not compiled
> >   in the kernel. thanks!
> 
> Sorry but you didn't answer my question in an obvious way... Yes or no?

  Yes, this is Linux specific. thanks!
  
  Yang


  reply	other threads:[~2021-09-09 12:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-08  8:19 [PATCH 0/7] The HMP/QMP interfaces in Qemu SGX Yang Zhong
2021-09-08  8:19 ` [PATCH 1/7] qmp: Add query-sgx command Yang Zhong
2021-09-08  8:19 ` [PATCH 2/7] hmp: Add 'info sgx' command Yang Zhong
2021-09-08  8:19 ` [PATCH 3/7] i386: Add sgx_get_info() interface Yang Zhong
2021-09-08  8:32   ` Philippe Mathieu-Daudé
2021-09-09  2:20     ` Yang Zhong
2021-09-08  8:55   ` Paolo Bonzini
2021-09-09  7:05     ` Yang Zhong
2021-09-08  8:19 ` [PATCH 4/7] bitops: Support 32 and 64 bit mask macro Yang Zhong
2021-09-08  8:34   ` Philippe Mathieu-Daudé
2021-09-09  2:04     ` Yang Zhong
2021-09-08  8:19 ` [PATCH 5/7] qmp: Add the qmp_query_sgx_capabilities() Yang Zhong
2021-09-08  8:38   ` Philippe Mathieu-Daudé
2021-09-09  2:51     ` Yang Zhong
2021-09-09  9:36       ` Philippe Mathieu-Daudé
2021-09-09 12:06         ` Yang Zhong [this message]
2021-09-09 13:25           ` Philippe Mathieu-Daudé
2021-09-08  8:19 ` [PATCH 6/7] monitor: Fix coredump issue in non-x86 platform Yang Zhong
2021-09-08  8:53   ` Philippe Mathieu-Daudé
2021-09-08  8:54   ` Paolo Bonzini
2021-09-09  6:48     ` Yang Zhong
2021-09-08  8:19 ` [PATCH 7/7] pc: Cleanup the SGX definitions Yang Zhong

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=20210909120646.GG21362@yangzhon-Virtual \
    --to=yang.zhong@intel.com \
    --cc=eblake@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=seanjc@google.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.