ESRT in OVMF


Sandeep Dhanvada
 

Hi,

I am trying to test capsule based FMP device upgrade in OVMF. I have a PCI NIC Adapter with PCI Passthrough enabled and need to upgrade firmware for this NIC in ovmf. I generated capsule file with embedded driver as FMP driver and payload as option ROM image.

I tried CapsuleApp.efi from OVMF Shell and also fwupdate tool from Linux.

Below is the observation with CapsuleApp.efi:
1. "CapsuleApp.efi -E" command from ovmf shell, but, it is not displaying any entries.
2. "CapsuleApp.efi -D <CapsuleFile>" is showing Capsule Header, Fmp Header and Fmp Payload Image Header properly.

Below is the observation with fwupdate tool in Linux:
1. CONFIG_EFI_ESRT is enabled in Kernel Config.
2. /sys/firmware/efi sysfs entry is created, but, there is no esrt entry under this.
3. Since there is no esrt sysfs entry, "fwupdate -s" command is showing that firmware updates are not supported.

Please let me know how to add ESRT table in OVMF so that i can upgrade device firmware.

Thanks,
Sandeep


Laszlo Ersek
 

Hello Sandeep,

On 07/29/20 05:03, Sandeep Dhanvada wrote:
Hi,

I am trying to test capsule based FMP device upgrade in OVMF.
This is out of scope for the current OvmfPkg platforms.

Clearly I'm not saying that capsule updates "should not" be supported by
OVMF "ever", all I'm saying is that for such use cases, a new OvmfPkg
platform DSC will be necessary.

