xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* Panic on CPU0 : Unable to boot with Xen 4.1 on Fedora 16, manual grub2 config after compiling Xen from source
@ 2012-03-07 19:34 Ranjith Krishnan
  2012-03-08 18:08 ` Ranjith Krishnan
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ranjith Krishnan @ 2012-03-07 19:34 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1805 bytes --]

Hello all,

I had asked my question on xen-users list, but I did not get any responses
for 5 days despite bumping the mail up once. Hence forwarding the question
here.

Hello,
Newbie here. So please be patient. If you need any extra information please
ask, and I will try to provide.
My intention is to study xen source and hopefully make some contributions
to it. So I tried to compile Xen 4.1 from source and start using it.

My environment details:
2.0 GHz 32 bit CPU, 2GB RAM with XP and Ubuntu Wubi install. ( Ubuntu
installed as an application within XP, can dual boot)
Trying to install Xen on external USB Hard disk (500 GB) : Installed Fedora
16 on this. Can boot and use Fedora 16 just fine from this.

I found these tutorials after searching and used them.

1. http://wiki.xen.org/wiki/Fedora_13_Xen_4_Tutorial
Used a partition scheme very similar to one mentioned in above tutorial.
Also disabled selinux.

2. Found a second tutorial for building xen from source:
http://wiki.xen.org/wiki/Compiling_Xen

3. I only complied and installed Xen, not linux kernel ( because wiki says
Fedora16 kernel is a valid Xen Dom0 Kernel ) according to
http://wiki.xen.org/wiki/Fedora_16_Dom0

After I installed Xen, confirmed that under /boot I have xen.gz, and the
folder /etc/xen exists.

I modified my grub2.cfg file by looking at a sample grub2 configuration
mentioned at
http://old-list-archives.xen.org/archives/html/xen-changelog/2011-10/msg00151.html

Now when I boot with Xen 4.1, it gives me a Kernel panic and fails to load
the dom0 kernel. Exact error message is

'elf_xen_note_check: ERROR: Will only load images built for the
generic loader or Linux images')

PANIC on CPU0:
Could not setup DOM0 guest OS

I am attaching my grub configuration file. Please have a look and advice.


-- 
Ranjith

[-- Attachment #1.2: Type: text/html, Size: 3109 bytes --]

[-- Attachment #2: Fedora_grub1.cfg --]
[-- Type: application/octet-stream, Size: 5029 bytes --]

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  insmod vbe
  insmod vga
  insmod video_bochs
  insmod video_cirrus
}

set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Fedora (3.2.7-1.fc16.i686)' --class fedora --class gnu-linux --class gnu --class os {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set=root 1c4a75fe-53e2-4320-9500-7111ad74169b
	echo 'Loading Fedora (3.2.7-1.fc16.i686)'
	linux	/vmlinuz-3.2.7-1.fc16.i686 root=/dev/mapper/vg_fedorausb-lvroot ro rd.md=0 rd.dm=0  KEYTABLE=us quiet rd.lvm.lv=vg_fedorausb/lvroot rhgb rd.luks=0 rd.lvm.lv=vg_fedorausb/lvswap SYSFONT=latarcyrheb-sun16 LANG=en_US.UTF-8
	echo 'Loading initial ramdisk ...'
	initrd /initramfs-3.2.7-1.fc16.i686.img
}
menuentry 'Fedora Linux, with Linux 3.1.0-7.fc16.i686' --class fedora --class gnu-linux --class gnu --class os {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set=root 1c4a75fe-53e2-4320-9500-7111ad74169b
	echo	'Loading Linux 3.1.0-7.fc16.i686 ...'
	linux	/vmlinuz-3.1.0-7.fc16.i686 root=/dev/mapper/vg_fedorausb-lvroot ro rd.md=0 rd.dm=0  KEYTABLE=us quiet rd.lvm.lv=vg_fedorausb/lvroot rhgb rd.luks=0 rd.lvm.lv=vg_fedorausb/lvswap SYSFONT=latarcyrheb-sun16 LANG=en_US.UTF-8
	echo	'Loading initial ramdisk ...'
	initrd	/initramfs-3.1.0-7.fc16.i686.img
}
menuentry 'Fedora Linux, with Linux 3.1.0-7.fc16.i686 (recovery mode)' --class fedora --class gnu-linux --class gnu --class os {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set=root 1c4a75fe-53e2-4320-9500-7111ad74169b
	echo	'Loading Linux 3.1.0-7.fc16.i686 ...'
	linux	/vmlinuz-3.1.0-7.fc16.i686 root=/dev/mapper/vg_fedorausb-lvroot ro single rd.md=0 rd.dm=0  KEYTABLE=us quiet rd.lvm.lv=vg_fedorausb/lvroot rhgb rd.luks=0 rd.lvm.lv=vg_fedorausb/lvswap SYSFONT=latarcyrheb-sun16 LANG=en_US.UTF-8
	echo	'Loading initial ramdisk ...'
	initrd	/initramfs-3.1.0-7.fc16.i686.img
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
submenu "Xen 4.1" {
menuentry 'Fedora Linux, with Xen 4.1 and Linux 3.2.7-1.fc16.i686' --class fedora --class gnu-linux --class gnu --class os --class xen {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set=root 1c4a75fe-53e2-4320-9500-7111ad74169b
	echo 'Loading Xen 4.1 ...'
	multiboot       /xen-4.1.gz placeholder
	echo 'Loading Linux 3.2.7-1.fc16.i686 ...'
	module	/vmlinuz-3.2.7-1.fc16.i686 placeholder
	root=/dev/mapper/vg_fedorausb-lvroot ro rd.md=0 rd.dm=0  KEYTABLE=us quiet rd.lvm.lv=vg_fedorausb/lvroot rhgb rd.luks=0 rd.lvm.lv=vg_fedorausb/lvswap SYSFONT=latarcyrheb-sun16 LANG=en_US.UTF-8
	echo 'Loading initial ramdisk ...'
	module /initramfs-3.2.7-1.fc16.i686.img
}
menuentry 'Fedora Linux, with Xen 4.1 and Linux 3.2.7-1.fc16.i686 (recovery mode)' --class fedora --class gnu-linux --class gnu --class os --class xen {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set=root 1c4a75fe-53e2-4320-9500-7111ad74169b
	echo 'Loading Xen 4.1 ...'
	multiboot       /xen-4.1.gz placeholder
	echo 'Loading Linux 3.2.7-1.fc16.i686 ...'
	module	/vmlinuz-3.2.7-1.fc16.i686 placeholder
	root=/dev/mapper/vg_fedorausb-lvroot ro single rd.md=0 rd.dm=0  KEYTABLE=us quiet rd.lvm.lv=vg_fedorausb/lvroot rhgb rd.luks=0 rd.lvm.lv=vg_fedorausb/lvswap SYSFONT=latarcyrheb-sun16 LANG=en_US.UTF-8
	echo 'Loading initial ramdisk ...'
	module /initramfs-3.2.7-1.fc16.i686.img
}
}
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Professional (on /dev/sda1)" --class windows --class os {
	insmod part_msdos
	insmod ntfs
	set root='(/dev/sda,msdos1)'
	search --no-floppy --fs-uuid --set=root 0650458050457807
	drivemap -s (hd0) ${root}
	chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

### BEGIN /etc/grub.d/90_persistent ###
### END /etc/grub.d/90_persistent ###

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: Panic on CPU0 : Unable to boot with Xen 4.1 on Fedora 16, manual grub2 config after compiling Xen from source
  2012-03-07 19:34 Panic on CPU0 : Unable to boot with Xen 4.1 on Fedora 16, manual grub2 config after compiling Xen from source Ranjith Krishnan
@ 2012-03-08 18:08 ` Ranjith Krishnan
  2012-03-16 16:00 ` Ian Campbell
  2012-03-16 22:39 ` Konrad Rzeszutek Wilk
  2 siblings, 0 replies; 5+ messages in thread
