From patchwork Thu Nov 23 18:31:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 119531 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp1172939edl; Thu, 23 Nov 2017 10:34:11 -0800 (PST) X-Google-Smtp-Source: AGs4zMbUbpFEfGDqTFHcmyTglrOX71Jeu6Bow4Lm3Y2j1OjkDW3oB2qaeJlP77c5fZdPYBhroGAX X-Received: by 10.36.188.195 with SMTP id n186mr12587570ite.139.1511462051718; Thu, 23 Nov 2017 10:34:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511462051; cv=none; d=google.com; s=arc-20160816; b=uMg02RKclJTbY46A3jRUgISTwrPJfYQn8fr84bmrDtL7zEuNCz56gWD1yJQVD5wZDC F28aQ9TDY+iAjFnL+M5XI4Ly6WmA1VBA6W26rL3mnZf/LtE9RvmoxEDVVodOABgbZbcY 2EDT5P4XE6vCfX06KALz9xX6/bnuxDgU7LrjWFQCbt7nQZNUmmVxenrDdzWEp1MUpZA1 /IujtH8WLO676/ILRlBp0/PjyueJrsprjWwUtv8LDwU6s0yWZxxZ9M6/SSe+63d2tp1F KtwkIsX2wdNq52aC/qwezSXJEx/ymNvoP09lBIkAW6rVXf0g7pq/V0lTqCwSJbb92EFi H8Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:dkim-signature:arc-authentication-results; bh=Y0Y5qxyE7Pk9rv/XfxbR7euY6Aluy0/P4l7B4JoVcrY=; b=a7XHVfiRIDE/w773DaPQ7IRqgRFB7mK7j8860AKG2uV5VhFOaw2B+cvzdz4gUnA3yX AmO2xg/as6eAxA9eGrYdTqLQz26j6a1hzPnsS0eG5VhchFMXmSeXmo5NU1NmJtgU79UG 4yjhmCEzj1MMI8RgGupQou2FPuSOd5HOMv2Ven0HNNsLAu0v8ZZtKJriERWf4DPzGWvH MzPTLgM7QYweetRrpdJpPXp7Lx/8yUin69XowtF+/dtPr72qS4dXjas0hn6T/0XSnReE Gb+0IoyLfhsAbtZCgaIVSvhwFMHe1/XGsI7+eH1thfBDOYtFDdy1/1WgUtVNIkH+anjO Xjhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=UVS7XbrE; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id x187si6783443itb.32.2017.11.23.10.34.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Nov 2017 10:34:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=UVS7XbrE; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHwIM-00059X-92; Thu, 23 Nov 2017 18:32:18 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHwIL-00059B-I1 for xen-devel@lists.xen.org; Thu, 23 Nov 2017 18:32:17 +0000 Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id A8/C0-27451-034171A5; Thu, 23 Nov 2017 18:32:16 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrFIsWRWlGSWpSXmKPExsVyMbThsK6BiHi UwdFVihZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8bjxtdMBWt5K562PWNpYGzk6mLk4hASmMwo cb9tCQuIwyIwj1ni+a9ONhBHQqCfVeLvvk+MXYwcQE6exK6tGhBmmsSK5eldjJxAZpXEzRNL2 UHCQgJqEmveREHM7GOSuPu5nwkkziagI7FuRi1IuYiAtMS1z5cZQWxmgXiJx1Ovs4HYwkD2tM kNYDaLgKpEb/NZMJtXwEbi9IP/zBCr5CV2tV1kBbE5BWwljh74wAyx1kbi82fFCYyCCxgZVjF qFKcWlaUW6Rob6CUVZaZnlOQmZuboGhqY6uWmFhcnpqfmJCYV6yXn525iBIZaPQMD4w7GCav8 DjFKcjApifLK/BKLEuJLyk+pzEgszogvKs1JLT7EKMPBoSTBu0JIPEpIsCg1PbUiLTMHGPQwa QkOHiUR3u0gad7igsTc4sx0iNQpRnuOC3cu/WHiOLDnFpB8NvN1AzPHtKutTcxCLHn5ealS4r ybQdoEQNoySvPghsKi9BKjrJQwLyMDA4MQT0FqUW5mCar8K0ZxDkYlYd5NIFN4MvNK4Ha/Ajq LCeisn8eFQc4qSURISTUw9hhtc76yovTarF/V4bpP9+qUPzQOMVpgYFVoK860TuOm0rHNthwX fi39tvH0P6ukr4XGCbt9IpdOz5uosoevIbnw8k6ve5OSrT0TOSY9NDXP7viyXUBBbuayhBd6I oHCfCeb57Qeyr0uVNl5VnJZ9PtTUorS51XN5dK9S/KfHJ8b/MivpyxKiaU4I9FQi7moOBEAv8 aXBc0CAAA= X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-4.tower-206.messagelabs.com!1511461936!108519832!1 X-Originating-IP: [209.85.128.195] 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 19105 invoked from network); 23 Nov 2017 18:32:16 -0000 Received: from mail-wr0-f195.google.com (HELO mail-wr0-f195.google.com) (209.85.128.195) by server-4.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 23 Nov 2017 18:32:16 -0000 Received: by mail-wr0-f195.google.com with SMTP id l22so18297808wrc.11 for ; Thu, 23 Nov 2017 10:32:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sPc/WkwHtIqcBaq/uRsdk4ZUhTlCkFbM3t5zmT4y8y0=; b=UVS7XbrEZX0ySbhLZviuAXmb6MoVNacm/jBWAXqcUEMdUPT4cX46M+qFsygEoE6JO9 ttkyb6xg2K23ndA6rg4QfQEsVmY5SAS4GxRgF9A9IH2bsaoZ/I7UIjk3oNXSBpU24udr azZuseykjykVbAECylXsUyL5vMh+3oCJdjz30= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sPc/WkwHtIqcBaq/uRsdk4ZUhTlCkFbM3t5zmT4y8y0=; b=X0V2stO4BbK75sgi4q9HE4dtGlWKSwSjuYO5CSdQm4ozZ64TUuak+523bQLwS683lr ksorfwCyp88uY1D4WrTp+4o1d2UqUQ74AJSdtf/0mEI3vxQndCFRizGBfNR1kZHnadql 30hKZIuYopAWMY5wigpsGvE1O/ot5TjKDptks5kqFBEpvT3TA8faEYuJG1tK9+/bQNim p3KEMM3yfoy5Ha4GFdY4gZCooLL+YTuqOvxfIHxH2E9AxZzazuB0pH0U7HpHm57MPKUq FDALJcLh0EX8grwQXRsSWzm/3f06gTF04XzKtOEN/6MdrXUS43ChBewh5+r3gRo290+0 xJ3g== X-Gm-Message-State: AJaThX4p8D0kSA7HZW5oXJ1CEbJrAQt6e1aKlpgZcJwsaPvR25OjTMay ZxNGvInretiEVUPSxjlD60Bv+Bfwqps= X-Received: by 10.223.182.73 with SMTP id i9mr23107650wre.113.1511461936012; Thu, 23 Nov 2017 10:32:16 -0800 (PST) Received: from e108454-lin.cambridge.arm.com ([2001:41d0:1:6c23::1]) by smtp.gmail.com with ESMTPSA id n32sm41412950wrb.62.2017.11.23.10.32.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Nov 2017 10:32:15 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Thu, 23 Nov 2017 18:31:55 +0000 Message-Id: <20171123183210.12045-2-julien.grall@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171123183210.12045-1-julien.grall@linaro.org> References: <20171123183210.12045-1-julien.grall@linaro.org> Cc: sstabellini@kernel.org, Julien Grall , andre.przywara@linaro.org Subject: [Xen-devel] [PATCH for-next 01/16] xen/arm: raw_copy_to_guest_helper: Rename flush_dcache to flags X-BeenThere: xen-devel@lists.xenproject.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.xenproject.org Sender: "Xen-devel" In a follow-up patch, it will be necessary to pass more flags to the function. Rename flush_dcache to flags and introduce a define to tell whether the cache needs to be flushed after the copy. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- xen/arch/arm/guestcopy.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c index 4ee07fcea3..2620e659b4 100644 --- a/xen/arch/arm/guestcopy.c +++ b/xen/arch/arm/guestcopy.c @@ -5,8 +5,10 @@ #include #include +#define COPY_flush_dcache (1U << 0) + static unsigned long raw_copy_to_guest_helper(void *to, const void *from, - unsigned len, int flush_dcache) + unsigned len, int flags) { /* XXX needs to handle faults */ unsigned offset = (vaddr_t)to & ~PAGE_MASK; @@ -24,7 +26,7 @@ static unsigned long raw_copy_to_guest_helper(void *to, const void *from, p = __map_domain_page(page); p += offset; memcpy(p, from, size); - if ( flush_dcache ) + if ( flags & COPY_flush_dcache ) clean_dcache_va_range(p, size); unmap_domain_page(p - offset); @@ -50,7 +52,7 @@ unsigned long raw_copy_to_guest(void *to, const void *from, unsigned len) unsigned long raw_copy_to_guest_flush_dcache(void *to, const void *from, unsigned len) { - return raw_copy_to_guest_helper(to, from, len, 1); + return raw_copy_to_guest_helper(to, from, len, COPY_flush_dcache); } unsigned long raw_clear_guest(void *to, unsigned len)