[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 10/16] x86/mapcache: initialise the mapcache for the idle domain
From: Hongyan Xia <hongyxia@xxxxxxxxxx> In order to use the mapcache in the idle domain, we also have to populate its page tables in the PERDOMAIN region, and we need to move mapcache_domain_init() earlier in arch_domain_create(). Note, commit 'x86: lift mapcache variable to the arch level' has initialised the mapcache for HVM domains. With this patch, PV, HVM, idle domains now all initialise the mapcache. Signed-off-by: Wei Wang <wawei@xxxxxxxxx> Signed-off-by: Hongyan Xia <hongyxia@xxxxxxxxxx> --- xen/arch/x86/domain.c | 4 ++-- xen/arch/x86/mm.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index e73f1efe85..c7e90c50e6 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -539,6 +539,8 @@ int arch_domain_create(struct domain *d, spin_lock_init(&d->arch.e820_lock); + mapcache_domain_init(d); + /* Minimal initialisation for the idle domain. */ if ( unlikely(is_idle_domain(d)) ) { @@ -634,8 +636,6 @@ int arch_domain_create(struct domain *d, psr_domain_init(d); - mapcache_domain_init(d); - if ( is_hvm_domain(d) ) { if ( (rc = hvm_domain_initialise(d)) != 0 ) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index a17ae0004a..b3530d2763 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -5828,6 +5828,9 @@ int create_perdomain_mapping(struct domain *d, unsigned long va, l3tab = __map_domain_page(pg); clear_page(l3tab); d->arch.perdomain_l3_pg = pg; + if ( is_idle_domain(d) ) + idle_pg_table[l4_table_offset(PERDOMAIN_VIRT_START)] = + l4e_from_page(pg, __PAGE_HYPERVISOR_RW); if ( !nr ) { unmap_domain_page(l3tab); -- 2.24.1.AMZN
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |