From patchwork Thu Jul 18 08:27:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13736214 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 549F5C3DA49 for ; Thu, 18 Jul 2024 08:28:31 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sUMUc-0005Sj-60; Thu, 18 Jul 2024 04:28:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sUMUa-0005H0-5L for qemu-devel@nongnu.org; Thu, 18 Jul 2024 04:28:00 -0400 Received: from galois.linutronix.de ([2a0a:51c0:0:12e:550::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sUMUX-0002WG-NO for qemu-devel@nongnu.org; Thu, 18 Jul 2024 04:27:59 -0400 From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1721291264; 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=GmZB4XwFunCnoC/FQ6QnBDumKGSssPizQ8tHdXR/z08=; b=uzQEFA1s2ecoe80+G0wwKjdtzI4cqzxSBzj3F6/golaUoi/Sbs3tYBOsSk7XINcWdBaI5F auAfDUK2jdYA5Mldv6kR6gUXR5VHz2GaRys7MPKS2gXq5IvgSBgdh4tYJS/fsWNdzF5Saj 0nistxmOhfI35KOR0Ad6L75fb9tVliJUu9vf3Nt4barEswsgSs3KHXFHvz12P9EdTUOkN7 hQ/UNLMyIDN3B2ap8RHtaIQTSvOsRJ7RmlrOgQvkrzVWWfO2PMqs45lWsul7ONM68w89y1 F+eOoW6q2d4Ospzg/fUwNsrEuT8YQnMI+snNR/OkQxo+trnRELVKiR9OyTIhHw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1721291264; 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=GmZB4XwFunCnoC/FQ6QnBDumKGSssPizQ8tHdXR/z08=; b=Vl/YL37dtaNQ+HybLjcyAPVvZrcKYRQRr+tmMr9bHiy+Rfw90BTnRxvKJvCqzX5NcN24Iv OFIuCMcbtACcXaCA== Date: Thu, 18 Jul 2024 10:27:38 +0200 Subject: [PATCH v4 1/3] docs/interop/firmware.json: add new enum FirmwareFormat MIME-Version: 1.0 Message-Id: <20240718-qapi-firmware-json-v4-1-449ce672db5c@linutronix.de> References: <20240718-qapi-firmware-json-v4-0-449ce672db5c@linutronix.de> In-Reply-To: <20240718-qapi-firmware-json-v4-0-449ce672db5c@linutronix.de> To: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?D?= =?utf-8?q?aniel_P=2E_Berrang=C3=A9?= , Kashyap Chamarthy Cc: qemu-devel@nongnu.org, Kevin Wolf , Hanna Czenczek , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1721291263; l=1407; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=L4+B74F9a35lXUy1Ep2m0jTKC7wqqLH5EyNaxqvfb7s=; b=Plksh+QxCSIwzY54Z8hGbNp10cVshuXhaRvgM+cfa5oOk8IKkrV68gOcDi7cyi2pcloCXd2AP eZuXBJem6chDGzuvAm+ZOGKAJ/z+EDtdj0OL1YcyNC54Q47gwhzGrmS X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Received-SPF: pass client-ip=2a0a:51c0:0:12e:550::1; envelope-from=t-8ch@linutronix.de; helo=galois.linutronix.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Only a small subset of all blockdev drivers make sense for firmware images. Introduce and use a new enum to represent this. This also reduces the dependency on firmware.json from the global qapi definitions. Suggested-by: Daniel P. Berrangé Signed-off-by: Thomas Weißschuh Reviewed-by: Daniel P. Berrangé --- docs/interop/firmware.json | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json index 54a1fc6c1041..a26fe81bf2fe 100644 --- a/docs/interop/firmware.json +++ b/docs/interop/firmware.json @@ -15,7 +15,6 @@ ## { 'include' : 'machine.json' } -{ 'include' : 'block-core.json' } ## # @FirmwareOSInterface: @@ -200,6 +199,20 @@ 'enrolled-keys', 'requires-smm', 'secure-boot', 'verbose-dynamic', 'verbose-static' ] } +## +# @FirmwareFormat: +# +# Formats that are supported for firmware images. +# +# @raw: Raw disk image format. +# +# @qcow2: QEMU image format. +# +# Since: 9.1 +## +{ 'enum': 'FirmwareFormat', + 'data': [ 'raw', 'qcow2' ] } + ## # @FirmwareFlashFile: # @@ -219,7 +232,7 @@ ## { 'struct' : 'FirmwareFlashFile', 'data' : { 'filename' : 'str', - 'format' : 'BlockdevDriver' } } + 'format' : 'FirmwareFormat' } } ## From patchwork Thu Jul 18 08:27:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13736211 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 26DC1C3DA49 for ; Thu, 18 Jul 2024 08:28:17 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sUMUa-0005Eq-82; Thu, 18 Jul 2024 04:28:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sUMUY-00054K-Jw for qemu-devel@nongnu.org; Thu, 18 Jul 2024 04:27:58 -0400 Received: from galois.linutronix.de ([193.142.43.55]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sUMUW-0002WC-OD for qemu-devel@nongnu.org; Thu, 18 Jul 2024 04:27:58 -0400 From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1721291264; 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=JZq3IhRbauWHu6szJR9OYc5OJgdDZeWUwH4DxCktR0M=; b=AhcL29ALkZvGY2d77l2SLgVuZO1ePkQTz2DQFg58mNm5u3EVcT/qwSjsCEIfn/RyyApxvR v3OBP93LF2RBXHV5sZNGX47uoDlWRRSeVloXJbO4SZGXXLjN723mg7NdbIZufGRfQZoMJH oIHEX2K5Ns0WxMsQxIMfdJzF00o0jlBAqMSMW7/ZYSX7SckWv9On4Zm3IH8mgOOT1hLi94 ax1PX5i+hMX0S0yi0XqzNfly62SgR8Op/DzWWyUkxe6DSJ4A0rdTyISPywzwQnT0eAXKI/ LIsABnpn3jdDygNS2VMThhLehpDlAqQvlHJ1epXqPC0CoCHdBexTIa5LD14abQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1721291264; 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=JZq3IhRbauWHu6szJR9OYc5OJgdDZeWUwH4DxCktR0M=; b=uvtJQuVarq/S1SwwBRY8dQ7l7rWU6uO9Q9AYxxrCMdPCpvuuCoiGs8GCSoMuxR6csrp42r 8CKJXez5+6GnapDg== Date: Thu, 18 Jul 2024 10:27:39 +0200 Subject: [PATCH v4 2/3] docs/interop/firmware.json: add new enum FirmwareArchitecture MIME-Version: 1.0 Message-Id: <20240718-qapi-firmware-json-v4-2-449ce672db5c@linutronix.de> References: <20240718-qapi-firmware-json-v4-0-449ce672db5c@linutronix.de> In-Reply-To: <20240718-qapi-firmware-json-v4-0-449ce672db5c@linutronix.de> To: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?D?= =?utf-8?q?aniel_P=2E_Berrang=C3=A9?= , Kashyap Chamarthy Cc: qemu-devel@nongnu.org, Kevin Wolf , Hanna Czenczek , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1721291263; l=1708; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=Tgea5UFMchTgIegHd+6uSGpAuKHpdth+Ngd2mO6Tpjo=; b=pWy0emCUQngrUYlQEiSM5lqzHZmnEqxJ/DFeEv7fHvnwXLaLJOZkYDV6wHtSFxFnPwB44vHyF ba408KzvTrqCwAxP/soWW7aCmyKqr9nx4xgY8ENeFy9ovtE6nzhPy8p X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Received-SPF: pass client-ip=193.142.43.55; envelope-from=t-8ch@linutronix.de; helo=galois.linutronix.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Only a small subset of all architectures supported by qemu make use of firmware files. Introduce and use a new enum to represent this. This also removes the dependency to machine.json from the global qapi definitions. Suggested-by: Daniel P. Berrangé Signed-off-by: Thomas Weißschuh Reviewed-by: Daniel P. Berrangé --- docs/interop/firmware.json | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json index a26fe81bf2fe..2eb0be11d595 100644 --- a/docs/interop/firmware.json +++ b/docs/interop/firmware.json @@ -14,7 +14,10 @@ # = Firmware ## -{ 'include' : 'machine.json' } +{ 'pragma': { + 'member-name-exceptions': [ + 'FirmwareArchitecture' # x86_64 + ] } } ## # @FirmwareOSInterface: @@ -59,6 +62,28 @@ { 'enum' : 'FirmwareDevice', 'data' : [ 'flash', 'kernel', 'memory' ] } +## +# @FirmwareArchitecture: +# +# Enumerations of architectures for which Qemu uses additional firmware files. +# The values are a subset of the enum SysEmuTarget. +# +# @aarch64: 64-bit Arm. +# +# @arm: 32-bit Arm. +# +# @i386: 32-bit x86. +# +# @loongarch64: 64-bit LoongArch. +# +# @x86_64: 64-bit x86. +# +# Since: 9.1 +## +{ 'enum' : 'FirmwareArchitecture', + 'data' : [ 'aarch64', 'arm', 'i386', 'loongarch64', 'x86_64' ] } + + ## # @FirmwareTarget: # @@ -80,7 +105,7 @@ # Since: 3.0 ## { 'struct' : 'FirmwareTarget', - 'data' : { 'architecture' : 'SysEmuTarget', + 'data' : { 'architecture' : 'FirmwareArchitecture', 'machines' : [ 'str' ] } } ## From patchwork Thu Jul 18 08:27:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13736212 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7FF61C3DA60 for ; Thu, 18 Jul 2024 08:28:26 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sUMUc-0005Su-Bk; Thu, 18 Jul 2024 04:28:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sUMUa-0005Gx-5L for qemu-devel@nongnu.org; Thu, 18 Jul 2024 04:28:00 -0400 Received: from galois.linutronix.de ([193.142.43.55]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sUMUY-0002WI-6T for qemu-devel@nongnu.org; Thu, 18 Jul 2024 04:27:59 -0400 From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1721291265; 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=S98RiMhDcRn5srm/emzoYqaTYubmw8WmI0dvnCP4akI=; b=oM0b/sZTk4wk8MQmifgzy039h1oZTJiQoFSkHyNtkZ6UpRB06O9Wz9SWe7dDGr0iVdonrV Gpnv0De1sG93hmvZ2qhyQjClEZZTyuy6CiVYfCTxjnhXHfb9oI3yhVmlt0EV8Yyf3A5aGo y7pE4g9MGemB8rUXPHmCgTIpRshQEtTPFr2wf9P0Gr00HwEAgyKkZIV7qGmBZGe9NYtbLX HCxYhCh4tTtPTcFKrxMGW0A/VR6+CBa3mPGpmFQ8F6Dg2DsO9RNGUyqyDIKgJFFbQ8d38+ cHgnjrQxtOx7gvSwtkcjbh4DsfHhqFeb3Fzhic6Vpe32X9iUyyqhlV50dt2vlg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1721291265; 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=S98RiMhDcRn5srm/emzoYqaTYubmw8WmI0dvnCP4akI=; b=YzHugJonEjv/HZJkdmNx63esZcGHhAS6Zj4F69F4JGKpxdCAhCN4HVzEwlcW7F8w2OXoNJ GRWy6mF+I6nWshDA== Date: Thu, 18 Jul 2024 10:27:40 +0200 Subject: [PATCH v4 3/3] docs: add test for firmware.json QAPI MIME-Version: 1.0 Message-Id: <20240718-qapi-firmware-json-v4-3-449ce672db5c@linutronix.de> References: <20240718-qapi-firmware-json-v4-0-449ce672db5c@linutronix.de> In-Reply-To: <20240718-qapi-firmware-json-v4-0-449ce672db5c@linutronix.de> To: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?D?= =?utf-8?q?aniel_P=2E_Berrang=C3=A9?= , Kashyap Chamarthy Cc: qemu-devel@nongnu.org, Kevin Wolf , Hanna Czenczek , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1721291263; l=892; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=LbJkyHA3nLuKk04gQfz1ncpyRm17TIWkBXwskRsKw6A=; b=IL14BxgV/kT8YeUAX9Wkb+QlReFMw8qJnPep2bz+DfzUbp+GcxICafLA7QjyR72G8wWSk6yUV eIe8Mnd4UA1CRyihLPyJxpekEEs8Dg2/flRW+y8ocmtsxaqKlk2s7mt X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Received-SPF: pass client-ip=193.142.43.55; envelope-from=t-8ch@linutronix.de; helo=galois.linutronix.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org To make sure that the QAPI description stays valid add a testcase. Suggested-by: Philippe Mathieu-Daudé Link: https://lore.kernel.org/qemu-devel/d9ce0234-4beb-4b90-b14c-76810d3b81d7@linaro.org/ Signed-off-by: Thomas Weißschuh Reviewed-by: Daniel P. Berrangé --- docs/meson.build | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/meson.build b/docs/meson.build index 9040f860ae1a..bcca45a342a3 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -99,3 +99,8 @@ if build_docs alias_target('html', sphinxdocs) alias_target('man', sphinxmans) endif + +test('QAPI firmware.json regression tests', python, + args: [qapi_gen.full_path(), '-o', meson.current_build_dir() / 'qapi', + meson.current_source_dir() / 'interop/firmware.json'], + env: test_env, suite: ['qapi-schema', 'qapi-interop'])