From: Ranjith Krishnan @ 2012-03-08 18:08 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 2176 bytes --]

Bumping this thread up.

Please can someone have a look at this and help. I think there is something
wrong with my grub.cfg so if someone has a working grub2 config, they can
help me.

On Wed, Mar 7, 2012 at 1:34 PM, Ranjith Krishnan <pkranjithpk@gmail.com>wrote:

> Hello all,
>
> I had asked my question on xen-users list, but I did not get any responses
> for 5 days despite bumping the mail up once. Hence forwarding the question
> here.
>
> Hello,
> Newbie here. So please be patient. If you need any extra information
> please ask, and I will try to provide.
> My intention is to study xen source and hopefully make some contributions
> to it. So I tried to compile Xen 4.1 from source and start using it.
>
> My environment details:
> 2.0 GHz 32 bit CPU, 2GB RAM with XP and Ubuntu Wubi install. ( Ubuntu
> installed as an application within XP, can dual boot)
> Trying to install Xen on external USB Hard disk (500 GB) : Installed
> Fedora 16 on this. Can boot and use Fedora 16 just fine from this.
>
> I found these tutorials after searching and used them.
>
> 1. http://wiki.xen.org/wiki/Fedora_13_Xen_4_Tutorial
> Used a partition scheme very similar to one mentioned in above tutorial.
> Also disabled selinux.
>
> 2. Found a second tutorial for building xen from source:
> http://wiki.xen.org/wiki/Compiling_Xen
>
> 3. I only complied and installed Xen, not linux kernel ( because wiki says
> Fedora16 kernel is a valid Xen Dom0 Kernel ) according to
> http://wiki.xen.org/wiki/Fedora_16_Dom0
>
> After I installed Xen, confirmed that under /boot I have xen.gz, and the
> folder /etc/xen exists.
>
> I modified my grub2.cfg file by looking at a sample grub2 configuration
> mentioned at
> http://old-list-archives.xen.org/archives/html/xen-changelog/2011-10/msg00151.html
>
> Now when I boot with Xen 4.1, it gives me a Kernel panic and fails to load
> the dom0 kernel. Exact error message is
>
> 'elf_xen_note_check: ERROR: Will only load images built for the generic loader or Linux images')
>
> PANIC on CPU0:
>
> Could not setup DOM0 guest OS
>
> I am attaching my grub configuration file. Please have a look and advice.
>
>
> --
> Ranjith
>
>


