Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 601872 - xen.gz Kernel Load And Hangs
Summary: xen.gz Kernel Load And Hangs
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Xen Devs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-07 03:05 UTC by John L. Poole
Modified: 2016-12-08 05:59 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
grub.cfg -- hand modified (grub_modified.cfg,19.79 KB, text/plain)
2016-12-07 03:13 UTC, John L. Poole
Details
kernel config file of 4.8.11 (config-4.8.11,144.54 KB, text/plain)
2016-12-08 04:10 UTC, Yixun Lan
Details
log of Yixun Lan kernel deployment (ylan_kernel_test.log,7.76 KB, text/plain)
2016-12-08 05:41 UTC, John L. Poole
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John L. Poole 2016-12-07 03:05:06 UTC
I'm not sure where to categorize this bug.  I compiled a xen.gz kernel, but when I try to load it, the system hangs.

I'm trying to build a Xen server.  I've successfully built a Gentoo kernel and modified it in accordance with the Xen wiki at https://wiki.gentoo.org/wiki/Xen#Kernel.  I've carefully made certain I have activated those sections in the kernel set forth in the wiki.

The kernel is built with genkernel, the session is below.  When I go to boot into xen, the 3 files, xen.gz,  kernel-genkernel-x86_64-4.4.26-gentoo, and initramfs-genkernel-x86_64-4.4.26-gentoo successfully load, after which the console just hangs and I get a column of white-filled text slots across the top of my screen.  

I have a serial null modem cable hooked up and have successfully monitoring a regular boot of kernel-genkernel-x86_64-4.4.26-gentoo  using baud=9600,8n1.  When I select the Xen alternative in the Grub2 menu, all the  output from Grub's echo statements appear and then nothing more.  http://pasik.reaktio.net/xenserialconsolelog.tx shows what posts a Xen kernel should be making and I do not get anything.

I don't know what to do next to try and monitor or debug the xen.gz.



Reproducible: Always

Steps to Reproduce:
1. emerge app-emulation/xen
2. genkernel --oldconfig --menuconfig --install --bootloader=grub --symlink --disklabel --lvm --mdadm --makeopts=-j9 all --no-symlink
3. select Xen Kernel in Grub2 (I have modified the /boot/grub/grub.cfg) which I'll add as an attachment to this bug.

Actual Results:  
zeta jlpoole # genkernel --oldconfig --menuconfig --install --bootloader=grub --symlink --disklabel --lvm --mdadm --makeopts=-j9 all --no-symlink
* [jlpoole gen_bootloader 3] BOOTLOADER = grub2
* Gentoo Linux Genkernel; Version 3.4.52.4
* Running with options: --oldconfig --menuconfig --install --bootloader=grub --symlink --disklabel --lvm --mdadm --makeopts=-j9 all --no-symlink

* Using genkernel.conf from /etc/genkernel.conf
* Sourcing arch-specific config.sh from /usr/share/genkernel/arch/x86_64/config.sh ..
* Sourcing arch-specific modules_load from /usr/share/genkernel/arch/x86_64/modules_load ..

* [jlpoole gen_determineargs 143] BOOTDIR = /boot before arch_replace()
* [jlpoole gen_determineargs 145] BOOTDIR = /boot after arch_replace()
* [jlpoole gen_determineargs 148] BOOTDIR = /boot after removing trailing slash
* Linux Kernel 4.4.26-gentoo for x86_64...
* .. with config file /etc/kernels/kernel-config-x86_64-4.4.26-gentoo
* kernel: --mrproper is disabled; not running 'make mrproper'.
*         >> Running oldconfig...
* kernel: --clean is disabled; not running 'make clean'.
* kernel: >> Invoking menuconfig...
*         >> Compiling 4.4.26-gentoo bzImage...
*         >> Installing firmware ('make firmware_install') due to CONFIG_FIRMWARE_IN_KERNEL != y...
*         >> Compiling 4.4.26-gentoo modules...
*         >> Generating module dependency data...
* Copying config for successful build to /etc/kernels/kernel-config-x86_64-4.4.26-gentoo
* busybox: >> Using cache
* initramfs: >> Initializing...
*         >> Appending base_layout cpio data...
*         >> Appending auxilary cpio data...
*         >> Copying keymaps
*         >> Appending busybox cpio data...
*         >> Appending lvm cpio data...
*           LVM: Adding support (compiling binaries)...
* lvm: >> Using cache
*         >> Appending mdadm cpio data...
*               MDADM: Skipping inclusion of mdadm.conf
*               MDADM: Adding support (compiling binaries)...
*               MDADM: Using cache
*         >> Appending modules cpio data...
*         >> Appending blkid cpio data...
*         >> Appending modprobed cpio data...
*         >> Appending linker cpio data...
*         >> Finalizing cpio...
*         >> Compressing cpio data (.xz)...
* [jlpoole debug]in set_bootloader(),  Bootloader = grub
* [jlpoole debug] OVERRIDING set_bootloader to force grub2
* [jlpoole gen_bootloader 13] correctly calling grub2
* [jlpoole gen_bootloader 39] BOOTDIR = /boot
* You can customize Grub2 parameters in /etc/default/grub.
*
* Kernel compiled successfully!
*
* Required Kernel Parameters:
*     root=/dev/$ROOT
*
*     Where $ROOT is the device node for your root partition as the
*     one specified in /etc/fstab
*
* If you require Genkernel's hardware detection features; you MUST
* tell your bootloader to use the provided INITRAMFS file.

