import SLOF-20191022-3.git899d9883.module+el8.3.0+6423+e4cb6418

This commit is contained in:
CentOS Sources 2020-07-28 05:57:51 -04:00 committed by Stepan Oksanichenko
parent d6f3d6fcc3
commit 7e4d136e8a
16 changed files with 352 additions and 974 deletions

View File

@ -1 +1 @@
bd6a7eebe47e1cf9be75373b21afdf0353d1af84 SOURCES/qemu-slof-20171214.tar.gz
8b17e3cd9c6cd9ea46febee20738bc194405c83d SOURCES/qemu-slof-20191022.tar.gz

2
.gitignore vendored
View File

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

View File

@ -1,72 +0,0 @@
From 864e689e887cd2fd00cc36e5d905238b18eb39bb Mon Sep 17 00:00:00 2001
From: Laurent Vivier <lvivier@redhat.com>
Date: Wed, 8 Aug 2018 15:10:58 +0100
Subject: [PATCH 2/6] Fix bad assembler statements for compiling with gcc 8.1 /
as 2.30
RH-Author: Laurent Vivier <lvivier@redhat.com>
Message-id: <20180808151102.11232-3-lvivier@redhat.com>
Patchwork-id: 81678
O-Subject: [RHEL-8.0 SLOF PATCH 2/6] Fix bad assembler statements for compiling with gcc 8.1 / as 2.30
Bugzilla: 1613619
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>
From: Thomas Huth <thuth@redhat.com>
When compiling with a very recent toolchain, I get these warnings:
../../llfw/boot_abort.S: Assembler messages:
../../llfw/boot_abort.S:76: Warning: invalid register expression
and:
stage2_head.S: Assembler messages:
stage2_head.S:57: Warning: invalid register expression
The first one is using the wrong opcode, we should use "and" instead of
"andi" here. The second one is using a register instead of a constant
for load-immediate, which is non-sense, too. Fix it to use the right
constant instead.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
(cherry picked from commit 203f6686dc3953a7248abb4f3e895a68c65d9b10)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
board-qemu/llfw/stage2_head.S | 2 +-
llfw/boot_abort.S | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/board-qemu/llfw/stage2_head.S b/board-qemu/llfw/stage2_head.S
index adf7554..1568f27 100644
--- a/board-qemu/llfw/stage2_head.S
+++ b/board-qemu/llfw/stage2_head.S
@@ -54,7 +54,7 @@ bsscdone:
/* jump to c-code */
/* r31 = fdt - r5 */
/* ------------------------------------ */
- li r3, r0
+ li r3, 0
mr r4, r31
bl .early_c_entry
diff --git a/llfw/boot_abort.S b/llfw/boot_abort.S
index 996bdd7..47a9178 100644
--- a/llfw/boot_abort.S
+++ b/llfw/boot_abort.S
@@ -73,7 +73,7 @@ ASM_ENTRY(boot_abort)
/* check if i/o is possible, if yes then print message */
li r10, ABORT_CANIO
- andi. r3, r31, r10
+ and. r3, r31, r10
bne abort_noio
/* use i/o ..., first print reference message */
--
1.8.3.1

View File

@ -1,100 +0,0 @@
From 22d45fb249bd6e276c26c5ff64132005b385d374 Mon Sep 17 00:00:00 2001
From: Laurent Vivier <lvivier@redhat.com>
Date: Tue, 29 May 2018 11:09:32 +0200
Subject: [PATCH 1/2] Fix output word
RH-Author: Laurent Vivier <lvivier@redhat.com>
Message-id: <20180529110933.1441-2-lvivier@redhat.com>
Patchwork-id: 80504
O-Subject: [RHEL7.6 SLOF PATCH 1/2] Fix output word
Bugzilla: 1495467
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
We can select the console output, but it does not really work
Implement term-io-emit, as we have term-io-key to really
send characters to the output selected by stdout.
Resolve xt and ihandle in the output command.
Use them in the new term-io-emit function.
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
[aik: fixed commit log]
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
(cherry picked from commit f05c38f7625eca1b9210ce68e80fa520274d7a8a)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
slof/fs/term-io.fs | 36 +++++++++++++++++++++++++++++++-----
1 file changed, 31 insertions(+), 5 deletions(-)
diff --git a/slof/fs/term-io.fs b/slof/fs/term-io.fs
index 52ce12a..f13ae87 100644
--- a/slof/fs/term-io.fs
+++ b/slof/fs/term-io.fs
@@ -10,6 +10,17 @@
\ * IBM Corporation - initial implementation
\ ****************************************************************************/
+0 VALUE write-xt
+
+VARIABLE stdout
+
+: set-stdout ( ihandle -- )
+ \ Close old stdout:
+ stdout @ ?dup IF close-dev THEN
+ \ Now set the new stdout:
+ dup stdout !
+ encode-int s" stdout" set-chosen
+;
: input ( dev-str dev-len -- )
open-dev ?dup IF
@@ -24,12 +35,15 @@
: output ( dev-str dev-len -- )
open-dev ?dup IF
- \ Close old stdout:
- s" stdout" get-chosen IF
- decode-int nip nip ?dup IF close-dev THEN
+ \ find new ihandle and xt handle
+ dup s" write" rot ihandle>phandle find-method
+ 0= IF
+ drop
+ cr ." Cannot find the write method for the given output console " cr
+ EXIT
THEN
- \ Now set the new stdout:
- encode-int s" stdout" set-chosen
+ to write-xt
+ set-stdout
THEN
;
@@ -40,6 +54,18 @@
1 BUFFER: (term-io-char-buf)
+: term-io-emit ( char -- )
+ write-xt IF
+ (term-io-char-buf) c!
+ (term-io-char-buf) 1 write-xt stdout @ call-package
+ drop
+ ELSE
+ serial-emit
+ THEN
+;
+
+' term-io-emit to emit
+
: term-io-key ( -- char )
s" stdin" get-chosen IF
decode-int nip nip dup 0= IF 0 EXIT THEN
--
1.8.3.1

View File

@ -1,54 +0,0 @@
From 49c493991c8cb9779022ffe3f1b2ac980f07852c Mon Sep 17 00:00:00 2001
From: Thomas Huth <thuth@redhat.com>
Date: Thu, 20 Dec 2018 10:26:07 +0000
Subject: [PATCH 1/3] board-qemu/slof/vio-vscsi: Scan up to 64 SCSI IDs
RH-Author: Thomas Huth <thuth@redhat.com>
Message-id: <1545301567-8565-2-git-send-email-thuth@redhat.com>
Patchwork-id: 83706
O-Subject: [RHEL8 SLOF PATCH 1/1] board-qemu/slof/vio-vscsi: Scan up to 64 SCSI IDs
Bugzilla: 1655649
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>
RH-Acked-by: Serhii Popovych <spopovyc@redhat.com>
QEMU supports up the 64 SCSI IDs on the vscsi "bus", see the string
"max_target = 63" in the source file hw/scsi/spapr_vscsi.c of QEMU.
However, SLOF currently only checks the first 9 IDs on the vscsi adaptor,
so when you try to boot from a CD-ROM like this, the boot fails:
qemu-system-ppc64 ... -device spapr-vscsi,id=scsi0,reg=0x2000 \
-drive file=/path/to/cdrom.iso,format=raw,if=none,id=dr1,readonly=on \
-device scsi-cd,bus=scsi0.0,channel=0,scsi-id=63,lun=1,drive=dr1,id=scd1
Thus let's change the amount of IDs that we scan in SLOF to 64, too, to
match the ID range that QEMU provides.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
(cherry picked from commit cad96808d130bcc1fc36741cbedaaa3f8215e6c4)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
board-qemu/slof/vio-vscsi.fs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/board-qemu/slof/vio-vscsi.fs b/board-qemu/slof/vio-vscsi.fs
index f2d4c6f..be11b69 100644
--- a/board-qemu/slof/vio-vscsi.fs
+++ b/board-qemu/slof/vio-vscsi.fs
@@ -507,9 +507,9 @@ TRUE VALUE first-time-init?
10000 \ Larger value seem to have problems with some CDROMs
;
-8 CONSTANT #dev
+\ Report the amount of supported SCSI IDs - QEMU uses "max_target = 63"
: dev-max-target ( -- #max-target )
- #dev
+ 40
;
" scsi-probe-helpers.fs" included
--
1.8.3.1

View File

@ -0,0 +1,240 @@
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

@ -0,0 +1,96 @@
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,49 +0,0 @@
From a32ea0519c017dec93014e16ef3063728f6491b5 Mon Sep 17 00:00:00 2001
From: Laurent Vivier <lvivier@redhat.com>
Date: Wed, 8 Aug 2018 15:10:57 +0100
Subject: [PATCH 1/6] libelf: Add REL32 to the list of ignored relocations
RH-Author: Laurent Vivier <lvivier@redhat.com>
Message-id: <20180808151102.11232-2-lvivier@redhat.com>
Patchwork-id: 81679
O-Subject: [RHEL-8.0 SLOF PATCH 1/6] libelf: Add REL32 to the list of ignored relocations
Bugzilla: 1613619
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>
From: Thomas Huth <thuth@redhat.com>
When compiling SLOF with GCC 8.1, I currently get a lot of these errors:
ERROR: Unhandled relocation (A) type 26
Type 26 is the "relative 32-bit" relocation. We can simply ignore it
(like the other relative relocations - REL14, REL24 and REL64) to
shut up these error messages.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
(cherry picked from commit 031cb1b921694f0c8676e0b478a3dccbae9d1639)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
lib/libelf/elf64.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/libelf/elf64.c b/lib/libelf/elf64.c
index 37e9c10..775cdee 100644
--- a/lib/libelf/elf64.c
+++ b/lib/libelf/elf64.c
@@ -362,6 +362,7 @@ elf_apply_rela64(void *file_addr, signed long offset, struct rela *relaentry,
case R_PPC64_TOC16_DS: /* (S + A - .TOC) >> 2 */
case R_PPC64_REL14:
case R_PPC64_REL24: /* (S + A - P) >> 2 */
+ case R_PPC64_REL32: /* S + A - P */
case R_PPC64_REL64: /* S + A - P */
case R_PPC64_GOT16_DS:
case R_PPC64_GOT16_LO_DS:
--
1.8.3.1

View File

@ -1,49 +0,0 @@
From 0b16818885a56bcf946e09a4c172d74e31d87342 Mon Sep 17 00:00:00 2001
From: Laurent Vivier <lvivier@redhat.com>
Date: Wed, 8 Aug 2018 15:10:59 +0100
Subject: [PATCH 3/6] make.rules: Compile SLOF with
-fno-asynchronous-unwind-tables
RH-Author: Laurent Vivier <lvivier@redhat.com>
Message-id: <20180808151102.11232-4-lvivier@redhat.com>
Patchwork-id: 81680
O-Subject: [RHEL-8.0 SLOF PATCH 3/6] make.rules: Compile SLOF with -fno-asynchronous-unwind-tables
Bugzilla: 1613619
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>
From: Thomas Huth <thuth@redhat.com>
With the new GCC 8, the asynchronous-unwind-tables are always enabled.
We don't need this for SLOF, so disable them to save 32 kiB in the
boot_rom.bin.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
(cherry picked from commit 5cd96a5ba9782d6f1c2d53d02d5a265fbcae580b)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
make.rules | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/make.rules b/make.rules
index 3067314..acbc8ab 100644
--- a/make.rules
+++ b/make.rules
@@ -73,8 +73,9 @@ RANLIB ?= $(CROSS)ranlib
CPP ?= $(CROSS)cpp
WARNFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -Wformat-security
-CFLAGS ?= -g -O2 -fno-builtin -ffreestanding -nostdinc -msoft-float -fno-strict-aliasing \
- -mno-altivec -mabi=no-altivec -fno-stack-protector $(WARNFLAGS)
+CFLAGS ?= -g -O2 -fno-builtin -ffreestanding -nostdinc -msoft-float \
+ -fno-strict-aliasing -mno-altivec -mabi=no-altivec \
+ -fno-stack-protector -fno-asynchronous-unwind-tables $(WARNFLAGS)
export CC AS LD CLEAN OBJCOPY OBJDUMP STRIP AR RANLIB CFLAGS
--
1.8.3.1

View File

@ -1,123 +0,0 @@
From d8b13f259660ed37f219db40f3d93f2ae81d4945 Mon Sep 17 00:00:00 2001
From: Laurent Vivier <lvivier@redhat.com>
Date: Tue, 29 May 2018 11:09:33 +0200
Subject: [PATCH 2/2] resolve ihandle and xt handle in the input command (like
for the output)
RH-Author: Laurent Vivier <lvivier@redhat.com>
Message-id: <20180529110933.1441-3-lvivier@redhat.com>
Patchwork-id: 80502
O-Subject: [RHEL7.6 SLOF PATCH 2/2] resolve ihandle and xt handle in the input command (like for the output)
Bugzilla: 1495467
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
(cherry picked from commit 85d5b4d62d0563163bd12d06a783fbc04a4d9069)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
slof/fs/term-io.fs | 40 ++++++++++++++++++++++++----------------
1 file changed, 24 insertions(+), 16 deletions(-)
diff --git a/slof/fs/term-io.fs b/slof/fs/term-io.fs
index f13ae87..5b94b26 100644
--- a/slof/fs/term-io.fs
+++ b/slof/fs/term-io.fs
@@ -10,10 +10,20 @@
\ * IBM Corporation - initial implementation
\ ****************************************************************************/
+0 VALUE read-xt
0 VALUE write-xt
+VARIABLE stdin
VARIABLE stdout
+: set-stdin ( ihandle -- )
+ \ Close old stdin:
+ stdin @ ?dup IF close-dev THEN
+ \ Now set the new stdin:
+ dup stdin !
+ encode-int s" stdin" set-chosen
+;
+
: set-stdout ( ihandle -- )
\ Close old stdout:
stdout @ ?dup IF close-dev THEN
@@ -24,12 +34,15 @@ VARIABLE stdout
: input ( dev-str dev-len -- )
open-dev ?dup IF
- \ Close old stdin:
- s" stdin" get-chosen IF
- decode-int nip nip ?dup IF close-dev THEN
+ \ find new ihandle and xt handle
+ dup s" read" rot ihandle>phandle find-method
+ 0= IF
+ drop
+ cr ." Cannot find the read method for the given input console " cr
+ EXIT
THEN
- \ Now set the new stdin:
- encode-int s" stdin" set-chosen
+ to read-xt
+ set-stdin
THEN
;
@@ -51,7 +64,6 @@ VARIABLE stdout
2dup input output
;
-
1 BUFFER: (term-io-char-buf)
: term-io-emit ( char -- )
@@ -67,16 +79,14 @@ VARIABLE stdout
' term-io-emit to emit
: term-io-key ( -- char )
- s" stdin" get-chosen IF
- decode-int nip nip dup 0= IF 0 EXIT THEN
- >r BEGIN
- (term-io-char-buf) 1 s" read" r@ $call-method
+ read-xt IF
+ BEGIN
+ (term-io-char-buf) 1 read-xt stdin @ call-package
0 >
UNTIL
(term-io-char-buf) c@
- r> drop
ELSE
- [ ' key behavior compile, ]
+ serial-key
THEN
;
@@ -88,8 +98,7 @@ VARIABLE stdout
\ - if it's an hv console, use hvterm-key?
\ otherwise it will always return false
: term-io-key? ( -- true|false )
- s" stdin" get-chosen IF
- decode-int nip nip dup 0= IF drop 0 EXIT THEN \ return false and exit if no stdin set
+ stdin @ ?dup IF
>r \ store ihandle on return stack
s" device_type" r@ ihandle>phandle ( propstr len phandle )
get-property ( true | data dlen false )
@@ -115,8 +124,7 @@ VARIABLE stdout
2drop r> drop false EXIT \ unknown device_type cleanup return-stack, return false
THEN
ELSE
- \ stdin not set, return false
- false
+ serial-key?
THEN
;
--
1.8.3.1

View File

@ -1,128 +0,0 @@
From 14f7e3a845c339fc98c14d0d57908d4c76f4596a Mon Sep 17 00:00:00 2001
From: Laurent Vivier <lvivier@redhat.com>
Date: Wed, 8 Aug 2018 15:11:00 +0100
Subject: [PATCH 4/6] romfs/tools: Remove superfluous union around the rom
header struct
RH-Author: Laurent Vivier <lvivier@redhat.com>
Message-id: <20180808151102.11232-5-lvivier@redhat.com>
Patchwork-id: 81683
O-Subject: [RHEL-8.0 SLOF PATCH 4/6] romfs/tools: Remove superfluous union around the rom header struct
Bugzilla: 1613619
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>
From: Thomas Huth <thuth@redhat.com>
Accessing the struct with memset and memcpy can also be done without the
union wrapper. While we're at it, also remove the FLASHFS_HEADER_DATA_SIZE
macre and use sizeof(stHeader) instead.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
(cherry picked from commit d4443f17c956e77df7bb23b2d19462faae9f4b23)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
include/calculatecrc.h | 1 -
romfs/tools/create_crc.c | 29 +++++++++++++----------------
2 files changed, 13 insertions(+), 17 deletions(-)
diff --git a/include/calculatecrc.h b/include/calculatecrc.h
index a19a229..667ea81 100644
--- a/include/calculatecrc.h
+++ b/include/calculatecrc.h
@@ -17,7 +17,6 @@
#define FLASHFS_HEADER_SIZE_ADDR 0x08 // uint64_t position of total flash header size value
#define FLASHFS_ROMADDR 0x00 // uint64_t position of pointer to next file
-#define FLASHFS_HEADER_DATA_SIZE 0x68 // 104 bytes of total header data size
#define CRC_METHODE Ethernet_32 // define the CRC genarator (CRC 16 bit to 64 is supported)
//--- header format ---------------------------------
diff --git a/romfs/tools/create_crc.c b/romfs/tools/create_crc.c
index 5a76b9c..e354339 100644
--- a/romfs/tools/create_crc.c
+++ b/romfs/tools/create_crc.c
@@ -10,6 +10,7 @@
* IBM Corporation - initial implementation
*****************************************************************************/
+#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@@ -71,21 +72,18 @@ createHeaderImage(int notime)
char dastr[16] = { 0, };
unsigned long long da = 0;
- union {
- unsigned char pcArray[FLASHFS_HEADER_DATA_SIZE];
- struct stH stHeader;
- } uHeader;
+ struct stH stHeader;
/* initialize Header */
- memset(uHeader.pcArray, 0x00, FLASHFS_HEADER_DATA_SIZE);
+ memset(&stHeader, 0x00, sizeof(stHeader));
/* read driver info */
if (NULL != (pcVersion = getenv("DRIVER_NAME"))) {
- strncpy(uHeader.stHeader.version, pcVersion, 16);
+ strncpy(stHeader.version, pcVersion, 16);
} else if (NULL != (pcVersion = getenv("USER"))) {
- strncpy(uHeader.stHeader.version, pcVersion, 16);
+ strncpy(stHeader.version, pcVersion, 16);
} else if (pcVersion == NULL) {
- strncpy(uHeader.stHeader.version, "No known user!", 16);
+ strncpy(stHeader.version, "No known user!", 16);
}
if (!notime) {
@@ -104,18 +102,18 @@ createHeaderImage(int notime)
}
da = cpu_to_be64(strtoll(dastr, NULL, 16));
}
- memcpy(uHeader.stHeader.date, &da, 8);
+ memcpy(stHeader.date, &da, 8);
/* write Magic value into data stream */
- strncpy(uHeader.stHeader.magic, FLASHFS_MAGIC, 8);
+ strncpy(stHeader.magic, FLASHFS_MAGIC, 8);
/* write platform name into data stream */
- strcpy(uHeader.stHeader.platform_name, FLASHFS_PLATFORM_MAGIC);
+ strcpy(stHeader.platform_name, FLASHFS_PLATFORM_MAGIC);
/* write platform revision into data stream */
- strcpy(uHeader.stHeader.platform_revision, FLASHFS_PLATFORM_REVISION);
+ strcpy(stHeader.platform_revision, FLASHFS_PLATFORM_REVISION);
/* fill end of file info (8 bytes of FF) into data stream */
- uHeader.stHeader.ui64FileEnd = -1;
+ stHeader.ui64FileEnd = -1;
/* read address of next file and address of header date, both are 64 bit values */
ui64RomAddr = 0;
@@ -129,7 +127,7 @@ createHeaderImage(int notime)
/* calculate final flash-header-size and flash-file-size */
/* calculate end addr of header */
- ui64globalHeaderSize = (uint32_t) ui64DataAddr + (uint32_t) FLASHFS_HEADER_DATA_SIZE;
+ ui64globalHeaderSize = (uint32_t) ui64DataAddr + sizeof(stHeader);
/* cut 64 bit to place CRC for File-End */
ui64globalHeaderSize -= 8;
/* add 64 bit to place CRC behind File-End */
@@ -143,8 +141,7 @@ createHeaderImage(int notime)
/* fill free space in Header with zeros */
memset(&pucFileStream[ui64DataAddr], 0, (ui64RomAddr - ui64DataAddr));
/* place data to header */
- memcpy(&pucFileStream[ui64DataAddr], uHeader.pcArray,
- FLASHFS_HEADER_DATA_SIZE);
+ memcpy(&pucFileStream[ui64DataAddr], &stHeader, sizeof(stHeader));
/* insert header length into data stream */
*(uint64_t *) (pucFileStream + FLASHFS_HEADER_SIZE_ADDR) =
--
1.8.3.1

View File

@ -1,83 +0,0 @@
From e17f0d9c136d4304e53d6f875e25279b838ae476 Mon Sep 17 00:00:00 2001
From: Laurent Vivier <lvivier@redhat.com>
Date: Wed, 8 Aug 2018 15:11:01 +0100
Subject: [PATCH 5/6] romfs/tools: Silence GCC 8.1 compiler warning with
FLASHFS_MAGIC
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
Message-id: <20180808151102.11232-6-lvivier@redhat.com>
Patchwork-id: 81684
O-Subject: [RHEL-8.0 SLOF PATCH 5/6] romfs/tools: Silence GCC 8.1 compiler warning with FLASHFS_MAGIC
Bugzilla: 1613619
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>
From: Thomas Huth <thuth@redhat.com>
GCC 8.1 introduce some new warnings which affect create_crc.c. One of
them is:
create_crc.c: In function ‘createHeaderImage’:
create_crc.c:110:2: warning: ‘strncpy’ output truncated before terminating nul
copying 8 bytes from a string of the same length [-Wstringop-truncation]
strncpy(uHeader.stHeader.magic, FLASHFS_MAGIC, 8);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Initialize the header struct statically here instead to silence the warning.
Suggested-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
(cherry picked from commit 49482e06ea74652a70a8cd067b852cc142021c03)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
romfs/tools/create_crc.c | 21 ++++++---------------
1 file changed, 6 insertions(+), 15 deletions(-)
diff --git a/romfs/tools/create_crc.c b/romfs/tools/create_crc.c
index e354339..475b184 100644
--- a/romfs/tools/create_crc.c
+++ b/romfs/tools/create_crc.c
@@ -72,10 +72,12 @@ createHeaderImage(int notime)
char dastr[16] = { 0, };
unsigned long long da = 0;
- struct stH stHeader;
-
- /* initialize Header */
- memset(&stHeader, 0x00, sizeof(stHeader));
+ struct stH stHeader = {
+ .magic = FLASHFS_MAGIC,
+ .platform_name = FLASHFS_PLATFORM_MAGIC,
+ .platform_revision = FLASHFS_PLATFORM_REVISION,
+ .ui64FileEnd = -1,
+ };
/* read driver info */
if (NULL != (pcVersion = getenv("DRIVER_NAME"))) {
@@ -104,17 +106,6 @@ createHeaderImage(int notime)
}
memcpy(stHeader.date, &da, 8);
- /* write Magic value into data stream */
- strncpy(stHeader.magic, FLASHFS_MAGIC, 8);
- /* write platform name into data stream */
- strcpy(stHeader.platform_name, FLASHFS_PLATFORM_MAGIC);
- /* write platform revision into data stream */
- strcpy(stHeader.platform_revision, FLASHFS_PLATFORM_REVISION);
-
-
- /* fill end of file info (8 bytes of FF) into data stream */
- stHeader.ui64FileEnd = -1;
-
/* read address of next file and address of header date, both are 64 bit values */
ui64RomAddr = 0;
ui64DataAddr = 0;
--
1.8.3.1

View File

@ -1,81 +0,0 @@
From bc63c0f48746d246e0c2fb755515fa05077a3bfd Mon Sep 17 00:00:00 2001
From: Laurent Vivier <lvivier@redhat.com>
Date: Wed, 8 Aug 2018 15:11:02 +0100
Subject: [PATCH 6/6] romfs/tools: Silence more compiler warnings with GCC 8.1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
Message-id: <20180808151102.11232-7-lvivier@redhat.com>
Patchwork-id: 81682
O-Subject: [RHEL-8.0 SLOF PATCH 6/6] romfs/tools: Silence more compiler warnings with GCC 8.1
Bugzilla: 1613619
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>
From: Thomas Huth <thuth@redhat.com>
GCC 8 complains about the following usages of strncpy, too:
create_crc.c:86:3: warning: ‘strncpy’ specified bound 16 equals destination
size [-Wstringop-truncation]
strncpy(uHeader.stHeader.version, pcVersion, 16);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
create_crc.c:84:3: warning: ‘strncpy’ specified bound 16 equals destination
size [-Wstringop-truncation]
strncpy(uHeader.stHeader.version, pcVersion, 16);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Let's work around the issue by using memcpy instead.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
(cherry picked from commit d8a9354c2a351360da438826c95cf78efcaaf1b0)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
romfs/tools/create_crc.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/romfs/tools/create_crc.c b/romfs/tools/create_crc.c
index 475b184..abc373b 100644
--- a/romfs/tools/create_crc.c
+++ b/romfs/tools/create_crc.c
@@ -32,6 +32,11 @@ static uint64_t ui64globalHeaderSize = 0;
/* flag to filter detect the header in buildDataStream() */
static int iglobalHeaderFlag = 1;
+static size_t min(size_t a, size_t b)
+{
+ return a < b ? a : b;
+}
+
/**
* Build the file image and store it as Data Stream of bytes
* calculate a first CRC for the first file and
@@ -80,13 +85,13 @@ createHeaderImage(int notime)
};
/* read driver info */
- if (NULL != (pcVersion = getenv("DRIVER_NAME"))) {
- strncpy(stHeader.version, pcVersion, 16);
- } else if (NULL != (pcVersion = getenv("USER"))) {
- strncpy(stHeader.version, pcVersion, 16);
- } else if (pcVersion == NULL) {
- strncpy(stHeader.version, "No known user!", 16);
- }
+ pcVersion = getenv("DRIVER_NAME");
+ if (!pcVersion)
+ pcVersion = getenv("USER");
+ if (!pcVersion)
+ pcVersion = "unknown";
+ memcpy(stHeader.version, pcVersion,
+ min(strlen(pcVersion), sizeof(stHeader.version)));
if (!notime) {
/* read time and write it into data stream */
--
1.8.3.1

View File

@ -1,110 +0,0 @@
From 54b418a32c1e12265dd421f0289b45f77fd38fc1 Mon Sep 17 00:00:00 2001
From: Laurent Vivier <lvivier@redhat.com>
Date: Thu, 20 Dec 2018 11:33:01 +0000
Subject: [PATCH 3/3] usb/storage: Implement block write support
RH-Author: Laurent Vivier <lvivier@redhat.com>
Message-id: <20181220113301.29914-3-lvivier@redhat.com>
Patchwork-id: 83709
O-Subject: [RHEL-8.0 SLOF PATCH 2/2] usb/storage: Implement block write support
Bugzilla: 1654196
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>
RH-Acked-by: Serhii Popovych <spopovyc@redhat.com>
The only missing parts were to manage the transfer direction in
do-bulk-command and to copy the data to the buffer before the
write operation.
This is needed as GRUB2 wants to write the grubenv file at start
and hangs because the data are not provided to the disk controller.
I've checked the file is correctly modified by modifying an environment
variable in GRUB2 with "set saved_entry=2" then "save_env saved_entry"
and checking the result in linux with "grub2-editenv list".
Fixes: Fixes: a0b96fe66fcd991b407c1d67ca842921e477a6fd
(Provide "write" function in the disk-label package)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
(cherry picked from commit d10500a4e0378b7f02f63f78a97e3440805f1374)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
slof/fs/usb/dev-storage.fs | 27 ++++++++++++++++++++++-----
1 file changed, 22 insertions(+), 5 deletions(-)
diff --git a/slof/fs/usb/dev-storage.fs b/slof/fs/usb/dev-storage.fs
index a0a0bac..db5d0a8 100644
--- a/slof/fs/usb/dev-storage.fs
+++ b/slof/fs/usb/dev-storage.fs
@@ -103,23 +103,30 @@ scsi-open
\ if sense-len is 0 then no sense data is actually present
\
-: do-bulk-command ( resp-buffer resp-size -- TRUE | FALSE )
+: do-bulk-command ( dir resp-buffer resp-size -- TRUE | FALSE )
TO resp-size
TO resp-buffer
udev USB_PIPE_OUT td-buf td-buf-phys dma-buf-phys usb>cmd 1F
usb-transfer-bulk 0= IF
- FALSE EXIT
+ drop FALSE EXIT
THEN
\ transfer CBW
resp-size IF
d# 125 us
- udev USB_PIPE_IN td-buf td-buf-phys resp-buffer resp-size
+ IF
+ udev USB_PIPE_IN
+ ELSE
+ udev USB_PIPE_OUT
+ THEN
+ td-buf td-buf-phys resp-buffer resp-size
usb-transfer-bulk 0= IF \ transfer data
usb-disk-debug? IF ." Data phase failed " cr THEN
\ FALSE EXIT
\ in case of a stall/halted endpoint we clear the halt
\ Fall through and try reading the CSW
THEN
+ ELSE
+ drop
THEN
d# 125 us
udev USB_PIPE_IN td-buf td-buf-phys dma-buf-phys usb>csw 0D
@@ -182,18 +189,28 @@ CONSTANT cbw-length
build-cbw
1 tag + to tag
+ \ copy command
usb-cmd-addr
dma-buf usb>cmd SCSI-COMMAND-OFFSET +
usb-cmd-len
move
+ \ copy data to write
+ usb-dir not IF
+ usb-buf-addr dma-buf usb>data usb-buf-len move
+ THEN
+
\ Send it
- dma-buf-phys usb>data usb-buf-len
+ usb-dir dma-buf-phys usb>data usb-buf-len
do-bulk-command 0= IF
." USB-DISK: Bulk command failed!" cr
0 0 -1 EXIT
THEN
- dma-buf usb>data usb-buf-addr usb-buf-len move
+
+ \ copy read data
+ usb-dir IF
+ dma-buf usb>data usb-buf-addr usb-buf-len move
+ THEN
dma-buf usb>csw to csw-addr
csw-addr csw>sig l@ 55534253 <> IF
--
1.8.3.1

View File

@ -1,88 +0,0 @@
From 74c062d40d0dcc68816b8bfef6940b8876ca635f Mon Sep 17 00:00:00 2001
From: Laurent Vivier <lvivier@redhat.com>
Date: Thu, 20 Dec 2018 11:33:00 +0000
Subject: [PATCH 2/3] usb/storage: Invert the logic of the IF-statements
RH-Author: Laurent Vivier <lvivier@redhat.com>
Message-id: <20181220113301.29914-2-lvivier@redhat.com>
Patchwork-id: 83707
O-Subject: [RHEL-8.0 SLOF PATCH 1/2] usb/storage: Invert the logic of the IF-statements
Bugzilla: 1654196
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>
RH-Acked-by: Serhii Popovych <spopovyc@redhat.com>
to prepare write implementation
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
(cherry picked from commit 7d72d327e231d8ae9f1e8bce9f20faeaa2278b24)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
slof/fs/usb/dev-storage.fs | 39 +++++++++++++++++++--------------------
1 file changed, 19 insertions(+), 20 deletions(-)
diff --git a/slof/fs/usb/dev-storage.fs b/slof/fs/usb/dev-storage.fs
index 94f8421..a0a0bac 100644
--- a/slof/fs/usb/dev-storage.fs
+++ b/slof/fs/usb/dev-storage.fs
@@ -107,23 +107,23 @@ scsi-open
TO resp-size
TO resp-buffer
udev USB_PIPE_OUT td-buf td-buf-phys dma-buf-phys usb>cmd 1F
- usb-transfer-bulk IF \ transfer CBW
- resp-size IF
- d# 125 us
- udev USB_PIPE_IN td-buf td-buf-phys resp-buffer resp-size
- usb-transfer-bulk 1 = not IF \ transfer data
- usb-disk-debug? IF ." Data phase failed " cr THEN
- \ FALSE EXIT
- \ in case of a stall/halted endpoint we clear the halt
- \ Fall through and try reading the CSW
- THEN
- THEN
- d# 125 us
- udev USB_PIPE_IN td-buf td-buf-phys dma-buf-phys usb>csw 0D
- usb-transfer-bulk \ transfer CSW
- ELSE
- FALSE EXIT
+ usb-transfer-bulk 0= IF
+ FALSE EXIT
THEN
+ \ transfer CBW
+ resp-size IF
+ d# 125 us
+ udev USB_PIPE_IN td-buf td-buf-phys resp-buffer resp-size
+ usb-transfer-bulk 0= IF \ transfer data
+ usb-disk-debug? IF ." Data phase failed " cr THEN
+ \ FALSE EXIT
+ \ in case of a stall/halted endpoint we clear the halt
+ \ Fall through and try reading the CSW
+ THEN
+ THEN
+ d# 125 us
+ udev USB_PIPE_IN td-buf td-buf-phys dma-buf-phys usb>csw 0D
+ usb-transfer-bulk \ transfer CSW
;
STRUCT \ cbw
@@ -189,12 +189,11 @@ CONSTANT cbw-length
\ Send it
dma-buf-phys usb>data usb-buf-len
- do-bulk-command IF
- dma-buf usb>data usb-buf-addr usb-buf-len move
- ELSE
- ." USB-DISK: Bulk commad failed!" cr
+ do-bulk-command 0= IF
+ ." USB-DISK: Bulk command failed!" cr
0 0 -1 EXIT
THEN
+ dma-buf usb>data usb-buf-addr usb-buf-len move
dma-buf usb>csw to csw-addr
csw-addr csw>sig l@ 55534253 <> IF
--
1.8.3.1

View File

@ -1,38 +1,22 @@
%define GITDATE 20171214
%define GITCOMMIT fa98132
%define GITDATE 20191022
%define GITCOMMIT 899d9883
%global debug_package %{nil}
Name: SLOF
Version: %{GITDATE}
Release: 6.git%{GITCOMMIT}%{?dist}
Release: 3.git%{GITCOMMIT}%{?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-20171214.tar.gz
Source0: https://github.com/aik/SLOF/archive/qemu-slof-20191022.tar.gz
Patch1: slof-Fix-output-word.patch
Patch2: slof-resolve-ihandle-and-xt-handle-in-the-input-command-l.patch
# For bz#1613619 - [RHEL8.0]Console contains error message (ERROR: Unhandled relocation (A) type 26) after continuing a guest
Patch3: slof-libelf-Add-REL32-to-the-list-of-ignored-relocations.patch
# For bz#1613619 - [RHEL8.0]Console contains error message (ERROR: Unhandled relocation (A) type 26) after continuing a guest
Patch4: slof-Fix-bad-assembler-statements-for-compiling-with-gcc-.patch
# For bz#1613619 - [RHEL8.0]Console contains error message (ERROR: Unhandled relocation (A) type 26) after continuing a guest
Patch5: slof-make.rules-Compile-SLOF-with-fno-asynchronous-unwind.patch
# For bz#1613619 - [RHEL8.0]Console contains error message (ERROR: Unhandled relocation (A) type 26) after continuing a guest
Patch6: slof-romfs-tools-Remove-superfluous-union-around-the-rom-.patch
# For bz#1613619 - [RHEL8.0]Console contains error message (ERROR: Unhandled relocation (A) type 26) after continuing a guest
Patch7: slof-romfs-tools-Silence-GCC-8.1-compiler-warning-with-FL.patch
# For bz#1613619 - [RHEL8.0]Console contains error message (ERROR: Unhandled relocation (A) type 26) after continuing a guest
Patch8: slof-romfs-tools-Silence-more-compiler-warnings-with-GCC-.patch
# For bz#1655649 - RHEL8.0 - ISST-LTE:KVM:Failed to boot the guest from cdrom drive
Patch9: slof-board-qemu-slof-vio-vscsi-Scan-up-to-64-SCSI-IDs.patch
# For bz#1654196 - [RHEL8.0][USB] guest failed to boot from emulated usb-storage
Patch10: slof-usb-storage-Invert-the-logic-of-the-IF-statements.patch
# For bz#1654196 - [RHEL8.0][USB] guest failed to boot from emulated usb-storage
Patch11: slof-usb-storage-Implement-block-write-support.patch
# 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}
@ -54,17 +38,8 @@ separately. It is a dependency of qemu-system-ppc64.
%prep
%setup -q -n SLOF-qemu-slof-%{GITDATE}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%autopatch -p1
%build
export CROSS=""
@ -87,6 +62,10 @@ install -c -m 0644 boot_rom.bin $RPM_BUILD_ROOT%{_datadir}/qemu-kvm/slof.bin
%{_datadir}/qemu-kvm/slof.bin
%changelog
* 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)
* Fri Jun 28 2019 Danilo de Paula <ddepaula@redhat.com> - 20171214-6.gitfa98132
- Rebuild all virt packages to fix RHEL's upgrade path
- Resolves: rhbz#1695587