All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Lendacky <thomas.lendacky@amd.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Dov Murik" <dovmurik@linux.ibm.com>,
	qemu-devel@nongnu.org
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	James Bottomley <jejb@linux.ibm.com>
Subject: Re: [PATCH] hw/i386/pc: Document pc_system_ovmf_table_find
Date: Tue, 29 Jun 2021 08:28:12 -0500	[thread overview]
Message-ID: <faf8b5b6-435d-44fb-a198-0c5382dd12b4@amd.com> (raw)
In-Reply-To: <0fcb8bf0-f149-e0e6-5dde-8c21df96887c@redhat.com>

On 6/29/21 2:11 AM, Philippe Mathieu-Daudé wrote:
> On 6/29/21 7:56 AM, Dov Murik wrote:
>> On 29/06/2021 1:03, Tom Lendacky wrote:
>>> On 6/22/21 7:58 AM, Dov Murik wrote:
>>

>> (a) add a 'static bool ovmf_table_parsed' which will be set to true at
>> the beginning of pc_system_parse_ovmf_flash(). Then, at the beginning of
>> pc_system_ovmf_table_find add: assert(ovmf_table_parsed).
>>
>> (b) (ab)use our existing ovmf_table_len static variable: initialize it
>> to -1 (meaning that we haven't parsed the OVMF flash yet). When looking
>> for the table set it to 0 (meaning that OVMF table doesn't exist or is
>> invalid). When a proper table is found and copied to ovmf_table, then
>> set it to the real length (>= 0). At the beginning of
>> pc_system_ovmf_table_find add: assert(ovmf_table_len != -1). (this -1
>> can be #define OVMF_FLASH_NOT_PARSED -1).
>>
>>
>> Phil, Tom, James: which do you prefer? other options? Rust enum? ;-)
> 
> Since we are discussing code that should not be called, I don't have
> strong preference as long as we keep the code easy to review :)
> 
> With that in mind, (a) seems simpler.

Yes, to me (a) seems simpler, too.

Thanks,
Tom

> 
> Regards,
> 
> Phil.
> 


  reply	other threads:[~2021-06-29 13:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22 12:44 [PATCH] hw/i386/pc: Document pc_system_ovmf_table_find Dov Murik
2021-06-22 12:47 ` Philippe Mathieu-Daudé
2021-06-22 12:58   ` Dov Murik
2021-06-28 22:03     ` Tom Lendacky
2021-06-29  5:56       ` Dov Murik
2021-06-29  7:11         ` Philippe Mathieu-Daudé
2021-06-29 13:28           ` Tom Lendacky [this message]
2021-06-29  7:29         ` Dov Murik

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=faf8b5b6-435d-44fb-a198-0c5382dd12b4@amd.com \
    --to=thomas.lendacky@amd.com \
    --cc=dovmurik@linux.ibm.com \
    --cc=ehabkost@redhat.com \
    --cc=jejb@linux.ibm.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.