* [PATCH v2 0/5] docs/interop/firmware.json: scripts/qapi-gen.py compatibility
@ 2024-03-07 12:05 Thomas Weißschuh
2024-03-07 12:05 ` [PATCH v2 1/5] docs/interop/firmware.json: Align examples Thomas Weißschuh
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Thomas Weißschuh @ 2024-03-07 12:05 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, Daniel P. Berrangé,
Kashyap Chamarthy
Cc: qemu-devel, Thomas Weißschuh
docs/interop/firmware.json is currently not usable with qapi-gen.py due
to various non-functional issues.
Fix those issue to provide compatibility.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
Changes in v2:
- Add review tag from Philippe
- Add Fixes tag (Philippe)
- Add testcase (Philippe)
- Link to v1: https://lore.kernel.org/r/20240306-qapi-firmware-json-v1-0-619f7122a249@linutronix.de
---
Thomas Weißschuh (5):
docs/interop/firmware.json: Align examples
docs/interop/firmware.json: Fix doc for FirmwareFlashMode
docs/interop/firmware.json: Use full include paths
docs/interop/firmware.json: Include pragma.json
docs: add test for firmware.json QAPI
docs/interop/firmware.json | 392 +++++++++++++++++++++++----------------------
docs/meson.build | 5 +
2 files changed, 202 insertions(+), 195 deletions(-)
---
base-commit: 8f6330a807f2642dc2a3cdf33347aa28a4c00a87
change-id: 20240306-qapi-firmware-json-6fb1213936dd
Best regards,
--
Thomas Weißschuh <thomas.weissschuh@linutronix.de>
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH v2 1/5] docs/interop/firmware.json: Align examples 2024-03-07 12:05 [PATCH v2 0/5] docs/interop/firmware.json: scripts/qapi-gen.py compatibility Thomas Weißschuh @ 2024-03-07 12:05 ` Thomas Weißschuh 2024-03-07 12:05 ` [PATCH v2 2/5] docs/interop/firmware.json: Fix doc for FirmwareFlashMode Thomas Weißschuh ` (3 subsequent siblings) 4 siblings, 0 replies; 7+ messages in thread From: Thomas Weißschuh @ 2024-03-07 12:05 UTC (permalink / raw) To: Philippe Mathieu-Daudé, Daniel P. Berrangé, Kashyap Chamarthy Cc: qemu-devel, Thomas Weißschuh The QAPI generator now validates the alignment and rejects this file. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> --- docs/interop/firmware.json | 384 ++++++++++++++++++++++----------------------- 1 file changed, 192 insertions(+), 192 deletions(-) diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json index cc8f86918681..a024f1b9bf3f 100644 --- a/docs/interop/firmware.json +++ b/docs/interop/firmware.json @@ -435,203 +435,203 @@ # # Examples: # -# { -# "description": "SeaBIOS", -# "interface-types": [ -# "bios" -# ], -# "mapping": { -# "device": "memory", -# "filename": "/usr/share/seabios/bios-256k.bin" -# }, -# "targets": [ -# { -# "architecture": "i386", -# "machines": [ -# "pc-i440fx-*", -# "pc-q35-*" -# ] +# { +# "description": "SeaBIOS", +# "interface-types": [ +# "bios" +# ], +# "mapping": { +# "device": "memory", +# "filename": "/usr/share/seabios/bios-256k.bin" # }, -# { -# "architecture": "x86_64", -# "machines": [ -# "pc-i440fx-*", -# "pc-q35-*" -# ] -# } -# ], -# "features": [ -# "acpi-s3", -# "acpi-s4" -# ], -# "tags": [ -# "CONFIG_BOOTSPLASH=n", -# "CONFIG_ROM_SIZE=256", -# "CONFIG_USE_SMM=n" -# ] -# } -# -# { -# "description": "OVMF with SB+SMM, empty varstore", -# "interface-types": [ -# "uefi" -# ], -# "mapping": { -# "device": "flash", -# "executable": { -# "filename": "/usr/share/OVMF/OVMF_CODE.secboot.fd", -# "format": "raw" +# "targets": [ +# { +# "architecture": "i386", +# "machines": [ +# "pc-i440fx-*", +# "pc-q35-*" +# ] +# }, +# { +# "architecture": "x86_64", +# "machines": [ +# "pc-i440fx-*", +# "pc-q35-*" +# ] +# } +# ], +# "features": [ +# "acpi-s3", +# "acpi-s4" +# ], +# "tags": [ +# "CONFIG_BOOTSPLASH=n", +# "CONFIG_ROM_SIZE=256", +# "CONFIG_USE_SMM=n" +# ] +# } +# +# { +# "description": "OVMF with SB+SMM, empty varstore", +# "interface-types": [ +# "uefi" +# ], +# "mapping": { +# "device": "flash", +# "executable": { +# "filename": "/usr/share/OVMF/OVMF_CODE.secboot.fd", +# "format": "raw" +# }, +# "nvram-template": { +# "filename": "/usr/share/OVMF/OVMF_VARS.fd", +# "format": "raw" +# } # }, -# "nvram-template": { -# "filename": "/usr/share/OVMF/OVMF_VARS.fd", -# "format": "raw" -# } -# }, -# "targets": [ -# { -# "architecture": "x86_64", -# "machines": [ -# "pc-q35-*" -# ] -# } -# ], -# "features": [ -# "acpi-s3", -# "amd-sev", -# "requires-smm", -# "secure-boot", -# "verbose-dynamic" -# ], -# "tags": [ -# "-a IA32", -# "-a X64", -# "-p OvmfPkg/OvmfPkgIa32X64.dsc", -# "-t GCC48", -# "-b DEBUG", -# "-D SMM_REQUIRE", -# "-D SECURE_BOOT_ENABLE", -# "-D FD_SIZE_4MB" -# ] -# } -# -# { -# "description": "OVMF with SB+SMM, SB enabled, MS certs enrolled", -# "interface-types": [ -# "uefi" -# ], -# "mapping": { -# "device": "flash", -# "executable": { -# "filename": "/usr/share/OVMF/OVMF_CODE.secboot.fd", -# "format": "raw" +# "targets": [ +# { +# "architecture": "x86_64", +# "machines": [ +# "pc-q35-*" +# ] +# } +# ], +# "features": [ +# "acpi-s3", +# "amd-sev", +# "requires-smm", +# "secure-boot", +# "verbose-dynamic" +# ], +# "tags": [ +# "-a IA32", +# "-a X64", +# "-p OvmfPkg/OvmfPkgIa32X64.dsc", +# "-t GCC48", +# "-b DEBUG", +# "-D SMM_REQUIRE", +# "-D SECURE_BOOT_ENABLE", +# "-D FD_SIZE_4MB" +# ] +# } +# +# { +# "description": "OVMF with SB+SMM, SB enabled, MS certs enrolled", +# "interface-types": [ +# "uefi" +# ], +# "mapping": { +# "device": "flash", +# "executable": { +# "filename": "/usr/share/OVMF/OVMF_CODE.secboot.fd", +# "format": "raw" +# }, +# "nvram-template": { +# "filename": "/usr/share/OVMF/OVMF_VARS.secboot.fd", +# "format": "raw" +# } # }, -# "nvram-template": { -# "filename": "/usr/share/OVMF/OVMF_VARS.secboot.fd", -# "format": "raw" -# } -# }, -# "targets": [ -# { -# "architecture": "x86_64", -# "machines": [ -# "pc-q35-*" -# ] -# } -# ], -# "features": [ -# "acpi-s3", -# "amd-sev", -# "enrolled-keys", -# "requires-smm", -# "secure-boot", -# "verbose-dynamic" -# ], -# "tags": [ -# "-a IA32", -# "-a X64", -# "-p OvmfPkg/OvmfPkgIa32X64.dsc", -# "-t GCC48", -# "-b DEBUG", -# "-D SMM_REQUIRE", -# "-D SECURE_BOOT_ENABLE", -# "-D FD_SIZE_4MB" -# ] -# } -# -# { -# "description": "OVMF with SEV-ES support", -# "interface-types": [ -# "uefi" -# ], -# "mapping": { -# "device": "flash", -# "executable": { -# "filename": "/usr/share/OVMF/OVMF_CODE.fd", -# "format": "raw" +# "targets": [ +# { +# "architecture": "x86_64", +# "machines": [ +# "pc-q35-*" +# ] +# } +# ], +# "features": [ +# "acpi-s3", +# "amd-sev", +# "enrolled-keys", +# "requires-smm", +# "secure-boot", +# "verbose-dynamic" +# ], +# "tags": [ +# "-a IA32", +# "-a X64", +# "-p OvmfPkg/OvmfPkgIa32X64.dsc", +# "-t GCC48", +# "-b DEBUG", +# "-D SMM_REQUIRE", +# "-D SECURE_BOOT_ENABLE", +# "-D FD_SIZE_4MB" +# ] +# } +# +# { +# "description": "OVMF with SEV-ES support", +# "interface-types": [ +# "uefi" +# ], +# "mapping": { +# "device": "flash", +# "executable": { +# "filename": "/usr/share/OVMF/OVMF_CODE.fd", +# "format": "raw" +# }, +# "nvram-template": { +# "filename": "/usr/share/OVMF/OVMF_VARS.fd", +# "format": "raw" +# } # }, -# "nvram-template": { -# "filename": "/usr/share/OVMF/OVMF_VARS.fd", -# "format": "raw" -# } -# }, -# "targets": [ -# { -# "architecture": "x86_64", -# "machines": [ -# "pc-q35-*" -# ] -# } -# ], -# "features": [ -# "acpi-s3", -# "amd-sev", -# "amd-sev-es", -# "verbose-dynamic" -# ], -# "tags": [ -# "-a X64", -# "-p OvmfPkg/OvmfPkgX64.dsc", -# "-t GCC48", -# "-b DEBUG", -# "-D FD_SIZE_4MB" -# ] -# } -# -# { -# "description": "UEFI firmware for ARM64 virtual machines", -# "interface-types": [ -# "uefi" -# ], -# "mapping": { -# "device": "flash", -# "executable": { -# "filename": "/usr/share/AAVMF/AAVMF_CODE.fd", -# "format": "raw" +# "targets": [ +# { +# "architecture": "x86_64", +# "machines": [ +# "pc-q35-*" +# ] +# } +# ], +# "features": [ +# "acpi-s3", +# "amd-sev", +# "amd-sev-es", +# "verbose-dynamic" +# ], +# "tags": [ +# "-a X64", +# "-p OvmfPkg/OvmfPkgX64.dsc", +# "-t GCC48", +# "-b DEBUG", +# "-D FD_SIZE_4MB" +# ] +# } +# +# { +# "description": "UEFI firmware for ARM64 virtual machines", +# "interface-types": [ +# "uefi" +# ], +# "mapping": { +# "device": "flash", +# "executable": { +# "filename": "/usr/share/AAVMF/AAVMF_CODE.fd", +# "format": "raw" +# }, +# "nvram-template": { +# "filename": "/usr/share/AAVMF/AAVMF_VARS.fd", +# "format": "raw" +# } # }, -# "nvram-template": { -# "filename": "/usr/share/AAVMF/AAVMF_VARS.fd", -# "format": "raw" -# } -# }, -# "targets": [ -# { -# "architecture": "aarch64", -# "machines": [ -# "virt-*" -# ] -# } -# ], -# "features": [ -# -# ], -# "tags": [ -# "-a AARCH64", -# "-p ArmVirtPkg/ArmVirtQemu.dsc", -# "-t GCC48", -# "-b DEBUG", -# "-D DEBUG_PRINT_ERROR_LEVEL=0x80000000" -# ] -# } +# "targets": [ +# { +# "architecture": "aarch64", +# "machines": [ +# "virt-*" +# ] +# } +# ], +# "features": [ +# +# ], +# "tags": [ +# "-a AARCH64", +# "-p ArmVirtPkg/ArmVirtQemu.dsc", +# "-t GCC48", +# "-b DEBUG", +# "-D DEBUG_PRINT_ERROR_LEVEL=0x80000000" +# ] +# } ## { 'struct' : 'Firmware', 'data' : { 'description' : 'str', -- 2.44.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 2/5] docs/interop/firmware.json: Fix doc for FirmwareFlashMode 2024-03-07 12:05 [PATCH v2 0/5] docs/interop/firmware.json: scripts/qapi-gen.py compatibility Thomas Weißschuh 2024-03-07 12:05 ` [PATCH v2 1/5] docs/interop/firmware.json: Align examples Thomas Weißschuh @ 2024-03-07 12:05 ` Thomas Weißschuh 2024-03-07 12:05 ` [PATCH v2 3/5] docs/interop/firmware.json: Use full include paths Thomas Weißschuh ` (2 subsequent siblings) 4 siblings, 0 replies; 7+ messages in thread From: Thomas Weißschuh @ 2024-03-07 12:05 UTC (permalink / raw) To: Philippe Mathieu-Daudé, Daniel P. Berrangé, Kashyap Chamarthy Cc: qemu-devel, Thomas Weißschuh The doc title did not match the actual definition. Fixes: 2720ceda05 ("docs: expand firmware descriptor to allow flash without NVRAM") Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- docs/interop/firmware.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json index a024f1b9bf3f..54a1fc6c1041 100644 --- a/docs/interop/firmware.json +++ b/docs/interop/firmware.json @@ -223,7 +223,7 @@ ## -# @FirmwareFlashType: +# @FirmwareFlashMode: # # Describes how the firmware build handles code versus variable # persistence. -- 2.44.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 3/5] docs/interop/firmware.json: Use full include paths 2024-03-07 12:05 [PATCH v2 0/5] docs/interop/firmware.json: scripts/qapi-gen.py compatibility Thomas Weißschuh 2024-03-07 12:05 ` [PATCH v2 1/5] docs/interop/firmware.json: Align examples Thomas Weißschuh 2024-03-07 12:05 ` [PATCH v2 2/5] docs/interop/firmware.json: Fix doc for FirmwareFlashMode Thomas Weißschuh @ 2024-03-07 12:05 ` Thomas Weißschuh 2024-03-07 12:05 ` [PATCH v2 4/5] docs/interop/firmware.json: Include pragma.json Thomas Weißschuh 2024-03-07 12:05 ` [PATCH v2 5/5] docs: add test for firmware.json QAPI Thomas Weißschuh 4 siblings, 0 replies; 7+ messages in thread From: Thomas Weißschuh @ 2024-03-07 12:05 UTC (permalink / raw) To: Philippe Mathieu-Daudé, Daniel P. Berrangé, Kashyap Chamarthy Cc: qemu-devel, Thomas Weißschuh The included files are part of the toplevel QAPI directory and need to be included from there. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> --- docs/interop/firmware.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json index 54a1fc6c1041..4ac840e2b413 100644 --- a/docs/interop/firmware.json +++ b/docs/interop/firmware.json @@ -14,8 +14,8 @@ # = Firmware ## -{ 'include' : 'machine.json' } -{ 'include' : 'block-core.json' } +{ 'include' : '../../qapi/machine.json' } +{ 'include' : '../../qapi/block-core.json' } ## # @FirmwareOSInterface: -- 2.44.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 4/5] docs/interop/firmware.json: Include pragma.json 2024-03-07 12:05 [PATCH v2 0/5] docs/interop/firmware.json: scripts/qapi-gen.py compatibility Thomas Weißschuh ` (2 preceding siblings ...) 2024-03-07 12:05 ` [PATCH v2 3/5] docs/interop/firmware.json: Use full include paths Thomas Weißschuh @ 2024-03-07 12:05 ` Thomas Weißschuh 2024-03-07 12:05 ` [PATCH v2 5/5] docs: add test for firmware.json QAPI Thomas Weißschuh 4 siblings, 0 replies; 7+ messages in thread From: Thomas Weißschuh @ 2024-03-07 12:05 UTC (permalink / raw) To: Philippe Mathieu-Daudé, Daniel P. Berrangé, Kashyap Chamarthy Cc: qemu-devel, Thomas Weißschuh The files included by firmware.json use names that do not satisfy the generators requirements. By including pragma.json these errors are suppressed. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> --- docs/interop/firmware.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json index 4ac840e2b413..a7e9a22a0046 100644 --- a/docs/interop/firmware.json +++ b/docs/interop/firmware.json @@ -10,6 +10,8 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. +{ 'include' : '../../qapi/pragma.json' } + ## # = Firmware ## -- 2.44.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 5/5] docs: add test for firmware.json QAPI 2024-03-07 12:05 [PATCH v2 0/5] docs/interop/firmware.json: scripts/qapi-gen.py compatibility Thomas Weißschuh ` (3 preceding siblings ...) 2024-03-07 12:05 ` [PATCH v2 4/5] docs/interop/firmware.json: Include pragma.json Thomas Weißschuh @ 2024-03-07 12:05 ` Thomas Weißschuh 2024-03-07 13:19 ` Philippe Mathieu-Daudé 4 siblings, 1 reply; 7+ messages in thread From: Thomas Weißschuh @ 2024-03-07 12:05 UTC (permalink / raw) To: Philippe Mathieu-Daudé, Daniel P. Berrangé, Kashyap Chamarthy Cc: qemu-devel, Thomas Weißschuh To make sure that the QAPI description stays valid add a testcase. Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Link: https://lore.kernel.org/qemu-devel/d9ce0234-4beb-4b90-b14c-76810d3b81d7@linaro.org/ Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> --- 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']) -- 2.44.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2 5/5] docs: add test for firmware.json QAPI 2024-03-07 12:05 ` [PATCH v2 5/5] docs: add test for firmware.json QAPI Thomas Weißschuh @ 2024-03-07 13:19 ` Philippe Mathieu-Daudé 0 siblings, 0 replies; 7+ messages in thread From: Philippe Mathieu-Daudé @ 2024-03-07 13:19 UTC (permalink / raw) To: Thomas Weißschuh, Daniel P. Berrangé, Kashyap Chamarthy Cc: qemu-devel On 7/3/24 13:05, Thomas Weißschuh wrote: > To make sure that the QAPI description stays valid add a testcase. > > Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org> > Link: https://lore.kernel.org/qemu-devel/d9ce0234-4beb-4b90-b14c-76810d3b81d7@linaro.org/ The 'Link:' tag isn't really useful, so I'd remote it (maintainer might do that). Otherwise thanks for adding the test! Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> > Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> > --- > 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']) > ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-03-07 13:20 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-03-07 12:05 [PATCH v2 0/5] docs/interop/firmware.json: scripts/qapi-gen.py compatibility Thomas Weißschuh 2024-03-07 12:05 ` [PATCH v2 1/5] docs/interop/firmware.json: Align examples Thomas Weißschuh 2024-03-07 12:05 ` [PATCH v2 2/5] docs/interop/firmware.json: Fix doc for FirmwareFlashMode Thomas Weißschuh 2024-03-07 12:05 ` [PATCH v2 3/5] docs/interop/firmware.json: Use full include paths Thomas Weißschuh 2024-03-07 12:05 ` [PATCH v2 4/5] docs/interop/firmware.json: Include pragma.json Thomas Weißschuh 2024-03-07 12:05 ` [PATCH v2 5/5] docs: add test for firmware.json QAPI Thomas Weißschuh 2024-03-07 13:19 ` Philippe Mathieu-Daudé
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).