diff --git a/arch/x86/xen/hyperv.c b/arch/x86/xen/hyperv.c index a0d9f82ebdcd25..0c1f104d0c3291 100644 --- a/arch/x86/xen/hyperv.c +++ b/arch/x86/xen/hyperv.c @@ -424,6 +424,7 @@ struct irq_domain *hyperv_xen_vpci_root_domain(void) pr_err("Xen: can't bind the Hyper-V vPCI VIRQ: %d\n", ret); irq_domain_remove(xen_hv_vpci_domain); xen_hv_vpci_domain = NULL; + irq_domain_free_fwnode(fn); return NULL; } diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c index 2b4080e51f97c3..8bd7c280499e12 100644 --- a/drivers/hv/hv_balloon.c +++ b/drivers/hv/hv_balloon.c @@ -1940,6 +1940,22 @@ static int balloon_probe(struct hv_device *dev, { int ret; + /* + * A Xen PV dom0 nested under Hyper-V does not own the machine memory + * it runs on; Xen does. Every page range this driver would hand the + * L0 host (balloon, free-page report, hot-add) is a dom0 + * pseudo-physical range, which L0 reads as a range of Xen machine + * frames: a balloon request would have the host reclaim Xen's own or + * another domain's memory, and a hot-add would add a range dom0's + * physmap does not back. Dynamic memory for the L1 VM is Xen's to + * manage, so leave the device unbound. + */ + if (hyperv_nested_on_xen) { + dev_info(&dev->device, + "dynamic memory is not supported on a Xen PV dom0 nested under Hyper-V\n"); + return -ENODEV; + } + allow_hibernation = hv_is_hibernation_supported(); if (allow_hibernation) hot_add = false;