From: <Narendra.K@dell.com>
To: <ard.biesheuvel@linaro.org>
Cc: <pjones@redhat.com>, <linux-efi@vger.kernel.org>
Subject: Re: [RFC PATCH] Export Runtime Configuration Interface table to sysfs
Date: Wed, 26 Jun 2019 12:17:22 +0000 [thread overview]
Message-ID: <20190626121712.GA2523@localhost.localdomain> (raw)
In-Reply-To: <CAKv+Gu_cdjU49d5JSJKJ_2Eb2Pp2JY=xe=39J3KyVs7qQnke2g@mail.gmail.com>
On Tue, Jun 25, 2019 at 04:21:33PM +0200, Ard Biesheuvel wrote:
[...]
> > > > --- a/drivers/firmware/efi/efi.c
> > > > +++ b/drivers/firmware/efi/efi.c
> > > > @@ -53,6 +53,7 @@ struct efi __read_mostly efi = {
> > > > .rng_seed = EFI_INVALID_TABLE_ADDR,
> > > > .tpm_log = EFI_INVALID_TABLE_ADDR,
> > > > .mem_reserve = EFI_INVALID_TABLE_ADDR,
> > > > + .rci2 = EFI_INVALID_TABLE_ADDR,
> > >
> > > Does this really need to live in the efi struct?
> >
> > It probably need not be part of struct efi. We could define a struct of
> > type 'efi_config_table_type_t' in the rci2_table.c. Did you have a
> > similar idea in mind ? If yes, I will modify and test this idea.
> >
>
> Yes, I'd like to start keeping these things separate.
>
> I pushed a branch here
>
> https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git/log/?h=next
>
> that changes the way uv_systab is handled, and moves it into arch/x86.
> Please follow that pattern instead.
Okay. Thank you for the guidance. I will make this change in the next version.
>
> > >
> > > > };
> > > > EXPORT_SYMBOL(efi);
> > > >
> > > > @@ -73,6 +74,7 @@ static unsigned long *efi_tables[] = {
> > > > &efi.esrt,
> > > > &efi.properties_table,
> > > > &efi.mem_attr_table,
> > > > + &efi.rci2,
> > > > };
> > > >
> > >
> > > AFAICT, this table is only used by memremap_is_efi_data() to decide
> > > whether a page should be map as unencrypted, and if the address is in
> > > boot services data or runtime services data, the test will already
> > > success, regardless of whether it appears in this enumeration.
> >
> > Yes. Before 'memremap_is_efi_data()' checks if the memory type is boot
> > services data for runtime services data, it checks if the address is a
> > 'table' address in 'efi_is_table_address'. I added it because of this
> > check. Since the memory type used for the table is efi reserved type, we
> > need to add the table address to 'efi_tables' array so that it could be
> > checked in 'efi_is_table_address'. Please share your thought on this.
> >
>
> OK. My branch ^^^ moves this into arch/x86 as well, please add it there
I have a query related to this change. I will discuss it in next section
below as it helps provide complete context.
> > > > @@ -488,6 +493,12 @@ static __initdata efi_config_table_type_t common_tables[] = {
> > > > {NULL_GUID, NULL, NULL},
> > > > };
> > > >
> > > > +/* OEM Tables */
> > > > +static __initdata efi_config_table_type_t oem_tables[] = {
> > > > + {DELLEMC_EFI_RCI2_TABLE_GUID, "RCI2", &efi.rci2},
> > >
> > > Please drop the string. We don't have to print the presence of this
> > > table in the bootlog since it has no significance to the OS itself.
> >
> > Okay. I will drop this in the next version of the patch.
> >
> > >
> > > > + {NULL_GUID, NULL, NULL},
> > > > +};
> > > > +
> > >
> > > Do we really need a separate oem_tables[] array?
> >
> > The RCI2 table did not seem to be part of the group of common tables
> > such as SMBIOS and ACPI. To indicate this, I created a separate array.
> > It seems like it is not required. Having the array allows to leverage
> > the table matching code in 'match_config_table' function. Would you prefer
> > to have this entry added to the 'common_tables' array ?
> >
>
> Please add it to the arch_tables array in arch/x86 (if my assumption
> is correct that this is x86-only)
The table is used on x86. But it is not specific to x86 and is
independent of the architecture. Because of this detail, my thinking is
to keep the rci2_table.c and related changes in generic efi layer
drivers/firmware/efi/. If we keep the changes in drivers/firmware/efi/,
then two options are
1. Retain the oem_tables array and add rci2 table address to this array
2. Add rci2 table address to common_tables array
Does this detail sound correct ?
Also, since the 'efi_is_table_address' function and efi_tables array are moved
to arch/x86, for rci2 table address to be detected as a table address, it needs to be
added to 'efi_tables' array. Would it be correct to add rci2 table
address to this array with rest of the changes residing in the generic efi
layer ?
Please share your thoughts on the two details.
[...]
> > Would you prefer to merge this function into 'efi_rci2_sysfs_init' function ?
> >
>
> Yes. Only user space needs to access this, so we can defer this to
> later, when the normal memremap() functions are available.
>
Okay, I will make this change in the next version.
--
With regards,
Narendra K
next prev parent reply other threads:[~2019-06-26 12:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-17 10:11 [RFC PATCH] Export Runtime Configuration Interface table to sysfs Narendra.K
2019-06-21 16:35 ` Ard Biesheuvel
2019-06-25 12:10 ` Narendra.K
2019-06-25 14:21 ` Ard Biesheuvel
2019-06-26 12:17 ` Narendra.K [this message]
2019-06-26 12:22 ` Ard Biesheuvel
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=20190626121712.GA2523@localhost.localdomain \
--to=narendra.k@dell.com \
--cc=ard.biesheuvel@linaro.org \
--cc=linux-efi@vger.kernel.org \
--cc=pjones@redhat.com \
/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).