Skip to content

Backport #102 to 6.18-lts: Drivers: hv: balloon: refuse to bind on a Xen PV dom0 nested under Hyper-V - #106

Merged
kaniini merged 2 commits into
edera/6.18-ltsfrom
backport/edera-6.18-lts/pr-102
Nov 14, 2026
Merged

kaniini merged 2 commits into
edera/6.18-ltsfrom
backport/edera-6.18-lts/pr-102

Conversation

@edera-rebase-app

Copy link
Copy Markdown

Backport of #102 from edera/mainline to edera/6.18-lts (492d0ef30003), prepared by Claude. Run log.

Merge with Rebase and merge, so edera/6.18-lts stays linear.

Independent checks

Builds: success (x86_64 and arm64 vmlinux with the Edera features built in).

LTS tip before 492d0ef30003
LTS tip after 5a9e2ae8cafb
Commits requested 2
  • New branch fast-forwards the LTS tip.
  • Backported commits are linear.
  • All 2 requested commits backported in order, each with its source's subject and identical +/- lines.

Claude's report

Summary

Two commits were requested from #102 and both are backported unchanged, in order, with cherry-pick -x. Both applied cleanly to 492d0ef30003. hyperv_nested_on_xen already exists on 6.18-lts: it is declared in arch/x86/include/asm/mshyperv.h and include/asm-generic/mshyperv.h, and is a build-time false without CONFIG_XEN_PV. The fn local and the error path in hyperv_xen_vpci_root_domain() are the same as on mainline, so no adaptation was needed. verify-backport.sh passes: the branch fast-forwards, is linear, and has both commits in order with matching subjects and identical +/- lines.

The REQUEST file and the PENDING file list different SHAs for these two commits: 98e86378/7ef9c692 in REQUEST, 109e385a/a779e3fe in PENDING. git range-diff shows the patches are identical. The two pairs differ only in committer date, which looks like the PR branch versus the rebased copy. The (cherry picked from commit …) trailers name the REQUEST SHAs.

Needs a decision

None.

Adapted commits

None.

Left out

None.

Builds

BUILD_RESULTS

…per-V

The Hyper-V-on-Xen series translates GPADLs, SynIC pages, hypercall
arguments and netvsc buffers to the machine (L1-physical) frames the L0
host expects, but hv_balloon was never taught about nested mode.  It
hands L0 page_to_pfn() ranges straight from dom0's pseudo-physical
address space, in balloon responses, free-page reports and hot-add
requests, and L0 reads each of those numbers as a Xen machine frame.

On a PV dom0 nested on Hyper-V the device autoloads from the VMBus
offer, Xen proxies POST_MESSAGE and SIGNAL_EVENT, and the dynamic memory
protocol runs end to end.  A DM_BALLOON_REQUEST from the host then has
L0 reclaim whichever machine frames dom0's PFNs happen to name: Xen's
own memory, another domain's, or unrelated dom0 memory, with no error
anywhere.  A hot-add does the reverse and calls add_memory() on a host
range that dom0's physmap does not back, so dom0 oopses on first touch.

Translating the ranges would not make this correct either.  A PV dom0
does not own the machine memory it runs on, Xen does, and the memory an
L1 VM returns to or takes from L0 has to be accounted for in Xen's heap,
not handed over behind its back by one of its domains.  Dynamic memory
for the L1 VM is a job for Xen itself.

Refuse the probe when nested on Xen, so the offer stays unbound and dom0
does not speak the protocol at all.  Nothing changes when not nested:
hyperv_nested_on_xen is a build-time false without CONFIG_XEN_PV.

Signed-off-by: Ariadne Conill <[email protected]>
(cherry picked from commit 98e8637)
…t be bound

hyperv_xen_vpci_root_domain() frees the named fwnode when creating the
irq domain fails, but not when cpuhp_setup_state() fails afterwards:
irq_domain_remove() does not free the fwnode its domain was created
with, so that path leaked it.  Free it there too.

Signed-off-by: Ariadne Conill <[email protected]>
(cherry picked from commit 7ef9c69)
@kaniini
kaniini merged commit c20f0c9 into edera/6.18-lts Nov 14, 2026
2 checks passed
@github-actions
github-actions Bot deleted the backport/edera-6.18-lts/pr-102 branch November 14, 2026 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant