Compare commits
No commits in common. "c8-beta-stream-rhel" and "imports/c8-beta-stream-rhel/SLOF-20171214-6.gitfa98132.module+el8.1.0+4066+0f1aadab" have entirely different histories.
c8-beta-st
...
imports/c8
@ -1 +1 @@
|
||||
9bc8b85c83af0d4108d0a44625d83ccc9a22fa04 SOURCES/qemu-slof-20210217.tar.gz
|
||||
bd6a7eebe47e1cf9be75373b21afdf0353d1af84 SOURCES/qemu-slof-20171214.tar.gz
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
||||
SOURCES/qemu-slof-20210217.tar.gz
|
||||
SOURCES/qemu-slof-20171214.tar.gz
|
||||
|
@ -0,0 +1,72 @@
|
||||
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
|
||||
|
100
SOURCES/slof-Fix-output-word.patch
Normal file
100
SOURCES/slof-Fix-output-word.patch
Normal file
@ -0,0 +1,100 @@
|
||||
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
|
||||
|
@ -0,0 +1,54 @@
|
||||
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
|
||||
|
@ -0,0 +1,49 @@
|
||||
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
|
||||
|
@ -0,0 +1,49 @@
|
||||
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
|
||||
|
@ -0,0 +1,123 @@
|
||||
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
|
||||
|
@ -0,0 +1,128 @@
|
||||
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
|
||||
|
@ -0,0 +1,83 @@
|
||||
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
|
||||
|
@ -0,0 +1,81 @@
|
||||
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
|
||||
|
110
SOURCES/slof-usb-storage-Implement-block-write-support.patch
Normal file
110
SOURCES/slof-usb-storage-Implement-block-write-support.patch
Normal file
@ -0,0 +1,110 @@
|
||||
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
|
||||
|
@ -0,0 +1,88 @@
|
||||
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
|
||||
|
@ -1,87 +0,0 @@
|
||||
From 27f045e2d52ee49ddbb375b5593d4fc387aad4b0 Mon Sep 17 00:00:00 2001
|
||||
From: Jordan Niethe <jniethe5@gmail.com>
|
||||
Date: Tue, 29 Aug 2023 10:12:01 +1000
|
||||
Subject: [PATCH 2/2] virtio-serial: Do not close stdout on quiesce
|
||||
|
||||
RH-Author: Thomas Huth <thuth@redhat.com>
|
||||
RH-MergeRequest: 1: Fix SLOF crash when only using virtio console (without spapr-vty)
|
||||
RH-Jira: RHEL-3709
|
||||
RH-Acked-by: David Gibson (Red Hat) <dgibson@redhat.com>
|
||||
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
|
||||
RH-Commit: [2/2] cbde239703a11aa2676a12b8415281d37cba54a5
|
||||
|
||||
Commit 76fee95 ("slof: Only close stdout for virtio-serial devices")
|
||||
says that commit cf28264 ("virtio-serial: Rework shutdown sequence")
|
||||
fixed a hang. The problem was believed to be that it was necessary to
|
||||
close stdout to shutdown the underlying virtio device.
|
||||
|
||||
Commit cf28264 ("virtio-serial: Rework shutdown sequence") closed stdout
|
||||
on quiesce. This meant when prom_init() called write on stdout after
|
||||
quiesce, there is a use after free so this is unreliable, and can also
|
||||
hang (especially after reboots).
|
||||
|
||||
Quiescing is intended to put hardware into a safe state for the client
|
||||
to take over. It is incorrect for SLOF to close ihandles that the client
|
||||
could still be using, even after a quiesce.
|
||||
|
||||
Rather than closing the stdout device, all that needs to happen is to
|
||||
ensure virtio-serial-shutdown gets called. On quiesce, close the virtio
|
||||
device, but leave the stdout device itself open.
|
||||
|
||||
Commit 8174acd ("virtio-serial: Close device completely") handles reads
|
||||
and writes as no-ops if the underlying virtio device is closed so there
|
||||
is no problem with the client calling "write" on stdout after this, but
|
||||
no output will be displayed.
|
||||
|
||||
Fixes: cf28264 ("virtio-serial: Rework shutdown sequence")
|
||||
Debugged-by: Kautuk Consul <kconsul@linux.vnet.ibm.com>
|
||||
Co-developed-by: Kautuk Consul <kconsul@linux.vnet.ibm.com>
|
||||
Signed-off-by: Kautuk Consul <kconsul@linux.vnet.ibm.com>
|
||||
Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
|
||||
Reviewed-by: Thomas Huth <thuth@redhat.com>
|
||||
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
|
||||
(cherry picked from commit dd4d4ea0add97df078d571b48192adaf7c4b0d87)
|
||||
Jira: https://issues.redhat.com/browse/RHEL-3709
|
||||
Signed-off-by: Thomas Huth <thuth@redhat.com>
|
||||
---
|
||||
board-qemu/slof/virtio-serial.fs | 12 +++++-------
|
||||
1 file changed, 5 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/board-qemu/slof/virtio-serial.fs b/board-qemu/slof/virtio-serial.fs
|
||||
index 41e2e04..de42cc7 100644
|
||||
--- a/board-qemu/slof/virtio-serial.fs
|
||||
+++ b/board-qemu/slof/virtio-serial.fs
|
||||
@@ -33,16 +33,14 @@ virtio-setup-vd VALUE virtiodev
|
||||
: virtio-serial-term-key? virtiodev virtio-serial-haschar ;
|
||||
: virtio-serial-term-key BEGIN virtio-serial-term-key? UNTIL virtiodev virtio-serial-getchar ;
|
||||
|
||||
-: virtio-serial-close-stdout s" stdout" get-chosen IF decode-int nip nip close-dev THEN ;
|
||||
-
|
||||
\ Basic device initialization - which has only to be done once
|
||||
: init ( -- )
|
||||
virtiodev virtio-serial-init drop
|
||||
TRUE to initialized?
|
||||
- \ Linux closes stdin at some point in prom_init(). This internally triggers a
|
||||
- \ quiesce in SLOF. We must ensure stdout gets closed as well otherwise the
|
||||
- \ device cannot be reset properly and the boot will hang.
|
||||
- ['] virtio-serial-close-stdout add-quiesce-xt
|
||||
+ \ virtiodev must be shutdown at quiesce so the device is reset properly.
|
||||
+ \ The read and write methods can be called after quiesce so must handle
|
||||
+ \ virtiodev being closed.
|
||||
+ ['] shutdown add-quiesce-xt
|
||||
;
|
||||
|
||||
0 VALUE open-count
|
||||
@@ -62,8 +60,8 @@ virtiodev virtio-serial-init drop
|
||||
open-count 0> IF
|
||||
open-count 1 - dup to open-count
|
||||
0= IF shutdown THEN
|
||||
+ close
|
||||
THEN
|
||||
- close
|
||||
;
|
||||
|
||||
: write ( addr len -- actual )
|
||||
--
|
||||
2.41.0
|
||||
|
@ -1,58 +0,0 @@
|
||||
From 67cbc16b3e6d34cf3932f88fd32323878026d6a0 Mon Sep 17 00:00:00 2001
|
||||
From: Kautuk Consul <kconsul@linux.vnet.ibm.com>
|
||||
Date: Tue, 29 Aug 2023 10:12:00 +1000
|
||||
Subject: [PATCH 1/2] virtio-serial: Make read and write methods report failure
|
||||
|
||||
RH-Author: Thomas Huth <thuth@redhat.com>
|
||||
RH-MergeRequest: 1: Fix SLOF crash when only using virtio console (without spapr-vty)
|
||||
RH-Jira: RHEL-3709
|
||||
RH-Acked-by: David Gibson (Red Hat) <dgibson@redhat.com>
|
||||
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
|
||||
RH-Commit: [1/2] 7aee41dceade77a47edd794cab43672ff95896d0
|
||||
|
||||
The read and write methods return successfully even if the virtio device
|
||||
is closed (virtiodev is 0) and it is not able to send or receive any
|
||||
characters.
|
||||
|
||||
Make the read and write methods return 0 to indicate they did not
|
||||
succeed in this case.
|
||||
|
||||
This also fixes an invalid stack access in the read method.
|
||||
|
||||
Fixes: 8174acd ("virtio-serial: Close device completely")
|
||||
Signed-off-by: Kautuk Consul <kconsul@linux.vnet.ibm.com>
|
||||
Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
|
||||
Reviewed-by: Thomas Huth <thuth@redhat.com>
|
||||
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
|
||||
(cherry picked from commit 63b66a5147069bda815989732442cb07790609db)
|
||||
Jira: https://issues.redhat.com/browse/RHEL-3709
|
||||
Signed-off-by: Thomas Huth <thuth@redhat.com>
|
||||
---
|
||||
board-qemu/slof/virtio-serial.fs | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/board-qemu/slof/virtio-serial.fs b/board-qemu/slof/virtio-serial.fs
|
||||
index 82868e2..41e2e04 100644
|
||||
--- a/board-qemu/slof/virtio-serial.fs
|
||||
+++ b/board-qemu/slof/virtio-serial.fs
|
||||
@@ -67,7 +67,7 @@ virtiodev virtio-serial-init drop
|
||||
;
|
||||
|
||||
: write ( addr len -- actual )
|
||||
- virtiodev 0= IF nip EXIT THEN
|
||||
+ virtiodev 0= IF 2drop 0 EXIT THEN
|
||||
tuck
|
||||
0 ?DO
|
||||
dup c@ virtiodev SWAP virtio-serial-putchar
|
||||
@@ -78,7 +78,7 @@ virtiodev virtio-serial-init drop
|
||||
|
||||
: read ( addr len -- actual )
|
||||
0= IF drop 0 EXIT THEN
|
||||
- virtiodev 0= IF nip EXIT THEN
|
||||
+ virtiodev 0= IF drop 0 EXIT THEN
|
||||
virtiodev virtio-serial-haschar 0= IF 0 swap c! -2 EXIT THEN
|
||||
virtiodev virtio-serial-getchar swap c! 1
|
||||
;
|
||||
--
|
||||
2.41.0
|
||||
|
@ -1,21 +1,38 @@
|
||||
%define GITDATE 20210217
|
||||
%define GITDATE 20171214
|
||||
%define GITCOMMIT fa98132
|
||||
|
||||
%global debug_package %{nil}
|
||||
|
||||
Name: SLOF
|
||||
Version: %{GITDATE}
|
||||
Release: 2%{?dist}
|
||||
Release: 6.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-20210217.tar.gz
|
||||
Source0: https://github.com/aik/SLOF/archive/qemu-slof-20171214.tar.gz
|
||||
|
||||
# For RHEL-3709 - SLOF regression prevents VM startup
|
||||
Patch1: slof-virtio-serial-Make-read-and-write-methods-report-fai.patch
|
||||
# For RHEL-3709 - SLOF regression prevents VM startup
|
||||
Patch2: slof-virtio-serial-Do-not-close-stdout-on-quiesce.patch
|
||||
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
|
||||
|
||||
BuildArch: noarch
|
||||
ExclusiveArch: %{power64}
|
||||
@ -37,7 +54,17 @@ separately. It is a dependency of qemu-system-ppc64.
|
||||
|
||||
%prep
|
||||
%setup -q -n SLOF-qemu-slof-%{GITDATE}
|
||||
%autopatch -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
%patch9 -p1
|
||||
%patch10 -p1
|
||||
%patch11 -p1
|
||||
|
||||
%build
|
||||
export CROSS=""
|
||||
@ -60,20 +87,6 @@ install -c -m 0644 boot_rom.bin $RPM_BUILD_ROOT%{_datadir}/qemu-kvm/slof.bin
|
||||
%{_datadir}/qemu-kvm/slof.bin
|
||||
|
||||
%changelog
|
||||
* Wed Oct 04 2023 Jon Maloy <jmaloy@redhat.com> - 20210217-2.el8
|
||||
- slof-virtio-serial-Make-read-and-write-methods-report-fai.patch [RHEL-3709]
|
||||
- slof-virtio-serial-Do-not-close-stdout-on-quiesce.patch [RHEL-3709]
|
||||
- Resolves: RHEL-3709
|
||||
(SLOF regression prevents VM startup)
|
||||
|
||||
* 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)
|
||||
|
||||
* 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
|
||||
|
Loading…
Reference in New Issue
Block a user