From nobody Mon Feb 9 12:10:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633629390; cv=none; d=zohomail.com; s=zohoarc; b=bkxnXxrP8RmkYDKb+23tOhnVdgL5tAsJmrY26vIjAQBRabbE8sUaAXMP9UsvB30IWi+wPexU7hoCl67abhZOLQBohIm/Gf7tI8GQkRk/S0//3CWhjGm54nuUEpHItxA5DW/2mHNqS/LhM1XWb417Lpkk2Ude8w6GNLfGHfahBjs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633629390; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=7fgw+iLF03hU/h1yPH0+fm9VyX2b04jOBSqyKLGZY2M=; b=k3ae+189EgAt4mfcdGxA5wAOfGRP62ZCFq5SBhUQwg0VMV7TgAiQsVyT5nU6u+6BUxmZAWB4DsiUHX2YPI7xUfsT+kVLxtYz4PJAx9ljTsclP0+vCVjV59aU3Gl6hV09upu/XmnR+tOTb6oBCPMS5I3kqB1ynmheyzlv2uGsY88= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1633629390921706.1739004485349; Thu, 7 Oct 2021 10:56:30 -0700 (PDT) Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-588-L2rfOHV8PT2suXYxyC1oQA-1; Thu, 07 Oct 2021 13:56:28 -0400 Received: by mail-wr1-f72.google.com with SMTP id d13-20020adfa34d000000b00160aa1cc5f1so5318482wrb.14 for ; Thu, 07 Oct 2021 10:56:28 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id u17sm16972wrw.85.2021.10.07.10.56.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Oct 2021 10:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633629389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7fgw+iLF03hU/h1yPH0+fm9VyX2b04jOBSqyKLGZY2M=; b=RfkT3lBABTRUzGT6I6V4BX8OIVmw9KXXXGhrlw1B+zAUqApMO9v7s+vlO1LbIcjEpc2Fa6 TkSi/Y4zIM7hAFoOyRv1ZXfIY7D0YOJMfAvlUJzQGC4Mn1NxJLXO7ft1X1BM/GHKDyCaZq xYpsbzXzsK9QtlVav9JBz196YZjEE3E= X-MC-Unique: L2rfOHV8PT2suXYxyC1oQA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7fgw+iLF03hU/h1yPH0+fm9VyX2b04jOBSqyKLGZY2M=; b=qxEF5cHm1F364UxYcreEsvrCZ2MaRfXXlhOkdQoZ+SPPWCoNqt59ECp5pK/IyhJlKR v35odUIaNeG5+AV1BrOWj7TIXC/e+WaTXy+oVFTgVOBhfGhg96Ozh4UZnZnKNO5G5oZm LIyrFIl67H+/Kz+KpLalmvgb2MHY9ug8Qne/Fh+t7APSKa56uiBlLLYn91SItrDvTPyE IMbhuLUTWzV+h+sog+xMHWvrMOgEjiDDa4U0ll94q+ROf5A1eCVMYGdVo+7mynYELFuX 9xEHtRYc0C0JWei6B15gyE2mY7Wz0FLgUVp3t0fTRHGdWiNUAugVZpMuRU09324KqlAc 1gGA== X-Gm-Message-State: AOAM53143nkpRd6zdaSuHpMbUIYVCv9bdlKKsd8cTgbryoHzlhKRRKtd shgBqi5jFlmV0/1YDtBKlE4qnxwD4xQ8lP06DedL+4R/gdTg9vnvG6zquL+6wC96BY4cjJ1M1Kd wtNp9UzpRGWqDVw== X-Received: by 2002:adf:bc48:: with SMTP id a8mr7118422wrh.19.1633629387536; Thu, 07 Oct 2021 10:56:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXg09UIXw/PyR6YZ0rdSVYedZwnDWbseQ9/cXgBGURa/nqhgWO7NiRH37q/7DEC7ugy6Ootw== X-Received: by 2002:adf:bc48:: with SMTP id a8mr7118401wrh.19.1633629387335; Thu, 07 Oct 2021 10:56:27 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Eduardo Habkost , Yang Zhong , Marcel Apfelbaum , Richard Henderson , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= 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 Message-Id: <20211007175612.496366-4-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211007175612.496366-1-philmd@redhat.com> References: <20211007175612.496366-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633629392523100003 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 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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" =20 SGXInfo *sgx_get_info(Error **errp); -SGXInfo *sgx_get_capabilities(Error **errp); =20 #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" =20 SGXInfo *sgx_get_info(Error **errp) { @@ -9,7 +11,7 @@ SGXInfo *sgx_get_info(Error **errp) return NULL; } =20 -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; } =20 -SGXInfo *sgx_get_capabilities(Error **errp) +SGXInfo *qmp_query_sgx_capabilities(Error **errp) { SGXInfo *info =3D 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); -} --=20 2.31.1