From patchwork Mon Oct 2 12:59:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 9980821 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 DFE5E60365 for ; Mon, 2 Oct 2017 13:02:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D18D8201F3 for ; Mon, 2 Oct 2017 13:02:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C6898289BC; Mon, 2 Oct 2017 13:02:26 +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=-4.2 required=2.0 tests=BAYES_00, 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 38AE4201F3 for ; Mon, 2 Oct 2017 13:02:26 +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 1dz0KG-0003dV-2e; Mon, 02 Oct 2017 13:00:00 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dz0KE-0003cS-9Q for xen-devel@lists.xen.org; Mon, 02 Oct 2017 12:59:58 +0000 Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id B7/C8-25121-D4832D95; Mon, 02 Oct 2017 12:59:57 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrELMWRWlGSWpSXmKPExsVysyfVTdfD4lK kQfNpXYslHxezODB6HN39mymAMYo1My8pvyKBNeP/f5OCFxYV/zZ/Z2lgfKzZxcjFISSwmVHi 1KKDjBDOaUaJRYf2s3UxcnKwCWhK3Pn8iQnEFhGQlrj2+TJYEbPAYkaJz/t7mUESwgLuEi9Ob 2cHsVkEVCV2ndwGFucVsJRo3v6VBcSWEJCX2NV2kRXE5hSwknh//COYLQRUc7x7EtMERu4FjA yrGNWLU4vKUot0zfSSijLTM0pyEzNzdA0NjPVyU4uLE9NTcxKTivWS83M3MQL9W8/AwLiD8Uq b8yFGSQ4mJVFeZsNLkUJ8SfkplRmJxRnxRaU5qcWHGGU4OJQkeDXMgXKCRanpqRVpmTnAQINJ S3DwKInwmoKkeYsLEnOLM9MhUqcYdTk6bt79wyTEkpeflyolzvvfDKhIAKQoozQPbgQs6C8xy koJ8zIyMDAI8RSkFuVmlqDKv2IU52BUEublAlnFk5lXArfpFdARTEBHzOm6AHJESSJCSqqB8a ZU0zS13ZmXloa5nTZ3+G9UdlyAvWPGjNY7t/+UB7MZvPx1RmVRms2lCQ9ubtqSK7bxi/7GubX Tnb3UAtqs/H9u2Xn083zHCessLOsVUyJlukWtxP6c28R8Zsnlaq2Tz+vONrkuu39H9T1vWZNl CE/i1rk2RvckN/3qXb/XQaD7l43yJIW+LiWW4oxEQy3mouJEACy8hL51AgAA X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-2.tower-31.messagelabs.com!1506949192!105812660!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 23311 invoked from network); 2 Oct 2017 12:59:52 -0000 Received: from usa-sjc-mx-foss1.foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-2.tower-31.messagelabs.com with SMTP; 2 Oct 2017 12:59:52 -0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CA8FE15A2; Mon, 2 Oct 2017 05:59:51 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BB9D63F53D; Mon, 2 Oct 2017 05:59:50 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Mon, 2 Oct 2017 13:59:28 +0100 Message-Id: <20171002125941.11274-3-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171002125941.11274-1-julien.grall@arm.com> References: <20171002125941.11274-1-julien.grall@arm.com> Cc: George Dunlap , Andrew Cooper , Julien Grall , Jan Beulich Subject: [Xen-devel] [PATCH v3 02/15] xen/x86: p2m-pod: Remove trailing whitespaces 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: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Julien Grall Acked-by: Andrew Cooper Reviewed-by: George Dunlap Reviewed-by: Wei Liu --- Cc: George Dunlap Cc: Jan Beulich Cc: Andrew Cooper Changes in v3: - Add George's and Wei's reviewed-by Changes in v2: - Add Andrew's acked-by --- xen/arch/x86/mm/p2m-pod.c | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c index fec87e5224..1f07441259 100644 --- a/xen/arch/x86/mm/p2m-pod.c +++ b/xen/arch/x86/mm/p2m-pod.c @@ -1,7 +1,7 @@ /****************************************************************************** * arch/x86/mm/p2m-pod.c * - * Populate-on-demand p2m entries. + * Populate-on-demand p2m entries. * * Copyright (c) 2009-2011 Citrix Systems, Inc. * @@ -76,7 +76,7 @@ p2m_pod_cache_add(struct p2m_domain *p2m, __func__, mfn_x(mfn), order, ((1UL << order) - 1)); return -1; } - + for(i=0; i < 1 << order ; i++) { struct domain * od; @@ -223,8 +223,8 @@ p2m_pod_set_cache_target(struct p2m_domain *p2m, unsigned long pod_target, int p /* If we can't allocate a superpage, try singleton pages */ order = PAGE_ORDER_4K; goto retry; - } - + } + printk("%s: Unable to allocate page for PoD cache (target=%lu cache=%ld)\n", __func__, pod_target, p2m->pod.count); ret = -ENOMEM; @@ -272,7 +272,7 @@ p2m_pod_set_cache_target(struct p2m_domain *p2m, unsigned long pod_target, int p if ( test_and_clear_bit(_PGT_pinned, &(page+i)->u.inuse.type_info) ) put_page_and_type(page+i); - + if ( test_and_clear_bit(_PGC_allocated, &(page+i)->count_info) ) put_page(page+i); @@ -296,7 +296,7 @@ out: * definitions: * + M: static_max * + B: number of pages the balloon driver has ballooned down to. - * + P: Number of populated pages. + * + P: Number of populated pages. * + T: Old target * + T': New target * @@ -311,10 +311,10 @@ out: * the remainder of the ram to the guest OS. * T default_access); - + out: gfn_unlock(p2m, gfn, SUPERPAGE_ORDER); return ret; @@ -836,8 +836,8 @@ p2m_pod_zero_check(struct p2m_domain *p2m, unsigned long *gfns, int count) /* If this is ram, and not a pagetable or from the xen heap, and probably not mapped elsewhere, map it; otherwise, skip. */ if ( p2m_is_ram(types[i]) - && ( (mfn_to_page(mfns[i])->count_info & PGC_allocated) != 0 ) - && ( (mfn_to_page(mfns[i])->count_info & (PGC_page_table|PGC_xen_heap)) == 0 ) + && ( (mfn_to_page(mfns[i])->count_info & PGC_allocated) != 0 ) + && ( (mfn_to_page(mfns[i])->count_info & (PGC_page_table|PGC_xen_heap)) == 0 ) && ( (mfn_to_page(mfns[i])->count_info & PGC_count_mask) <= max_ref ) ) map[i] = map_domain_page(mfns[i]); else @@ -915,7 +915,7 @@ p2m_pod_zero_check(struct p2m_domain *p2m, unsigned long *gfns, int count) t.mfn = mfn_x(mfns[i]); t.d = d->domain_id; t.order = 0; - + __trace_var(TRC_MEM_POD_ZERO_RECLAIM, 0, sizeof(t), &t); } @@ -924,7 +924,7 @@ p2m_pod_zero_check(struct p2m_domain *p2m, unsigned long *gfns, int count) p2m->pod.entry_count++; } } - + } #define POD_SWEEP_LIMIT 1024 @@ -1046,12 +1046,12 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn, pod_lock(p2m); /* This check is done with the pod lock held. This will make sure that - * even if d->is_dying changes under our feet, p2m_pod_empty_cache() + * even if d->is_dying changes under our feet, p2m_pod_empty_cache() * won't start until we're done. */ if ( unlikely(d->is_dying) ) goto out_fail; - + /* Because PoD does not have cache list for 1GB pages, it has to remap * 1GB region to 2MB chunks for a retry. */ if ( order == PAGE_ORDER_1G ) @@ -1107,7 +1107,7 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn, set_gpfn_from_mfn(mfn_x(mfn) + i, gfn_aligned + i); paging_mark_dirty(d, mfn_add(mfn, i)); } - + p2m->pod.entry_count -= (1 << order); BUG_ON(p2m->pod.entry_count < 0); @@ -1124,7 +1124,7 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn, t.mfn = mfn_x(mfn); t.d = d->domain_id; t.order = order; - + __trace_var(TRC_MEM_POD_POPULATE, 0, sizeof(t), &t); } @@ -1161,7 +1161,7 @@ remap_and_retry: t.gfn = gfn; t.d = d->domain_id; - + __trace_var(TRC_MEM_POD_SUPERPAGE_SPLINTER, 0, sizeof(t), &t); }