* [Qemu-devel] [PATCH 1/6] S390: BIOS check for file
2013-05-06 15:30 [Qemu-devel] [PULL 1.5 0/6] s390 patch queue 2013-05-06 Alexander Graf
@ 2013-05-06 15:30 ` Alexander Graf
2013-05-06 15:30 ` [Qemu-devel] [PATCH 2/6] S390: BIOS create link to src folder for .img file Alexander Graf
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Alexander Graf @ 2013-05-06 15:30 UTC (permalink / raw)
To: qemu-devel; +Cc: blauwirbel, Dominik Dingel, anthony, aurelien
From: Dominik Dingel <dingel@linux.vnet.ibm.com>
Add a check if the BIOS blob exists before trying to load.
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
hw/s390x/ipl.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index ace5ff5..cc3cd23 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -82,6 +82,10 @@ static int s390_ipl_init(SysBusDevice *dev)
}
bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
+ if (bios_filename == NULL) {
+ hw_error("could not find stage1 bootloader\n");
+ }
+
bios_size = load_elf(bios_filename, NULL, NULL, &ipl->start_addr, NULL,
NULL, 1, ELF_MACHINE, 0);
if (bios_size == -1UL) {
--
1.6.0.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 2/6] S390: BIOS create link to src folder for .img file
2013-05-06 15:30 [Qemu-devel] [PULL 1.5 0/6] s390 patch queue 2013-05-06 Alexander Graf
2013-05-06 15:30 ` [Qemu-devel] [PATCH 1/6] S390: BIOS check for file Alexander Graf
@ 2013-05-06 15:30 ` Alexander Graf
2013-05-06 15:30 ` [Qemu-devel] [PATCH 3/6] S390: Merging s390_ipl_cpu and s390_ipl_reset Alexander Graf
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Alexander Graf @ 2013-05-06 15:30 UTC (permalink / raw)
To: qemu-devel; +Cc: blauwirbel, Dominik Dingel, anthony, aurelien
From: Dominik Dingel <dingel@linux.vnet.ibm.com>
For *.img files, there will be a link created directly to the src folder,
like for all other blobs.
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
configure | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/configure b/configure
index a9ff4ad..9439f1c 100755
--- a/configure
+++ b/configure
@@ -4518,6 +4518,7 @@ for bios_file in \
$source_path/pc-bios/*.aml \
$source_path/pc-bios/*.rom \
$source_path/pc-bios/*.dtb \
+ $source_path/pc-bios/*.img \
$source_path/pc-bios/openbios-* \
$source_path/pc-bios/palcode-*
do
--
1.6.0.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 3/6] S390: Merging s390_ipl_cpu and s390_ipl_reset
2013-05-06 15:30 [Qemu-devel] [PULL 1.5 0/6] s390 patch queue 2013-05-06 Alexander Graf
2013-05-06 15:30 ` [Qemu-devel] [PATCH 1/6] S390: BIOS check for file Alexander Graf
2013-05-06 15:30 ` [Qemu-devel] [PATCH 2/6] S390: BIOS create link to src folder for .img file Alexander Graf
@ 2013-05-06 15:30 ` Alexander Graf
2013-05-06 15:30 ` [Qemu-devel] [PATCH 4/6] S390: Add virtio-blk boot Alexander Graf
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Alexander Graf @ 2013-05-06 15:30 UTC (permalink / raw)
To: qemu-devel; +Cc: blauwirbel, Dominik Dingel, anthony, aurelien
From: Dominik Dingel <dingel@linux.vnet.ibm.com>
There is no use in have this splitted in two functions.
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
hw/s390x/ipl.c | 16 +++++-----------
1 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index cc3cd23..d14c548 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -57,16 +57,6 @@ typedef struct S390IPLState {
} S390IPLState;
-static void s390_ipl_cpu(uint64_t pswaddr)
-{
- S390CPU *cpu = S390_CPU(qemu_get_cpu(0));
- CPUS390XState *env = &cpu->env;
-
- env->psw.addr = pswaddr;
- env->psw.mask = IPL_PSW_MASK;
- s390_add_running_cpu(cpu);
-}
-
static int s390_ipl_init(SysBusDevice *dev)
{
S390IPLState *ipl = S390_IPL(dev);
@@ -155,8 +145,12 @@ static Property s390_ipl_properties[] = {
static void s390_ipl_reset(DeviceState *dev)
{
S390IPLState *ipl = S390_IPL(dev);
+ S390CPU *cpu = S390_CPU(qemu_get_cpu(0));
+ CPUS390XState *env = &cpu->env;
- s390_ipl_cpu(ipl->start_addr);
+ env->psw.addr = ipl->start_addr;
+ env->psw.mask = IPL_PSW_MASK;
+ s390_add_running_cpu(cpu);
}
static void s390_ipl_class_init(ObjectClass *klass, void *data)
--
1.6.0.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 4/6] S390: Add virtio-blk boot
2013-05-06 15:30 [Qemu-devel] [PULL 1.5 0/6] s390 patch queue 2013-05-06 Alexander Graf
` (2 preceding siblings ...)
2013-05-06 15:30 ` [Qemu-devel] [PATCH 3/6] S390: Merging s390_ipl_cpu and s390_ipl_reset Alexander Graf
@ 2013-05-06 15:30 ` Alexander Graf
2013-05-06 15:30 ` [Qemu-devel] [PATCH 5/6] S390: BIOS boot from given device Alexander Graf
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Alexander Graf @ 2013-05-06 15:30 UTC (permalink / raw)
To: qemu-devel; +Cc: blauwirbel, Dominik Dingel, anthony, aurelien
From: Dominik Dingel <dingel@linux.vnet.ibm.com>
If no kernel IPL entry is specified, boot the bios and pass if available
device information for the first boot device (as given by the boot index).
The provided information will be used in the next commit from the BIOS.
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
hw/s390x/ipl.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index d14c548..0aeb003 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -16,6 +16,8 @@
#include "elf.h"
#include "hw/loader.h"
#include "hw/sysbus.h"
+#include "hw/s390x/virtio-ccw.h"
+#include "hw/s390x/css.h"
#define KERN_IMAGE_START 0x010000UL
#define KERN_PARM_AREA 0x010480UL
@@ -150,6 +152,22 @@ static void s390_ipl_reset(DeviceState *dev)
env->psw.addr = ipl->start_addr;
env->psw.mask = IPL_PSW_MASK;
+
+ if (!ipl->kernel) {
+ /* booting firmware, tell what device to boot from */
+ DeviceState *dev_st = get_boot_device(0);
+ VirtioCcwDevice *ccw_dev = (VirtioCcwDevice *) object_dynamic_cast(
+ OBJECT(&(dev_st->parent_obj)), "virtio-blk-ccw");
+
+ if (ccw_dev) {
+ env->regs[7] = ccw_dev->sch->cssid << 24 |
+ ccw_dev->sch->ssid << 16 |
+ ccw_dev->sch->devno;
+ } else {
+ env->regs[7] = -1;
+ }
+ }
+
s390_add_running_cpu(cpu);
}
--
1.6.0.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 5/6] S390: BIOS boot from given device
2013-05-06 15:30 [Qemu-devel] [PULL 1.5 0/6] s390 patch queue 2013-05-06 Alexander Graf
` (3 preceding siblings ...)
2013-05-06 15:30 ` [Qemu-devel] [PATCH 4/6] S390: Add virtio-blk boot Alexander Graf
@ 2013-05-06 15:30 ` Alexander Graf
2013-05-06 15:30 ` [Qemu-devel] [PATCH 6/6] s390: update s390-ccw.img Alexander Graf
2013-05-06 18:22 ` [Qemu-devel] [PULL 1.5 0/6] s390 patch queue 2013-05-06 Aurelien Jarno
6 siblings, 0 replies; 8+ messages in thread
From: Alexander Graf @ 2013-05-06 15:30 UTC (permalink / raw)
To: qemu-devel; +Cc: blauwirbel, Dominik Dingel, anthony, aurelien
From: Dominik Dingel <dingel@linux.vnet.ibm.com>
Use the passed device, if there is no device, use the first applicable device.
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
pc-bios/s390-ccw/main.c | 24 ++++++++++++++++++------
pc-bios/s390-ccw/start.S | 2 ++
2 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
index fd40fa5..1665c57 100644
--- a/pc-bios/s390-ccw/main.c
+++ b/pc-bios/s390-ccw/main.c
@@ -12,6 +12,7 @@
struct subchannel_id blk_schid;
char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE)));
+uint64_t boot_value;
void virtio_panic(const char *string)
{
@@ -20,15 +21,22 @@ void virtio_panic(const char *string)
while (1) { }
}
-static void virtio_setup(void)
+static void virtio_setup(uint64_t dev_info)
{
struct schib schib;
int i;
int r;
bool found = false;
-
+ bool check_devno = false;
+ uint16_t dev_no = -1;
blk_schid.one = 1;
+ if (dev_info != -1) {
+ check_devno = true;
+ dev_no = dev_info & 0xffff;
+ debug_print_int("device no. ", dev_no);
+ }
+
for (i = 0; i < 0x10000; i++) {
blk_schid.sch_no = i;
r = stsch_err(blk_schid, &schib);
@@ -36,9 +44,11 @@ static void virtio_setup(void)
break;
}
if (schib.pmcw.dnv) {
- if (virtio_is_blk(blk_schid)) {
- found = true;
- break;
+ if (!check_devno || (schib.pmcw.dev == dev_no)) {
+ if (virtio_is_blk(blk_schid)) {
+ found = true;
+ break;
+ }
}
}
}
@@ -53,7 +63,9 @@ static void virtio_setup(void)
int main(void)
{
sclp_setup();
- virtio_setup();
+ debug_print_int("boot reg[7] ", boot_value);
+ virtio_setup(boot_value);
+
if (zipl_load() < 0)
sclp_print("Failed to load OS from hard disk\n");
disabled_wait();
diff --git a/pc-bios/s390-ccw/start.S b/pc-bios/s390-ccw/start.S
index 09deee7..5d5df0d 100644
--- a/pc-bios/s390-ccw/start.S
+++ b/pc-bios/s390-ccw/start.S
@@ -14,6 +14,8 @@
_start:
larl %r15, stack + 0x8000 /* Set up stack */
+larl %r6, boot_value
+stg %r7, 0(%r6) /* save the boot_value before any function calls */
j main /* And call C */
/*
--
1.6.0.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 6/6] s390: update s390-ccw.img
2013-05-06 15:30 [Qemu-devel] [PULL 1.5 0/6] s390 patch queue 2013-05-06 Alexander Graf
` (4 preceding siblings ...)
2013-05-06 15:30 ` [Qemu-devel] [PATCH 5/6] S390: BIOS boot from given device Alexander Graf
@ 2013-05-06 15:30 ` Alexander Graf
2013-05-06 18:22 ` [Qemu-devel] [PULL 1.5 0/6] s390 patch queue 2013-05-06 Aurelien Jarno
6 siblings, 0 replies; 8+ messages in thread
From: Alexander Graf @ 2013-05-06 15:30 UTC (permalink / raw)
To: qemu-devel; +Cc: blauwirbel, anthony, aurelien
Now that we have boot device selection support, update the firmware
blob accordingly.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
pc-bios/s390-ccw.img | Bin 9432 -> 9432 bytes
1 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/pc-bios/s390-ccw.img b/pc-bios/s390-ccw.img
index 149cf70140e9e690960b49337b4e5f419c452a86..1b2a11e728d1e17d386d64a9f13a90b4635dc2ba 100644
GIT binary patch
delta 1298
zcmX|Be`s4p9RFTk(w8)Cc}dEe(uBOU!7ST!0f#L^F?Id1(y9f2v;|>tLYY!nD^&*$
zmSLUU)UDZV;-E?#j%%l2X+&EQdVkbf2D*wC3l#|q9mQ05g^1O;p5MEaKDhhb=lk<>
z_wK!wj+KtF5SdAv?XE>oPvv5Iu#q&SC(e26;?kn$+`E`fke{l~{KnS+?7y=jK;fhn
zhe+NMd&LmXfb(ff`p6_VaDDd!k|BA+z+e^<f{j2A`w)o#MK%L)qaUC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x%N^PFgt`M)~duhFi3S@WwIbxBT`E%RC}r35(%9aX|13Q2*mK<
z5yq}*K`=i|<1MBeS0LGCnrw-<A5@s`<mOt6Dz!)~BrJ%XsQm{IL*d|^H+%nBd|~Fh
z+1>f%qhpN|vwL!vLp6kCC~JL%L@%@*cV~nMKvRY$+g|ik{(1m*l<9n1myxIxoBu<_
Ie<7Uz7f`gM7XSbN
--
1.6.0.2
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PULL 1.5 0/6] s390 patch queue 2013-05-06
2013-05-06 15:30 [Qemu-devel] [PULL 1.5 0/6] s390 patch queue 2013-05-06 Alexander Graf
` (5 preceding siblings ...)
2013-05-06 15:30 ` [Qemu-devel] [PATCH 6/6] s390: update s390-ccw.img Alexander Graf
@ 2013-05-06 18:22 ` Aurelien Jarno
6 siblings, 0 replies; 8+ messages in thread
From: Aurelien Jarno @ 2013-05-06 18:22 UTC (permalink / raw)
To: Alexander Graf; +Cc: blauwirbel, qemu-devel, anthony
On Mon, May 06, 2013 at 05:30:18PM +0200, Alexander Graf wrote:
> Hi Blue / Aurelien,
>
> This is my current patch queue for s390. Please pull.
>
> Alex
>
>
> The following changes since commit 8e515b125d5f7849167dbee6cbe6ef61636607d4:
> Peter Maydell (1):
> configure: Check that "libtool" is not the MacOSX one
>
> are available in the git repository at:
>
> git://github.com/agraf/qemu.git s390-for-upstream
>
> Alexander Graf (1):
> s390: update s390-ccw.img
>
> Dominik Dingel (5):
> S390: BIOS check for file
> S390: BIOS create link to src folder for .img file
> S390: Merging s390_ipl_cpu and s390_ipl_reset
> S390: Add virtio-blk boot
> S390: BIOS boot from given device
>
> configure | 1 +
> hw/s390x/ipl.c | 38 +++++++++++++++++++++++++++-----------
> pc-bios/s390-ccw.img | Bin 9432 -> 9432 bytes
> pc-bios/s390-ccw/main.c | 24 ++++++++++++++++++------
> pc-bios/s390-ccw/start.S | 2 ++
> 5 files changed, 48 insertions(+), 17 deletions(-)
Thanks, pulled.
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 8+ messages in thread