From patchwork Wed Apr 2 16:23:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 27644 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 100F520341 for ; Wed, 2 Apr 2014 16:24:45 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id j17sf2084156oag.6 for ; Wed, 02 Apr 2014 09:24:45 -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:message-id:from:to:date:in-reply-to :references:organization: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=kZegc26eYp97nmIWoHLfUgJ2OxtGuS6U0cagr6mJNC0=; b=BbaNI9t7zwmxT9+2CXQB+5aQNnA4fx3BjEVfH3ZDrKoHR1iVpCQHeFmUsE43RQQcq2 A0DkMc5gju/cmyBsSKVQ26Xyyq6RV+rO/+JW8zUASEmEOm3T5xGnfMRv7TZcevaOztH0 OiULL7QXfBDPZs2feHfzfhXtpCpXSDBiw6M3n83eV4zXfDyb2/4oxutqpmRRw8oo+uW5 p3Mq6wpOyoZQI6HbFW3dpDf7Au/ujU7BKWZNjahxLCGuD+BTWY6mpIoSCJ11paze8Kq6 qnfqMy+mbOWC+q2hZBMf3k8kI4dKbEFFlVsqtiXXViAAr3NdVILVJHzDRxwd4imC1tXh 6TGg== X-Gm-Message-State: ALoCoQmvu5PV+sTwT5O1cd6VEQqq/VdfkkFdWVrI+/cGnJKINafD2Aqr0mpA4Bd7NgsWCCxMymWm X-Received: by 10.42.13.198 with SMTP id e6mr724328ica.21.1396455885506; Wed, 02 Apr 2014 09:24:45 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.16.165 with SMTP id 34ls387555qgb.30.gmail; Wed, 02 Apr 2014 09:24:45 -0700 (PDT) X-Received: by 10.52.126.107 with SMTP id mx11mr1415764vdb.41.1396455885428; Wed, 02 Apr 2014 09:24:45 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id rx10si667348vdc.24.2014.04.02.09.24.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Apr 2014 09:24:45 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id ld13so648066vcb.19 for ; Wed, 02 Apr 2014 09:24:45 -0700 (PDT) X-Received: by 10.52.12.36 with SMTP id v4mr1605856vdb.20.1396455885331; Wed, 02 Apr 2014 09:24:45 -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.220.12.8 with SMTP id v8csp337232vcv; Wed, 2 Apr 2014 09:24:44 -0700 (PDT) X-Received: by 10.52.6.162 with SMTP id c2mr1559998vda.6.1396455884539; Wed, 02 Apr 2014 09:24:44 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id m3si666702vcr.23.2014.04.02.09.24.43 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 02 Apr 2014 09:24:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) 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 1WVNwi-0001EJ-NH; Wed, 02 Apr 2014 16:23:24 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WVNwh-0001EA-5m for xen-devel@lists.xen.org; Wed, 02 Apr 2014 16:23:23 +0000 Received: from [85.158.137.68:33881] by server-9.bemta-3.messagelabs.com id 78/E9-30063-A793C335; Wed, 02 Apr 2014 16:23:22 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-5.tower-31.messagelabs.com!1396455800!4585773!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.11.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 6349 invoked from network); 2 Apr 2014 16:23:21 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-5.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 2 Apr 2014 16:23:21 -0000 X-IronPort-AV: E=Sophos;i="4.97,780,1389744000"; d="scan'208";a="117383102" Received: from accessns.citrite.net (HELO FTLPEX01CL01.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 02 Apr 2014 16:23:17 +0000 Received: from [10.80.2.80] (10.80.2.80) by FTLPEX01CL01.citrite.net (10.13.107.78) with Microsoft SMTP Server id 14.2.342.4; Wed, 2 Apr 2014 12:23:17 -0400 Message-ID: <1396455795.4211.7.camel@kazak.uk.xensource.com> From: Ian Campbell To: Julien Grall Date: Wed, 2 Apr 2014 17:23:15 +0100 In-Reply-To: <5332E126.2020907@linaro.org> References: <1395841009.12547.11.camel@kazak.uk.xensource.com> <1395841133-2223-15-git-send-email-ian.campbell@citrix.com> <5332E126.2020907@linaro.org> Organization: Citrix Systems, Inc. X-Mailer: Evolution 3.8.5-2+b3 MIME-Version: 1.0 X-Originating-IP: [10.80.2.80] X-DLP: MIA2 Cc: stefano.stabellini@eu.citrix.com, tim@xen.org, xen-devel@lists.xen.org Subject: [Xen-devel] [PATCH v3 15/17] xen: arm64: optimised clear_page 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: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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: > > +#ifdef CONFIG_ARM_32 > > +#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) > > +#else > > +extern void clear_page(void *to); > > +#endif > > + > > I would prefer if you move the defined in arm{32,64}/page.h. Ack. Just resending this one: ------------<8------------------ >From f679cbc3a191c43aa303b4e74f241e8755430ba0 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Wed, 19 Mar 2014 17:19:56 +0000 Subject: [PATCH] xen: arm64: optimised clear_page Taken from Linux v3.14-rc7. The clear_page header now needs to be within the !__ASSEMBLY__ Signed-off-by: Ian Campbell Acked-by: Tim Deegan Acked-by: Julien Grall --- v3: Move prototypes to arm{32,64}/page.h --- xen/arch/arm/arm64/lib/Makefile | 1 + xen/arch/arm/arm64/lib/clear_page.S | 36 +++++++++++++++++++++++++++++++++++ xen/include/asm-arm/arm32/page.h | 2 ++ xen/include/asm-arm/arm64/page.h | 2 ++ xen/include/asm-arm/page.h | 2 -- 5 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 xen/arch/arm/arm64/lib/clear_page.S diff --git a/xen/arch/arm/arm64/lib/Makefile b/xen/arch/arm/arm64/lib/Makefile index 9f3b236..b895afa 100644 --- a/xen/arch/arm/arm64/lib/Makefile +++ b/xen/arch/arm/arm64/lib/Makefile @@ -1,3 +1,4 @@ obj-y += memcpy.o memmove.o memset.o memchr.o +obj-y += clear_page.o obj-y += bitops.o find_next_bit.o obj-y += strchr.o strrchr.o diff --git a/xen/arch/arm/arm64/lib/clear_page.S b/xen/arch/arm/arm64/lib/clear_page.S new file mode 100644 index 0000000..8d5cadb --- /dev/null +++ b/xen/arch/arm/arm64/lib/clear_page.S @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2012 ARM Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include + +/* + * Clear page @dest + * + * Parameters: + * x0 - dest + */ +ENTRY(clear_page) + mrs x1, dczid_el0 + and w1, w1, #0xf + mov x2, #4 + lsl x1, x2, x1 + +1: dc zva, x0 + add x0, x0, x1 + tst x0, #(PAGE_SIZE - 1) + b.ne 1b + ret +ENDPROC(clear_page) diff --git a/xen/include/asm-arm/arm32/page.h b/xen/include/asm-arm/arm32/page.h index 191a108..a4c1a1a 100644 --- a/xen/include/asm-arm/arm32/page.h +++ b/xen/include/asm-arm/arm32/page.h @@ -111,6 +111,8 @@ static inline uint64_t gva_to_ipa_par(vaddr_t va) return par; } +#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) + #endif /* __ASSEMBLY__ */ #endif /* __ARM_ARM32_PAGE_H__ */ diff --git a/xen/include/asm-arm/arm64/page.h b/xen/include/asm-arm/arm64/page.h index 20b4c5a..91e1914 100644 --- a/xen/include/asm-arm/arm64/page.h +++ b/xen/include/asm-arm/arm64/page.h @@ -105,6 +105,8 @@ static inline uint64_t gva_to_ipa_par(vaddr_t va) return par; } +extern void clear_page(void *to); + #endif /* __ASSEMBLY__ */ #endif /* __ARM_ARM64_PAGE_H__ */ diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h index d18ec2a..c77ba85 100644 --- a/xen/include/asm-arm/page.h +++ b/xen/include/asm-arm/page.h @@ -382,8 +382,6 @@ static inline int gva_to_ipa(vaddr_t va, paddr_t *paddr) #define third_table_offset(va) TABLE_OFFSET(third_linear_offset(va)) #define zeroeth_table_offset(va) TABLE_OFFSET(zeroeth_linear_offset(va)) -#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) - #define PAGE_ALIGN(x) (((x) + PAGE_SIZE - 1) & PAGE_MASK) #endif /* __ARM_PAGE_H__ */