qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] s390: remove boot image detection to fix boot with newer kernels
@ 2011-09-06 11:41 Christian Borntraeger
  2011-09-07 11:56 ` Alexander Graf
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Borntraeger @ 2011-09-06 11:41 UTC (permalink / raw)
  To: agraf; +Cc: Carsten Otte, programming.philipp.muens, qemu-devel@nongnu.org

Alex,

Newer kernels will not always have a 0dd0 (basr 13,0) at address 0x10000.
(e.g. current linux-next). We must not rely on specific code at certain
addresses, so lets just remove this check.

Reported-by: Philipp Muens <programming.philipp.muens@googlemail.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>

---
 hw/s390-virtio.c |    5 -----
 1 file changed, 5 deletions(-)

Index: b/hw/s390-virtio.c
===================================================================
--- a/hw/s390-virtio.c
+++ b/hw/s390-virtio.c
@@ -193,11 +193,6 @@ static void s390_init(ram_addr_t my_ram_
     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);
-        }
-
         env->psw.addr = KERN_IMAGE_START;
         env->psw.mask = 0x0000000180000000ULL;
     } else {

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] s390: remove boot image detection to fix boot with newer kernels
  2011-09-06 11:41 [Qemu-devel] [PATCH] s390: remove boot image detection to fix boot with newer kernels Christian Borntraeger
@ 2011-09-07 11:56 ` Alexander Graf
  2011-09-07 12:33   ` Christian Borntraeger
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Graf @ 2011-09-07 11:56 UTC (permalink / raw)
  To: Christian Borntraeger
  Cc: Carsten Otte, programming.philipp.muens, qemu-devel@nongnu.org


On 06.09.2011, at 13:41, Christian Borntraeger wrote:

> Alex,
> 
> Newer kernels will not always have a 0dd0 (basr 13,0) at address 0x10000.
> (e.g. current linux-next). We must not rely on specific code at certain
> addresses, so lets just remove this check.

Is there any other sane way we can find out if the image we're loading is actually bootable? I don't want users to do qemu-system-s390x -kernel vmlinux and see it just plain fail.


Alex

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] s390: remove boot image detection to fix boot with newer kernels
  2011-09-07 11:56 ` Alexander Graf
@ 2011-09-07 12:33   ` Christian Borntraeger
  2011-09-07 12:34     ` Alexander Graf
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Borntraeger @ 2011-09-07 12:33 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Carsten Otte, programming.philipp.muens, qemu-devel@nongnu.org

On 07/09/11 13:56, Alexander Graf wrote:
> 
> On 06.09.2011, at 13:41, Christian Borntraeger wrote:
> 
>> Alex,
>>
>> Newer kernels will not always have a 0dd0 (basr 13,0) at address 0x10000.
>> (e.g. current linux-next). We must not rely on specific code at certain
>> addresses, so lets just remove this check.
> 
> Is there any other sane way we can find out if the image we're loading is 
> actually bootable? I don't want users to do qemu-system-s390x -kernel 
> vmlinux and see it just plain fail.

No, in theory it could change arbitrarily. The vmlinux case is unfortunate
but in the end its "shoot yourself in the foot", we just have to make sure
that we allow a graceful exit from a looping qemu guest.


Christian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] s390: remove boot image detection to fix boot with newer kernels
  2011-09-07 12:33   ` Christian Borntraeger
@ 2011-09-07 12:34     ` Alexander Graf
  2011-09-08 14:48       ` Christian Borntraeger
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Graf @ 2011-09-07 12:34 UTC (permalink / raw)
  To: Christian Borntraeger
  Cc: Carsten Otte, programming.philipp.muens, qemu-devel@nongnu.org


On 07.09.2011, at 14:33, Christian Borntraeger wrote:

> On 07/09/11 13:56, Alexander Graf wrote:
>> 
>> On 06.09.2011, at 13:41, Christian Borntraeger wrote:
>> 
>>> Alex,
>>> 
>>> Newer kernels will not always have a 0dd0 (basr 13,0) at address 0x10000.
>>> (e.g. current linux-next). We must not rely on specific code at certain
>>> addresses, so lets just remove this check.
>> 
>> Is there any other sane way we can find out if the image we're loading is 
>> actually bootable? I don't want users to do qemu-system-s390x -kernel 
>> vmlinux and see it just plain fail.
> 
> No, in theory it could change arbitrarily. The vmlinux case is unfortunate
> but in the end its "shoot yourself in the foot", we just have to make sure
> that we allow a graceful exit from a looping qemu guest.

That's not the answer I'd like to hear. Can't we put a magic constant somewhere for newer kernel versions that would identify those and keep the basr 13,0 hack around for older ones?


Alex

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] s390: remove boot image detection to fix boot with newer kernels
  2011-09-07 12:34     ` Alexander Graf
@ 2011-09-08 14:48       ` Christian Borntraeger
  0 siblings, 0 replies; 5+ messages in thread
From: Christian Borntraeger @ 2011-09-08 14:48 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Carsten Otte, programming.philipp.muens, qemu-devel@nongnu.org

On 07/09/11 14:34, Alexander Graf wrote:
>> No, in theory it could change arbitrarily. The vmlinux case is unfortunate
>> but in the end its "shoot yourself in the foot", we just have to make sure
>> that we allow a graceful exit from a looping qemu guest.
> 
> That's not the answer I'd like to hear. Can't we put a magic constant somewhere
>for newer kernel versions that would identify those and keep the basr 13,0 hack 
> around for older ones?

I will wire up the elf loader for s390, to make vmlinux simply work. That should
make the test no longer needed. 
There are some small problems left, e.g. the elf loader loads the kernel as bios 
afterwards and therefore overwrites the kernel parameter line. Will fix this in the
next days.

Christian

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-09-08 14:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-06 11:41 [Qemu-devel] [PATCH] s390: remove boot image detection to fix boot with newer kernels Christian Borntraeger
2011-09-07 11:56 ` Alexander Graf
2011-09-07 12:33   ` Christian Borntraeger
2011-09-07 12:34     ` Alexander Graf
2011-09-08 14:48       ` Christian Borntraeger

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).