public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: jejb@linux.ibm.com, devel@edk2.groups.io
Cc: dovmurik@linux.vnet.ibm.com, Dov.Murik1@il.ibm.com,
	ashish.kalra@amd.com, brijesh.singh@amd.com, tobin@ibm.com,
	david.kaplan@amd.com, jon.grimm@amd.com, thomas.lendacky@amd.com,
	frankeh@us.ibm.com,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>
Subject: Re: [PATCH v2 2/6] OvmfPkg/AmdSev: add Grub Firmware Volume Package
Date: Tue, 24 Nov 2020 09:23:26 +0100	[thread overview]
Message-ID: <b95a5301-7987-5ccd-7228-7690fc535a89@redhat.com> (raw)
In-Reply-To: <06b9425507ab8c1b35d377cf9bba155b0cc44147.camel@linux.ibm.com>

On 11/24/20 07:38, James Bottomley wrote:
> On Mon, 2020-11-23 at 22:08 +0100, Laszlo Ersek wrote:

>> In [a](5) I requested the removal of everything in this INF file that
>> was not required for the desired semantics (i.e., for unconditionally
>> booting the builtin GRUB binary).
>>
>> So again I'm unsure if you missed my feedback, or thought it was not
>> important. (I didn't get a request for clarification either.)
>>  
>> Keeping INF files minimal is relevant for future contributions. We
>> frequently need to determine the set of modules that depend on a
>> particular PCD. If some INF files list PCDs unjustifiedly, then the
>> affected module set may appear larger than it really is.
>>
>> This applies to all sections of the INF file, not just [Pcd].
> 
> I did try stripping quite a lot, but then it wouldn't boot.  It seems
> that the PCI devices are needed for grub to find the encrypted volume,
> so I put most of it back again.  Is there some way of identifying
> superfluous pieces so I can detect if I put too much back?

I suggest proceeding element by element in the INF file (and matching
that, in the header / C files) -- remove one element per patch. Then you
can either build+test it as you go, or create a series of micro-patches
up-front, and if it doesn't boot, bisect it. Finally, squash the
removals that are justifiable into this patch (for posting), and drop
the rest.

It's unfortunately trial and error to some extent; however, given that
each step removes 1 element (PCD, Protocol, GUID, lib class, and finally
Package), and the number of elements summed over the INF file sections
is finite, this process is guaranteed to terminate.

Working in the other direction is much simpler, because the compiler
and/or the "build" tool will tell you if something is missing. Alas,
they don't tell us when something is listed superfluously. (The same
problem applies to #include directives in any C project -- I'm unaware
of any tool that flags a superfluous #include directive as such.)


>> (13) the indentation seems strange (Linux kernel style?); please
>> don't use hardware tabs. (Hmmm, applies to other parts of this script
>> too.)
> 
> OK, I got emacs to untabify it.  I did try converting it to DOS format
> like the rest of edk2 but bash really doesn't like that:
> 
> /home/jejb/git/edk2/OvmfPkg/AmdSev/Grub/grub.sh: line 10: $'\r':
> command not found

Yup, "grub.cfg" and "grub.sh" should use LF line terminators, not CRLF.

If you use 8bit or base64 Content-Transfer-Encoding with git-send-email,
it should be possible to send a patch that contains hunks with both LF
and CRLF line terminators.

This CRLF mess is a long-standing problem in edk2, and it has trained me
to look for files such as "grub.cfg" and "grub.sh" in patches. I tend to
verify them for LF manually, and if they appear to have CRLF after I
apply them locally -- which may or may not mean that they had CRLF on
the contributor's side too --, then I push them through dos2unix first
(rebasing the series).


... apologies that I sounded irritated earlier; it had been another
hectic day.

Thanks!
Laszlo


  reply	other threads:[~2020-11-24  8:23 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20 18:45 [PATCH v2 0/6] SEV Encrypted Boot for Ovmf James Bottomley
2020-11-20 18:45 ` [PATCH v2 1/6] OvmfPkg/Amdsev: Base commit to build encrypted boot specific OVMF James Bottomley
2020-11-23 18:01   ` Laszlo Ersek
2020-11-23 23:25     ` James Bottomley
2020-11-23 23:43       ` Laszlo Ersek
2020-11-20 18:45 ` [PATCH v2 2/6] OvmfPkg/AmdSev: add Grub Firmware Volume Package James Bottomley
2020-11-23 21:08   ` Laszlo Ersek
2020-11-24  6:38     ` James Bottomley
2020-11-24  8:23       ` Laszlo Ersek [this message]
2020-11-24 14:54         ` Laszlo Ersek
2020-11-24 15:58           ` Laszlo Ersek
2020-11-24 16:22             ` [edk2-devel] " James Bottomley
2020-11-24 23:22               ` Laszlo Ersek
2020-11-24 23:42                 ` James Bottomley
2020-11-25  1:27                   ` James Bottomley
2020-11-25 14:01                     ` Laszlo Ersek
2020-11-25 16:02                       ` James Bottomley
2020-11-25 17:09                         ` James Bottomley
2020-11-25 18:17                           ` James Bottomley
2020-11-25 19:20                             ` Laszlo Ersek
2020-11-25 20:11                               ` James Bottomley
2020-11-25 18:35                           ` Laszlo Ersek
2020-11-25 19:08                             ` Laszlo Ersek
2020-11-25 19:14                               ` Laszlo Ersek
2020-11-20 18:45 ` [PATCH v2 3/6] OvmfPkg: convert ES Reset Block structure to be guided James Bottomley
2020-11-23 22:16   ` Laszlo Ersek
2020-11-24 14:57     ` Lendacky, Thomas
2020-11-24 19:07       ` James Bottomley
2020-11-24 23:19         ` Laszlo Ersek
2020-11-24 19:05     ` James Bottomley
2020-11-24 23:15       ` Laszlo Ersek
2020-11-20 18:45 ` [PATCH v2 4/6] OvmfPkg: create a SEV secret area in the AmdSev memfd James Bottomley
2020-11-23 22:28   ` Laszlo Ersek
2020-11-20 18:45 ` [PATCH v2 5/6] OvmfPkg/AmdSev: assign and protect the Sev Secret area James Bottomley
2020-11-23 22:38   ` Laszlo Ersek
2020-11-20 18:45 ` [PATCH v2 6/6] OvmfPkg/AmdSev: Expose the Sev Secret area using a configuration table James Bottomley
2020-11-23 22:56   ` Laszlo Ersek

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-list 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=b95a5301-7987-5ccd-7228-7690fc535a89@redhat.com \
    --to=devel@edk2.groups.io \
    /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