public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: "Cohen, Eugene" <eugene@hp.com>,
	Larry Cleeton <Larry.Cleeton@microsoft.com>,
	"Ye, Ting" <ting.ye@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@ml01.01.org>
Subject: Re: Breaking change issue with NetworkPkg/Ip6Dxe/Ip6ConfigImlp.[c, h]
Date: Fri, 5 Aug 2016 21:03:26 +0200	[thread overview]
Message-ID: <6be427bf-21d9-207d-f504-4946d4fe07f4@redhat.com> (raw)
In-Reply-To: <AT5PR84MB0291BCF32DB2372386F29A87B4180@AT5PR84MB0291.NAMPRD84.PROD.OUTLOOK.COM>

On 08/05/16 18:12, Cohen, Eugene wrote:
> We've been hit by this same kind of issue and it's really painful, especially as it affects shipping systems.
> 
> Long term I think we need an extensible/revisioned data format so we can get forwards and backwards compatibility between NVRAM data and FW.

In OVMF we have a (very rudimentary) implementation for this, see
PlatformConfigLoad() in "OvmfPkg/PlatformDxe/PlatformConfig.c".

The idea is shamelessly stolen from UEFI protocols:
- we store the config structure in some NV variable under some
  namespace GUID,
- new fields can only be added after existing fields to the structure,
- if a new field would change the meaning of a preexistent field, or
  some preexistent fields would have to be dropped / replaced, then the
  change is deemed incompatible, and a new variable name or namespace
  GUID is required.

The number of bytes the config reader function reads from the variable
is the minimum of:
(a) the size of the variable,
(b) the size of largest structure version known to the config reader.

If a==b, then it's a version match. If a>b, then it's a firmware
downgrade (unknown fields are ignored). If a<b, then it's a firmware
upgrade, fields missing from the NV data are initialized to default
values (or some such).

The implementation in OVMF is of course just a "stem" for future
extensions. We've never needed such an extension yet :), but the idea is
the one above, FWIW.

Thanks
Laszlo



      reply	other threads:[~2016-08-05 19:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-02 20:55 Breaking change issue with NetworkPkg/Ip6Dxe/Ip6ConfigImlp.[c, h] Larry Cleeton
2016-08-05  3:24 ` Ye, Ting
2016-08-05 15:34   ` Larry Cleeton
2016-08-05 16:12     ` Cohen, Eugene
2016-08-05 19:03       ` Laszlo Ersek [this message]

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=6be427bf-21d9-207d-f504-4946d4fe07f4@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