x86: switch to use domheap page for page tables

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Hongyan Xia authored and Jan Beulich committed 2021-04-22 14:14:41 +02:00
1 parent 16ea77931c
commit bf6cead724
1 file changed
+4 -4
+4 -4
View File
@@ -4901,10 +4901,10 @@ mfn_t alloc_xen_pagetable_new(void)
{
if ( system_state != SYS_STATE_early_boot )
{
void *ptr = alloc_xenheap_page();
const struct page_info *pg = alloc_domheap_page(NULL, 0);
BUG_ON(!hardware_domain && !ptr);
return ptr ? virt_to_mfn(ptr) : INVALID_MFN;
BUG_ON(!hardware_domain && !pg);
return pg ? page_to_mfn(pg) : INVALID_MFN;
}
return alloc_boot_pages(1, 1);
@@ -4914,7 +4914,7 @@ mfn_t alloc_xen_pagetable_new(void)
void free_xen_pagetable_new(mfn_t mfn)
{
if ( system_state != SYS_STATE_early_boot && !mfn_eq(mfn, INVALID_MFN) )
free_xenheap_page(mfn_to_virt(mfn_x(mfn)));
free_domheap_page(mfn_to_page(mfn));
}
void *alloc_mapped_pagetable(mfn_t *pmfn)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.