RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1518308 - UEFI memory map regression (runtime code entry splitting) introduced by c1cab54ce57c
Summary: UEFI memory map regression (runtime code entry splitting) introduced by c1cab...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ovmf
Version: 7.5
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Laszlo Ersek
QA Contact: FuXiangChun
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-28 15:37 UTC by Laszlo Ersek
Modified: 2018-04-10 16:31 UTC (History)
11 users (show)

Fixed In Version: ovmf-20171011-3.git92d07e48907f.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 16:31:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
memmap unfix sceenshot (14.93 KB, image/png)
2017-12-12 08:45 UTC, FuXiangChun
no flags Details
memmap fixed screenshot (14.81 KB, image/png)
2017-12-12 08:49 UTC, FuXiangChun
no flags Details
unfix log (3.37 KB, text/plain)
2017-12-13 02:52 UTC, FuXiangChun
no flags Details
fixed log (3.12 KB, text/plain)
2017-12-13 02:53 UTC, FuXiangChun
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0902 0 None None None 2018-04-10 16:31:20 UTC
TianoCore 753 0 None None None 2019-07-29 08:13:52 UTC

Description Laszlo Ersek 2017-11-28 15:37:03 UTC
*** Description of problem:
Upstream commit c1cab54ce57c ("UefiCpuPkg/CpuDxe: Fix out-of-sync issue in page attributes", 2017-09-16) broke some aspects of the UEFI memory map, which is diretly consumed by UEFI operating systems. Some OSes may crash or display other undesired behavior when facing the memory maps in question.

Detailed description at <https://bugzilla.tianocore.org/show_bug.cgi?id=753#c0>.

*** Version-Release number of selected component (if applicable):
ovmf-20171011-1.git92d07e48907f.el7

*** How reproducible:
100%

*** Steps to Reproduce:
The following steps are based on <https://bugzilla.tianocore.org/show_bug.cgi?id=753#c10>:

1. Start an OVMF domain with "virsh start --console --paused DOMAIN",
   in "screen" or another utility that lets you capture the serial console
   traffic.
2. Boot to the UEFI shell, using "UefiShell.iso". (The operating system
   does not matter for determining the symptoms. In fact an OS need not be
   installed at all.)
3. At the UEFI shell prompt, run the MEMMAP command.
4. Save the output from "screen.log" to another text file, for later
   comparison.

*** Actual and expected results:
The MEMMAP command outputs will differ between "broken" and fixed. One representative diff is:

 Available  000000007EC7A000-000000007EC7BFFF 0000000000000002 000000000000000F
 BS_Code    000000007EC7C000-000000007EDF9FFF 000000000000017E 000000000000000F
-RT_Code    000000007EDFA000-000000007EE17FFF 000000000000001E 800000000000000F
-RT_Code    000000007EE18000-000000007EE1DFFF 0000000000000006 800000000002000F
-RT_Code    000000007EE1E000-000000007EE20FFF 0000000000000003 800000000000000F
-RT_Code    000000007EE21000-000000007EE27FFF 0000000000000007 800000000002000F
-RT_Code    000000007EE28000-000000007EE29FFF 0000000000000002 800000000000000F
+RT_Code    000000007EDFA000-000000007EE29FFF 0000000000000030 800000000000000F
 RT_Data    000000007EE2A000-000000007EE4DFFF 0000000000000024 800000000000000F
 Reserved   000000007EE4E000-000000007EE51FFF 0000000000000004 000000000000000F

Note that in the broken case, the 000000007EDFA000..000000007EE29FFF range (0x30 pages, type RT_Code) is split into five entries, with entries #2 and #4 (in 1-based counting) having attributes 0x800000000002000F.

In the fixed case, the range is covered by just one RT_Code entry, with attributes 800000000000000F.

(Slight differences are plausible in other parts of the UEFI memmap too.)

*** Additional info:
For verifying the fix, beyond the above UEFI Shell-based steps, QE should please sanity check OS boot with Fedora 26, Windows 2016, and RHEL-7 guests.

Comment 1 Laszlo Ersek 2017-11-28 15:39:57 UTC
Patches to backport:

  1  768bd967847e  UefiCpuPkg/CpuDxe: Fix multiple entries of RT_CODE in memory
                   map
  2  e38451cd9a87  MdeModulePkg/DxeCore: Filter out all paging capabilities
  3  646127c1929a  MdeModulePkg/Core: Merge memory map after filtering paging
                   capability

Comment 9 Miroslav Rezanina 2017-12-01 06:01:50 UTC
Fix included in ovmf-20171011-3.git92d07e48907f.el7

Comment 11 FuXiangChun 2017-12-12 08:43:15 UTC
Reproduced this bug with OVMF-20171011-1.git92d07e48907f.el7.noarch.

I attached a screenshot.

Verified this bug with OVMF-20171011-4.git92d07e48907f.el7.noarch.

I attached a screenshot.

According to this result. I am not sure if it is expected result. 

Laszlo,
Could you help me check it? In addition, I am doing sanity check OS boot with Fedora 26, Windows 2016, and RHEL-7 guest. I will update test result to bz later.

Comment 12 FuXiangChun 2017-12-12 08:45:40 UTC
Created attachment 1366465 [details]
memmap unfix sceenshot

Comment 13 FuXiangChun 2017-12-12 08:49:03 UTC
Created attachment 1366466 [details]
memmap fixed screenshot

Comment 14 Laszlo Ersek 2017-12-12 10:24:45 UTC
FuXiangChun,

the screenshots are not useful. They do not contain the full UEFI memory map, and they cannot be compared textually.

Looking at the images from comment 12 and comment 13, they look nearly identical, so I first thought there was a problem with OVMF. Therefore I checked the builds myself:

  OVMF-20171011-1.git92d07e48907f.el7.noarch.rpm
  OVMF-20171011-4.git92d07e48907f.el7.noarch.rpm

The problem with the attached screenshots is that the differences are only visible in a *later* part of the UEFI memmap dump, which is not displayed in the screenshots.

Please don't use screenshots for this. In comment 0, I wrote:

> 1. Start an OVMF domain with "virsh start --console --paused DOMAIN",
>    in "screen" or another utility that lets you capture the serial console
>    traffic.

The "screen" utility captures the terminal traffic after [Ctrl-A H]. (Note the upper-case "H".)

- start "screen"
- start capturing with [Ctrl-A H].
- issue "virsh start --console --paused DOMAIN", or the equivalent QEMU command
  (so that the serial console is written to stdio)
- enter the UEFI shell,
- run MEMMAP
- kill the VM
- exit "screen"
- rename "screen.log" to "test-1.log"

Please repeat the same with the updated OVMF (capturing to "test-2.log"), and then upload "test-1.log" and "test-2.log". (Or you can diff them as well.)

Thanks!

Comment 15 FuXiangChun 2017-12-13 02:51:20 UTC
Thanks Laszlo,

I re-tested this problem with with OVMF-20171011-1.git92d07e48907f.el7.noarch.

This is part of result. 

.....
BS_Code    000000007D555000-000000007D6D4FFF 0000000000000180 000000000000000F
RT_Code    000000007D6D5000-000000007D6F4FFF 0000000000000020 800000000000000F
RT_Code    000000007D6F5000-000000007D6F9FFF 0000000000000005 800000000002000F
RT_Code    000000007D6FA000-000000007D6FCFFF 0000000000000003 800000000000000F
RT_Code    000000007D6FD000-000000007D702FFF 0000000000000006 800000000002000F
RT_Code    000000007D703000-000000007D704FFF 0000000000000002 800000000000000F
RT_Data    000000007D705000-000000007D728FFF 0000000000000024 800000000000000F
......

with OVMF-20171011-4.git92d07e48907f.el7.noarch.

This is part of result.
.......
BS_Code    000000007D558000-000000007D6D4FFF 000000000000017D 000000000000000F
RT_Code    000000007D6D5000-000000007D704FFF 0000000000000030 800000000000000F
RT_Data    000000007D705000-000000007D728FFF 0000000000000024 800000000000000F
......


This result isn't exactly the same with expected result.  I will attach full console log.

Comment 16 FuXiangChun 2017-12-13 02:52:59 UTC
Created attachment 1367062 [details]
unfix log

Comment 17 FuXiangChun 2017-12-13 02:53:35 UTC
Created attachment 1367063 [details]
fixed log

Comment 18 Laszlo Ersek 2017-12-13 09:11:39 UTC
Hi FuXiangChun,

thanks for the new logs, in comment 16 and comment 17. I diffed them. The differences that matter are:

* removed:

-RT_Code    000000007D6D5000-000000007D6F4FFF 0000000000000020 800000000000000F
-RT_Code    000000007D6F5000-000000007D6F9FFF 0000000000000005 800000000002000F
-RT_Code    000000007D6FA000-000000007D6FCFFF 0000000000000003 800000000000000F
-RT_Code    000000007D6FD000-000000007D702FFF 0000000000000006 800000000002000F
-RT_Code    000000007D703000-000000007D704FFF 0000000000000002 800000000000000F

* added:

+RT_Code    000000007D6D5000-000000007D704FFF 0000000000000030 800000000000000F

Both of these sets of entries cover the 000000007D6D5000-000000007D704FFF range (inclusive). Without the fix, the range is split to 5 entries (due to unmergeable attributes). With the fix, the range is covered by just one entry.

So the verification is successful; please set the BZ to VERIFIED status. Thanks!

Comment 19 FuXiangChun 2017-12-14 12:07:00 UTC
Thanks Laszlo, set this bug as verified.

Comment 22 errata-xmlrpc 2018-04-10 16:31:01 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0902


Note You need to log in before you can comment on or make changes to this bug.