Re: [PATCH v1] Export Runtime Configuration Interface table to sysfs

2019-08-08 Thread Narendra.K
On Thu, Aug 08, 2019 at 11:16:55AM +0300, Ard Biesheuvel wrote:
> 
> On Wed, 7 Aug 2019 at 16:09,  wrote:
> > On Thu, Jul 11, 2019 at 11:00:37PM +, Limonciello, Mario wrote:
[...]
> > Hi Ard,
> >
> > Does the version 1 of the patch look good ? Please share your thoughts.
> >
> 
> Thanks Narendra,
> 
> The patch looks mostly fine. I have pushed it to my efi/next branch,

Ard, thank you for the review comments and applying the patch.

> and I will let you know if the autobuilders find any problems.

Ok.

> 
> One possible enhancement would be to defer the second memremap() call
> until the first call to raw_table_read(), so the mapping only exists
> if you are actually interested in the contents of the table. If you do
> decide to make any followup changes, please send them as delta patches
> against 
> https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git/log/?h=next

Ok. I will work on the enhancement suggestion. Thank you for the
suggestion. 

-- 
With regards,
Narendra K

Re: [PATCH v1] Export Runtime Configuration Interface table to sysfs

2019-08-08 Thread Ard Biesheuvel
On Wed, 7 Aug 2019 at 16:09,  wrote:
>
> On Thu, Jul 11, 2019 at 11:00:37PM +, Limonciello, Mario wrote:
> > > -Original Message-
> > > From: K, Narendra
> > > Sent: Wednesday, July 10, 2019 11:59 AM
> > > To: linux-efi@vger.kernel.org; ard.biesheu...@linaro.org; 
> > > pjo...@redhat.com
> > > Cc: K, Narendra; Hayes, Stuart; Limonciello, Mario
> > > Subject: [PATCH v1] Export Runtime Configuration Interface table to sysfs
> > >
> > > From: Narendra K 
> > >
> > > System firmware advertises the address of the 'Runtime Configuration 
> > > Interface
> > > table version 2 (RCI2)' via an EFI Configuration Table entry. This code 
> > > retrieves
> > > the RCI2 table from the address and exports it to sysfs as a binary 
> > > attribute 'rci2'
> > > under /sys/firmware/efi/tables directory.
> > > The approach adopted is similar to the attribute 'DMI' under
> > > /sys/firmware/dmi/tables.
> > >
> > > RCI2 table contains BIOS HII in XML format and is used to populate BIOS 
> > > setup
> > > page in Dell EMC OpenManage Server Administrator tool.
> > > The BIOS setup page contains BIOS tokens which can be configured.
> > >
> > > Signed-off-by: Narendra K 
> >
> > Reviewed-by: Mario Limonciello 
>
> Hi Ard,
>
> Does the version 1 of the patch look good ? Please share your thoughts.
>

Thanks Narendra,

The patch looks mostly fine. I have pushed it to my efi/next branch,
and I will let you know if the autobuilders find any problems.

One possible enhancement would be to defer the second memremap() call
until the first call to raw_table_read(), so the mapping only exists
if you are actually interested in the contents of the table. If you do
decide to make any followup changes, please send them as delta patches
against https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git/log/?h=next

Thanks,
Ard.




> >
> > > ---
> > > Hi Ard, the review comment in the v0 version of the patch suggested that 
> > > the
> > > kconfig symbol be set to Y for X86. I made a change to the suggestion.
> > > In the v1 version, I have set the symbol to N by default and added a note 
> > > to the
> > > help section to make it Y for Dell EMC PowerEdge systems. If it needs to 
> > > be
> > > changed, I will resubmit the patch after changing it to implement the 
> > > suggestion.
> > >
> > > The patch is created on 'next' branch of efi tree.
> > >
> > > v0 -> v1:
> > > - Introduced a new Kconfig symbol CONFIG_EFI_RCI2_TABLE and compile
> > > RCI2 table support if it is set. Set the symbol to N by default.
> > > - Removed calling 'efi_rci2_sysfs_init' from drivers/firmware/efi/efi.c 
> > > and made
> > > it a 'late_initcall' in drivers/firmware/efi/rci2_table.c.
> > > Removed the function declaration from include/linux/efi.h.
> > >
> > > RFC -> v0:
> > > - Removed rci2 table from struct efi and defined it in rci2_table.c 
> > > similar to the
> > > way uv_systab_phys is defined in arch/x86/platform/uv/bios_uv.c
> > > - Removed the oem_tables array and added rci2 to common_tables array
> > > - Removed the string 'rci2' from the common_tables array so that it is not
> > > printed in dmesg.
> > > - Merged function 'efi_rci2_table_init' into 'efi_rci2_sysfs_init' 
> > > function to avoid
> > > calling early_memremap/unmap functions.
>
> --
> With regards,
> Narendra K


