From patchwork Sun Jun 11 13:34:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: f4da1594@opayq.com X-Patchwork-Id: 9780159 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EDA0B60352 for ; Sun, 11 Jun 2017 13:36:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD12228549 for ; Sun, 11 Jun 2017 13:36:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C192A28591; Sun, 11 Jun 2017 13:36:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=2.0 tests=BAYES_00, HTML_IMAGE_ONLY_16, HTML_MESSAGE,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EEB672858F for ; Sun, 11 Jun 2017 13:36:50 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dK30W-0002Ou-K8; Sun, 11 Jun 2017 13:34:20 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dK30U-0002Om-VR for xen-devel@lists.xensource.com; Sun, 11 Jun 2017 13:34:19 +0000 Received: from [193.109.254.147] by server-11.bemta-6.messagelabs.com id B7/13-03587-AD64D395; Sun, 11 Jun 2017 13:34:18 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrHKsWRWlGSWpSXmKPExsWyI3PbTN0bbra RBh+uaVncm/Ke3YHRY3vfLvYAxijWzLyk/IoE1ozp19+wF2ybwVjRt2EFcwPjoi7GLkZODhYB PYk37VdYuxi5OIQEZjNJLNtxnQUkwSYgIXGuv48JxBYRUJRYt/odUJyDg1fAU2LbHQeQMK+Ao MTJmU/AyiUExCU+N3xnhbDLJLbvfMAGYVdI7L38AqyGWSBF4uv+HrCRjAIyEqcm3QCrERbQlf jXdBbqHm2JSb2/2CF6pSWmL3rKDrJWQiBM4vBTVQizTmLzP02ICmWJY2t2M8HYVz82MU1gFJq F5LhZSBZD2B4SB5oXsEHYPhIbfr1kh7A1JVq3/4ayNSQW3NnHOAtoG4h9YGE8hGkisb3fCqJC UWJK90OoajGJI5cvs0LYqhKzdjWwQZTLSPQslYUIa0ssW/iaeQEj7ypGjeLUorLUIl1Dc72ko sz0jJLcxMwcXUMDM73c1OLixPTUnMSkYr3k/NxNjMC4ZQCCHYy3NwYcYpTkYFIS5d1yxSZSiC 8pP6UyI7E4I76oNCe1+BCjDAeHkgSvrrNtpJBgUWp6akVaZg4wgcCkJTh4lER4JzoBpXmLCxJ zizPTIVKnGHU5Nqxe/4VJiCUvPy9VSpz3JUiRAEhRRmke3AhYMrvEKCslzMsIdJQQT0FqUW5m Car8K0ZxDkYlYd5Ce6ApPJl5JXCbXgEdwQR0xHWQ+3mLSxIRUlINjB7vT0aGGr77YCRrpdwt3 lmbsll79h/77ZqPX2+LEC/e+mef75eLfXKSkk8D1b0Xmh/l3nJwK49Prv3cLw3WKua/H5V+t6 hlvmoze33EvQA9dy+BZTueZZRVOKz9YqB680Puw3SVthV9P9MuiSVVdC7b2XNxcdBfAa4VL2Z 1Xfz7vF/t/LyZU5VYijMSDbWYi4oTAWa+gOJhAwAA X-Env-Sender: f4da1594@opayq.com X-Msg-Ref: server-11.tower-27.messagelabs.com!1497188054!76541733!1 X-Originating-IP: [184.105.182.153] X-SpamReason: No, hits=1.2 required=7.0 tests=BODY_RANDOM_LONG, HTML_IMAGE_ONLY_16,HTML_MESSAGE,ML_IS_POSSIBLE_BOUNCE X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 39153 invoked from network); 11 Jun 2017 13:34:16 -0000 Received: from opayq-out-03.junkemailfilter.com (HELO opayq-out-03.junkemailfilter.com) (184.105.182.153) by server-11.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 11 Jun 2017 13:34:16 -0000 Received: from smtp5.opayq.com ([107.22.209.6]:16548) helo=[107.22.209.6] by opayq-outbound.junkemailfilter.com with esmtps (TLSv1.2:AES256-SHA256:256) (Exim 4.89) id 1dK30Q-0005EK-FN on interface=184.105.182.150 for xen-devel@lists.xensource.com; Sun, 11 Jun 2017 06:34:14 -0700 From: f4da1594@opayq.com To: xen-devel@lists.xensource.com Message-ID: <527261183.22381.1497188051637.JavaMail.root@smtp5.opayq.com> MIME-Version: 1.0 X-GetAbine-Processed: 1 X-Gm-Message-State: AODbwcCfMElm1KMDpFP8hZqc6V1ho+tKpR26IQM27vSOauHxoy3AoxVc U0rdLFK3SHP1l7VYu6LKIXOQrLmVXTUiWWyh2oUh X-Received: by 10.84.254.73 with SMTP id a9mr27082034pln.64.1497188050559; Sun, 11 Jun 2017 06:34:10 -0700 (PDT) Auto-Submitted: auto-replied Date: Sun, 11 Jun 2017 06:34:10 -0700 (PDT) X-Sender-Domain: google.com X-Spamfilter-host: opayq-outbound.junkemailfilter.com - http://www.junkemailfilter.com X-Key-ID: eGVuLWRldmVsQGxpc3RzLnhlbnNvdXJjZS5jb20gZjRkYTE1OTRAb3BheXEuY29tIDIwMTctMDYtMTEgMDY6MzQ6MTQgMWRLMzBRLTAwMDVFSy1GTg== X-Sender-Host-Address: 107.22.209.6 X-Sender-Host-Name: smtp5.opayq.com Subject: [Xen-devel] Delivery Status Notification (Delay) X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP ** Delivery incomplete ** There was a temporary problem delivering your message to curtiskwong9@gmail.com. Gmail will retry for 23 more hours. You'll be notified if the delivery fails permanently. jSh 7FWTG4c2mqDrC7LJkprTawIDpp4S5mPl3iJ3ZbdyuvacYRCkq/q8BCdyf/xf5GCalP= It aajJGr+Glm1aTmv30y94LhPYjniQqqHzaxINOoSTdzGacxkdEi15XNq4rZlPIPddJk= go MTfRlEFZSSebidKMMsY0GptTeKEgxgfl38GmSimn4RB8j/gQjcewVu9j+iYLDQ52oU= qX fdD4YBA+8ZiCdf43AAbnFpa7MY9tx9hB+/bufr/BmzMakJhcciZCYcmCByjSBK+DvR= Fx 8VzA=3D=3D ARC-Message-Signature: i=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; d=3Dgoog= le.com; s=3Darc-20160816; h=3Dlist-subscribe:list-help:list-post:list-unsubscribe :list-unsubscribe:list-id:precedence:subject:date:message-id:to :reply-to:sender:from:content-transfer-encoding:mime-version :dkim-signature:delivery-date:arc-authentication-results; bh=3DngeKm5DSjLW4bGugGzkH0bapiUj+jI7celGaaKe0rhw=3D; b=3Dq90++tf0WDgClwPo/LsaaAKNBku7aPgwCZXf2inaIWI+oWUoEYdt7e+y8Y9blaL= LZ8 jZAJ5gmjgO9teLquuDD91iVvHM5m2UEJ8jrWrMRuR++jFiIyolotT9EHkm2hPbuHfz= W1 YQnJELRO4h4A2DTL3G6YRIwqY09VIlYWa7bZkbt4BjcYfo/p0zO5MV2dK2T4t0b1JH= ED EbkfAuScRkuqqFo4LrRGgDhtpDhHUDHA8IUOCznkcwd5RLzsdiRMfwofa6DLeZ1LYV= 51 x7scGzQ+zWKcZGsvtEaFTrf3JkSfmkxBFb4Q95hle/bnlqxKdQRnCqMgX8W87uLiIA= nW JeEw=3D=3D ARC-Authentication-Results: i=3D1; mx.google.com; dkim=3Dpass header.i=3D@opayq.com; spf=3Dpass (google.com: domain of fwd-737qhysmhvayqaucaoiqbdaagaqlma= 2yamheccjdlibayawyakiazaqhsmccwmblia4uanqueigcimbkmazuz4aaeaaca=3D=3D=3D@op= ayq.com designates 184.105.182.158 as permitted sender) smtp.mailfrom=3DFWD= -737QHYSMHVAYQAUCAOIQBDAAGAQLMA2YAMHECCJDLIBAYAWYAKIAZAQHSMCCWMBLIA4UANQUEI= GCIMBKMAZUZ4AAEAACA=3D=3D=3D@opayq.com; dmarc=3Dpass (p=3DNONE sp=3DNONE dis=3DNONE) header.from=3Dopayq.com Return-Path: Received: from opayq-out-08.junkemailfilter.com ([184.105.182.158]) by mx.google.com with ESMTPS id v13si892745plk.122.2017.06.09.05.55= .59 for (version=3DTLS1_2 cipher=3DECDHE-RSA-AES128-GCM-SHA256 bits=3D128/1= 28); Fri, 09 Jun 2017 05:55:59 -0700 (PDT) Received-SPF: pass (google.com: domain of fwd-737qhysmhvayqaucaoiqbdaagaqlm= a2yamheccjdlibayawyakiazaqhsmccwmblia4uanqueigcimbkmazuz4aaeaaca=3D=3D=3D@o= payq.com designates 184.105.182.158 as permitted sender) client-ip=3D184.10= 5.182.158; Authentication-Results: mx.google.com; dkim=3Dpass header.i=3D@opayq.com; spf=3Dpass (google.com: domain of fwd-737qhysmhvayqaucaoiqbdaagaqlma= 2yamheccjdlibayawyakiazaqhsmccwmblia4uanqueigcimbkmazuz4aaeaaca=3D=3D=3D@op= ayq.com designates 184.105.182.158 as permitted sender) smtp.mailfrom=3DFWD= -737QHYSMHVAYQAUCAOIQBDAAGAQLMA2YAMHECCJDLIBAYAWYAKIAZAQHSMCCWMBLIA4UANQUEI= GCIMBKMAZUZ4AAEAACA=3D=3D=3D@opayq.com; dmarc=3Dpass (p=3DNONE sp=3DNONE dis=3DNONE) header.from=3Dopayq.com Delivery-date: Fri, 09 Jun 2017 05:55:59 -0700 Received: from smtp5.opayq.com ([107.22.209.6]:50008) helo=3D[107.22.209.6] by opayq-outbound.junkemailfilter.com with esmtps (TLSv1.2:AES256-SHA256:2= 56) (Exim 4.89) id 1dJJSJ-0007sl-8i on interface=3D184.105.182.150 for curtiskwong9@gmail.com; Fri, 09 Jun 2017 05:55:59 -0700 DKIM-Signature: v=3D1; d=3Dopayq.com; t=3D1497012958; b=3DLD4g7jWRsvVQbIvVU= /ZukiFX8nQG7DZBN+YP70ymkGyKEaeb8BLd13XY9muEMLRZ7rKYE605giggwM8Lq++6YoVw7o+d= EL0XHUyr3BCVvr4jkEhl6DRe0rh7gnW6OxgmGHW6xa/WA2Y4yCm6YkH9tmVkkZ1NxoSm+bewIQV= YqOs=3D; s=3Dabine; c=3Drelaxed/relaxed; a=3Drsa-sha256; bh=3DngeKm5DSjLW4b= GugGzkH0bapiUj+jI7celGaaKe0rhw=3D; h=3DDate:From:Reply-To:Subject:To:List-U= nsubscribe; MIME-Version: 1.0 Content-Type: text/plain; charset=3D"utf-8" Content-Transfer-Encoding: 7bit X-GetAbine-Processed: 1 From: "lists.xen.org [Masked]" Sender: "lists.xen.org [Masked]" Reply-To:=20 FWD-737QHYSMHVAYQAUCAOIQBDAAGAQLMA2YAMHECCJDLIBAYAWYAKIAZAQHSMCCWMBLIA4UAN= QUEIGCIMBKMAZUZ4AAEAACA=3D=3D=3D@opayq.com To: f4da1594@opayq.com X-GetAbine-Sender: xen-changelog-bounces@lists.xen.org X-GetAbine-Disposable: f4da1594@opayq.com X-GetAbine-Host-Address: 107.22.209.6 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrILMWRWlGSWpSXmKPExsWS0XRdVXf3LKt Ig4sXpSwmbDNwYPTY3reLPYAxijUzLym/IoE1Y9n/j8wFSzUrrk1dz97A+EW+i5GLQ0jgC6PE /c8LWSGc84wST09PYOti5OBgExCTmLtXoYuRk0NEQFVi1orlzCC2kIC6RNPvBjYQW1ggTeLus blgNq+AmcThG0dYQGwWoPrjNz6xTmDkWMDIsIpRozi1qCy1SNfIXC+pKDM9oyQ3MTNH19DATC 83tbg4MT01JzGpWC85P3cTI9ArDECwg3Hx2sBDjJIcTEqivNMKrCKF+JLyUyozEosz4otKc1K LDzHKcHAoSfCKzgTKCRalpqdWpGXmAMMDJi3BwaMkwnu/HSjNW1yQmFucmQ6ROsWoKCXO2wzS JwCSyCjNg2uDheQlRlkpYV5GoEOEeApSi3IzS1DlXzGKczAqCfP6gEzhycwrgZv+CmgxE9DiJ e8sQBaXJCKkpBoY53S8LX9R439u7t8SfZ19Xbwvz73k/zHz/51YtrP3CzNaswzs69sa163tUP irFmt8dTrry31XYl+tC/Qw63DiEr1xTD/UOXBy1z3L11c36koI7gmsl2URaj6duGi7/Dz/7LX Kqxd//nr0wItGxSWrmybODv55deOSa1zBM6YXuHz7basez1tTrMRSnJFoqMVcVJwIADFS9+1E AgAA X-Env-Sender: ian.jackson@eu.citrix.com X-Msg-Ref: server-3.tower-27.messagelabs.com!1497012922!106612077!1 X-Originating-IP: [104.130.215.37] X-SpamReason: No, hits=3D0.5 required=3D7.0 tests=3DBODY_RANDOM_LONG X-StarScan-Received:=20 X-StarScan-Version: 9.4.19; banners=3D-,-,- X-VirusChecked: Checked Message-Id: Date: Fri, 09 Jun 2017 12:55:22 +0000 Subject: [Xen-changelog] [xen master] Avoid excess icache flushes in populate_physmap() before domain has been created X-BeenThere: xen-changelog@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Change log for Mercurial \(receive only\)" List-Unsubscribe: ,=20 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: ,=20 X-Sender-Domain: xenproject.org X-Spamfilter-host: plato.junkemailfilter.com - http://www.junkemailfilter.c= om X-Key-ID: ZjRkYTE1OTRAb3BheXEuY29tIHhlbi1jaGFuZ2Vsb2ctYm91bmNlc0BsaXN0cy54Z= W4ub3JnIDIwMTctMDYtMDkgMDU6NTU6MjcgMWRKSlJuLTAwMDhQeS05Ng=3D=3D X-Mail-from: xen-changelog-bounces@lists.xen.org X-Sender-Host-Address: 192.237.175.120 X-Sender-Host-Name: lists.xenproject.org X-Key-ID: Y3VydGlza3dvbmc5QGdtYWlsLmNvbSBmd2QtNzM3cWh5c21odmF5cWF1Y2FvaXFiZ= GFhZ2FxbG1hMnlhbWhlY2NqZGxpYmF5YXd5YWtpYXphcWhzbWNjd21ibGlhNHVhbnF1ZWlnY2lt= YmttYXp1ejRhYWVhYWNhPT09QG9wYXlxLmNvbSAyMDE3LTA2LTA5IDA1OjU1OjU5IDFkSkpTSi0= wMDA3c2wtOGk=3D -------------------------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/f4da1594@opayq.com/FWD-737QHYSMHVAYQAUC= AOIQBDAAGAQLMA2YAMHECCJDLIBAYAWYAKIAZAQHSMCCWMBLIA4UANQUEIGCIMBKMAZUZ4AAEAA= CA=3D=3D=3D@opayq.com Want to shop safely and privately online? Go Premium: https://dnt.abine.com= /?pk_campaign=3DmaskHeader#premium -------------------------by Abine------------------------- commit 726b737574a3c075be95440e572b317a39293a9e Author: Punit Agrawal AuthorDate: Fri May 26 12:14:07 2017 +0100 Commit: Stefano Stabellini CommitDate: Tue Jun 6 11:49:39 2017 -0700 Avoid excess icache flushes in populate_physmap() before domain has bee= n created =20 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 deffere= d until all the extents have been allocated as there is no risk of executing stale instructions from the icache. =20 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. =20 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. =20 Signed-off-by: Punit Agrawal Reviewed-by: Stefano Stabellini --- 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(-) for ( i =3D a->nr_done; i < a->nr_extents; i++ ) { @@ -211,7 +221,6 @@ static void populate_physmap(struct memop_args *a) } =20 mfn =3D gpfn; - page =3D mfn_to_page(mfn); } else { @@ -255,6 +264,10 @@ static void populate_physmap(struct memop_args *a) out: if ( need_tlb ----- Message truncated ----- diff --git a/xen/common/memory.c b/xen/common/memory.c index 52879e7..34d2dda 100644 --- a/xen/common/memory.c +++ b/xen/common/memory.c @@ -152,16 +152,26 @@ static void populate_physmap(struct memop_args *a) max_order(curr_d)) ) return; =20 - /* - * 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 ca= n + * make pages accessible to guest B, when guest A may still have a + * cached mapping to them). So we do this only during domain creat= ion, + * when the domain itself has not yet been unpaused for the first + * time. + */ a->memflags |=3D 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 |=3D MEMF_no_icache_flush; + } =20