* WARNING... WARNING... WARNING...
* Additional kernel cmdline arguments that *may* be required to boot properly...
* add "dolvm" for lvm support
* add "domdadm" for RAID support
* With support for several ext* filesystems available, it may be needed to
* add "rootfstype=ext3" or "rootfstype=ext4" to the list of boot parameters.

* Do NOT report kernel bugs as genkernel bugs unless your bug
* is about the default genkernel configuration...
*
* Make sure you have the latest ~arch genkernel before reporting bugs.
zeta jlpoole #

 

Expected Results:  
posted results during the loading of the xen.gz kernel

zeta jlpoole # eix -I xen
[I] app-emulation/xen
     Available versions:  4.6.3-r3^st ~4.6.4^st ~4.7.0-r3^st (~)4.7.1^st {custom-cflags debug efi flask}
     Installed versions:  4.7.1^st(02:08:41 PM 12/06/2016)(debug efi flask -custom-cflags)
     Homepage:            http://xen.org/
     Description:         The Xen virtual machine monitor

[I] app-emulation/xen-tools
     Available versions:  4.6.3-r2(0/4.6)^t ~4.6.4(0/4.6)^t ~4.7.0-r2(0/4.7)^t (~)4.7.1(0/4.7)^t {api custom-cflags debug doc flask hvm ocaml ovmf +pam pygrub python qemu +qemu-traditional screen sdl static-libs system-qemu system-seabios PYTHON_TARGETS="python2_7"}
     Installed versions:  4.7.1^t(08:01:41 PM 11/15/2016)(flask hvm ovmf pam qemu qemu-traditional screen sdl -api -custom-cflags -debug -doc -ocaml -pygrub -python -static-libs -system-qemu -system-seabios PYTHON_TARGETS="python2_7")
     Homepage:            http://xen.org/
     Description:         Xen tools including QEMU and xl

Found 2 matches
zeta jlpoole #
Comment 1 John L. Poole 2016-12-07 03:13:42 UTC
Created attachment 455308 [details]
grub.cfg -- hand modified

I have modified this trying different things obtain postings from the xen kernel.

I added the load_video.

Here's the current line:
multiboot	/xen.gz placeholder console_timestamps=boot loglvl=all guest_loglvl=all  earlyprintk=xen dom0_mem=1024M,max:1024M softlevel=xen ${xen_rm_opts} console=ttyS0 

I've tried modifications of the above line trying to get some output on my serial port.  Examples: 

... com1=9600,8n1 console=com1
... console=com1,com2    <-- I had read that the com ports can get renumbered, so tried both.
Comment 2 Yixun Lan archtester gentoo-dev 2016-12-07 03:37:37 UTC
could you adjust your grub.cfg like this? this is something works for me, and you should get information from serial console (you need to connect the serial port from another computer)

multiboot /boot/xen.gz loglvl=all guest_loglvl=all com1=115200,8n1 console=com1
Comment 3 John L. Poole 2016-12-07 03:49:58 UTC
Yixun: thank you.