Re: [PATCH v1] Export Runtime Configuration Interface table to sysfs

2019-08-07 Thread Narendra.K
On Thu, Jul 11, 2019 at 11:00:37PM +, Limonciello, Mario wrote:
> > -Original Message-
> > From: K, Narendra
> > Sent: Wednesday, July 10, 2019 11:59 AM
> > To: linux-efi@vger.kernel.org; ard.biesheu...@linaro.org; pjo...@redhat.com
> > Cc: K, Narendra; Hayes, Stuart; Limonciello, Mario
> > Subject: [PATCH v1] Export Runtime Configuration Interface table to sysfs
> > 
> > From: Narendra K 
> > 
> > System firmware advertises the address of the 'Runtime Configuration 
> > Interface
> > table version 2 (RCI2)' via an EFI Configuration Table entry. This code 
> > retrieves
> > the RCI2 table from the address and exports it to sysfs as a binary 
> > attribute 'rci2'
> > under /sys/firmware/efi/tables directory.
> > The approach adopted is similar to the attribute 'DMI' under
> > /sys/firmware/dmi/tables.
> > 
> > RCI2 table contains BIOS HII in XML format and is used to populate BIOS 
> > setup
> > page in Dell EMC OpenManage Server Administrator tool.
> > The BIOS setup page contains BIOS tokens which can be configured.
> > 
> > Signed-off-by: Narendra K 
> 
> Reviewed-by: Mario Limonciello 

Hi Ard,

Does the version 1 of the patch look good ? Please share your thoughts.

> 
> > ---
> > Hi Ard, the review comment in the v0 version of the patch suggested that the
> > kconfig symbol be set to Y for X86. I made a change to the suggestion.
> > In the v1 version, I have set the symbol to N by default and added a note 
> > to the
> > help section to make it Y for Dell EMC PowerEdge systems. If it needs to be
> > changed, I will resubmit the patch after changing it to implement the 
> > suggestion.
> > 
> > The patch is created on 'next' branch of efi tree.
> > 
> > v0 -> v1:
> > - Introduced a new Kconfig symbol CONFIG_EFI_RCI2_TABLE and compile
> > RCI2 table support if it is set. Set the symbol to N by default.
> > - Removed calling 'efi_rci2_sysfs_init' from drivers/firmware/efi/efi.c and 
> > made
> > it a 'late_initcall' in drivers/firmware/efi/rci2_table.c.
> > Removed the function declaration from include/linux/efi.h.
> > 
> > RFC -> v0:
> > - Removed rci2 table from struct efi and defined it in rci2_table.c similar 
> > to the
> > way uv_systab_phys is defined in arch/x86/platform/uv/bios_uv.c
> > - Removed the oem_tables array and added rci2 to common_tables array
> > - Removed the string 'rci2' from the common_tables array so that it is not
> > printed in dmesg.
> > - Merged function 'efi_rci2_table_init' into 'efi_rci2_sysfs_init' function 
> > to avoid
> > calling early_memremap/unmap functions.

-- 
With regards,
Narendra K

RE: [PATCH v1] Export Runtime Configuration Interface table to sysfs

2019-07-11 Thread Mario.Limonciello
> -Original Message-
> From: K, Narendra
> Sent: Wednesday, July 10, 2019 11:59 AM
> To: linux-efi@vger.kernel.org; ard.biesheu...@linaro.org; pjo...@redhat.com
> Cc: K, Narendra; Hayes, Stuart; Limonciello, Mario
> Subject: [PATCH v1] Export Runtime Configuration Interface table to sysfs
> 
> From: Narendra K 
> 
> System firmware advertises the address of the 'Runtime Configuration Interface
> table version 2 (RCI2)' via an EFI Configuration Table entry. This code 
> retrieves
> the RCI2 table from the address and exports it to sysfs as a binary attribute 
> 'rci2'
> under /sys/firmware/efi/tables directory.
> The approach adopted is similar to the attribute 'DMI' under
> /sys/firmware/dmi/tables.
> 
> RCI2 table contains BIOS HII in XML format and is used to populate BIOS setup
> page in Dell EMC OpenManage Server Administrator tool.
> The BIOS setup page contains BIOS tokens which can be configured.
> 
> Signed-off-by: Narendra K 

Reviewed-by: Mario Limonciello 

