From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:a17:504:6615:b0:1be9:327d:8ee3 with SMTP id h21csp158382njk; Thu, 20 Feb 2025 07:55:32 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWyln7rQs8hBsJgPsBXWTl+8L/DU0uzIIQLhloMU4Tk89lN81snODEBqIm74uLH2AEzGEd8iao6H6TTsg==@linaro.org X-Google-Smtp-Source: AGHT+IEoJCP2b4Ep+0GaEg8KdE2C2yuroyXgNPQ+EixbTDSwyfhy0Amz4/3m5aoyO6ZKHJrzZHu1 X-Received: by 2002:a05:622a:1106:b0:472:4c9:617e with SMTP id d75a77b69052e-472082862a5mr130966221cf.31.1740066932356; Thu, 20 Feb 2025 07:55:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1740066932; cv=none; d=google.com; s=arc-20240605; b=ADF/T0hfPe21faOSzWBo8Mz17pwpqYnMO137Ipt6CWKCKGOfN5BKRYYRXM0ZzWDD/M Uo4TBdad1RzxNr9KJWZvUMW+9pZAjrEadx7pv/XUfAwumQS7MuawIWRSAil+p+qYQq+/ ck71zw2TrUo84WdE8HmdFq/rTOa36PuMax78FyrEgnvXhzWyKiKPpBWqlPgUISNqDkmk 7eF5PEckbOmBEZ6pN+0prCLyj4KHdYsuywvsbv6ab1q0RThmeBdfrckrBAC+WtqAZE52 fPA+xNRyIUhClqjvY7PvFmeWYBGUeVXG7gOKwZkmXVxSdpifY9qgo1hSX6VQslX6zqOY 8tPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:user-agent :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=svMb0hMjsByEN3jNk32qxtNTGWo84eb8AH74fZ+nvGk=; fh=tUCyjvcSN1KRD/P8TJfN97xpHG61EnEtdwb1LlsWOhY=; b=LOYnKZen0qMA15NmjbEYMs66NadroJ+mPS0u5SUC2OIb16mv0Q4aDpy7KOZr7xALNM iRWUw8w8Mg9iqt9VRMmfWw4ceQEcZ13PZv/RcMcpiim7WbG6HbDIu9pqYCdxG7Nm2leW grI9TH6BhCSQeDkDuAD14QoyGbbak2Hzsqud5IeDpclZKkSRU4L4usPxc4dHq8xFN7nH iDw1uPaOIUgdI6z3KXq+U0mgTdDJrkFtyEpiGNneLJBjdYj+rUuS8oMfMK0i6cAtNdpr M2FD+uMxjK7OkbCFt0FHGCg1wNsQm7cknnM8NGV3Bg3fmX7zcbNBhbD+Pd7vuvurFlYG /1NQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="NjE3Y/qh"; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-47205450f0fsi46172211cf.671.2025.02.20.07.55.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Feb 2025 07:55:32 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="NjE3Y/qh"; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tl8sy-0000Bf-JS; Thu, 20 Feb 2025 10:54:48 -0500 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 1tl8sw-0000As-Im for qemu-arm@nongnu.org; Thu, 20 Feb 2025 10:54:46 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tl8st-0004mA-IA for qemu-arm@nongnu.org; Thu, 20 Feb 2025 10:54:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1740066882; 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: in-reply-to:in-reply-to:references:references; bh=svMb0hMjsByEN3jNk32qxtNTGWo84eb8AH74fZ+nvGk=; b=NjE3Y/qhLLTNDH75dGTpUpwKNANEY5fuOt3ATG3UTGqSxQBeqOEtFewvDB764b+cZepSe+ uURvfVgq7PsH/CujnP/zm279JUQSWiAz4r8sBn3+8AxiJCmQRMOt1OQ4OxWyjDSDFDyIb2 gjVFxLPtV0muH9/qQl/Bb4TNKGVzzzg= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-176-B3pw8yMyMauE5q5vR1YHTQ-1; Thu, 20 Feb 2025 10:54:37 -0500 X-MC-Unique: B3pw8yMyMauE5q5vR1YHTQ-1 X-Mimecast-MFC-AGG-ID: B3pw8yMyMauE5q5vR1YHTQ_1740066876 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0E85D19783B6; Thu, 20 Feb 2025 15:54:34 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.9]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 853A219412A3; Thu, 20 Feb 2025 15:54:32 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E9B4A21E6A28; Thu, 20 Feb 2025 16:54:29 +0100 (CET) From: Markus Armbruster To: Gerd Hoffmann Cc: qemu-devel@nongnu.org, qemu-arm@nongnu.org, Ard Biesheuvel , Michael Roth , "Michael S. Tsirkin" , Peter Maydell , Thomas Huth , Eduardo Habkost , Paolo Bonzini , Richard Henderson , Eric Blake , Daniel P. =?utf-8?Q?Berrang=C3=A9?= , Marcel Apfelbaum , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , graf@amazon.com, Markus Armbruster Subject: Re: [PATCH v4 14/24] hw/uefi: add var-service-json.c + qapi for NV vars. In-Reply-To: <20250219071431.50626-15-kraxel@redhat.com> (Gerd Hoffmann's message of "Wed, 19 Feb 2025 08:14:16 +0100") References: <20250219071431.50626-1-kraxel@redhat.com> <20250219071431.50626-15-kraxel@redhat.com> Date: Thu, 20 Feb 2025 16:54:29 +0100 Message-ID: <87tt8or4qy.fsf@pond.sub.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.457, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@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-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org X-TUID: E5GyHDTdxVAl Gerd Hoffmann writes: > Define qapi schema for the uefi variable store state. > > Use it and the generated visitor helper functions to store persistent > (EFI_VARIABLE_NON_VOLATILE) variables in JSON format on disk. > > Signed-off-by: Gerd Hoffmann [...] > diff --git a/qapi/meson.build b/qapi/meson.build > index e7bc54e5d047..eadde4db307f 100644 > --- a/qapi/meson.build > +++ b/qapi/meson.build > @@ -65,6 +65,7 @@ if have_system > 'pci', > 'rocker', > 'tpm', > + 'uefi', > ] > endif > if have_system or have_tools > diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json > index b1581988e4eb..2877aff73d0c 100644 > --- a/qapi/qapi-schema.json > +++ b/qapi/qapi-schema.json > @@ -81,3 +81,4 @@ > { 'include': 'vfio.json' } > { 'include': 'cryptodev.json' } > { 'include': 'cxl.json' } > +{ 'include': 'uefi.json' } > diff --git a/qapi/uefi.json b/qapi/uefi.json > new file mode 100644 > index 000000000000..c268ed11b70c > --- /dev/null > +++ b/qapi/uefi.json > @@ -0,0 +1,45 @@ > +# -*- Mode: Python -*- > +# vim: filetype=python > +# > + This ends up in section "CXL devices", which is not what you want. I guess you want a suitable heading right here, like ## # UEFI mumble mumble ## > +## > +# @UefiVariable: > +# > +# UEFI Variable Overview text is optional. Is this one worthwhile? > +# > +# @guid: variable namespace guid How is guid usually capitalized in UEFI documentation? GUID maybe? > +# > +# @name: variable name (utf-8) UTF-8 > +# > +# @attr: variable attributes These are encoded as int. How? > +# > +# @data: variable content (base64) I'm not a native speaker... for what it's worth, "contents" feels better to me. (base64 encoded) and (encoded in base64) are the common phrasings. > +# > +# @time: variable modification time (EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS). Long line, please break it like # @time: variable modification time # (EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) What's the unit and the anchor? Seconds since the epoch? What is EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS trying to tell the reader? > +# > +# @digest: variable certificate digest (EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS). Long line, please break it like # @digest: variable certificate digest # (EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) What kind of digest is this? > +# > +# Since: 10.0 > +## > +{ 'struct' : 'UefiVariable', > + 'data' : { 'guid' : 'str', > + 'name' : 'str', > + 'attr' : 'int', > + 'data' : 'str', > + '*time' : 'str', > + '*digest' : 'str'}} > + > +## > +# @UefiVarStore: > +# > +# UEFI Variable Store Overview is optional. Is this one worthwhile? > +# > +# @version: 2 What about "currently always 2"? > +# > +# @variables: list of uefi variables UEFI > +# > +# Since: 10.0 > +## > +{ 'struct' : 'UefiVarStore', > + 'data' : { 'version' : 'int', > + 'variables' : [ 'UefiVariable' ] }}