I went into line edit mode in grub and adopted your suggestions  (changing baud to 9600 which is what I have on PuTTY from my Windows7 workstation):

                          GNU GRUB  version 2.02~beta3

 +----------------------------------------------------------------------------+
 |          search --no-floppy --fs-uuid --set=root EDE9-F8EE                 |^
 |        fi                                                                  |
 |        echo        'Loading Xen xen ...'                                   |
 |        if [ "$grub_platform" = "pc" -o "$grub_platform" = "" ]; then       |
 |            xen_rm_opts=                                                    |
 |        else                                                                |
 |            xen_rm_opts="no-real-mode edd=off"                              |
 |        fi                                                                  |
 |        multiboot        /boot/xen.gz loglvl=all guest_loglvl=all com1=9600\|
 |,8n1 conosle=com1                                                           |
 |        echo        'Loading Linux x86_64-4.4.26-gentoo ...'                |
 |        module        /kernel-genkernel-x86_64-4.4.26-gentoo placeholder ro\|v
 +----------------------------------------------------------------------------+

      Minimum Emacs-like screen editing is supported. TAB lists
      completions. Press Ctrl-x or F10 to boot, Ctrl-c or F2 for
      a command-line or ESC to discard edits and return to the GRUB menu.

I then clicked F10 and go the disappointing results:

  Booting a command list

Loading Xen xen ...
WARNING: no console will be available to OS
Loading Linux x86_64-4.4.26-gentoo ...
Loading initial ramdisk ...
error: no suitable video mode found.
Comment 4 John L. Poole 2016-12-07 03:59:08 UTC
For what it's worth, my serial connection via PuTTY:

   grub> serial
   grub> terminal_output
   Active output terminals:
   serial console
   Available output terminals:
   serial_efi1 serial_efi0 serial_com1 serial_com0 spkmodem gfxterm cbmemc audio
   grub> terminal_input
   Active input terminals:
   serial console
   Available input terminals:
   serial_efi1 serial_efi0 serial_com1 serial_com0 at_keyboard
   grub>

I also was trying to manually load and see if I could finesse the "WARNING: no console will be available to OS" error message.  I'm not sure if this error message means once the kernel boots up, it will be headless, or if it means there will not be console output as the kernel loads.  I suspect the former: see https://github.com/mokafive/grub/blob/upstream/grub-core/loader/multiboot.c at line 197.  

    grub> echo $feature_platform_search_hint
    y
    grub> echo $grub_platform
    efi
    grub> set gfxpayload=keep
    grub> insmod gzio
    grub> insmod part_gpt
    grub> insmod fat
    grub> set root='hd0,gpt2'
    grub> search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hing-efi=hd
    0,gpt2 --hint-baremetal=ahci0,gpt2 EDE9-F8EE
    error: no such device: --hing-efi=hd0,gpt2.
    grub> search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=h
    d0,gpt2 --hint-baremetal=ahci0,gpt2 EDE9-F8EE
    grub> linux /ker
    Possible files are:

     kernel-genkernel-x86_64-4.4.26-gentoo
    kernel-genkernel-x86_64-4.4.26-gentoo.
    old
    grub> linux /kernel-genkernel-x86_64-4.4.26-gentoo root=UUID=667ba578-dfa7-40c8-
    bf09-1a63d3e58799 ro
    grub> multi-boot /xen.gz placeholder console_timestamps=boot dom0_mem=1024M,max:
    1024M softlevel=xen no-real-mode edd=off
    error: can't find command `multi-boot'.
    grub> multiboot /xen.gz placeholder console_timestamps=boot dom0_mem=1024M,max:
    WARNING: no console will be available to OS
    grub> multiboot /xen.gz placeholder console_timestamps=boot dom0_mem=1024M,max:
    1024M softlevel=xen no-real-mode edd=off
    WARNING: no console will be available to OS
    grub> multiboot /xen.gz placeholder console_timestamps=boot dom0_mem=1024M,max:
    1024M softlevel=xen no-real-mode edd=off console=com1
    WARNING: no console will be available to OS
    grub> multiboot /xen.gz placeholder console_timestamps=boot dom0_mem=1024M,max:
    1024M softlevel=xen no-real-mode edd=offf console=com1,vga
    WARNING: no console will be available to OS
    grub> multiboot /xen.gz placeholder console_timestamps=boot dom0_mem=1024M,max:
    1024M softlevel=xen no-real-mode edd=offf console=ttyS0   a
    WARNING: no console will be available to OS
    grub>
Comment 5 Yixun Lan archtester gentoo-dev 2016-12-08 04:10:26 UTC
Created attachment 455472 [details]
kernel config file of 4.8.11

do you still have problem? did you try to narrow down what's the root cause? a) problem inside xen , or b) problem of kernel?

attached file is the kernel config I'm using and should work fine both on host & guest machine
Comment 6 John L. Poole 2016-12-08 04:32:01 UTC
I've spent a lot of time this morning and learned today through further research that on a UEFI based machine, using GRUB2 and XEN will not work... at this time.

