[edk2] [PATCH v3 0/3] OvmfPkg: mark flash memory range as MMIO

Brijesh Singh posted 3 patches 5 years, 9 months ago
Failed in applying to current master (apply log)
There is a newer version of this series
.../FvbServicesRuntimeDxe.inf                      |  1 +
.../FwBlockService.c                               | 38 +-----------
.../FwBlockService.h                               |  7 +++
.../FwBlockServiceDxe.c                            | 68 ++++++++++++++++++++++
.../FwBlockServiceSmm.c                            | 13 +++++
5 files changed, 90 insertions(+), 37 deletions(-)
[edk2] [PATCH v3 0/3] OvmfPkg: mark flash memory range as MMIO
Posted by Brijesh Singh 5 years, 9 months ago
The Qemu flash range is marked as 'system ram' in EFI runtime memmap
but it is actually an IO address. The patch series updates the
EFI runtime memmap to add this range as Memory Mapped IO address.

Changes since v2:
 - added cover letter and extend CC list to add all OvmfPkg
   maintainers/reviewers.

Changes since v1:
 - split the OvmfPkg single patch into three patches based on Laszlo's feedback.
  a) mark memory as MMIO for non SEV case
  b) do not adding EFI runtime mapping for SMM build
  c) clear C-bit when SEV is active for non SMM builds only

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Julien Grall <julien.grall@linaro.org>
Cc: Justen Jordan L <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>

Complete tree is available:
url: https://github.com/codomania/edk2.git
branch: qemu-flash-mmio

Brijesh Singh (3):
  OvmfPkg/QemuFlashFvbServicesRuntimeDxe: mark Flash memory range as
    MMIO
  OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Do not expose MMIO in SMM
    build
  OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Restore C-bit when SEV is
    active

 .../FvbServicesRuntimeDxe.inf                      |  1 +
 .../FwBlockService.c                               | 38 +-----------
 .../FwBlockService.h                               |  7 +++
 .../FwBlockServiceDxe.c                            | 68 ++++++++++++++++++++++
 .../FwBlockServiceSmm.c                            | 13 +++++
 5 files changed, 90 insertions(+), 37 deletions(-)

-- 
2.7.4

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH v3 0/3] OvmfPkg: mark flash memory range as MMIO
Posted by Laszlo Ersek 5 years, 9 months ago
On 07/05/18 21:12, Brijesh Singh wrote:
> The Qemu flash range is marked as 'system ram' in EFI runtime memmap
> but it is actually an IO address. The patch series updates the
> EFI runtime memmap to add this range as Memory Mapped IO address.
> 
> Changes since v2:
>  - added cover letter and extend CC list to add all OvmfPkg
>    maintainers/reviewers.
> 
> Changes since v1:
>  - split the OvmfPkg single patch into three patches based on Laszlo's feedback.
>   a) mark memory as MMIO for non SEV case
>   b) do not adding EFI runtime mapping for SMM build
>   c) clear C-bit when SEV is active for non SMM builds only
> 
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Anthony Perard <anthony.perard@citrix.com>
> Cc: Julien Grall <julien.grall@linaro.org>
> Cc: Justen Jordan L <jordan.l.justen@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
> 
> Complete tree is available:
> url: https://github.com/codomania/edk2.git
> branch: qemu-flash-mmio
> 
> Brijesh Singh (3):
>   OvmfPkg/QemuFlashFvbServicesRuntimeDxe: mark Flash memory range as
>     MMIO
>   OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Do not expose MMIO in SMM
>     build
>   OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Restore C-bit when SEV is
>     active
> 
>  .../FvbServicesRuntimeDxe.inf                      |  1 +
>  .../FwBlockService.c                               | 38 +-----------
>  .../FwBlockService.h                               |  7 +++
>  .../FwBlockServiceDxe.c                            | 68 ++++++++++++++++++++++
>  .../FwBlockServiceSmm.c                            | 13 +++++
>  5 files changed, 90 insertions(+), 37 deletions(-)
> 

Regression tested -- only without SEV -- on top of commit 9090c8b53301,
using the configs below.

The "rdmsr" and "efibootmgr" checks are explained at
<https://github.com/tianocore/tianocore.github.io/wiki/Testing-SMM-with-QEMU,-KVM-and-libvirt>.


* i440fx, X64, without SMM:

(01) Fedora 28 guest, efibootmgr + rdmsr checks after boot and S3: PASS

(02) RHEL 6 guest, efibootmgr check after boot: PASS

(03) RHEL 7 guest, efibootmgr check after boot and S3: PASS

(04) Windows 7 guest, boot and S3: PASS


* q35, IA32, with SMM:

(05) Fedora 26 guest, efibootmgr check after boot and S3: PASS


* q35, IA32X64, with SMM:

