{"id":2222174,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2222174/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-ppc/patch/20260410195323.17937-24-philmd@linaro.org/","project":{"id":69,"url":"http://patchwork.ozlabs.org/api/1.1/projects/69/?format=json","name":"QEMU powerpc development","link_name":"qemu-ppc","list_id":"qemu-ppc.nongnu.org","list_email":"qemu-ppc@nongnu.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260410195323.17937-24-philmd@linaro.org>","date":"2026-04-10T19:53:17","name":"[v2,23/27] monitor: Do not check TARGET_I386 to build 'info sgx' command","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"91b10c164a144108847c7661b6f12708ccec4f42","submitter":{"id":85046,"url":"http://patchwork.ozlabs.org/api/1.1/people/85046/?format=json","name":"Philippe Mathieu-Daudé","email":"philmd@linaro.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-ppc/patch/20260410195323.17937-24-philmd@linaro.org/mbox/","series":[{"id":499497,"url":"http://patchwork.ozlabs.org/api/1.1/series/499497/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-ppc/list/?series=499497","date":"2026-04-10T19:52:55","name":"monitor: Remove need of per-target handlers","version":2,"mbox":"http://patchwork.ozlabs.org/series/499497/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2222174/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2222174/checks/","tags":{},"headers":{"Return-Path":"<qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=n8DmGKHl;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fsndM2wklz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 11 Apr 2026 05:57:11 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-ppc-bounces@nongnu.org>)\n\tid 1wBHxk-0008Hl-T4; Fri, 10 Apr 2026 15:56:20 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1wBHxi-00084s-Mx\n for qemu-ppc@nongnu.org; Fri, 10 Apr 2026 15:56:18 -0400","from mail-wm1-x334.google.com ([2a00:1450:4864:20::334])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1wBHxc-00040T-7v\n for qemu-ppc@nongnu.org; Fri, 10 Apr 2026 15:56:16 -0400","by mail-wm1-x334.google.com with SMTP id\n 5b1f17b1804b1-4838c15e3cbso21861805e9.3\n for <qemu-ppc@nongnu.org>; Fri, 10 Apr 2026 12:56:11 -0700 (PDT)","from localhost.localdomain (88-187-86-199.subs.proxad.net.\n [88.187.86.199]) by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-488d531f2b6sm106301525e9.2.2026.04.10.12.56.09\n (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);\n Fri, 10 Apr 2026 12:56:10 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1775850971; x=1776455771; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=C78IbPBsz6cVs2Ym43RKAMokAYox7chDUSzKqZO66SU=;\n b=n8DmGKHlWSIX4ZQwbtlQ0+D23gzPAAiOsDkskPo8XxYh7NN2Tvrc5mjpylEeRTIdWf\n bHvJExa324wGjoLNN4cZJjZE+c7/NZqILob5JYIk7bJPmPYvZX+W3+riuu0PWKEhZuHB\n 1m9J8UMaGy91gZD1OCQTPKH006rUYUbB0zxQPSGdoX+Ntni236xs11cpgtZZdvYgDHi4\n DX/+y8GVknfROZXOb55OUmjKHqPo8dRns9RiMWx2KsRrzQzQhVCO8ant60gMpiPRqiej\n 9kYKSmSgJly5FLDf8UGV4nLhhRkbJaR5MYo58CjDOBIISqq382JHMxcbv8UmZ/dK6rzF\n xyrQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775850971; x=1776455771;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=C78IbPBsz6cVs2Ym43RKAMokAYox7chDUSzKqZO66SU=;\n b=YXj3U3/N+fQ0y1UaYotQweKbDB78kLPmnSswmUJmlw4O5e3QTeIbWgtOobtOhFJ3YB\n oezWCy52RwoPup6zGW1k8Y6Nx7iQTbHSKYFqtdva+J5q9+Kgf13YqUGxg+8FMlHDAG7I\n l8zGYuMF/JBsFGi/r+AnmlN2EobM3T/sIzjsgQbE0tik4Lz1gCd3vXi+Y2oYjc1eJHQK\n /Aw8t6zZX/Lmjp3pSrj60sBqMCIumXA16pOADxzGUfI34JFimKpEEXG4yFvstHAEgV0z\n MVgf9RhmApPKXlpxyN2AmcatPXdFc2hWqBuo4hVoyplgFMsFxt205PlSWDwhVYWDVc4J\n 2JHQ==","X-Forwarded-Encrypted":"i=1;\n AJvYcCWQeYYBabocyDuLm7+EqPUZV3+tgVy0rcP8YgLJwKOpekIj8geyMUT30xKdLxP3EgTJiuAg1h6qNA==@nongnu.org","X-Gm-Message-State":"AOJu0YypKiDV/iDDRgyd4oHzMusl/1/w6WlTOP0Mp5i8ahCKBkPme6Qn\n 5qa0ypZCJJOHcP3iDr/K64mPY/9Beo0QTtcDIZt2z6jd+QPDxTG3Y8mOj7zstXhZ8ZkGtPLGJqa\n KVRdm0g0=","X-Gm-Gg":"AeBDievKLBw8dsfe8TGhO5YdWe4WSGp7E96loMT45Mxr8RoAVnD2YQ9G5MzA0YB0zsu\n hZ8bje3tRDJ/ess7SUELyAMEkfNiAbguirsRUXjhSja1vByrtV7V5g1b9pKkNxuyMWPYXsz4asn\n /VcrFeRWxKxTJ4qZAFOt2kn1RSt7KmVltBxkg8UnM3cTfeup5oJvoO/Z2novngTKRj1VdlAsRZz\n zqTvYdl58Zo1GNobVJKp0+MOWv/v2wKLfiPW4PljkJ/QNDeNBc5VyBwZetLbige3FtwjPUc7dO6\n oKdpfWU7F+LjO0hBT1Vzh8ZYyj8Pz5ySiY1t4mbt6zf8EO6fqpnlI6rxAGxl9SsMDCXEGjHqIvv\n eBwZw1VKIPRElcW5qA05RMOnDOsfCdz29XbSveKO2SBo/SlL6pFb8TgJhUqt6KP25wdZ7EJDYzO\n 5T9PUlJj3TCDKfOUxyk/4NYkkY6mb2ZNM9W8uh3VZY209wr+XW3AY8y7WpIQgCElwghoDoYmzm","X-Received":"by 2002:a05:600c:45c9:b0:480:4a8f:2d5c with SMTP id\n 5b1f17b1804b1-488d689cf9emr52390385e9.29.1775850970618;\n Fri, 10 Apr 2026 12:56:10 -0700 (PDT)","From":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>","To":"qemu-devel@nongnu.org","Cc":"Richard Henderson <richard.henderson@linaro.org>,\n \"Dr. David Alan Gilbert\" <dave@treblig.org>,\n Pierrick Bouvier <pierrick.bouvier@linaro.org>, qemu-riscv@nongnu.org,\n Markus Armbruster <armbru@redhat.com>, qemu-s390x@nongnu.org,\n kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud?=\n\t=?utf-8?q?=C3=A9?= <philmd@linaro.org>,\n \"Michael S. Tsirkin\" <mst@redhat.com>,\n Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,\n Paolo Bonzini <pbonzini@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>","Subject":"[PATCH v2 23/27] monitor: Do not check TARGET_I386 to build 'info\n sgx' command","Date":"Fri, 10 Apr 2026 21:53:17 +0200","Message-ID":"<20260410195323.17937-24-philmd@linaro.org>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260410195323.17937-1-philmd@linaro.org>","References":"<20260410195323.17937-1-philmd@linaro.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Received-SPF":"pass client-ip=2a00:1450:4864:20::334;\n envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com","X-Spam_score_int":"-20","X-Spam_score":"-2.1","X-Spam_bar":"--","X-Spam_report":"(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-ppc@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<qemu-ppc.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-ppc>,\n <mailto:qemu-ppc-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-ppc>","List-Post":"<mailto:qemu-ppc@nongnu.org>","List-Help":"<mailto:qemu-ppc-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-ppc>,\n <mailto:qemu-ppc-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org"},"content":"This command is filtered at build-time for i386/x86_64 binaries.\nBy using the recently introduced HMPCommand::arch_bitmask flag\nwe can filter it at runtime, making it possible to compile\nhmp-commands-info.hx once.\n\nSince the method depends on the CONFIG_SGX definition, define it\nin its own stub file.\n\nSigned-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>\n---\n MAINTAINERS            |  1 +\n hw/i386/sgx-hmp-stub.c | 16 ++++++++++++++++\n hw/i386/sgx-stub.c     |  5 -----\n hmp-commands-info.hx   |  3 +--\n hw/i386/meson.build    |  1 +\n 5 files changed, 19 insertions(+), 7 deletions(-)\n create mode 100644 hw/i386/sgx-hmp-stub.c","diff":"diff --git a/MAINTAINERS b/MAINTAINERS\nindex 458951bc051..31e973fdeb0 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -514,6 +514,7 @@ L: kvm@vger.kernel.org\n S: Supported\n F: docs/system/i386/amd-memory-encryption.rst\n F: docs/system/i386/sgx.rst\n+F: hw/i386/sgx*\n F: stubs/qmp-i386-sev.c\n F: stubs/qmp-i386-sgx.c\n F: target/i386/kvm/\ndiff --git a/hw/i386/sgx-hmp-stub.c b/hw/i386/sgx-hmp-stub.c\nnew file mode 100644\nindex 00000000000..cf1d9a6344b\n--- /dev/null\n+++ b/hw/i386/sgx-hmp-stub.c\n@@ -0,0 +1,16 @@\n+/*\n+ * Human Monitor 'info sgx' stub (CONFIG_SGX)\n+ *\n+ * Copyright (c) Linaro\n+ *\n+ * SPDX-License-Identifier: GPL-2.0-or-later\n+ */\n+\n+#include \"qemu/osdep.h\"\n+#include \"monitor/hmp.h\"\n+#include \"monitor/monitor.h\"\n+\n+void hmp_info_sgx(Monitor *mon, const QDict *qdict)\n+{\n+    monitor_printf(mon, \"SGX is not available in this QEMU\\n\");\n+}\ndiff --git a/hw/i386/sgx-stub.c b/hw/i386/sgx-stub.c\nindex 6e82773a86d..59d58926311 100644\n--- a/hw/i386/sgx-stub.c\n+++ b/hw/i386/sgx-stub.c\n@@ -22,11 +22,6 @@ SgxInfo *qmp_query_sgx_capabilities(Error **errp)\n     return NULL;\n }\n \n-void hmp_info_sgx(Monitor *mon, const QDict *qdict)\n-{\n-    monitor_printf(mon, \"SGX is not available in this QEMU\\n\");\n-}\n-\n void pc_machine_init_sgx_epc(PCMachineState *pcms)\n {\n     memset(&pcms->sgx_epc, 0, sizeof(SGXEPCState));\ndiff --git a/hmp-commands-info.hx b/hmp-commands-info.hx\nindex b575e4ac993..da9fdc0ab7b 100644\n--- a/hmp-commands-info.hx\n+++ b/hmp-commands-info.hx\n@@ -866,15 +866,14 @@ SRST\n     Display the vcpu dirty page limit information.\n ERST\n \n-#if defined(TARGET_I386)\n     {\n         .name       = \"sgx\",\n         .args_type  = \"\",\n         .params     = \"\",\n         .help       = \"show intel SGX information\",\n         .cmd        = hmp_info_sgx,\n+        .arch_bitmask = QEMU_ARCH_I386,\n     },\n-#endif\n \n SRST\n   ``info sgx``\ndiff --git a/hw/i386/meson.build b/hw/i386/meson.build\nindex 63ae57baa51..b611fbb5a7f 100644\n--- a/hw/i386/meson.build\n+++ b/hw/i386/meson.build\n@@ -24,6 +24,7 @@ i386_ss.add(when: 'CONFIG_VTD', if_true: files('intel_iommu.c'))\n i386_ss.add(when: 'CONFIG_VTD_ACCEL', if_true: files('intel_iommu_accel.c'))\n i386_ss.add(when: 'CONFIG_SGX', if_true: files('sgx-epc.c','sgx.c'),\n                                 if_false: files('sgx-stub.c'))\n+stub_ss.add(files('sgx-hmp-stub.c'))\n \n i386_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-common.c'))\n i386_ss.add(when: 'CONFIG_PC', if_true: files(\n","prefixes":["v2","23/27"]}