Delivery Status Notification (Delay)
** Delivery incomplete **
There was a temporary problem delivering your message to [email protected]. Gmail will retry for 47 more hours. You'll be notified if the delivery fails permanently.
-------------------------Blur-------------------------
This email is forwarded from a MASKED EMAIL you created using Blur. (https://dnt.abine.com/#help/faq/faq-whataremaskedemails).
IF THIS IS SPAM, CLICK HERE TO BLOCK:
https://dnt.abine.com/#/block_email/[email protected]/FWD-737QHYSMHVAYQAUCAOIQBDAAGAQLMA2YAMHECCJDLIBAYAWYAKIAZAQHSMCCWMBLIA4UANQUEIGCIMBKMAZUZ4AAEAACA===@opayq.com
Want to shop safely and privately online? Go Premium: https://dnt.abine.com/?pk_campaign=maskHeader#premium
-------------------------by Abine-------------------------
commit 726b737574a3c075be95440e572b317a39293a9e
Author: Punit Agrawal <[email protected]> AuthorDate: Fri May 26 12:14:07 2017 +0100 Commit: Stefano Stabellini <[email protected]> CommitDate: Tue Jun 6 11:49:39 2017 -0700
Avoid excess icache flushes in populate_physmap() before domain has been created
populate_physmap() calls alloc_heap_pages() per requested extent. alloc_heap_pages() invalidates the entire icache per extent. During domain creation, the icache invalidations can be deffered until all the extents have been allocated as there is no risk of executing stale instructions from the icache.
Introduce a new flag "MEMF_no_icache_flush" to be used to prevent alloc_heap_pages() from performing icache maintenance operations. Use the flag in populate_physmap() before the domain has been unpaused and perform required icache maintenance function at the end of the allocation.
One concern is the lack of synchronisation around testing for "creation_finished". But it seems, in practice the window where it is out of sync should be small enough to not matter.
--- xen/common/memory.c | 31 ++++++++++++++++++++++--------- xen/common/page_alloc.c | 2 +- xen/include/asm-x86/page.h | 8 ++++++++ xen/include/xen/mm.h | 2 ++ 4 files changed, 33 insertions(+), 10 deletions(-)
xen/common/memory.c +18 -10
@@ -152,16 +152,26 @@ static void populate_physmap(struct memop_args *a) max_order(curr_d)) )return ; -/* -* With MEMF_no_tlbflush set, alloc_heap_pages() will ignore -* TLB-flushes. After VM creation, this is a security issue (it can -* make pages accessible to guest B, when guest A may still have a -* cached mapping to them). So we do this only during domain creation, -* when the domain itself has not yet been unpaused for the first -* time. -*/ if (unlikely (!d->creation_finished) ) + { +/* +* With MEMF_no_tlbflush set, alloc_heap_pages() will ignore +* TLB-flushes. After VM creation, this is a security issue (it can +* make pages accessible to guest B, when guest A may still have a +* cached mapping to them). So we do this only during domain creation, +* when the domain itself has not yet been unpaused for the first +* time. +*/ a->memflags |= MEMF_no_tlbflush; +/* +* With MEMF_no_icache_flush, alloc_heap_pages() will skip +* performing icache flushes. We do it only before domain +* creation as once the domain is running there is a danger of +* executing instructions from stale caches if icache flush is +* delayed. +*/ + a->memflags |= MEMF_no_icache_flush; + }for ( i = a->nr_done; i < a->nr_extents; i++ ) {
@@ -211,7 +221,6 @@ static void populate_physmap(struct memop_args *a) } mfn = gpfn; - page =mfn_to_page (mfn); }else {
@@ -255,6 +264,10 @@ static void populate_physmap(struct memop_args *a) out: if ( need_tlb ----- Message truncated -----
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel