From patchwork Fri Oct 10 11:43:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 38552 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 87458202DB for ; Fri, 10 Oct 2014 11:47:25 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id b6sf2012342lbj.7 for ; Fri, 10 Oct 2014 04:47:24 -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=kR3213UqVDhvi1rh05G3NR3250De/ChfcyfvsT5yvL0=; b=RJY4dPr0luLzy0ApXOXqyIHiv8SqXjRflago2RfY88e5ulO2VQwXoinZ9KGn6orVfQ gsBAGiLxZfvwp+Pp6tparhX888G98i2ZjImhIct///UQyo9rjkA+Sd7AiU871Vsb3sIE t2Gv1CuQkl/aoCHi6rPmXezWH+MHP7l+ah49d4oodh/dAR/QJ1HoK2bSFcUcnQkyb6mc G5sRy7fBcluQLLMXWiRIxQFDX6S6Hbu5sWWBdgJOmd7AlcHrqZGW1iTDQdO6wzr0Tnx8 hm+Uw+AqqqqMVW8S6Bbe70Io+CUuALZnOIORHWeExykVUFnjqs/QeETp4mt1NLhia9N3 qukg== X-Gm-Message-State: ALoCoQlnLz++YKsgVL5VjnOTYOu9xSiDgLdOy9xc/xCMj0rcN7z7EdqWgkHc7nqnC4XIsiNCDywo X-Received: by 10.194.100.3 with SMTP id eu3mr60082wjb.6.1412941644243; Fri, 10 Oct 2014 04:47:24 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.66 with SMTP id o2ls277741laj.8.gmail; Fri, 10 Oct 2014 04:47:23 -0700 (PDT) X-Received: by 10.112.166.6 with SMTP id zc6mr4081803lbb.31.1412941643950; Fri, 10 Oct 2014 04:47:23 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com [209.85.215.49]) by mx.google.com with ESMTPS id zm10si8714654lbb.125.2014.10.10.04.47.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Oct 2014 04:47:23 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id q1so3014085lam.8 for ; Fri, 10 Oct 2014 04:47:23 -0700 (PDT) X-Received: by 10.113.10.9 with SMTP id dw9mr4200927lbd.46.1412941643263; Fri, 10 Oct 2014 04:47:23 -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 c5csp411497lbz; Fri, 10 Oct 2014 04:47:22 -0700 (PDT) X-Received: by 10.220.1.5 with SMTP id 5mr220881vcd.74.1412941642043; Fri, 10 Oct 2014 04:47:22 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id sj4si326489vcb.97.2014.10.10.04.47.18 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 10 Oct 2014 04:47:22 -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 1XcYeQ-0007lK-My; Fri, 10 Oct 2014 11:46:26 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XcYeP-0007kz-T7 for xen-devel@lists.xensource.com; Fri, 10 Oct 2014 11:46:25 +0000 Received: from [85.158.143.35:38495] by server-1.bemta-4.messagelabs.com id 85/3E-05872-117C7345; Fri, 10 Oct 2014 11:46:25 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-7.tower-21.messagelabs.com!1412941582!12094959!3 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 25352 invoked from network); 10 Oct 2014 11:46:24 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 10 Oct 2014 11:46:24 -0000 X-IronPort-AV: E=Sophos;i="5.04,691,1406592000"; d="scan'208";a="180112518" 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, 10 Oct 2014 07:46:21 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1XcYeG-0008F6-CH; Fri, 10 Oct 2014 12:46:16 +0100 From: Stefano Stabellini To: Date: Fri, 10 Oct 2014 12:43:57 +0100 Message-ID: <1412941440-5646-4-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 v4 4/7] xen/x86: introduce more cache maintenance operations 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.215.49 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: Signed-off-by: Stefano Stabellini --- Changes in v4: - remove _xen in the function names; - implement the functions using existing x86 flushing functions. --- xen/arch/x86/flushtlb.c | 6 ++++++ xen/include/asm-x86/page.h | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/flushtlb.c b/xen/arch/x86/flushtlb.c index 5d5d79c..3e5e287 100644 --- a/xen/arch/x86/flushtlb.c +++ b/xen/arch/x86/flushtlb.c @@ -152,3 +152,9 @@ void flush_area_local(const void *va, unsigned int flags) local_irq_restore(irqfl); } + +void clean_and_invalidate_dcache_va_range(const void *p, unsigned long size) +{ + int order = get_order_from_bytes(size); + flush_area_local(p, FLUSH_CACHE|FLUSH_ORDER(order)); +} diff --git a/xen/include/asm-x86/page.h b/xen/include/asm-x86/page.h index 9aa780e..e56be8a 100644 --- a/xen/include/asm-x86/page.h +++ b/xen/include/asm-x86/page.h @@ -344,8 +344,13 @@ static inline uint32_t cacheattr_to_pte_flags(uint32_t cacheattr) return ((cacheattr & 4) << 5) | ((cacheattr & 3) << 3); } -/* No cache maintenance required on x86 architecture. */ static inline void flush_page_to_ram(unsigned long mfn) {} +static inline void invalidate_dcache_va_range(const void *p, unsigned long size) {} +void clean_and_invalidate_dcache_va_range(const void *p, unsigned long size); +static inline void clean_dcache_va_range(const void *p, unsigned long size) +{ + clean_and_invalidate_dcache_va_range(p, size); +} /* return true if permission increased */ static inline bool_t