(06) Fedora 28 guest, efibootmgr + rdmsr checks after boot and S3: PASS

(07) RHEL 7 guest, efibootmgr check after boot and S3: PASS

(08) Windows 10 guest, boot and S3: PASS

(09) Windows Server 2016 guest, boot: PASS
     (can't test S3 due to signing requirements for the QXL driver)

(10) Windows 8.1 guest, boot and S3: PASS

(11) Windows Server 2012 R2 guest, boot and S3: PASS

(12) Windows 7 guest, boot and S3: PASS

(13) Windows Server 2008 R2 guest, boot and S3: PASS


Once you submit v4 with the superficial updates requested, I will add:

Regression-tested-by: Laszlo Ersek <lersek@redhat.com>

I'll leave the SEV testing (with and without SMM) up to you :)

Thanks!
Laszlo
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH v3 0/3] OvmfPkg: mark flash memory range as MMIO
Posted by Brijesh Singh 5 years, 9 months ago

On 07/06/2018 09:01 AM, Laszlo Ersek wrote:
> On 07/05/18 21:12, Brijesh Singh wrote:
>> The Qemu flash range is marked as 'system ram' in EFI runtime memmap
>> but it is actually an IO address. The patch series updates the
>> EFI runtime memmap to add this range as Memory Mapped IO address.
>>
>> Changes since v2:
>>   - added cover letter and extend CC list to add all OvmfPkg
>>     maintainers/reviewers.
>>
>> Changes since v1:
>>   - split the OvmfPkg single patch into three patches based on Laszlo's feedback.
>>    a) mark memory as MMIO for non SEV case
>>    b) do not adding EFI runtime mapping for SMM build
>>    c) clear C-bit when SEV is active for non SMM builds only
>>
>> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> Cc: Anthony Perard <anthony.perard@citrix.com>
>> Cc: Julien Grall <julien.grall@linaro.org>
>> Cc: Justen Jordan L <jordan.l.justen@intel.com>
>> Cc: Laszlo Ersek <lersek@redhat.com>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
>>
>> Complete tree is available:
>> url: https://github.com/codomania/edk2.git
>> branch: qemu-flash-mmio
>>
>> Brijesh Singh (3):
>>    OvmfPkg/QemuFlashFvbServicesRuntimeDxe: mark Flash memory range as
>>      MMIO
>>    OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Do not expose MMIO in SMM
>>      build
>>    OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Restore C-bit when SEV is
>>      active
>>
>>   .../FvbServicesRuntimeDxe.inf                      |  1 +
>>   .../FwBlockService.c                               | 38 +-----------
>>   .../FwBlockService.h                               |  7 +++
>>   .../FwBlockServiceDxe.c                            | 68 ++++++++++++++++++++++
>>   .../FwBlockServiceSmm.c                            | 13 +++++
>>   5 files changed, 90 insertions(+), 37 deletions(-)
>>
> 
> Regression tested -- only without SEV -- on top of commit 9090c8b53301,
> using the configs below.
> 
> The "rdmsr" and "efibootmgr" checks are explained at
> <https://github.com/tianocore/tianocore.github.io/wiki/Testing-SMM-with-QEMU,-KVM-and-libvirt>.
> 
> 
> * i440fx, X64, without SMM:
> 
> (01) Fedora 28 guest, efibootmgr + rdmsr checks after boot and S3: PASS
> 
> (02) RHEL 6 guest, efibootmgr check after boot: PASS
> 
> (03) RHEL 7 guest, efibootmgr check after boot and S3: PASS
> 
> (04) Windows 7 guest, boot and S3: PASS
> 
> 
> * q35, IA32, with SMM:
> 
> (05) Fedora 26 guest, efibootmgr check after boot and S3: PASS
> 
> 
> * q35, IA32X64, with SMM:
> 
> (06) Fedora 28 guest, efibootmgr + rdmsr checks after boot and S3: PASS
> 
> (07) RHEL 7 guest, efibootmgr check after boot and S3: PASS
> 
> (08) Windows 10 guest, boot and S3: PASS
> 
> (09) Windows Server 2016 guest, boot: PASS
>       (can't test S3 due to signing requirements for the QXL driver)
> 
> (10) Windows 8.1 guest, boot and S3: PASS
> 
> (11) Windows Server 2012 R2 guest, boot and S3: PASS
> 
> (12) Windows 7 guest, boot and S3: PASS
> 
> (13) Windows Server 2008 R2 guest, boot and S3: PASS
> 
> 
> Once you submit v4 with the superficial updates requested, I will add:
> 
> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
> 
> I'll leave the SEV testing (with and without SMM) up to you :)
> 


Thank you so much for regression tests.  Glad we didn't broke anything. 
I did test with SEV guest and everything seems to be working fine so far.

thanks

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel