import SLOF-20210217-1.module+el8.6.0+12861+13975d62

This commit is contained in:
CentOS Sources 2022-03-29 06:27:14 -04:00 committed by Stepan Oksanichenko
parent 7e4d136e8a
commit 81126cdf7c
5 changed files with 9 additions and 347 deletions

View File

@ -1 +1 @@
8b17e3cd9c6cd9ea46febee20738bc194405c83d SOURCES/qemu-slof-20191022.tar.gz
9bc8b85c83af0d4108d0a44625d83ccc9a22fa04 SOURCES/qemu-slof-20210217.tar.gz

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/qemu-slof-20191022.tar.gz
SOURCES/qemu-slof-20210217.tar.gz

View File

@ -1,240 +0,0 @@
From d53b544b88877a8a91a6579d54a2b384ee8a3715 Mon Sep 17 00:00:00 2001
From: David Gibson <dgibson@redhat.com>
Date: Tue, 7 Jan 2020 00:40:36 +0000
Subject: [PATCH 2/2] fdt: Fix updating the tree at H_CAS
RH-Author: David Gibson <dgibson@redhat.com>
Message-id: <20200107004037.421470-3-dgibson@redhat.com>
Patchwork-id: 93281
O-Subject: [RHEL-AV-8.2.0 SLOF PATCH 2/2] fdt: Fix updating the tree at H_CAS
Bugzilla: 1778704
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
From: Alexey Kardashevskiy <aik@ozlabs.ru>
The previous approach to merge the QEMU FDT into the existing tree and
then patch it turned to be broken as we patch properties based on their
names only so we patch not just what QEMU provides (which was
the intention) but also all properties SLOF created. This breaks one of
them - "interrupt-map" - it is created by QEMU for a PHB but SLOF creates
it for PCI bridges and since they have different sizes, patching phandles
at fixed offset fails.
Rather than skipping certain nodes in the SLOF tree, this uses different
approach: now we read the QEMU FDT in 3 passes:
1. find all phandle/linux-phandle properties and store these in the SLOF
internal tree to allow phandle->node lookup later;
2. walk through all FDT properties, patch them if needed using
phandles from the SLOF tree and save patched values in SLOF properties;
3. delete phandle/linux-phandle properties created in 1. This is safe
as SLOF does not create these properties anyway.
Fixes: 44d06f9e68cf ("fdt: Update phandles after H_CAS")
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
(cherry picked from commit 497f61400d3b10cde3f2bd98201bf99441ec0eae)
Signed-off-by: David Gibson <dgibson@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
board-qemu/slof/archsupport.fs | 1 -
board-qemu/slof/fdt.fs | 123 +++++++++++++++++++++++++++++++++++++++--
2 files changed, 117 insertions(+), 7 deletions(-)
diff --git a/board-qemu/slof/archsupport.fs b/board-qemu/slof/archsupport.fs
index 6512d57..fc48830 100644
--- a/board-qemu/slof/archsupport.fs
+++ b/board-qemu/slof/archsupport.fs
@@ -33,7 +33,6 @@
fdt-check-header
fdt-struct fdt-fix-cas-node
fdt-fix-cas-success NOT ( memaddr err? )
- s" /" find-node fdt-fix-phandles
ELSE
FALSE
THEN
diff --git a/board-qemu/slof/fdt.fs b/board-qemu/slof/fdt.fs
index 5ece270..fc39a82 100644
--- a/board-qemu/slof/fdt.fs
+++ b/board-qemu/slof/fdt.fs
@@ -12,6 +12,7 @@
0 VALUE fdt-debug
TRUE VALUE fdt-cas-fix?
+0 VALUE fdt-cas-pass
\ Bail out if no fdt
fdt-start 0 = IF -1 throw THEN
@@ -294,6 +295,81 @@ fdt-claim-reserve
2drop 2drop
;
+: (phandle>node) ( phandle current -- node|0 )
+ dup s" phandle" rot get-property 0= IF
+ decode-int nip nip ( phandle current phandle-prop )
+ 2 pick = IF
+ fdt-debug IF ." Found phandle; " dup . ." <= " over . cr THEN
+ nip ( current )
+ EXIT
+ THEN
+ ELSE
+ dup s" linux-phandle" rot get-property 0= IF
+ decode-int nip nip ( phandle current phandle-prop )
+ 2 pick = IF
+ fdt-debug IF ." Found linux-phandle; " dup . ." <= " over . cr THEN
+ nip ( current )
+ EXIT
+ THEN
+ THEN
+ THEN
+ child BEGIN
+ dup
+ WHILE
+ 2dup
+ RECURSE
+ ?dup 0<> IF
+ nip nip
+ EXIT
+ THEN
+ PEER
+ REPEAT
+ 2drop 0
+;
+
+: phandle>node ( phandle -- node ) s" /" find-node (phandle>node) ;
+
+: (fdt-patch-phandles) ( prop-addr prop-len -- )
+ BEGIN
+ dup
+ WHILE ( prop-addr prop-len )
+ over l@ phandle>node
+ ?dup 0<> IF
+ fdt-debug IF ." ### Patching phandle=" 2 pick l@ . cr THEN
+ 2 pick l!
+ TRUE TO (fdt-phandle-replaced)
+ THEN
+ 4 - swap 4 + swap
+ REPEAT
+ 2drop
+;
+
+: (fdt-patch-interrupt-map) ( prop-addr prop-len -- )
+ \ interrupt-controller phandle is expected to be the same accross the map
+ over 10 + l@ phandle>node ?dup 0= IF 2drop EXIT THEN
+ -rot
+ fdt-debug IF ." ### Patching interrupt-map: " over 10 + l@ . ." => " 2 pick . cr THEN
+
+ TRUE TO (fdt-phandle-replaced)
+ BEGIN
+ dup
+ WHILE ( newph prop-addr prop-len )
+ 2 pick 2 pick 10 + l!
+ 1c - swap 1c + swap
+ REPEAT
+ 3drop
+;
+
+: fdt-patch-phandles ( prop-addr prop-len nameadd namelen -- )
+ 2dup s" interrupt-map" str= IF 2drop (fdt-patch-interrupt-map) EXIT THEN
+ 2dup s" interrupt-parent" str= IF 2drop (fdt-patch-phandles) EXIT THEN
+ 2dup s" ibm,gpu" str= IF 2drop (fdt-patch-phandles) EXIT THEN
+ 2dup s" ibm,npu" str= IF 2drop (fdt-patch-phandles) EXIT THEN
+ 2dup s" ibm,nvlink" str= IF 2drop (fdt-patch-phandles) EXIT THEN
+ 2dup s" memory-region" str= IF 2drop (fdt-patch-phandles) EXIT THEN
+ 4drop
+;
+
\ Replace one phandle "old" with a phandle "new" in "node" and recursively
\ in its child nodes:
: fdt-replace-all-phandles ( old new node -- )
@@ -394,6 +470,12 @@ r> drop
find-node ?dup 0 <> IF set-node THEN
;
+: str=phandle? ( s len -- true|false )
+ 2dup s" phandle" str= >r
+ s" linux,phandle" str=
+ r> or
+;
+
: (fdt-fix-cas-node) ( start -- end )
recursive
fdt-next-tag dup OF_DT_BEGIN_NODE <> IF
@@ -414,7 +496,7 @@ r> drop
2dup find-node ?dup 0 <> IF
set-node 2drop
ELSE
- fdt-debug IF ." Node not found, creating " 2dup type cr THEN
+ fdt-debug IF ." Creating node: " 2dup type cr THEN
fdt-create-cas-node
THEN
fdt-debug IF ." Current now: " pwd cr THEN
@@ -422,22 +504,48 @@ r> drop
fdt-next-tag dup OF_DT_END_NODE <>
WHILE
dup OF_DT_PROP = IF
- fdt-debug IF ." Found property " cr THEN
drop dup ( drop tag, dup addr : a1 a1 )
dup l@ dup rot 4 + ( fetch size, stack is : a1 s s a2)
dup l@ swap 4 + ( fetch nameid, stack is : a1 s s i a3 )
rot ( we now have: a1 s i a3 s )
fdt-encode-prop rot ( a1 s pa ps i)
fdt-fetch-string ( a1 s pa ps na ns )
- property
- fdt-debug IF ." Setting property done " cr THEN
+
+ fdt-cas-pass CASE
+ 0 OF
+ 2dup str=phandle? IF
+ fdt-debug IF 4dup ." Phandle: " type ." =" swap ." @" . ." " .d ." bytes" cr THEN
+ property
+ ELSE
+ 4drop
+ THEN
+ ENDOF
+ 1 OF
+ 2dup str=phandle? not IF
+ fdt-debug IF 4dup ." Property: " type ." =" swap ." @" . ." " .d ." bytes" cr THEN
+ 4dup fdt-patch-phandles
+ property
+ ELSE
+ 4drop
+ THEN
+ ENDOF
+ 2 OF
+ 2dup str=phandle? IF
+ fdt-debug IF 4dup ." Deleting: " type ." =" swap ." @" . ." " .d ." bytes" cr THEN
+ delete-property
+ 2drop
+ ELSE
+ 4drop
+ THEN
+ ENDOF
+ ENDCASE
+
+ 8 + 3 + fffffffc and
ELSE dup OF_DT_BEGIN_NODE = IF
drop ( drop tag )
4 -
(fdt-fix-cas-node)
get-parent set-node
- fdt-debug IF ." Returning back " pwd cr THEN
ELSE
." Error " cr
drop
@@ -450,7 +558,10 @@ r> drop
;
: fdt-fix-cas-node ( start -- )
- (fdt-fix-cas-node) drop
+ 0 to fdt-cas-pass dup (fdt-fix-cas-node) drop \ Add phandles
+ 1 to fdt-cas-pass dup (fdt-fix-cas-node) drop \ Patch+add other properties
+ 2 to fdt-cas-pass dup (fdt-fix-cas-node) drop \ Delete phandles from pass 1
+ drop
;
: fdt-fix-cas-success
--
1.8.3.1

View File

@ -1,96 +0,0 @@
From 16b3bfa4f74942d9c2f49159715008d8d93c0f2d Mon Sep 17 00:00:00 2001
From: David Gibson <dgibson@redhat.com>
Date: Tue, 7 Jan 2020 00:40:35 +0000
Subject: [PATCH 1/2] ibm, client-architecture-support: Fix stack handling
RH-Author: David Gibson <dgibson@redhat.com>
Message-id: <20200107004037.421470-2-dgibson@redhat.com>
Patchwork-id: 93280
O-Subject: [RHEL-AV-8.2.0 SLOF PATCH 1/2] ibm, client-architecture-support: Fix stack handling
Bugzilla: 1778704
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
From: Alexey Kardashevskiy <aik@ozlabs.ru>
fdt-fix-cas-node returns the end address after it's finished which
the caller (ibm,client-architecture-support) does not use or drop.
This renames fdt-fix-cas-node to (fdt-fix-cas-node) and adds a wrapper
on top of that which does the drop. This will be used later for 2-pass
tree patching.
While at this, exit the function if memory allocation failed.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
(cherry picked from commit c50195e007319bf39c5315289ab93a2d7d02828b)
Signed-off-by: David Gibson <dgibson@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
board-qemu/slof/archsupport.fs | 8 ++++++--
board-qemu/slof/fdt.fs | 8 ++++++--
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/board-qemu/slof/archsupport.fs b/board-qemu/slof/archsupport.fs
index 33ea765..6512d57 100644
--- a/board-qemu/slof/archsupport.fs
+++ b/board-qemu/slof/archsupport.fs
@@ -18,7 +18,11 @@
\ to come back to right boot device
\ Allocate memory for H_CALL
cas-buffer-size alloc-mem ( vec memaddr )
- dup 0= IF ." out of memory during ibm,client-architecture-support" cr THEN
+ dup 0= IF
+ ." out of memory during ibm,client-architecture-support" cr
+ 2drop TRUE
+ EXIT
+ THEN
swap over cas-buffer-size ( memaddr vec memaddr size )
\ make h_call to hypervisor
hv-cas 0= IF ( memaddr )
@@ -28,7 +32,7 @@
dup 4 + fdt-init
fdt-check-header
fdt-struct fdt-fix-cas-node
- fdt-fix-cas-success NOT
+ fdt-fix-cas-success NOT ( memaddr err? )
s" /" find-node fdt-fix-phandles
ELSE
FALSE
diff --git a/board-qemu/slof/fdt.fs b/board-qemu/slof/fdt.fs
index 3e4c1b3..5ece270 100644
--- a/board-qemu/slof/fdt.fs
+++ b/board-qemu/slof/fdt.fs
@@ -394,7 +394,7 @@ r> drop
find-node ?dup 0 <> IF set-node THEN
;
-: fdt-fix-cas-node ( start -- end )
+: (fdt-fix-cas-node) ( start -- end )
recursive
fdt-next-tag dup OF_DT_BEGIN_NODE <> IF
." Error " cr
@@ -435,7 +435,7 @@ r> drop
ELSE dup OF_DT_BEGIN_NODE = IF
drop ( drop tag )
4 -
- fdt-fix-cas-node
+ (fdt-fix-cas-node)
get-parent set-node
fdt-debug IF ." Returning back " pwd cr THEN
ELSE
@@ -449,6 +449,10 @@ r> drop
drop \ drop tag
;
+: fdt-fix-cas-node ( start -- )
+ (fdt-fix-cas-node) drop
+;
+
: fdt-fix-cas-success
fdt-cas-fix?
;
--
1.8.3.1

View File

@ -1,22 +1,17 @@
%define GITDATE 20191022
%define GITCOMMIT 899d9883
%define GITDATE 20210217
%global debug_package %{nil}
Name: SLOF
Version: %{GITDATE}
Release: 3.git%{GITCOMMIT}%{?dist}
Release: 1%{?dist}
Summary: Slimline Open Firmware
Group: Applications/Emulators
License: BSD
URL: http://www.openfirmware.info/SLOF
Source0: https://github.com/aik/SLOF/archive/qemu-slof-20191022.tar.gz
Source0: https://github.com/aik/SLOF/archive/qemu-slof-20210217.tar.gz
# For bz#1778704 - Guest failed to boot up with device under pci-bridge
Patch2: slof-ibm-client-architecture-support-Fix-stack-handling.patch
# For bz#1778704 - Guest failed to boot up with device under pci-bridge
Patch3: slof-fdt-Fix-updating-the-tree-at-H_CAS.patch
BuildArch: noarch
ExclusiveArch: %{power64}
@ -40,7 +35,6 @@ separately. It is a dependency of qemu-system-ppc64.
%setup -q -n SLOF-qemu-slof-%{GITDATE}
%autopatch -p1
%build
export CROSS=""
@ -62,6 +56,10 @@ install -c -m 0644 boot_rom.bin $RPM_BUILD_ROOT%{_datadir}/qemu-kvm/slof.bin
%{_datadir}/qemu-kvm/slof.bin
%changelog
* Thu Sep 2 2021 Danilo C. L. de Paula <ddepaula@redhat.com> - 20210217-1.el8
- Resolves: bz#2000225
(Rebase virt:rhel module:stream based on AV-8.6)
* Mon Apr 27 2020 Danilo C. L. de Paula <ddepaula@redhat.com> - 20191022
- Resolves: bz#1810193
(Upgrade components in virt:rhel module:stream for RHEL-8.3 release)