qemu-arm.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Gerd Hoffmann <kraxel@redhat.com>, qemu-devel@nongnu.org
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Eric Blake" <eblake@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org, "Michael Roth" <michael.roth@amd.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [PULL 04/24] hw/uefi: add include/hw/uefi/var-service.h
Date: Fri, 24 Oct 2025 16:43:34 +0200	[thread overview]
Message-ID: <04aad62d-321e-4b37-ad11-4f785f7c3d81@linaro.org> (raw)
In-Reply-To: <20250304124815.591749-5-kraxel@redhat.com>

Hi,

On 4/3/25 13:47, Gerd Hoffmann wrote:
> Add state structs and function declarations for the uefi-vars device.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> Message-ID: <20250225163031.1409078-5-kraxel@redhat.com>
> ---
>   include/hw/uefi/var-service.h | 191 ++++++++++++++++++++++++++++++++++
>   1 file changed, 191 insertions(+)
>   create mode 100644 include/hw/uefi/var-service.h
> 
> diff --git a/include/hw/uefi/var-service.h b/include/hw/uefi/var-service.h
> new file mode 100644
> index 000000000000..f7ceac4ce243
> --- /dev/null
> +++ b/include/hw/uefi/var-service.h
> @@ -0,0 +1,191 @@
> +/*
> + * SPDX-License-Identifier: GPL-2.0-or-later
> + *
> + * uefi-vars device - state struct and function prototypes
> + */
> +#ifndef QEMU_UEFI_VAR_SERVICE_H
> +#define QEMU_UEFI_VAR_SERVICE_H
> +
> +#include "qemu/uuid.h"
> +#include "qemu/queue.h"
> +
> +#include "hw/uefi/var-service-edk2.h"
> +
> +#define MAX_BUFFER_SIZE (64 * 1024)
> +
> +typedef struct uefi_variable uefi_variable;
> +typedef struct uefi_var_policy uefi_var_policy;
> +typedef struct uefi_vars_state uefi_vars_state;
> +
> +typedef struct uefi_vars_cert uefi_vars_cert;
> +typedef struct uefi_vars_hash uefi_vars_hash;
> +typedef struct uefi_vars_siglist uefi_vars_siglist;
> +
> +struct uefi_variable {
> +    QemuUUID                          guid;
> +    uint16_t                          *name;
> +    uint32_t                          name_size;
> +    uint32_t                          attributes;
> +    void                              *data;
> +    uint32_t                          data_size;
> +    efi_time                          time;
> +    void                              *digest;
> +    uint32_t                          digest_size;
> +    QTAILQ_ENTRY(uefi_variable)       next;
> +};
> +
> +struct uefi_var_policy {
> +    variable_policy_entry             *entry;
> +    uint32_t                          entry_size;
> +    uint16_t                          *name;
> +    uint32_t                          name_size;
> +
> +    /* number of hashmarks (wildcard character) in name */
> +    uint32_t                          hashmarks;
> +
> +    QTAILQ_ENTRY(uefi_var_policy)     next;
> +};
> +
> +struct uefi_vars_state {
> +    MemoryRegion                      mr;

FYI this is missing "system/memory.h" which is indirectly included,
otherwise when refactoring unrelated generic headers I get:

include/hw/uefi/var-service.h:50:39: error: field has incomplete type 
'MemoryRegion' (aka 'struct MemoryRegion')
    50 |     MemoryRegion                      mr;
       |                                       ^
include/qemu/typedefs.h:68:16: note: forward declaration of 'struct 
MemoryRegion'
    68 | typedef struct MemoryRegion MemoryRegion;
       |                ^

No need to post a fix, I'll with my refactor.

> +    uint16_t                          sts;
> +    uint32_t                          buf_size;
> +    uint32_t                          buf_addr_lo;
> +    uint32_t                          buf_addr_hi;
> +    uint8_t                           *buffer;
> +    QTAILQ_HEAD(, uefi_variable)      variables;
> +    QTAILQ_HEAD(, uefi_var_policy)    var_policies;
> +
> +    /* pio transfer buffer */
> +    uint32_t                          pio_xfer_offset;
> +    uint8_t                           *pio_xfer_buffer;
> +
> +    /* boot phases */
> +    bool                              end_of_dxe;
> +    bool                              ready_to_boot;
> +    bool                              exit_boot_service;
> +    bool                              policy_locked;
> +
> +    /* storage accounting */
> +    uint64_t                          max_storage;
> +    uint64_t                          used_storage;
> +
> +    /* config options */
> +    char                              *jsonfile;
> +    int                               jsonfd;
> +    bool                              force_secure_boot;
> +    bool                              disable_custom_mode;
> +    bool                              use_pio;
> +};



  reply	other threads:[~2025-10-24 14:44 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-04 12:47 [PULL 00/24] Firmware 20250304 patches Gerd Hoffmann
2025-03-04 12:47 ` [PULL 01/24] Add support for etc/hardware-info fw_cfg file Gerd Hoffmann
2025-03-04 12:47 ` [PULL 02/24] hw/uefi: add include/hw/uefi/var-service-api.h Gerd Hoffmann
2025-03-04 12:47 ` [PULL 03/24] hw/uefi: add include/hw/uefi/var-service-edk2.h Gerd Hoffmann
2025-03-04 12:47 ` [PULL 04/24] hw/uefi: add include/hw/uefi/var-service.h Gerd Hoffmann
2025-10-24 14:43   ` Philippe Mathieu-Daudé [this message]
2025-03-04 12:47 ` [PULL 05/24] hw/uefi: add var-service-guid.c Gerd Hoffmann
2025-03-04 12:47 ` [PULL 06/24] hw/uefi: add var-service-utils.c Gerd Hoffmann
2025-03-04 12:47 ` [PULL 07/24] hw/uefi: add var-service-vars.c Gerd Hoffmann
2025-03-04 12:47 ` [PULL 08/24] hw/uefi: add var-service-auth.c Gerd Hoffmann
2025-03-04 12:47 ` [PULL 09/24] hw/uefi: add var-service-policy.c Gerd Hoffmann
2025-03-04 12:47 ` [PULL 10/24] hw/uefi: add var-service-core.c Gerd Hoffmann
2025-03-04 12:47 ` [PULL 11/24] hw/uefi: add var-service-pkcs7.c Gerd Hoffmann
2025-03-04 12:48 ` [PULL 12/24] hw/uefi: add var-service-pkcs7-stub.c Gerd Hoffmann
2025-03-04 12:48 ` [PULL 13/24] hw/uefi: add var-service-siglist.c Gerd Hoffmann
2025-03-04 12:48 ` [PULL 14/24] hw/uefi: add var-service-json.c + qapi for NV vars Gerd Hoffmann
2025-03-18 16:39   ` Peter Maydell
2025-03-19  8:29     ` Gerd Hoffmann
2025-03-19 10:18       ` Peter Maydell
2025-03-19 11:39         ` Gerd Hoffmann
2025-03-04 12:48 ` [PULL 15/24] hw/uefi: add trace-events Gerd Hoffmann
2025-03-04 12:48 ` [PULL 16/24] hw/uefi: add UEFI_VARS to Kconfig Gerd Hoffmann
2025-03-19 11:27   ` Daniel P. Berrangé
2025-03-19 11:43     ` Gerd Hoffmann
2025-03-19 12:02     ` Philippe Mathieu-Daudé
2025-03-04 12:48 ` [PULL 17/24] hw/uefi: add to meson Gerd Hoffmann
2025-03-04 12:48 ` [PULL 18/24] hw/uefi: add uefi-vars-sysbus device Gerd Hoffmann
2025-03-04 12:48 ` [PULL 19/24] hw/uefi-vars-sysbus: qemu platform bus support Gerd Hoffmann
2025-03-04 12:48 ` [PULL 20/24] hw/uefi-vars-sysbus: add x64 variant Gerd Hoffmann
2025-09-16 11:43   ` Peter Maydell
2025-03-04 12:48 ` [PULL 21/24] hw/uefi-vars-sysbus: allow for arm virt Gerd Hoffmann
2025-03-04 12:48 ` [PULL 22/24] hw/uefi-vars-sysbus: allow for pc and q35 Gerd Hoffmann
2025-03-04 12:48 ` [PULL 23/24] hw/uefi: add MAINTAINERS entry Gerd Hoffmann
2025-03-04 12:48 ` [PULL 24/24] docs: add uefi variable service documentation Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=04aad62d-321e-4b37-ad11-4f785f7c3d81@linaro.org \
    --to=philmd@linaro.org \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=michael.roth@amd.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).