From patchwork Mon Oct 13 14:58:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 38669 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 55D512039B for ; Mon, 13 Oct 2014 15:02:44 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id d1sf2980817wiv.6 for ; Mon, 13 Oct 2014 08:02:43 -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=rCtHJnYHMlnM5D3e8R3mIsxFQZJKVewf9GKx7IUikPc=; b=VRMxtu1cOf1E5baU2MB3pm4/hsWIlogq4DD/Uh55IOc45TW/xYPsaBmTNcyeMh8siG VJM2D49Hw3bRC7dg+z7gymMOU16C6mRWNH006iVH+6NRki2Xexl6wM3833oFj83bdZn5 qKv5Y3ijtm1tj3Hk2knaoaW8iguPGn+MwMZwJvgvp8bdq/ERX+cjAtbJBQEljuzCKblp S/EEjeb7uBJMTp1hMhw4S3f4RTUk3ecAlKX6eP5oNkH1LDPNg9JiGgfJ9Tl6DDGuNMsz S+Uy/IE0nFdkL2dTDaBZ16Fy8RdR1VVsSTDkgrzdFHJ4dM2skYmhcPA4fpNO9M8B67ea V/ZA== X-Gm-Message-State: ALoCoQk6eWvuR6/InkV4qVVnQ9vgPJKcoBXMoPR85TY/UrE67mSvNBd8cfrABk5Bh2kY+mpkJANz X-Received: by 10.112.83.38 with SMTP id n6mr6832lby.24.1413212563150; Mon, 13 Oct 2014 08:02:43 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.141 with SMTP id j13ls497272laa.5.gmail; Mon, 13 Oct 2014 08:02:42 -0700 (PDT) X-Received: by 10.152.20.98 with SMTP id m2mr24598847lae.51.1413212562914; Mon, 13 Oct 2014 08:02:42 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com [209.85.217.173]) by mx.google.com with ESMTPS id it2si22643968lac.40.2014.10.13.08.02.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 Oct 2014 08:02:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by mail-lb0-f173.google.com with SMTP id 10so6667415lbg.18 for ; Mon, 13 Oct 2014 08:02:42 -0700 (PDT) X-Received: by 10.152.26.226 with SMTP id o2mr24551545lag.44.1413212562832; Mon, 13 Oct 2014 08:02:42 -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 c5csp230725lbz; Mon, 13 Oct 2014 08:02:42 -0700 (PDT) X-Received: by 10.140.89.232 with SMTP id v95mr15142324qgd.85.1413212560928; Mon, 13 Oct 2014 08:02:40 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id p63si25338832qga.7.2014.10.13.08.02.40 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 13 Oct 2014 08:02:40 -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 1Xdh7l-0004Ft-Bj; Mon, 13 Oct 2014 15:01:25 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xdh7k-0004FV-9L for xen-devel@lists.xensource.com; Mon, 13 Oct 2014 15:01:24 +0000 Received: from [85.158.143.35:16732] by server-1.bemta-4.messagelabs.com id DD/71-05872-349EB345; Mon, 13 Oct 2014 15:01:23 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-11.tower-21.messagelabs.com!1413212480!12585469!2 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 28960 invoked from network); 13 Oct 2014 15:01:22 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-11.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 13 Oct 2014 15:01:22 -0000 X-IronPort-AV: E=Sophos;i="5.04,711,1406592000"; d="scan'208";a="180809045" 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; Mon, 13 Oct 2014 11:01:09 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1Xdh7P-0008Ho-Qi; Mon, 13 Oct 2014 16:01:03 +0100 From: Stefano Stabellini To: Date: Mon, 13 Oct 2014 15:58:41 +0100 Message-ID: <1413212324-664-5-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 v5 5/8] 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.217.173 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: Move the existing flush_page_to_ram flushtlb.h. Signed-off-by: Stefano Stabellini --- Changes in v5: - make order an unsigned int; - add a comment on sub-page granularity support; - cache operations return error; - move the functions to xen/include/asm-x86/flushtlb.h. Changes in v4: - remove _xen in the function names; - implement the functions using existing x86 flushing functions. --- xen/include/asm-x86/flushtlb.h | 16 ++++++++++++++++ xen/include/asm-x86/page.h | 3 --- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/xen/include/asm-x86/flushtlb.h b/xen/include/asm-x86/flushtlb.h index 7f46632..3ced2fb 100644 --- a/xen/include/asm-x86/flushtlb.h +++ b/xen/include/asm-x86/flushtlb.h @@ -11,6 +11,7 @@ #define __FLUSHTLB_H__ #include +#include #include #include #include @@ -115,4 +116,19 @@ void flush_area_mask(const cpumask_t *, const void *va, unsigned int flags); #define flush_tlb_one_all(v) \ flush_tlb_one_mask(&cpu_online_map, v) +static inline int flush_page_to_ram(unsigned long mfn) { return -EOPNOTSUPP; } +static inline int invalidate_dcache_va_range(const void *p, unsigned long size) { return -EOPNOTSUPP; } +static inline int clean_and_invalidate_dcache_va_range(const void *p, unsigned long size) +{ + unsigned int order = get_order_from_bytes(size); + /* sub-page granularity support needs to be added if necessary */ + flush_area_local(p, FLUSH_CACHE|FLUSH_ORDER(order)); + return 0; +} +static inline int clean_dcache_va_range(const void *p, unsigned long size) +{ + clean_and_invalidate_dcache_va_range(p, size); + return 0; +} + #endif /* __FLUSHTLB_H__ */ diff --git a/xen/include/asm-x86/page.h b/xen/include/asm-x86/page.h index 006e3fa..8ca6923 100644 --- a/xen/include/asm-x86/page.h +++ b/xen/include/asm-x86/page.h @@ -345,9 +345,6 @@ 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 int flush_page_to_ram(unsigned long mfn) { return -EOPNOTSUPP; } - /* return true if permission increased */ static inline bool_t perms_strictly_increased(uint32_t old_flags, uint32_t new_flags)