public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC 6/6] efi_loader: variable: support runtime variable access via cache
Date: Tue, 18 Jun 2019 13:34:48 +0300	[thread overview]
Message-ID: <20190618103448.GA25137@apalos> (raw)
In-Reply-To: <20190618011903.GF6610@linaro.org>

Hi all,

[...]
> > >>I think one version of the functions serving at runtime and boottime is
> > >>enough.
> > >>
> > >>The cache should be used both at runtime and at boottime.
> > >
> > >So do you mean that we should replace the existing "boottime" version
> > >of get/set_variable with my code (algorithm)?
> > >
> > >This is a bit complicated work because we should be able to *udpate*
> > >UEFI variables at boottime, but my version of hsearch_runtime() is
> > >a stripped (and modified) version and doesn't support it.
> > 
> > Do we really need a multilevel hash table? I would not expect hundreds
> > of variables.
> 
> Please don't change your point suddenly.
> Here we are discussing whether "The cache should be used both at runtime
> and at boottime" or not.
> 
Heinrich, the idea here is to present a copy of the variables on the OS
and totally disable RT variable updating from the OS.
If someone wants to update UEFI variables, we can pack them to a Capsule
(using FIT image format) and apply them on next reboot.
Given the fact that UEFI variables are not updated that often, isn't this a
viable option? If it is, then we need to keep the access separated
(as Akashi-san suggests) allowing bootime to change the variables.

> > >
> > >Making the existing hsearch_r() executable at UEFI runtime is,
> > >as I said before, quite painful.
> > 
> > You could start the cache implementation with a less complicated data
> > structure like a linked list.
> 
> This is totally a different issue. I listed this issue
> in my cover letter.
> 
> > >
> > >>Essentially I
> > >>expect three modules working together:
> > >>
> > >>UEFI API implementation <-> Cache <-> Persistence driver
> > >>
> > >>I would suggest to put each of these into a separate file.
> > >>
> > >>Both the API implementation and the Cache have to be available at
> > >>Boottime and at Runtime. A first version of the persistence driver may
> > >>only be working at boottime.
> > >
> > >Unfortunately, this is not practical right now because there is
> > >already some sort of assumption (and consensus) that we would re-use
> > >"Standalone MM services", which is already there in EDK2, as
> > >secure storage for UEFI variables.
> > >In the case, all the cache would be bypassed.
> > >In my old prototype, I utilized the cache but dropped that feature
> > >for several reasons.
> > 
> > What has EDK2 code to do with it?
> 
> Did you follow my comment below?
> > >Unfortunately, this is not practical right now because there is
> > >already some sort of assumption (and consensus) that we would re-use
> > >"Standalone MM services", which is already there in EDK2, as
> > >secure storage for UEFI variables.
We are already working towards having StandAloneMM as an early OP-TEE TA.
This will provide us with a secure variable storage for armv7/v8.

> 
> > In case of write you could do a write-through in your cache if needed.
> > 
> > >
> > >>The NV-cache content should be written to non-volatile memory on Reset()
> > >>and on ExitBootServices() and if possible when updating variables at
> > >>runtime.
> > >
> > >I'm not sure your intent here, but are you going to write back
> > >the cache only once?
> > >It won't work as every change of UEFI variable must be flushed
> > >to persistent storage instantly.
> > 
> > >


Thanks
/Ilias

  parent reply	other threads:[~2019-06-18 10:34 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-05  4:21 [U-Boot] [RFC 0/6] efi_loader: support runtime variable access via cache AKASHI Takahiro
2019-06-05  4:21 ` [U-Boot] [RFC 1/6] efi_loader: runtime: make SetVirtualAddressMap configurable AKASHI Takahiro
2019-06-15 19:46   ` Heinrich Schuchardt
2019-06-15 21:14     ` Mark Kettenis
2019-06-16 21:52       ` Heinrich Schuchardt
2019-06-18 18:11         ` Mark Kettenis
2019-06-17  1:05     ` AKASHI Takahiro
2019-06-05  4:21 ` [U-Boot] [RFC 2/6] efi: add RuntimeServicesSupported variable AKASHI Takahiro
2019-06-13  5:56   ` Heinrich Schuchardt
2019-06-13  7:06     ` AKASHI Takahiro
2019-06-13  9:17       ` Heinrich Schuchardt
2019-06-13  9:21         ` Heinrich Schuchardt
2019-06-05  4:21 ` [U-Boot] [RFC 3/6] efi_loader: support convert_pointer at runtime AKASHI Takahiro
2019-06-15 19:41   ` Heinrich Schuchardt
2019-06-17  1:15     ` AKASHI Takahiro
2019-06-17  5:41       ` Heinrich Schuchardt
2019-07-13  6:16         ` Heinrich Schuchardt
2019-06-05  4:21 ` [U-Boot] [RFC 4/6] efi_loader: Patch non-runtime code out at ExitBootServices already AKASHI Takahiro
2019-06-05  4:21 ` [U-Boot] [RFC 5/6] cmd: efidebug: add "boot exit" sub-command AKASHI Takahiro
2019-06-05  4:21 ` [U-Boot] [RFC 6/6] efi_loader: variable: support runtime variable access via cache AKASHI Takahiro
2019-06-15 19:01   ` Heinrich Schuchardt
2019-06-17  1:51     ` AKASHI Takahiro
2019-06-17 19:52       ` Heinrich Schuchardt
2019-06-18  1:19         ` AKASHI Takahiro
2019-06-18  2:25           ` AKASHI Takahiro
2019-06-18 10:34           ` Ilias Apalodimas [this message]
2019-06-18 20:45             ` Heinrich Schuchardt
2019-06-19  1:25               ` AKASHI Takahiro
2019-06-19  5:13                 ` Ilias Apalodimas
2019-06-19  6:24                   ` Heinrich Schuchardt
2019-06-19  7:07                     ` AKASHI Takahiro
2019-06-05 10:34 ` [U-Boot] [RFC 0/6] efi_loader: " Heinrich Schuchardt

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=20190618103448.GA25137@apalos \
    --to=ilias.apalodimas@linaro.org \
    --cc=u-boot@lists.denx.de \
    /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