]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86/mm: purge unneeded destroy_perdomain_mapping()
authorRoger Pau Monne <roger.pau@citrix.com>
Tue, 26 Nov 2024 14:36:07 +0000 (15:36 +0100)
committerRoger Pau Monne <roger.pau@citrix.com>
Wed, 4 Dec 2024 14:48:57 +0000 (15:48 +0100)
The destroy_perdomain_mapping() call in the hvm_domain_initialise() fail path
is useless.  destroy_perdomain_mapping() called with nr == 0 is effectively a
no op, as there are not entries torn down.  Remove the call, as
arch_domain_create() already calls free_perdomain_mappings() on failure.

There's also a call to destroy_perdomain_mapping() in pv_domain_destroy() which
is also not needed.  arch_domain_destroy() will already unconditionally call
free_perdomain_mappings(), which does the same as destroy_perdomain_mapping(),
plus additionally frees the page table structures.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/pv/domain.c

index 74e58c653e6f697e7e563fd076bbbafaf257137d..bd9e06789aea8417dfb3f0762396072975275a25 100644 (file)
@@ -708,7 +708,6 @@ int hvm_domain_initialise(struct domain *d,
     XFREE(d->arch.hvm.irq);
  fail0:
     hvm_destroy_cacheattr_region_list(d);
-    destroy_perdomain_mapping(d, PERDOMAIN_VIRT_START, 0);
  fail:
     hvm_domain_relinquish_resources(d);
     XFREE(d->arch.hvm.io_handler);
index 7aef628f55be46a60e501182b68384336f530377..bc7cd0c62f0e4b8131835345368425e3cda51b95 100644 (file)
@@ -345,9 +345,6 @@ void pv_domain_destroy(struct domain *d)
 {
     pv_l1tf_domain_destroy(d);
 
-    destroy_perdomain_mapping(d, GDT_LDT_VIRT_START,
-                              GDT_LDT_MBYTES << (20 - PAGE_SHIFT));
-
     XFREE(d->arch.pv.cpuidmasks);
 
     FREE_XENHEAP_PAGE(d->arch.pv.gdt_ldt_l1tab);