]> xenbits.xensource.com Git - xen.git/commit
move TLB-flush filtering out into populate_physmap during vm creation
authorDongli Zhang <dongli.zhang@oracle.com>
Tue, 20 Sep 2016 14:15:14 +0000 (16:15 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 20 Sep 2016 14:15:14 +0000 (16:15 +0200)
commitbbb17f6f1273857b27197b581b87c20264059a8f
tree7f43c11c5fcc6d732501cb137378d877bee072f4
parent80943aa40e30bcba24f52eff156c29d9d57a2e53
move TLB-flush filtering out into populate_physmap during vm creation

This patch implemented parts of TODO left in commit id
a902c12ee45fc9389eb8fe54eeddaf267a555c58 (More efficient TLB-flush
filtering in alloc_heap_pages()). It moved TLB-flush filtering out into
populate_physmap. Because of TLB-flush in alloc_heap_pages, it's very slow
to create a guest with memory size of more than 100GB on host with 100+
cpus.

This patch introduced a "MEMF_no_tlbflush" bit to memflags to indicate
whether TLB-flush should be done in alloc_heap_pages or its caller
populate_physmap.  Once this bit is set in memflags, alloc_heap_pages will
ignore TLB-flush. To use this bit after vm is created might lead to
security issue, that is, this would make pages accessible to the guest B,
when guest A may still have a cached mapping to them.

Therefore, this patch also introduced a "creation_finished" field to struct
domain to indicate whether this domain has ever got unpaused by hypervisor.
MEMF_no_tlbflush can be set only during vm creation phase when
creation_finished is still false before this domain gets unpaused for the
first time.

Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
xen/common/domain.c
xen/common/memory.c
xen/common/page_alloc.c
xen/include/xen/mm.h
xen/include/xen/sched.h