Skip to contentSkip to conversation

VMX: don't ignore P2M setup error

PATCH In review Jan Beulich 3 participants 3 messages Feb 6, 2019 – Feb 12, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 VMX: don't ignore P2M setup error

set_mmio_p2m_entry() may fail, in particular with -ENOMEM. Don't ignore such an error, but instead cause domain creation to fail in such a case.

---
4.12: Another candidate, but again open for discussion.

xen/arch/x86/hvm/vmx/vmx.c +3 -3
@@ -2999,10 +2999,10 @@ static int vmx_alloc_vlapic_mapping(stru
     clear_domain_page(mfn);
     share_xen_page_with_guest(pg, d, SHARE_rw);
     d->arch.hvm.vmx.apic_access_mfn = mfn_x(mfn);
-    set_mmio_p2m_entry(d, paddr_to_pfn(APIC_DEFAULT_PHYS_BASE), mfn,
-                       PAGE_ORDER_4K, p2m_get_hostp2m(d)->default_access);
 
-    return 0;
+    return set_mmio_p2m_entry(d, paddr_to_pfn(APIC_DEFAULT_PHYS_BASE), mfn,
+                              PAGE_ORDER_4K,
+                              p2m_get_hostp2m(d)->default_access);
 }
 
 static void vmx_free_vlapic_mapping(struct domain *d)

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Acked-by on v1 1/1
#2 lore raw
In reply to Jan Beulich
Quoted 7 lines

From: Jan Beulich [mailto:[email protected]]
Sent: Wednesday, February 6, 2019 6:24 PM

set_mmio_p2m_entry() may fail, in particular with -ENOMEM. Don't ignore such an error, but instead cause domain creation to fail in such a case.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel