From patchwork Wed Mar 26 13:38:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 27132 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f71.google.com (mail-yh0-f71.google.com [209.85.213.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 656B020062 for ; Wed, 26 Mar 2014 13:44:49 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id a41sf4875894yho.6 for ; Wed, 26 Mar 2014 06:44: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=E16GDI8dLngIBGNxOi0nZ9xmReIJaRgiX0GoIO1N/1U=; b=DlYmOZmWkOIyki5XjEEu5jQmISeCWh2xFar6ty3Kd2KDMXcdlAZ03ZLCjoUpMSOT1K 34m+N+Wulx00MHZNInASDlxqqAgzXOiIVXzjnuPygKUd90LGdwI9/XXr3UJMAbffPUOd WtVwZyDs6JdNYYlskaQWIrBztogoN3JHsYU09Fl2mk+rn9tM69NWBDjmuSC8+g9YMLd9 llp9RVxRxupmaPxhE3k2X8wY08YbUyCWNiOF3454HEnhyL8a/dQQpeiB8n0lFV4pzDzu 7/IedssopBoLjgY/BeIVo0z+Un1c6bsnw3CVaCduNuzwxS2jLIsq9u86z35U7vEimBOE G/wA== X-Gm-Message-State: ALoCoQkxLoBQH1HlqHU9ynSmadWXB6ZQH5rsC9QWuSCzkzVbnUs2zkxn7Fu6nma4NhKw8awmD/N2 X-Received: by 10.236.209.134 with SMTP id s6mr8005635yho.40.1395841489198; Wed, 26 Mar 2014 06:44:49 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.50.81 with SMTP id r75ls658627qga.71.gmail; Wed, 26 Mar 2014 06:44:49 -0700 (PDT) X-Received: by 10.58.91.133 with SMTP id ce5mr75858veb.64.1395841489088; Wed, 26 Mar 2014 06:44:49 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id fi2si4478593vcb.69.2014.03.26.06.44.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Mar 2014 06:44:49 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.172 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.172; Received: by mail-vc0-f172.google.com with SMTP id la4so2414415vcb.3 for ; Wed, 26 Mar 2014 06:44:49 -0700 (PDT) X-Received: by 10.220.159.4 with SMTP id h4mr49834527vcx.1.1395841488990; Wed, 26 Mar 2014 06:44:48 -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.78.9 with SMTP id i9csp47436vck; Wed, 26 Mar 2014 06:44:48 -0700 (PDT) X-Received: by 10.52.108.228 with SMTP id hn4mr163864vdb.43.1395841488573; Wed, 26 Mar 2014 06:44:48 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id 7si46868vcm.206.2014.03.26.06.44.47 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 26 Mar 2014 06:44:48 -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 1WSo6k-0006Da-3R; Wed, 26 Mar 2014 13:43:06 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WSo6j-0006DA-2P for xen-devel@lists.xen.org; Wed, 26 Mar 2014 13:43:05 +0000 Received: from [193.109.254.147:51053] by server-9.bemta-14.messagelabs.com id 16/01-03644-869D2335; Wed, 26 Mar 2014 13:43:04 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-11.tower-27.messagelabs.com!1395841373!4263562!5 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n X-StarScan-Received: X-StarScan-Version: 6.11.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 29307 invoked from network); 26 Mar 2014 13:43:03 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-11.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 26 Mar 2014 13:43:03 -0000 X-IronPort-AV: E=Sophos;i="4.97,735,1389744000"; d="scan'208";a="113734844" Received: from accessns.citrite.net (HELO FTLPEX01CL01.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 26 Mar 2014 13:43:03 +0000 Received: from norwich.cam.xci-test.com (10.80.248.129) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.2.342.4; Wed, 26 Mar 2014 09:43:02 -0400 Received: from drall.uk.xensource.com ([10.80.16.71] helo=drall.uk.xensource.com.) by norwich.cam.xci-test.com with esmtp (Exim 4.72) (envelope-from ) id 1WSo2g-00074X-6v; Wed, 26 Mar 2014 13:38:54 +0000 From: Ian Campbell To: Date: Wed, 26 Mar 2014 13:38:50 +0000 Message-ID: <1395841133-2223-15-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395841009.12547.11.camel@kazak.uk.xensource.com> References: <1395841009.12547.11.camel@kazak.uk.xensource.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: julien.grall@linaro.org, tim@xen.org, Ian Campbell , stefano.stabellini@eu.citrix.com Subject: [Xen-devel] [PATCH v2 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.172 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: Taken from Linux v3.14-rc7. The clear_page header now needs to be within the !__ASSEMBLY__ Signed-off-by: Ian Campbell --- xen/arch/arm/arm64/lib/Makefile | 1 + xen/arch/arm/arm64/lib/clear_page.S | 36 +++++++++++++++++++++++++++++++++++ xen/include/asm-arm/page.h | 9 +++++++-- 3 files changed, 44 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/page.h b/xen/include/asm-arm/page.h index d18ec2a..e880ae8 100644 --- a/xen/include/asm-arm/page.h +++ b/xen/include/asm-arm/page.h @@ -341,6 +341,13 @@ static inline int gva_to_ipa(vaddr_t va, paddr_t *paddr) /* Bits in the PAR returned by va_to_par */ #define PAR_FAULT 0x1 + +#ifdef CONFIG_ARM_32 +#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) +#else +extern void clear_page(void *to); +#endif + #endif /* __ASSEMBLY__ */ /* @@ -382,8 +389,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__ */