From patchwork Thu Oct 16 14:45:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 38827 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 A3ED420973 for ; Thu, 16 Oct 2014 14:50:52 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id hi2sf2132085wib.9 for ; Thu, 16 Oct 2014 07:50:51 -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=LKNQLeisiLYzQ7w6iaCIf25O9Kzw47zubQK+nO10LDc=; b=P71oURNScM33/7Yq3rLUWczqNTuTxIUa75I9zNS0BE8K6QNxyRuqoAMw1oR455yeml MOosnAKNzXLw7euA/y8qNQQptn9HVF9uV6/hOe9a34EtGmWqm9xnrJwlfNCikYuDBz5Z yp35m123ytrelPEJJlrD1a3okzo8/ix5EMOwZ9laqq0ExGjuCRaUoRc0vDyARzhnZYQz rTWf+gyqDBqxXZuDlSar5rFO18pJ72hqy45l32AGW3rAo3YFZ/5/eL1qX1XVRJwq0HpD Y+8x01yjIXcS8NX4omOaqo3i+SWs9E2pMpFdstTAjOr/GxNwP0DypNPJoRCxkPoSkcqz h4Kg== X-Gm-Message-State: ALoCoQnXOXp9h6XwkuUr3S6cMCB403QcIbhZ9xeSdSj5her0rXJ9bU+1WwIgYwxH50ECAFM5L0bu X-Received: by 10.112.26.82 with SMTP id j18mr152152lbg.16.1413471051433; Thu, 16 Oct 2014 07:50:51 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.227 with SMTP id p3ls177412laf.39.gmail; Thu, 16 Oct 2014 07:50:51 -0700 (PDT) X-Received: by 10.112.118.229 with SMTP id kp5mr2038914lbb.99.1413471051248; Thu, 16 Oct 2014 07:50:51 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com [209.85.217.175]) by mx.google.com with ESMTPS id w4si23592814laj.78.2014.10.16.07.50.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 16 Oct 2014 07:50:51 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by mail-lb0-f175.google.com with SMTP id u10so2970804lbd.34 for ; Thu, 16 Oct 2014 07:50:51 -0700 (PDT) X-Received: by 10.112.221.197 with SMTP id qg5mr2235150lbc.32.1413471051141; Thu, 16 Oct 2014 07:50:51 -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 c5csp53363lbz; Thu, 16 Oct 2014 07:50:50 -0700 (PDT) X-Received: by 10.220.97.72 with SMTP id k8mr1737552vcn.5.1413471049773; Thu, 16 Oct 2014 07:50:49 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id wb14si1694139vdc.76.2014.10.16.07.50.48 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 16 Oct 2014 07:50:49 -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 1XemLw-0002Sj-V6; Thu, 16 Oct 2014 14:48:32 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XemLv-0002SY-9f for xen-devel@lists.xensource.com; Thu, 16 Oct 2014 14:48:31 +0000 Received: from [193.109.254.147:53794] by server-13.bemta-14.messagelabs.com id A4/9E-19311-EBADF345; Thu, 16 Oct 2014 14:48:30 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-7.tower-27.messagelabs.com!1413470906!13195141!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 3447 invoked from network); 16 Oct 2014 14:48:29 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-7.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 16 Oct 2014 14:48:29 -0000 X-IronPort-AV: E=Sophos;i="5.04,732,1406592000"; d="scan'208";a="181975778" 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; Thu, 16 Oct 2014 10:48:22 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1XemLh-00040J-1j; Thu, 16 Oct 2014 15:48:17 +0100 From: Stefano Stabellini To: Date: Thu, 16 Oct 2014 15:45:50 +0100 Message-ID: <1413470755-30991-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 v6 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.175 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