From patchwork Fri Oct 17 15:31:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 38891 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ACA102054E for ; Fri, 17 Oct 2014 15:35:50 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id hi2sf699616wib.1 for ; Fri, 17 Oct 2014 08:35:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=Ha1LnMekn1hNFUz3JmywUSoS0BsaI6luaFikYVyLV9k=; b=azNCB3icHXaZKoWvpAA8hT0IZn2sikzD/5IH7WyWJv2/UD5m/Q+qKpFuJ6k+2wsZtr YTklj6kStdCVGFaHV4NrmCUR02+Kr5zQeDEe95H7aMfNS3yemMHM+xwcCYOmuZ0+pW54 pQ8EkkHhSAYRieh9cEU9TUYGOIAVIPmNZ3bjU0B98ab/Hq0fwdwVcUWmkBkSKPEVoo2g gUgm55WK13Ez6gvFK3HvhLkZARO2saaBmEmSaoP+37YbuqGD4cG+CDQFUoAfZCH/YLi7 2t20cyfqinRtUhcEwvN/6IpRixWRAgY0rX4j4UVKNoomZIzN88jRD1/qHyo9xm0X7CWW MWlQ== X-Gm-Message-State: ALoCoQlXnQreOBpjqHDbmNyfB+fwkNgXHi4z4eZjlAxMmBm6PFppGdA0N5VGLftjlDmXIO3CGkOX X-Received: by 10.112.38.104 with SMTP id f8mr3527lbk.24.1413560149788; Fri, 17 Oct 2014 08:35:49 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.229 with SMTP id h5ls285879lam.4.gmail; Fri, 17 Oct 2014 08:35:49 -0700 (PDT) X-Received: by 10.112.221.226 with SMTP id qh2mr9698423lbc.5.1413560149611; Fri, 17 Oct 2014 08:35:49 -0700 (PDT) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id rt5si2640912lbb.2.2014.10.17.08.35.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Oct 2014 08:35:49 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by mail-lb0-f178.google.com with SMTP id w7so902512lbi.9 for ; Fri, 17 Oct 2014 08:35:49 -0700 (PDT) X-Received: by 10.152.87.98 with SMTP id w2mr9482462laz.27.1413560149528; Fri, 17 Oct 2014 08:35:49 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp250401lbz; Fri, 17 Oct 2014 08:35:48 -0700 (PDT) X-Received: by 10.140.34.102 with SMTP id k93mr7944843qgk.21.1413560146900; Fri, 17 Oct 2014 08:35:46 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id u7si2831735qcq.28.2014.10.17.08.35.46 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 17 Oct 2014 08:35:46 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xf9XT-0000CJ-Bc; Fri, 17 Oct 2014 15:33:59 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xf9XS-0000C9-Qa for xen-devel@lists.xensource.com; Fri, 17 Oct 2014 15:33:58 +0000 Received: from [193.109.254.147:6108] by server-7.bemta-14.messagelabs.com id 40/E4-13362-6E631445; Fri, 17 Oct 2014 15:33:58 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-16.tower-27.messagelabs.com!1413560035!8051167!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.12.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 30346 invoked from network); 17 Oct 2014 15:33:57 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 17 Oct 2014 15:33:57 -0000 X-IronPort-AV: E=Sophos;i="5.04,739,1406592000"; d="scan'208";a="182384239" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.3.181.6; Fri, 17 Oct 2014 11:33:54 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1Xf9XJ-0008GX-Ap; Fri, 17 Oct 2014 16:33:49 +0100 From: Stefano Stabellini To: Date: Fri, 17 Oct 2014 16:31:21 +0100 Message-ID: <1413559886-11516-3-git-send-email-stefano.stabellini@eu.citrix.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-DLP: MIA2 Cc: julien.grall@citrix.com, Ian.Campbell@citrix.com, Stefano Stabellini Subject: [Xen-devel] [PATCH v7 3/8] xen/arm: return int *_dcache_va_range X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: stefano.stabellini@eu.citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: These functions cannot really fail on ARM, but their x86 equivalents can (-EOPNOTSUPP). Change the prototype to return int. Signed-off-by: Stefano Stabellini Reviewed-by: Julien Grall --- Changes in v6: - do not return int from flush_page_to_ram. --- xen/arch/arm/mm.c | 2 +- xen/include/asm-arm/page.h | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index e43499a..8e989bf 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -388,7 +388,7 @@ void flush_page_to_ram(unsigned long mfn) { void *v = map_domain_page(mfn); - clean_and_invalidate_dcache_va_range(v, PAGE_SIZE); + ASSERT(clean_and_invalidate_dcache_va_range(v, PAGE_SIZE) == 0); unmap_domain_page(v); } diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h index 1327b00..26c5856 100644 --- a/xen/include/asm-arm/page.h +++ b/xen/include/asm-arm/page.h @@ -268,16 +268,17 @@ extern size_t cacheline_bytes; /* Functions for flushing medium-sized areas. * if 'range' is large enough we might want to use model-specific * full-cache flushes. */ -static inline void clean_dcache_va_range(const void *p, unsigned long size) +static inline int clean_dcache_va_range(const void *p, unsigned long size) { const void *end; dsb(sy); /* So the CPU issues all writes to the range */ for ( end = p + size; p < end; p += cacheline_bytes ) asm volatile (__clean_dcache_one(0) : : "r" (p)); dsb(sy); /* So we know the flushes happen before continuing */ + return 0; } -static inline void clean_and_invalidate_dcache_va_range +static inline int clean_and_invalidate_dcache_va_range (const void *p, unsigned long size) { const void *end; @@ -285,6 +286,7 @@ static inline void clean_and_invalidate_dcache_va_range for ( end = p + size; p < end; p += cacheline_bytes ) asm volatile (__clean_and_invalidate_dcache_one(0) : : "r" (p)); dsb(sy); /* So we know the flushes happen before continuing */ + return 0; } /* Macros for flushing a single small item. The predicate is always