> ---
> Hi Ard, the review comment in the v0 version of the patch suggested that the
> kconfig symbol be set to Y for X86. I made a change to the suggestion.
> In the v1 version, I have set the symbol to N by default and added a note to 
> the
> help section to make it Y for Dell EMC PowerEdge systems. If it needs to be
> changed, I will resubmit the patch after changing it to implement the 
> suggestion.
> 
> The patch is created on 'next' branch of efi tree.
> 
> v0 -> v1:
> - Introduced a new Kconfig symbol CONFIG_EFI_RCI2_TABLE and compile
> RCI2 table support if it is set. Set the symbol to N by default.
> - Removed calling 'efi_rci2_sysfs_init' from drivers/firmware/efi/efi.c and 
> made
> it a 'late_initcall' in drivers/firmware/efi/rci2_table.c.
> Removed the function declaration from include/linux/efi.h.
> 
> RFC -> v0:
> - Removed rci2 table from struct efi and defined it in rci2_table.c similar 
> to the
> way uv_systab_phys is defined in arch/x86/platform/uv/bios_uv.c
> - Removed the oem_tables array and added rci2 to common_tables array
> - Removed the string 'rci2' from the common_tables array so that it is not
> printed in dmesg.
> - Merged function 'efi_rci2_table_init' into 'efi_rci2_sysfs_init' function 
> to avoid
> calling early_memremap/unmap functions.
> 
>  Documentation/ABI/testing/sysfs-firmware-efi |   8 +
>  arch/x86/platform/efi/efi.c  |   3 +
>  drivers/firmware/efi/Kconfig |  15 ++
>  drivers/firmware/efi/Makefile|   1 +
>  drivers/firmware/efi/efi.c   |   3 +
>  drivers/firmware/efi/rci2_table.c| 147 +++
>  include/linux/efi.h  |   9 ++
>  7 files changed, 186 insertions(+)
>  create mode 100644 drivers/firmware/efi/rci2_table.c
> 
> diff --git a/Documentation/ABI/testing/sysfs-firmware-efi
> b/Documentation/ABI/testing/sysfs-firmware-efi
> index e794eac32a90..5e4d0b27cdfe 100644
> --- a/Documentation/ABI/testing/sysfs-firmware-efi
> +++ b/Documentation/ABI/testing/sysfs-firmware-efi
> @@ -28,3 +28,11 @@ Description:   Displays the physical addresses of all
> EFI Configuration
>   versions are always printed first, i.e. ACPI20 comes
>   before ACPI.
>  Users:   dmidecode
> +
> +What:/sys/firmware/efi/tables/rci2
> +Date:July 2019
> +Contact: Narendra K , linux-b...@dell.com
> +Description: Displays the content of the Runtime Configuration Interface
> + Table version 2 on Dell EMC PowerEdge systems in binary
> format
> +Users:   It is used by Dell EMC OpenManage Server Administrator 
> tool to
> + populate BIOS setup page.
> diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index
> 6697c109c449..c202e1b07e29 100644
> --- a/arch/x86/platform/efi/efi.c
> +++ b/arch/x86/platform/efi/efi.c
> @@ -82,6 +82,9 @@ static const unsigned long * const efi_tables[] = {
>   &efi.esrt,
>   &efi.properties_table,
>   &efi.mem_attr_table,
> +#ifdef CONFIG_EFI_RCI2_TABLE
> + &rci2_table_phys,
> +#endif
>  };
> 
>  u64 efi_setup;   /* efi setup_data physical address */
> diff --git a/drivers/firmware/efi/Kconfig b/drivers/firmware/efi/Kconfig index
> d4ea929e8b34..1e1e33b61713 100644
> --- a/drivers/firmware/efi/Kconfig
> +++ b/drivers/firmware/efi/Kconfig
> @@ -180,6 +180,21 @@ config RESET_ATTACK_MITIGATION
> have been evicted, since otherwise it will trigger even on clean
> reboots.
> 
> +config E

[PATCH v1] Export Runtime Configuration Interface table to sysfs

2019-07-10 Thread Narendra.K
From: Narendra K 

System firmware advertises the address of the 'Runtime
Configuration Interface table version 2 (RCI2)' via
an EFI Configuration Table entry. This code retrieves the RCI2
table from the address and exports it to sysfs as a binary
attribute 'rci2' under /sys/firmware/efi/tables directory.
The approach adopted is similar to the attribute 'DMI' under
/sys/firmware/dmi/tables.

RCI2 table contains BIOS HII in XML format and is used to populate
BIOS setup page in Dell EMC OpenManage Server Administrator tool.
The BIOS setup page contains BIOS tokens which can be configured.

