Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Installing Gentoo
  • Search

[SOLVED] Xen with uefi flag?

Having problems with the Gentoo Handbook? If you're still working your way through it, or just need some info before you start your install, this is the place. All other questions go elsewhere.
Post Reply
Advanced search
3 posts • Page 1 of 1
Author
Message
bschnzl
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 105
Joined: Sun Mar 13, 2005 7:15 am

[SOLVED] Xen with uefi flag?

  • Quote

Post by bschnzl » Thu Jul 24, 2025 11:30 pm

Code: Select all

[ebuild   R    ] app-emulation/xen-4.19.2::gentoo  USE="boot-symlinks uefi -debug -flask -secureboot" 0 KiB
gives

Code: Select all

>>> Merging app-emulation/xen-4.19.2 to /
 * Your /boot partition was detected as being mounted.
 * Files will be installed there for xen to function correctly.
 * Assuming you do not have a separate /efi partition.
 * Your /boot/efi partition was detected as being mounted.
 * Files will be installed there for xen to function correctly.
 * Assuming you do not have a separate /boot/EFI partition.
--- /boot/
>>> /boot/xen.gz
>>> /boot/xen-4.gz
>>> /boot/xen-4.19.2.config
>>> /boot/xen-4.19.2.gz
>>> /boot/xen-4.19.gz
--- /usr/
--- /usr/lib/
--- /usr/lib/debug/
>>> /usr/lib/debug/xen-syms-4.19.2
=== /usr/lib/debug/xen-syms-4.19.2.map
>>> Safely unmerging already-installed instance...
There is no xen*.efi
nothing goes into /boot/efi even though its detected
Last edited by bschnzl on Wed Aug 06, 2025 5:49 am, edited 1 time in total.
Persistance Pays
Top
bschnzl
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 105
Joined: Sun Mar 13, 2005 7:15 am

  • Quote

Post by bschnzl » Wed Jul 30, 2025 3:13 pm

Well...

the distfile /var/cache/distfiles/xen-4.19.2.tar.gz produces xen-4.19.2/dist/install/usr/lib64/efi/xen-4.19.2.efi.

xen-4.19.2.efi is 30 MB.
xen-4.16.5.efi is 2.9 MB

xl dmesg renders about the same output! They both load a kernel built on the current Gentoo sources, but only xen-4.19.2 gets to a login prompt. Oddly, xen-4.16.5 drops to a dracut shell with logs. That is a rabbit hole I did not explore! I see no reason for a 30M boot file!

I did not try xen-gentoo-patches-4.17.0-gentoo-patchset-2.tar.bz2. That will keep my system in line with the Gentoo path, so... thats where I go next.

I do have to say that you will not get here without Gentoo. Thanks folks!

Caveat that EFI has to boot from VFAT and all that...
Persistance Pays
Top
bschnzl
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 105
Joined: Sun Mar 13, 2005 7:15 am

[Solved] Xen with uefi flag?

  • Quote

Post by bschnzl » Wed Aug 06, 2025 5:47 am

Well -

That was rough!

Xen 4.19.2 boots! And I can shell in via ssh.

The Tigon eth cards would not come up under xen. I would get:

Code: Select all

1 # RTNETLINK answers: cannot allocate memory
2 # SIOCSIFFLAGS cannot allocate memory  
Number 1 showed up the boot output. Number 2 returned from any variation of ifconfig eth0 up. Trying to modprobe tg3 just made a mess.

xl dmesg shows four changes - two of which are just due to boot timing. The two change indicators are:
  • (XEN) Intel VT-d Dom0 DMA Passthrough enabled.
    (XEN) - Dom0 mode: Passthrough
These are from adding:

Code: Select all

iommu=dom0-passthrough
to xen's command line. The command line is the same in xen.cfg, and refind_xen.conf. That has the effect of obfuscating the root cause. YMMV.

My command line is:

Code: Select all

loader xen.efi ucode=ucode.cpio iommu=dom0-passthrough dom0_mem=4096M  kernel=vmlinuz-6.12.31-gentoo root=/dev/sda3 net.ifnames=0 ipv6.autoconf=0
The initrd was generated with dracut - on bare metal. It gets the machine booted. It may be worth trimming in the future. The firmware is built into the kernel. There is no way to do that for Xen.

dmesg shows mainly boot timimg differences, and the Tigon cards successfully coming online. The best way to fix memory allocation issues as a system guy is to look for missing components! The Kernel! I'm pretty sure I would not have gotten here by the handbook, or the Xen documentation! I would suggest that "making it easier" to install the kernel is a disservice to the community! We need these skills to innovate! </rant>

So - Here is my diff from kernel to kernel. This was the solution! The files are kernels/six.12.31-e AND kernels/six.12.31-f.

Code: Select all

1066a1067
> CONFIG_DEVICE_MIGRATION=y
1108c1109,1111
< # CONFIG_ZONE_DEVICE is not set
---
> CONFIG_ZONE_DEVICE=y
> CONFIG_GET_FREE_REGION=y
> CONFIG_DEVICE_PRIVATE=y
1128c1131
< # CONFIG_NUMA_EMU is not set
---
> CONFIG_NUMA_EMU=y
1714a1724
> # CONFIG_PCI_P2PDMA is not set
4474c4483
< # CONFIG_USB_XEN_HCD is not set
---
> CONFIG_USB_XEN_HCD=m
4986a4996
> CONFIG_XEN_PRIVCMD_EVENTFD=y
4996c5006,5010
< # CONFIG_XEN_VIRTIO is not set
---
> CONFIG_XEN_UNPOPULATED_ALLOC=y
> CONFIG_XEN_GRANT_DMA_IOMMU=y
> CONFIG_XEN_GRANT_DMA_OPS=y
> CONFIG_XEN_VIRTIO=y
> CONFIG_XEN_VIRTIO_FORCE_GRANT=y
5929a5944,5946
> CONFIG_ND_PFN=m
> CONFIG_NVDIMM_PFN=y
> CONFIG_NVDIMM_DAX=y
You are not supposed to edit .config by hand! But you can read it! I use make menuconfig, because it works in ssh in a terminal. nconfig requires X, and a mouse. Anyone get heavy fingers? Menuconfig has a search function accessed by "/". Just like the man pages! Or any text you can get into less(1). The text after "CONFIG_" will usually bring up a discription of that option that is quite helpful. If it brings up more - *BONUS*! In this case I searched for "xen". That showed me more than the help text ever will, in this case: XEN_VIRTIO! Dom0's need all of Xen!

Some of the changes are automatic. We are looking for xen to add memory management. Xen manages multiple processors differently than the kernel. Numa emulation is needed! ZONE_DEVICE was a dependency for a xen option. USB_XEN_HCD is for future use. Some just disappear when not selected! They are critical adds to the Xen documentation. I've been in the wiki - it's a mess!

The patchset is small, and it doesn't apply smoothly. In any case, it was mostly for tools, so it did not help to get the server fully booted!
The 30 MB boot file booted every time, and loaded the kernel, every time. FWIW, I moved to rEFInd because my lappy boots xen with that. I may try Grub in the future.

I'm off to build VMs! I hope this helps someone!
Persistance Pays
Top
Post Reply

3 posts • Page 1 of 1

Return to “Installing Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic