* [Qemu-devel] [PULL 0/2] s390 patch queue 2012-03-05
@ 2012-03-05 18:51 Alexander Graf
2012-03-05 18:51 ` [Qemu-devel] [PATCH 1/2] s390: Rework kernel loading: supports elf and newer kernels Alexander Graf
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Alexander Graf @ 2012-03-05 18:51 UTC (permalink / raw)
To: qemu-devel; +Cc: blauwirbel, aurelien
Hi Aurelien / Blue,
This is my current patch queue for s390. Please pull.
Alex
The following changes since commit 2aeabc08179553e1a7eed6cf26286c3efc06ee0b:
Stefan Weil (1):
w64: fix type casts when calling flush_icache_range
are available in the git repository at:
git://repo.or.cz/qemu/agraf.git s390-for-upstream
Christian Borntraeger (1):
s390: Rework kernel loading: supports elf and newer kernels
Lluís Vilanova (1):
Move helpers.h to helper.h
hw/s390-virtio.c | 30 ++++++++++++++++++------------
target-s390x/{helpers.h => helper.h} | 0
target-s390x/op_helper.c | 2 +-
target-s390x/translate.c | 4 ++--
4 files changed, 21 insertions(+), 15 deletions(-)
rename target-s390x/{helpers.h => helper.h} (100%)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH 1/2] s390: Rework kernel loading: supports elf and newer kernels
2012-03-05 18:51 [Qemu-devel] [PULL 0/2] s390 patch queue 2012-03-05 Alexander Graf
@ 2012-03-05 18:51 ` Alexander Graf
2012-03-05 18:51 ` [Qemu-devel] [PATCH 2/2] Move helpers.h to helper.h Alexander Graf
2012-03-05 18:57 ` [Qemu-devel] [PULL 0/2] s390 patch queue 2012-03-05 Blue Swirl
2 siblings, 0 replies; 4+ messages in thread
From: Alexander Graf @ 2012-03-05 18:51 UTC (permalink / raw)
To: qemu-devel; +Cc: blauwirbel, Christian Borntraeger, aurelien
From: Christian Borntraeger <borntraeger@de.ibm.com>
This reworks the image loading on s390.
Newer kernels will not always have a 0dd0 (basr 13,0) at address 0x10000.
We must not rely on specific code at certain addresses. This check was
introduced to warn users that tried to load vmlinux, since ELF loading
was not supported. Lets wire that up. If elf loading fails, we assume
that this is a standard kernel image and load that via load_image_targphys.
This patch also changes all other users of load_image to
load_image_targphys to be consistent. (the elf loader registers the kernel
as rom).
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
hw/s390-virtio.c | 30 ++++++++++++++++++------------
1 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c
index 51123a7..15e3ef3 100644
--- a/hw/s390-virtio.c
+++ b/hw/s390-virtio.c
@@ -224,13 +224,17 @@ static void s390_init(ram_addr_t my_ram_size,
s390_add_running_cpu(env);
if (kernel_filename) {
- kernel_size = load_image(kernel_filename, qemu_get_ram_ptr(0));
- if (lduw_be_phys(KERN_IMAGE_START) != 0x0dd0) {
- fprintf(stderr, "Specified image is not an s390 boot image\n");
- exit(1);
+ kernel_size = load_elf(kernel_filename, NULL, NULL, NULL, NULL,
+ NULL, 1, ELF_MACHINE, 0);
+ if (kernel_size == -1UL) {
+ kernel_size = load_image_targphys(kernel_filename, 0, ram_size);
}
-
+ /*
+ * we can not rely on the ELF entry point, since up to 3.2 this
+ * value was 0x800 (the SALIPL loader) and it wont work. For
+ * all (Linux) cases 0x10000 (KERN_IMAGE_START) should be fine.
+ */
env->psw.addr = KERN_IMAGE_START;
env->psw.mask = 0x0000000180000000ULL;
} else {
@@ -243,7 +247,7 @@ static void s390_init(ram_addr_t my_ram_size,
}
bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
- bios_size = load_image(bios_filename, qemu_get_ram_ptr(ZIPL_LOAD_ADDR));
+ bios_size = load_image_targphys(bios_filename, ZIPL_LOAD_ADDR, 4096);
g_free(bios_filename);
if ((long)bios_size < 0) {
@@ -263,15 +267,17 @@ static void s390_init(ram_addr_t my_ram_size,
while (kernel_size + 0x100000 > initrd_offset) {
initrd_offset += 0x100000;
}
- initrd_size = load_image(initrd_filename, qemu_get_ram_ptr(initrd_offset));
-
- stq_be_phys(INITRD_PARM_START, initrd_offset);
- stq_be_phys(INITRD_PARM_SIZE, initrd_size);
+ initrd_size = load_image_targphys(initrd_filename, initrd_offset,
+ ram_size - initrd_offset);
+ /* we have to overwrite values in the kernel image, which are "rom" */
+ memcpy(rom_ptr(INITRD_PARM_START), &initrd_offset, 8);
+ memcpy(rom_ptr(INITRD_PARM_SIZE), &initrd_size, 8);
}
if (kernel_cmdline) {
- cpu_physical_memory_write(KERN_PARM_AREA, kernel_cmdline,
- strlen(kernel_cmdline) + 1);
+ /* we have to overwrite values in the kernel image, which are "rom" */
+ memcpy(rom_ptr(KERN_PARM_AREA), kernel_cmdline,
+ strlen(kernel_cmdline) + 1);
}
/* Create VirtIO network adapters */
--
1.6.0.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH 2/2] Move helpers.h to helper.h
2012-03-05 18:51 [Qemu-devel] [PULL 0/2] s390 patch queue 2012-03-05 Alexander Graf
2012-03-05 18:51 ` [Qemu-devel] [PATCH 1/2] s390: Rework kernel loading: supports elf and newer kernels Alexander Graf
@ 2012-03-05 18:51 ` Alexander Graf
2012-03-05 18:57 ` [Qemu-devel] [PULL 0/2] s390 patch queue 2012-03-05 Blue Swirl
2 siblings, 0 replies; 4+ messages in thread
From: Alexander Graf @ 2012-03-05 18:51 UTC (permalink / raw)
To: qemu-devel; +Cc: blauwirbel, Lluís Vilanova, aurelien
From: Lluís Vilanova <vilanova@ac.upc.edu>
Provides a file naming scheme consistent with other targets.
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
target-s390x/{helpers.h => helper.h} | 0
target-s390x/op_helper.c | 2 +-
target-s390x/translate.c | 4 ++--
3 files changed, 3 insertions(+), 3 deletions(-)
rename target-s390x/{helpers.h => helper.h} (100%)
diff --git a/target-s390x/helpers.h b/target-s390x/helper.h
similarity index 100%
rename from target-s390x/helpers.h
rename to target-s390x/helper.h
diff --git a/target-s390x/op_helper.c b/target-s390x/op_helper.c
index cf26b29..70d98a8 100644
--- a/target-s390x/op_helper.c
+++ b/target-s390x/op_helper.c
@@ -21,7 +21,7 @@
#include "cpu.h"
#include "dyngen-exec.h"
#include "host-utils.h"
-#include "helpers.h"
+#include "helper.h"
#include <string.h>
#include "kvm.h"
#include "qemu-timer.h"
diff --git a/target-s390x/translate.c b/target-s390x/translate.c
index 71f9dcd..8fab38c 100644
--- a/target-s390x/translate.c
+++ b/target-s390x/translate.c
@@ -38,9 +38,9 @@
static TCGv_ptr cpu_env;
#include "gen-icount.h"
-#include "helpers.h"
+#include "helper.h"
#define GEN_HELPER 1
-#include "helpers.h"
+#include "helper.h"
typedef struct DisasContext DisasContext;
struct DisasContext {
--
1.6.0.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PULL 0/2] s390 patch queue 2012-03-05
2012-03-05 18:51 [Qemu-devel] [PULL 0/2] s390 patch queue 2012-03-05 Alexander Graf
2012-03-05 18:51 ` [Qemu-devel] [PATCH 1/2] s390: Rework kernel loading: supports elf and newer kernels Alexander Graf
2012-03-05 18:51 ` [Qemu-devel] [PATCH 2/2] Move helpers.h to helper.h Alexander Graf
@ 2012-03-05 18:57 ` Blue Swirl
2 siblings, 0 replies; 4+ messages in thread
From: Blue Swirl @ 2012-03-05 18:57 UTC (permalink / raw)
To: Alexander Graf; +Cc: qemu-devel, aurelien
On Mon, Mar 5, 2012 at 18:51, Alexander Graf <agraf@suse.de> wrote:
> Hi Aurelien / Blue,
>
> This is my current patch queue for s390. Please pull.
Thanks, pulled.
> Alex
>
>
> The following changes since commit 2aeabc08179553e1a7eed6cf26286c3efc06ee0b:
> Stefan Weil (1):
> w64: fix type casts when calling flush_icache_range
>
> are available in the git repository at:
>
> git://repo.or.cz/qemu/agraf.git s390-for-upstream
>
> Christian Borntraeger (1):
> s390: Rework kernel loading: supports elf and newer kernels
>
> Lluís Vilanova (1):
> Move helpers.h to helper.h
>
> hw/s390-virtio.c | 30 ++++++++++++++++++------------
> target-s390x/{helpers.h => helper.h} | 0
> target-s390x/op_helper.c | 2 +-
> target-s390x/translate.c | 4 ++--
> 4 files changed, 21 insertions(+), 15 deletions(-)
> rename target-s390x/{helpers.h => helper.h} (100%)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-03-05 18:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-05 18:51 [Qemu-devel] [PULL 0/2] s390 patch queue 2012-03-05 Alexander Graf
2012-03-05 18:51 ` [Qemu-devel] [PATCH 1/2] s390: Rework kernel loading: supports elf and newer kernels Alexander Graf
2012-03-05 18:51 ` [Qemu-devel] [PATCH 2/2] Move helpers.h to helper.h Alexander Graf
2012-03-05 18:57 ` [Qemu-devel] [PULL 0/2] s390 patch queue 2012-03-05 Blue Swirl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).