-- 
Ranjith

[-- Attachment #1.2: Type: text/html, Size: 3824 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: Panic on CPU0 : Unable to boot with Xen 4.1 on Fedora 16, manual grub2 config after compiling Xen from source
  2012-03-07 19:34 Panic on CPU0 : Unable to boot with Xen 4.1 on Fedora 16, manual grub2 config after compiling Xen from source Ranjith Krishnan
  2012-03-08 18:08 ` Ranjith Krishnan
@ 2012-03-16 16:00 ` Ian Campbell
  2012-03-21  6:09   ` Ranjith Krishnan
  2012-03-16 22:39 ` Konrad Rzeszutek Wilk
  2 siblings, 1 reply; 5+ messages in thread
From: Ian Campbell @ 2012-03-16 16:00 UTC (permalink / raw)
  To: Ranjith Krishnan; +Cc: xen-devel@lists.xen.org

[-- Attachment #1: Type: text/plain, Size: 1147 bytes --]

On Wed, 2012-03-07 at 19:34 +0000, Ranjith Krishnan wrote:
[...]
> 3. I only complied and installed Xen, not linux kernel ( because wiki
> says Fedora16 kernel is a valid Xen Dom0 Kernel ) according
> to http://wiki.xen.org/wiki/Fedora_16_Dom0
[...]
> Now when I boot with Xen 4.1, it gives me a Kernel panic and fails to
> load the dom0 kernel. Exact error message is
> 
> 
> 'elf_xen_note_check: ERROR: Will only load images built for the generic loader or Linux images')
> PANIC on CPU0: 

I think it would be worth double checking the assumption that this
kernel supports Xen. It is also worth figuring out what the compresison
algorithm used is.

You could use the attached bzexplode.c to extract the cmpressed elf
from /boot/vmlinuz:
	$ bzexplode /boot/vmlinuz-3.2.7-1.fc16.i686 > vmlinux.compressed

Once you have that decompress it. e.g.
	$ file vmlinux.compressed
	e.g. ...gziped data...
	$ zcat vmlinux.compressed > vmlinux
	$ file vmlinux
	(should be an ELF file)

Then run "/usr/lib/xen/bin/readnotes vmlinux". If the kernel is Xen
capable then you should get some stuff output. Please post the output of
all the above commands.

Ian.

[-- Attachment #2: bzexplode.c --]
[-- Type: text/x-csrc, Size: 1251 bytes --]

#include <stdio.h>
#include <fcntl.h>
#include <stdint.h>
#include <unistd.h>

#include <inttypes.h>

#include <err.h>

#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>

int main(int argc, char **argv)
{
	int fd;
	struct stat sb;
	void *p;
	uint8_t *hdr;
	int setup_sectors;
	uint32_t compressed_payload_offset;
	uint32_t compressed_payload_length;

	if (argc != 2)
		errx(1, "usage: bzexplode <bzImage>");

	fd = open(argv[1], O_RDONLY);
	if (fd < 0)
		err(1, "open");

	if (fstat(fd, &sb) < 0)
		err(1, "fstat");

	p = mmap(0, sb.st_size, PROT_READ, MAP_SHARED, fd, 0);
	if (p == MAP_FAILED)
		err(1, "mmap");

	hdr = p;
	setup_sectors = hdr[0x1f1];
	compressed_payload_offset = *(uint32_t*)&hdr[0x248];

	fprintf(stderr, "setup sectors %d\n", setup_sectors);

	compressed_payload_offset += (setup_sectors+1) * 512;

	//compressed_payload_length = *(uint32_t*)(p + compressed_payload_offset - 4);
	compressed_payload_length = *(uint32_t*)&hdr[0x24c];

	fprintf(stderr, "compressed_payload_offset %"PRIx32" (abs)\n",
		compressed_payload_offset);
	fprintf(stderr, "compressed_payload_length %"PRIx32"\n",
		compressed_payload_length);

	write(1,
	      p + compressed_payload_offset,
	      compressed_payload_length);
	return 0;
}

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: Panic on CPU0 : Unable to boot with Xen 4.1 on Fedora 16, manual grub2 config after compiling Xen from source
  2012-03-07 19:34 Panic on CPU0 : Unable to boot with Xen 4.1 on Fedora 16, manual grub2 config after compiling Xen from source Ranjith Krishnan
  2012-03-08 18:08 ` Ranjith Krishnan
  2012-03-16 16:00 ` Ian Campbell
@ 2012-03-16 22:39 ` Konrad Rzeszutek Wilk
  2 siblings, 0 replies; 5+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-03-16 22:39 UTC (permalink / raw)
  To: Ranjith Krishnan; +Cc: xen-devel

On Wed, Mar 7, 2012 at 2:34 PM, Ranjith Krishnan <pkranjithpk@gmail.com> wrote:
> Hello all,
>
> I had asked my question on xen-users list, but I did not get any responses
> for 5 days despite bumping the mail up once. Hence forwarding the question
> here.
>
> Hello,
> Newbie here. So please be patient. If you need any extra information please
> ask, and I will try to provide.
> My intention is to study xen source and hopefully make some contributions to
> it. So I tried to compile Xen 4.1 from source and start using it.

OK, but does the version that come with Fedora work for you? Have you tried
'yum install xen' and seen how it installs and configured the grub2.cfg?

>
> My environment details:
> 2.0 GHz 32 bit CPU, 2GB RAM with XP and Ubuntu Wubi install. ( Ubuntu
> installed as an application within XP, can dual boot)
> Trying to install Xen on external USB Hard disk (500 GB) : Installed Fedora
> 16 on this. Can boot and use Fedora 16 just fine from this.
>
> I found these tutorials after searching and used them.
>
> 1. http://wiki.xen.org/wiki/Fedora_13_Xen_4_Tutorial
> Used a partition scheme very similar to one mentioned in above tutorial.
> Also disabled selinux.

Ewww. That is not good. Please don't use that.
>
> 2. Found a second tutorial for building xen from source:
> http://wiki.xen.org/wiki/Compiling_Xen
>
> 3. I only complied and installed Xen, not linux kernel ( because wiki says
> Fedora16 kernel is a valid Xen Dom0 Kernel ) according
> to http://wiki.xen.org/wiki/Fedora_16_Dom0
>
> After I installed Xen, confirmed that under /boot I have xen.gz, and the
> folder /etc/xen exists.
>
> I modified my grub2.cfg file by looking at a sample grub2 configuration
> mentioned
> at http://old-list-archives.xen.org/archives/html/xen-changelog/2011-10/msg00151.html
>
> Now when I boot with Xen 4.1, it gives me a Kernel panic and fails to load
> the dom0 kernel. Exact error message is
>
> 'elf_xen_note_check: ERROR: Will only load images built for the generic
> loader or Linux images')
>

So that looks like you are trying to load the initrd image instead of
the kernel. Sounds to me that you have missed a "module" line or
perhaps are using the "kernel"/ "initrd"
stanza.

I would strongly recommend you first install from the yum repos so
that you can get a working baseline first.
> PANIC on CPU0:
>
>
> Could not setup DOM0 guest OS
>
> I am attaching my grub configuration file. Please have a look and advice.
>
>
> --
> Ranjith
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>

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

* Re: Panic on CPU0 : Unable to boot with Xen 4.1 on Fedora 16, manual grub2 config after compiling Xen from source
  2012-03-16 16:00 ` Ian Campbell
@ 2012-03-21  6:09   ` Ranjith Krishnan
  0 siblings, 0 replies; 5+ messages in thread
From: Ranjith Krishnan @ 2012-03-21  6:09 UTC (permalink / raw)
  To: Ian Campbell, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1813 bytes --]

On Fri, Mar 16, 2012 at 11:00 AM, Ian Campbell <Ian.Campbell@citrix.com>wrote:

> On Wed, 2012-03-07 at 19:34 +0000, Ranjith Krishnan wrote:
> [...]
> > 3. I only complied and installed Xen, not linux kernel ( because wiki
> > says Fedora16 kernel is a valid Xen Dom0 Kernel ) according
> > to http://wiki.xen.org/wiki/Fedora_16_Dom0
> [...]
> > Now when I boot with Xen 4.1, it gives me a Kernel panic and fails to
> > load the dom0 kernel. Exact error message is
> >
> >
> > 'elf_xen_note_check: ERROR: Will only load images built for the generic
> loader or Linux images')
> > PANIC on CPU0:
>
> I think it would be worth double checking the assumption that this
> kernel supports Xen. It is also worth figuring out what the compresison
> algorithm used is.
>
> You could use the attached bzexplode.c to extract the cmpressed elf
> from /boot/vmlinuz:
>        $ bzexplode /boot/vmlinuz-3.2.7-1.fc16.i686 > vmlinux.compressed
>
> Once you have that decompress it. e.g.
>        $ file vmlinux.compressed
>        e.g. ...gziped data...
>        $ zcat vmlinux.compressed > vmlinux
>        $ file vmlinux
>        (should be an ELF file)
>
> Then run "/usr/lib/xen/bin/readnotes vmlinux". If the kernel is Xen
> capable then you should get some stuff output. Please post the output of
> all the above commands.
>
> Ian.
>

Hello Ian,
Thanks for responding.

Meanwhile I already got help of my university system administrators who
figured out the problem.
I was trying to install it on a 32 bit machine, and the fedora 16 dom0 page
explicitly mention that I need to use PAE-kernel for the i686 version.
(This bit of info was missing in the xen wiki though.)
http://fedoraproject.org/wiki/Features/XenPvopsDom0
When we tried yum install on the xen-pae, this particular error went away.

-- 
Ranjith

-- 
Ranjith

[-- Attachment #1.2: Type: text/html, Size: 2572 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

end of thread, other threads:[~2012-03-21  6:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-07 19:34 Panic on CPU0 : Unable to boot with Xen 4.1 on Fedora 16, manual grub2 config after compiling Xen from source Ranjith Krishnan
2012-03-08 18:08 ` Ranjith Krishnan
2012-03-16 16:00 ` Ian Campbell
2012-03-21  6:09   ` Ranjith Krishnan
2012-03-16 22:39 ` Konrad Rzeszutek Wilk

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