(If the intent with the capsule update is to upgrade the firmware add-on
devices *only*, that is, not the platform firmware itself, then *maybe*
the current OVMF DSC files could accommodate that, introducing a new
(default-off) build feature flag. I'm not sure.)

Mike Kinney and Peter Jones have done some work around capsule updates
in OVMF; I'm CC'ing them. Perhaps you can use their results for your
experiments.

Thanks
Laszlo

I have a PCI NIC Adapter with PCI Passthrough enabled and need to upgrade firmware for this NIC in ovmf. I generated capsule file with embedded driver as FMP driver and payload as option ROM image.

I tried CapsuleApp.efi from OVMF Shell and also fwupdate tool from Linux.

Below is the observation with CapsuleApp.efi:
1. "CapsuleApp.efi -E" command from ovmf shell, but, it is not displaying any entries.
2. "CapsuleApp.efi -D <CapsuleFile>" is showing Capsule Header, Fmp Header and Fmp Payload Image Header properly.

Below is the observation with fwupdate tool in Linux:
1. CONFIG_EFI_ESRT is enabled in Kernel Config.
2. /sys/firmware/efi sysfs entry is created, but, there is no esrt entry under this.
3. Since there is no esrt sysfs entry, "fwupdate -s" command is showing that firmware updates are not supported.

Please let me know how to add ESRT table in OVMF so that i can upgrade device firmware.


Sandeep Dhanvada
 

Hello Laszlo,

Thanks for your inputs. I will wait for updates from Mike Kinney and Peter Jones.

In DSC, i made the change mentioned in below patch, but still i am not able to see ESRT table.
https://www.redhat.com/archives/edk2-devel-archive/2019-July/msg00167.html

Thanks,
Sandeep


Michael D Kinney
 

Sandeep,

I agree with Laszlo that a new DSC/FDF file would be required.

Adding full set of UEFI feature to a new DSC/FDF file would
also enable more platform tests in EDK II CI as well, so it
would be valuable for more than just the use case described
here.

It is not a large change to add ESRT/FMP support. You can look
at edk2-platforms/Platform/Intel/Vlv2TbltDevicePkg for a
working platform example.

Best regards,

Mike

-----Original Message-----
From: Peter Jones <pjones@redhat.com>
Sent: Wednesday, July 29, 2020 8:36 AM
To: Laszlo Ersek <lersek@redhat.com>
Cc: sandeep.dhanvada@xilinx.com; discuss@edk2.groups.io;
Kinney, Michael D <michael.d.kinney@intel.com>
Subject: Re: [edk2-discuss] ESRT in OVMF

On Wed, Jul 29, 2020 at 11:52:42AM +0200, Laszlo Ersek
wrote:
Hello Sandeep,

On 07/29/20 05:03, Sandeep Dhanvada wrote:
Hi,

I am trying to test capsule based FMP device upgrade
in OVMF.

This is out of scope for the current OvmfPkg
platforms.

Clearly I'm not saying that capsule updates "should
not" be supported by
OVMF "ever", all I'm saying is that for such use
cases, a new OvmfPkg
platform DSC will be necessary.

(If the intent with the capsule update is to upgrade
the firmware add-on
devices *only*, that is, not the platform firmware
itself, then *maybe*
the current OVMF DSC files could accommodate that,
introducing a new
(default-off) build feature flag. I'm not sure.)

Mike Kinney and Peter Jones have done some work around
capsule updates
in OVMF; I'm CC'ing them. Perhaps you can use their
results for your
experiments.
I have a couple of ancient branches in various states of
disrepair that
were used as part of an API tester at one point. It's
from before FMP
was really driving anything and before the ESRT data
structures were
fully pushed to edk2, and such they are clearly well
unmaintained and
have totally rotted, but if there's any chance they help
at all, they're
at:

https://github.com/vathpela/edk2/tree/fake-capsule
https://github.com/vathpela/edk2/tree/fake-capsule-0
https://github.com/vathpela/edk2/tree/fake-capsule-1

Thanks
Laszlo

I have a PCI NIC Adapter with PCI Passthrough
enabled and need to
upgrade firmware for this NIC in ovmf. I generated
capsule file with
embedded driver as FMP driver and payload as option
ROM image.

I tried CapsuleApp.efi from OVMF Shell and also
fwupdate tool from
Linux.

Below is the observation with CapsuleApp.efi:
1. "CapsuleApp.efi -E" command from ovmf shell, but,
it is not displaying any entries.
2. "CapsuleApp.efi -D <CapsuleFile>" is showing
Capsule Header, Fmp Header and Fmp Payload Image Header
properly.

Below is the observation with fwupdate tool in
Linux:
1. CONFIG_EFI_ESRT is enabled in Kernel Config.
2. /sys/firmware/efi sysfs entry is created, but,
there is no esrt entry under this.
3. Since there is no esrt sysfs entry, "fwupdate -s"
command is showing that firmware updates are not
supported.

Please let me know how to add ESRT table in OVMF so
that i can upgrade device firmware.

--
Peter


Peter Jones <pjones@...>
 

On Wed, Jul 29, 2020 at 11:52:42AM +0200, Laszlo Ersek wrote:
Hello Sandeep,

On 07/29/20 05:03, Sandeep Dhanvada wrote:
Hi,

I am trying to test capsule based FMP device upgrade in OVMF.
This is out of scope for the current OvmfPkg platforms.

Clearly I'm not saying that capsule updates "should not" be supported by
OVMF "ever", all I'm saying is that for such use cases, a new OvmfPkg
platform DSC will be necessary.

(If the intent with the capsule update is to upgrade the firmware add-on
devices *only*, that is, not the platform firmware itself, then *maybe*
the current OVMF DSC files could accommodate that, introducing a new
(default-off) build feature flag. I'm not sure.)

Mike Kinney and Peter Jones have done some work around capsule updates
in OVMF; I'm CC'ing them. Perhaps you can use their results for your
experiments.
I have a couple of ancient branches in various states of disrepair that
were used as part of an API tester at one point. It's from before FMP
was really driving anything and before the ESRT data structures were
fully pushed to edk2, and such they are clearly well unmaintained and
have totally rotted, but if there's any chance they help at all, they're
at:

https://github.com/vathpela/edk2/tree/fake-capsule
https://github.com/vathpela/edk2/tree/fake-capsule-0
https://github.com/vathpela/edk2/tree/fake-capsule-1

Thanks
Laszlo

I have a PCI NIC Adapter with PCI Passthrough enabled and need to
upgrade firmware for this NIC in ovmf. I generated capsule file with
embedded driver as FMP driver and payload as option ROM image.

I tried CapsuleApp.efi from OVMF Shell and also fwupdate tool from
Linux.

Below is the observation with CapsuleApp.efi:
1. "CapsuleApp.efi -E" command from ovmf shell, but, it is not displaying any entries.
2. "CapsuleApp.efi -D <CapsuleFile>" is showing Capsule Header, Fmp Header and Fmp Payload Image Header properly.

Below is the observation with fwupdate tool in Linux:
1. CONFIG_EFI_ESRT is enabled in Kernel Config.
2. /sys/firmware/efi sysfs entry is created, but, there is no esrt entry under this.
3. Since there is no esrt sysfs entry, "fwupdate -s" command is showing that firmware updates are not supported.

Please let me know how to add ESRT table in OVMF so that i can upgrade device firmware.
--
Peter


Sandeep Dhanvada
 

Hi,

I am able to upgrade firmware using CaspsuleApp.efi with the help of Tomas Pilar in other thread in this mailing list.

however, i have some modifications in edk2 source code for this to happen. please let me know what is the process for sending patches to mailing list.

Thanks,
Sandeep


Tomas Pilar (tpilar)
 

Hi Sandeep,

You should probably discuss on this list what you want to add to the main
tree before sending patches, you might get good pointers. Otherwise, there
is a good guide as to how it works here:
https://github.com/tianocore/tianocore.github.io/wiki/Laszlo's-unkempt-git-guide-for-edk2-contributors-and-maintainers
.

Cheers,
Tom


On Tue, Sep 22, 2020 at 6:23 AM Sandeep Dhanvada <
sandeep.dhanvada@xilinx.com> wrote:

Hi,

I am able to upgrade firmware using CaspsuleApp.efi with the help of Tomas
Pilar in other thread in this mailing list.

however, i have some modifications in edk2 source code for this to happen.
please let me know what is the process for sending patches to mailing list.

Thanks,
Sandeep






Sandeep Dhanvada
 

Hi Tom,

Please see the patches attached and let me know in case of any issues.
I used all the "git config" options mentioned in the link you referred, but, I am not able to remove the line breaks at EOL in the patch.

Thanks,
Sandeep


Tomas Pilar (tpilar)
 

I don't think you will be allowed to modify the DxeCapsuleLib to connect
all controllers when it's loading the FMP embedded driver. There is
probably a better way of doing it.

Also, you need to send the patches to the mailing list devel@ rather than
attaching them here. Here is another link describing the process:
https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Development-Process

The second patch looks okay but you'll need to expand on the commit message
a lot more with motivation, use-cases etc. If you search through the devel@
mailing list, you will see that a similar discussion was already had in the
past.

Cheers,
Tom

On Tue, Oct 6, 2020 at 1:06 PM Sandeep Dhanvada <sandeep.dhanvada@xilinx.com>
wrote:

Hi Tom,

Please see the patches attached and let me know in case of any issues.
I used all the "git config" options mentioned in the link you referred,
but, I am not able to remove the line breaks at EOL in the patch.

Thanks,
Sandeep