See http://www.slideshare.net/xen_com_mgr/xen-in-efiworld20140801finaldk
at slide 12 where the author states:
GRUB/GRUB2 multiboot protocol and Xen do not work on EFI Platform.

I've learned that GRUB 2.02's multiboot2, as opposed to "multiboot", will address the problem and Xen 4.9 which should have all the patches in early 2017.  There was an extensive discussion about the direction of GRUB2 vis-a-vis EFI at: https://lists.xenproject.org/archives/html/xen-devel/2013-10/msg01645.html

I'm pretty certain the problem I am facing is the loading of the xen kernel, and not with my Gentoo kernel.  I never get to the stage were my Gentoo kernel is activated, because the Xen kernel never activates.  Remember, I can boot into my Gentoo kernel directly. 

In your situation is 1) the underlying platform BIOS or UEFI or UEFI in Compatibility Support Module (CSM) (referencing http://www.rodsbooks.com/efi-bootloaders/csm-good-bad-ugly.html)?  And what version of GRUB2 are you using?  Do you have an xen.efi file?

If you confirm your motherboard is in UEFI mode and not CSM, then I could try compiling a kernel based on your attachment and then recompile  app-emulation/xen, but before I undertake that, I want to make sure you and I are both coming form a UEFI exclusive platform.  My reading of the CSM article above suggests that if you have CSM invoked, it can be possible to boot in the BIOS mode.

I really appreciate your spending time on this.  What's remarkable is that I purchased my Supermicro completely unaware that this problem awaited me.  I think others who buy new equipment are going to be equally surprised, but then how many people try to run Xen??
Comment 7 John L. Poole 2016-12-08 05:01:09 UTC
I really do not have anything lose at the moment, so I'm compiling the proffered kernel with:

genkernel  --kernel-config=/usr/src/linux/.config_ylan  --install --bootloader=grub --symlink --disklabel --lvm --mdadm --makeopts=-j9 all --no-symlink

and we'll see what happens.
Comment 8 John L. Poole 2016-12-08 05:41:32 UTC
Created attachment 455476 [details]
log of  Yixun Lan kernel deployment

Attempt to boot with  Yixun Lan kernel failed as well.  I'm pretty certain the problem is the UEFI/Xen/Grub2.  Note: there was nothing added to the efi directory.  I understand that and xen.efi needs to be created.

zeta linux # date
Wed Dec  7 21:32:23 PST 2016
zeta linux # ls -ls /boot
total 35084
    1 drwxr-xr-x 2 root root      512 Dec  7 07:09 attic
    1 drwxr-xr-x 4 root root      512 Nov 12 16:42 efi
    1 drwxr-xr-x 6 root root     1024 Dec  7 21:22 grub
22756 -rwxr-xr-x 1 root root 23301932 Dec  7 21:22 initramfs-genkernel-x86_64-4.4.26-gentoo
 5521 -rwxr-xr-x 1 root root  5652752 Dec  7 20:57 kernel-genkernel-x86_64-4.4.26-gentoo
    1 drwxr-xr-x 2 root root      512 Nov 12 00:16 lost+found
 3218 -rwxr-xr-x 1 root root  3295183 Dec  7 20:57 System.map-genkernel-x86_64-4.4.26-gentoo
    1 -rwxr-xr-x 1 root root      949 Dec  7 21:23 xen-4.7.1.config
  897 -rwxr-xr-x 1 root root   917879 Dec  7 21:25 xen-4.7.1.gz
  897 -rwxr-xr-x 1 root root   917879 Dec  7 21:25 xen-4.7.gz
  897 -rwxr-xr-x 1 root root   917879 Dec  7 21:25 xen-4.gz
  897 -rwxr-xr-x 1 root root   917879 Dec  7 21:25 xen.gz
zeta linux #
Comment 9 Yixun Lan archtester gentoo-dev 2016-12-08 05:44:10 UTC
hi john, I actually do *not* have machine which equip with UEFI support, sorry I have pretty old machines ;-)

probably you could try qemu+kvm which is much simpler than xen if you do not have specific requirement
Comment 10 John L. Poole 2016-12-08 05:59:37 UTC
For someone very determined, here is an article about compiling a Xen kernel (Xen Server) that can be deployed on a UEFI machine:

http://xenserver.org/discuss-virtualization/virtualization-blog/entry/xenserver-6-5-can-do-true-uefi-boot.html