Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xen support might require some patches from QubesOS for better workstation compatibility. #340544

Open
CertainLach opened this issue Sep 8, 2024 · 1 comment · May be fixed by #341429
Open
Assignees

Comments

@CertainLach
Copy link
Member

Describe the bug

Upstream Xen might have compatibility issues with many hardware configurations, as it is primarily intended for enterprise servers, not for workstations/laptops, where NixOS is more popular.

Steps To Reproduce

  1. Enable Xen on workstation/laptop hardware.
  2. Notice that xen power management doesn't work correctly/xen doesn't boot because of some incompatibility.

Expected behavior

As far as I'm aware, the only distribution which explicitly provides support for Xen on workstations is QubesOS.
Wonder if we might want to have some kernel/hypervisor patches from QubesOS to be packaged.

I had an issue with E820 page conflict, which is resolved in QubesOS kernel (There is also a PR with better patch to consider, I am using it: QubesOS/qubes-linux-kernel#992)

(Upstream has also other workaround, but this PR is the "correct" fix for the issue)
There is also xen pm patches, which might be useful to some users, if we want to have user experience in NixOS Xen to be closer to QubesOS (everything works out of the box on consumer hardware)

  boot.kernelPatches = let
    e820 = id: name: hash: {
      inherit name;
      patch = pkgs.fetchpatch {
        inherit hash;
        url = "https://raw.githubusercontent.com/QubesOS/qubes-linux-kernel/8c92891869f38016372e89706c4e00e83d1f092d/${id}-xen-${name}.patch";
      };
    };
  in [
    (e820 "0001" "use-correct-end-address-of-kernel-for-conflict-c" "sha256-q0ntLxlrVNQi6YyeqCPppEfGosPRCbeWcKMBfijYPK0=")
    (e820 "0002" "introduce-generic-helper-checking-for-memory-map" "sha256-PG9a6KOWDbH3Q+n7Ak+3qIaD2XUpnUFsBho73LIUvrk=")
    (e820 "0003" "move-checks-for-e820-conflicts-further-up" "sha256-Mm9jTWSXbwPjHCcz9nWLnWnzEcOkM1lU5TOxXZkmqrU=")
    (e820 "0004" "move-max_pfn-in-xen_memory_setup-out-of-function" "sha256-g8slHt7oTU7bChxJiKrYjLSc6vyRjl05hO2hHW1qin4=")
    (e820 "0005" "tolerate-ACPI-NVS-memory-overlapping-with-Xen-al" "sha256-ZilEj4Eh57M7VWN6xS8gOWArghgSqXTllMXFYr8L2kA=")
  ];

Notify maintainers

@SigmaSquadron


Add a 👍 reaction to issues you find important.

@SigmaSquadron
Copy link
Contributor

I'd rather not make major changes to the Xen source. Would it be agreeable to package qubes-vmm-xen and qubes-linux-kernel as separate packages instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants