From patchwork Sat Jun 10 13:16:37 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: 9779831 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 310CA60352 for ; Sat, 10 Jun 2017 13:19:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1AD9628717 for ; Sat, 10 Jun 2017 13:19:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E0CF28724; Sat, 10 Jun 2017 13:19:38 +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 5B98428717 for ; Sat, 10 Jun 2017 13:19:37 +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 1dJgG0-0000Lj-Lp; Sat, 10 Jun 2017 13:16:48 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJgFy-0000Ld-SQ for xen-devel@lists.xensource.com; Sat, 10 Jun 2017 13:16:47 +0000 Received: from [193.109.254.147] by server-9.bemta-6.messagelabs.com id E1/5F-03557-E31FB395; Sat, 10 Jun 2017 13:16:46 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrHKsWRWlGSWpSXmKPExsWyI3PbPF2bj9a RBisb5S3uTXnP7sDosb1vF3sAYxRrZl5SfkUCa8b/NadYC7bNYKxof7mVqYFxURdjFyMnB4uA nsS8/Y/Zuhi5OIQEZjNJbHvdxgqSYBOQkDjX38cEYosIKEqsW/2OpYuRg4NXwFPi7UdpkDCvg KDEyZlPWEBsCQFxic8N31kh7DKJa3Pb2CDsComDy54zg9jMAikSp+7fAqthFJCRODXpBliNsI CuxL+ms1D3aEscu9cL1SstMX3RU3aQtRICYRKHn6pChOsk7t/ZyA5hK0scW7ObCca++rGJaQK j0Cwk181CsnkW0CRmAQ+JrpdJEGEfidUfvzJD2JoSrdt/s0PYGhIL7uxjhCjXkDiwMB7CNJHY 3m8FUaEoMaX7IVS1mMSRy5dZIWxViVm7GtggymUkepbKQoS1JZYtfM28gJF3FaNGcWpRWWqRr qGBXlJRZnpGSW5iZg6QZ6aXm1pcnJiempOYVKyXnJ+7iREYtwxAsIPx3rKAQ4ySHExKorwyD6 0ihfiS8lMqMxKLM+KLSnNSiw8xynBwKEnwTn1vHSkkWJSanlqRlpkDTCAwaQkOHiUR3u0vgNK 8xQWJucWZ6RCpU4y6HBtWr//CJMSSl5+XKiXOew1khgBIUUZpHtwIWDK7xCgrJczLCHSUEE9B alFuZgmq/CtGcQ5GJWHeondAU3gy80rgNr0COoIJ6Igl7yxAjihJREhJNTCGmgcH52rW8Clyb FMVdsr2inKdtcYw/NjSn++/zeH8OIlTqe3u/zPyy9sLG99nC8+sqf71MqU5ef4HLzfjeULq5/ 6evMgQcL7Uc8sW37cHLn+2fuWtyn/mi3WCvfqf5TG+1XGr4oyqqsPeyb3d6L3V/Tb/z7d/f4V NlQ+Q+ZL5nXG9jF7uEn8lluKMREMt5qLiRAAqp1soYQMAAA== X-Env-Sender: f4da1594@opayq.com X-Msg-Ref: server-9.tower-27.messagelabs.com!1497100602!107127986!1 X-Originating-IP: [184.105.182.158] 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 16650 invoked from network); 10 Jun 2017 13:16:44 -0000 Received: from opayq-out-08.junkemailfilter.com (HELO opayq-out-08.junkemailfilter.com) (184.105.182.158) by server-9.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 10 Jun 2017 13:16:44 -0000 Received: from smtp5.opayq.com ([107.22.209.6]:41390) helo=[107.22.209.6] by opayq-outbound.junkemailfilter.com with esmtps (TLSv1.2:AES256-SHA256:256) (Exim 4.89) id 1dJgFu-0006Oh-9O on interface=184.105.182.150 for xen-devel@lists.xensource.com; Sat, 10 Jun 2017 06:16:42 -0700 From: f4da1594@opayq.com To: xen-devel@lists.xensource.com Message-ID: <673592228.17596.1497100598232.JavaMail.root@smtp5.opayq.com> MIME-Version: 1.0 X-GetAbine-Processed: 1 X-Gm-Message-State: AODbwcBFRR279T1rwK2UWiDeuiNatIAuqb1NlesxznQQvdJhejNtJcbo igrYhFiGeXn8HUW0LJb5KhCPMH+6vsE3+V1ohgBG X-Received: by 10.84.254.73 with SMTP id a9mr22333473pln.64.1497100597069; Sat, 10 Jun 2017 06:16:37 -0700 (PDT) Auto-Submitted: auto-replied Date: Sat, 10 Jun 2017 06:16:37 -0700 (PDT) X-Sender-Domain: google.com X-Spamfilter-host: opayq-outbound.junkemailfilter.com - http://www.junkemailfilter.com X-Key-ID: eGVuLWRldmVsQGxpc3RzLnhlbnNvdXJjZS5jb20gZjRkYTE1OTRAb3BheXEuY29tIDIwMTctMDYtMTAgMDY6MTY6NDIgMWRKZ0Z1LTAwMDZPaC05Tw== 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 47 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