Bug 862766 - Hardcoded value for the initrd address overlaps the kernel address in qemu-system-arm.
Hardcoded value for the initrd address overlaps the kernel address in qemu-sy...
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: qemu (Show other bugs)
18
arm Linux
high Severity high
: ---
: ---
Assigned To: Fedora Virtualization Maintainers
Fedora Extras Quality Assurance
:
Depends On:
Blocks: ARMTracker
  Show dependency treegraph
 
Reported: 2012-10-03 09:47 EDT by Paul Whalen
Modified: 2013-01-09 07:09 EST (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-11-02 16:07:33 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
qemu patch to change initrd load address when using qemu-system-arm (406 bytes, patch)
2012-10-03 09:47 EDT, Paul Whalen
no flags Details | Diff

  None (edit)
Description Paul Whalen 2012-10-03 09:47:35 EDT
Created attachment 620891 [details]
qemu patch to change initrd load address when using qemu-system-arm

Description of problem:

Because our kernels have grown in size, the hardcoded value for the initrd address overlaps the kernel address and an emulated ARM system will fail to boot. 

Version-Release number of selected component (if applicable):

All versions

How reproducible:

Everytime. 

Steps to Reproduce:
1. Create or use a precreated ARM vexpress image. 
2. Attempt to boot using (or provided bootscript with F17 GA image and 3.6 kernel):

qemu-system-arm -machine vexpress-a9 -m 1024 -nographic -net nic -net user \
    -append "console=ttyAMA0,115200n8 rw root=/dev/mmcblk0p3 rootwait physmap.enabled=0" \
    -kernel "$KERN" \
    -initrd "$RAMFS" \
    -sd "$IMAGE"

3. System will not boot, the following kernel message can be seen:

INITRD: 0x60d00000+0x00b3eb00 overlaps in-use memory region - disabling initrd. 

Full log - http://fpaste.org/AeZc/

Expected results:

System should boot to a log in prompt. 


Additional info:

I have been able to boot by changing the load address of the initrd manually and rebuilding. Below is the patch(also attached):

--- b/hw/arm_boot.c	2012-08-06 09:23:25.000000000 -0400
+++ a/qemu-kvm-1.2.0/hw/arm_boot.c	2012-09-26 15:12:19.860390812 -0400
@@ -18,7 +18,7 @@
 
 #define KERNEL_ARGS_ADDR 0x100
 #define KERNEL_LOAD_ADDR 0x00010000
-#define INITRD_LOAD_ADDR 0x00d00000
+#define INITRD_LOAD_ADDR 0x01d00000
 
 /* The worlds second smallest bootloader.  Set r0-r2, then jump to kernel.  */
 static uint32_t bootloader[] = {
Comment 1 Cole Robinson 2012-10-07 18:29:35 EDT
Thanks Paul, I sent your patch upstream:

http://www.mail-archive.com/qemu-devel@nongnu.org/msg135069.html
Comment 2 Cole Robinson 2012-10-26 07:41:56 EDT
Paul, where can I grab a kernel to test this? The patch as-is was rejected upstream because it will conflict with small memory arm machines:

https://lists.gnu.org/archive/html/qemu-devel/2012-10/msg01176.html

If i've got a reproducer maybe I can play with it and find something acceptable for upstream. Or feel free to chime in on that thread
Comment 3 Cole Robinson 2012-10-26 07:42:20 EDT
(In reply to comment #2)
> Paul, where can I grab a kernel to test this? The patch as-is was rejected
> upstream because it will conflict with small memory arm machines:
> 
> https://lists.gnu.org/archive/html/qemu-devel/2012-10/msg01176.html
> 
> If i've got a reproducer maybe I can play with it and find something
> acceptable for upstream. Or feel free to chime in on that thread

Setting NEEDINFO
Comment 4 Peter Robinson 2012-10-26 07:53:39 EDT
Ultimately we set that value as it was larger and it worked. Maybe we need something in between. It might be better if the value could be set or overridden with a command line option or something like that. 

There's nightly builds here that allow you to recreate the problem. 

http://scotland.proximity.on.ca/arm-nightlies/vault/f18-prealpha/
Comment 5 Cole Robinson 2012-10-28 11:30:51 EDT
(In reply to comment #4)
> Ultimately we set that value as it was larger and it worked. Maybe we need
> something in between. It might be better if the value could be set or
> overridden with a command line option or something like that. 
> 
> There's nightly builds here that allow you to recreate the problem. 
> 
> http://scotland.proximity.on.ca/arm-nightlies/vault/f18-prealpha/

Using:

http://scotland.proximity.on.ca/arm-nightlies/vault/f18-prealpha/F18-vexpress-test-20121010.tar.xz
./boot/boot-vexpress boot/vmlinuz-3.6.0-3.fc18.armv7hl boot/initramfs-3.6.0-3.fc18.armv7hl.img F18-vexpress-test-20121010.img

Booted fine using stock qemu-system-arm on current F18, what am I missing?

Also, the qemu arm maintainer has posted a patch that should fix things in a nicer way:

https://lists.gnu.org/archive/html/qemu-devel/2012-10/msg04732.html

But i'll verify and respond to him once I can reproduce the original issue.
Comment 6 Paul Whalen 2012-10-29 11:01:19 EDT
(In reply to comment #5)
> (In reply to comment #4)
> > Ultimately we set that value as it was larger and it worked. Maybe we need
> > something in between. It might be better if the value could be set or
> > overridden with a command line option or something like that. 
> > 
> > There's nightly builds here that allow you to recreate the problem. 
> > 
> > http://scotland.proximity.on.ca/arm-nightlies/vault/f18-prealpha/
> 
> Using:
> 
> http://scotland.proximity.on.ca/arm-nightlies/vault/f18-prealpha/F18-
> vexpress-test-20121010.tar.xz
> ./boot/boot-vexpress boot/vmlinuz-3.6.0-3.fc18.armv7hl
> boot/initramfs-3.6.0-3.fc18.armv7hl.img F18-vexpress-test-20121010.img
> 
> Booted fine using stock qemu-system-arm on current F18, what am I missing?
> 
> Also, the qemu arm maintainer has posted a patch that should fix things in a
> nicer way:
> 
> https://lists.gnu.org/archive/html/qemu-devel/2012-10/msg04732.html
> 
> But i'll verify and respond to him once I can reproduce the original issue.

The issue seems to only appear in some kernels, most notably the RC kernels. I first noticed it using: kernel-3.6.0-0.rc3.git2.1.fc18
Comment 7 Peter Robinson 2012-10-29 11:09:01 EDT
I wonder if it's when we have debug kernels which are larger.
Comment 8 Peter Robinson 2012-10-29 11:09:59 EDT
> Also, the qemu arm maintainer has posted a patch that should fix things in a
> nicer way:
> 
> https://lists.gnu.org/archive/html/qemu-devel/2012-10/msg04732.html

I'm happy for a solution from upstream. It was just be useful not to have the issue :)
Comment 9 Cole Robinson 2012-10-29 11:46:02 EDT
Can you guys link me to one of those debug kernels (sorry if it's buried somewhere in one of the links you pasted above, but it didn't jump out at me)
Comment 10 Paul Whalen 2012-10-29 12:51:58 EDT
(In reply to comment #9)
> Can you guys link me to one of those debug kernels (sorry if it's buried
> somewhere in one of the links you pasted above, but it didn't jump out at me)

You can find one here - http://armpkgs.fedoraproject.org/packages/kernel/3.6.0/0.rc3.git2.1.fc18/armv7hl/kernel-3.6.0-0.rc3.git2.1.fc18.armv7hl.rpm
Comment 11 Fedora Update System 2012-10-31 08:53:11 EDT
qemu-1.2.0-18.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/qemu-1.2.0-18.fc18
Comment 12 Fedora Update System 2012-10-31 14:11:00 EDT
Package qemu-1.2.0-18.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing qemu-1.2.0-18.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-17353/qemu-1.2.0-18.fc18
then log in and leave karma (feedback).
Comment 13 Fedora Update System 2012-11-01 09:05:49 EDT
qemu-1.2.0-19.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/qemu-1.2.0-19.fc18
Comment 14 Paul Whalen 2012-11-02 16:07:33 EDT
qemu-1.2.0-19.fc18 - confirmed working with latest debug enabled kernel.

Note You need to log in before you can comment on or make changes to this bug.