Signed-off-by: Narendra K 
---
Hi Ard, the review comment in the v0 version of the patch suggested
that the kconfig symbol be set to Y for X86. I made a change to the suggestion.
In the v1 version, I have set the symbol to N by default and added a note to
the help section to make it Y for Dell EMC PowerEdge systems. If it needs to
be changed, I will resubmit the patch after changing it to implement the
suggestion.

The patch is created on 'next' branch of efi tree.

v0 -> v1:
- Introduced a new Kconfig symbol CONFIG_EFI_RCI2_TABLE and compile
RCI2 table support if it is set. Set the symbol to N by default.
- Removed calling 'efi_rci2_sysfs_init' from drivers/firmware/efi/efi.c
and made it a 'late_initcall' in drivers/firmware/efi/rci2_table.c.
Removed the function declaration from include/linux/efi.h.

RFC -> v0:
- Removed rci2 table from struct efi and defined it in rci2_table.c similar to
the way uv_systab_phys is defined in arch/x86/platform/uv/bios_uv.c
- Removed the oem_tables array and added rci2 to common_tables array
- Removed the string 'rci2' from the common_tables array so that it is 
not printed in dmesg.
- Merged function 'efi_rci2_table_init' into 'efi_rci2_sysfs_init' function to
avoid calling early_memremap/unmap functions.

 Documentation/ABI/testing/sysfs-firmware-efi |   8 +
 arch/x86/platform/efi/efi.c  |   3 +
 drivers/firmware/efi/Kconfig |  15 ++
 drivers/firmware/efi/Makefile|   1 +
 drivers/firmware/efi/efi.c   |   3 +
 drivers/firmware/efi/rci2_table.c| 147 +++
 include/linux/efi.h  |   9 ++
 7 files changed, 186 insertions(+)
 create mode 100644 drivers/firmware/efi/rci2_table.c

diff --git a/Documentation/ABI/testing/sysfs-firmware-efi 
b/Documentation/ABI/testing/sysfs-firmware-efi
index e794eac32a90..5e4d0b27cdfe 100644
--- a/Documentation/ABI/testing/sysfs-firmware-efi
+++ b/Documentation/ABI/testing/sysfs-firmware-efi
@@ -28,3 +28,11 @@ Description: Displays the physical addresses of all EFI 
Configuration
versions are always printed first, i.e. ACPI20 comes
before ACPI.
 Users: dmidecode
+
+What:  /sys/firmware/efi/tables/rci2
+Date:  July 2019
+Contact:   Narendra K , linux-b...@dell.com
+Description:   Displays the content of the Runtime Configuration Interface
+   Table version 2 on Dell EMC PowerEdge systems in binary format
+Users: It is used by Dell EMC OpenManage Server Administrator tool to
+   populate BIOS setup page.
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 6697c109c449..c202e1b07e29 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -82,6 +82,9 @@ static const unsigned long * const efi_tables[] = {
&efi.esrt,
&efi.properties_table,
&efi.mem_attr_table,
+#ifdef CONFIG_EFI_RCI2_TABLE
+   &rci2_table_phys,
+#endif
 };
 
 u64 efi_setup; /* efi setup_data physical address */
diff --git a/drivers/firmware/efi/Kconfig b/drivers/firmware/efi/Kconfig
index d4ea929e8b34..1e1e33b61713 100644
--- a/drivers/firmware/efi/Kconfig
+++ b/drivers/firmware/efi/Kconfig
@@ -180,6 +180,21 @@ config RESET_ATTACK_MITIGATION
  have been evicted, since otherwise it will trigger even on clean
  reboots.
 
+config EFI_RCI2_TABLE
+   bool "EFI Runtime Configuration Interface Table Version 2 Support"
+   depends on EFI
+   default n
+   help
+ Displays the content of the Runtime Configuration Interface
+ Table version 2 on Dell EMC PowerEdge systems as a binary
+ attribute 'rci2' under /sys/firmware/efi/tables directory.
+
+ RCI2 table contains BIOS HII in XML format and is used to populate
+ BIOS setup page in Dell EMC OpenManage Server Administrator tool.
+ The BIOS setup page contains BIOS tokens which can be configured.
+
+ Say Y here for Dell EMC PowerEdge systems.
+
 endmenu
 
 config UEFI_CPER
diff --git a/drivers/firmware/efi/Makefile b/drivers/firmware/efi/Makefile
index d2d0d2030620..2693f291a950 100644
--- a/drivers/firmware/efi/Makefile
+++ b/drivers/firmware/efi/Makefile
@@ -25,6 +25,7 @@ obj-$(CONFIG_EFI_BOOTLOADER_CONTROL)  += efibc.o
 obj-$(CONFIG_EFI_TEST) += test/
 obj-$(CONFIG_EFI_DEV_P