Bug 277200 - emulators/xen-kernel Dom0 built with FreeBSD 14 fails to boot
Summary: emulators/xen-kernel Dom0 built with FreeBSD 14 fails to boot
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Roger Pau Monné
URL:
Keywords:
: 277199 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-02-20 17:46 UTC by mgrooms
Modified: 2024-03-09 02:27 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (royger)


Attachments
Booting FreeBSD 14 with xen-kernel built with 14 (149.47 KB, image/png)
2024-02-20 17:47 UTC, mgrooms
no flags Details
Fix clang codegen (3.83 KB, patch)
2024-02-21 17:01 UTC, Roger Pau Monné
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mgrooms 2024-02-20 17:46:11 UTC
When I attempt to boot FreeBSD using the xen kernel compiled with FreeBSD 14 ( llvm v16.0.6 ), the FreeBSD kernel fails to boot. I gets stuck during the Launching APs step.

I force installed the xen-kernel package from a FreeBSD 13.2 system and that boots fine, so I assume this is an issue with code generated with the newer LLVM mc. Boot video attached.
Comment 1 mgrooms 2024-02-20 17:47:44 UTC
Created attachment 248646 [details]
Booting FreeBSD 14 with xen-kernel built with 14
Comment 2 mgrooms 2024-02-20 17:48:05 UTC
Sorry. Video was too large. Included a pic.
Comment 3 Li-Wen Hsu freebsd_committer freebsd_triage 2024-02-20 20:56:58 UTC
*** Bug 277199 has been marked as a duplicate of this bug. ***
Comment 4 Roger Pau Monné freebsd_committer freebsd_triage 2024-02-21 08:16:52 UTC
Just picked up the 14.0 build of xen-kernel and can indeed reproduce this.  Looking into it.
Comment 5 Roger Pau Monné freebsd_committer freebsd_triage 2024-02-21 17:01:26 UTC
Created attachment 248661 [details]
Fix clang codegen

The following should fix it, will submit to xen-devel for review.
Comment 6 Roger Pau Monné freebsd_committer freebsd_triage 2024-02-22 08:19:42 UTC
For the record, here is the bug report against llvm:

https://github.com/llvm/llvm-project/issues/82598
Comment 7 mgrooms 2024-02-22 16:00:14 UTC
Thanks for the help with this Roger. It's very much appreciated.

I'll see if I can get the port to build with a patch based on your diff and give it a spin. On a related note, when I booted the FreeBSD 14 dom0 using the xen-kernel pkg build with 13.2, I noticed that the interrupts were showing > %50 in top while idle. Did you notice anything like that? It 'seemed' responsive enough though, so may be just an accounting bug of some sort.
Comment 8 Roger Pau Monné freebsd_committer freebsd_triage 2024-02-22 16:26:14 UTC
Hm, it's possible the build in 13.2 is also affected by this code generation issue, albeit in a different way.  I will update the port and add the fix while we wait for it to be review upstream.
Comment 9 Roger Pau Monné freebsd_committer freebsd_triage 2024-02-22 17:32:38 UTC
I'm also seeing the weird interrupt usage in top, however `vmstat -i` doesn't show any interrupt source has having a high rate.  It will need some investigation, could you raise a separate ticket for it and assign it to me?

For what is worth, I think it's a cosmetic issue, as performance seems to be OK (at least on my end).
Comment 10 Roger Pau Monné freebsd_committer freebsd_triage 2024-02-22 17:49:11 UTC
I've now updated both the xen-kernel and xen-tools package to 4.18.0.20240201 and included the code generation fix in xen-kernel.  I think we will also need it for the pvshim (which is part of xen-tools), but I will backport that one once it's accepted upstream, as it's not so critical.
Comment 11 mgrooms 2024-03-09 02:27:23 UTC
Hey Roger. I can confirm that FreeBSD 14 boots after upgrading to the following ...

xen-kernel: 4.18.0.20231212 -> 4.18.0.20240201
xen-tools: 4.18.0.20231212 -> 4.18.0.20240201_1

Thanks again for your help with this!