From patchwork Thu Mar 20 15:46:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 26725 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 951FD20143 for ; Thu, 20 Mar 2014 15:49:07 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id wo20sf4024452obc.2 for ; Thu, 20 Mar 2014 08:49:07 -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=kfbR/GKbuCqg4IHlhL/VL9bDdg3vgAlaUlfH1NvSX3c=; b=CsX2VWJx1E++H3yG7hiDIAuK9SsmY6loGz+fa3S889J5O+fgaVLLtXXb4QnL6xG6Hj 46YVw5wCbiW0nJrnm4uKdkBtSh8ae/vy6aAfa7VopdCY5n/dwxzQDo565txkft4gq6tg Xvo+6bWT2nzuFVgdcAoUUF9hsBlpkmp28KParwTgc9etv1gqsS6QOXb5SFFPHx3o8Wr9 8pLMKWJjdoJwEdKLI5OpGvdc2UfOWpdKgacQHzLYUOFXES+AwZGfteEuYTjHC/a/iZ4g yyAa+HtdAZ5ERTEuNeZXzOfxUV7suBGiDTLAh3eunCfMK1ekDL2dh+0r4D0ID8UzWcQl iYnw== X-Gm-Message-State: ALoCoQlwWaEqUHA75rASW/5EiDNcNj3EUeZs52G2iW33XR3UCJ+0yMAnVoH9nyhm6Ia04UOKaiAe X-Received: by 10.182.118.194 with SMTP id ko2mr3944157obb.32.1395330547135; Thu, 20 Mar 2014 08:49:07 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.93.33 with SMTP id c30ls313970qge.9.gmail; Thu, 20 Mar 2014 08:49:07 -0700 (PDT) X-Received: by 10.220.47.10 with SMTP id l10mr520784vcf.56.1395330547035; Thu, 20 Mar 2014 08:49:07 -0700 (PDT) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id sj4si522117vdc.138.2014.03.20.08.49.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 08:49:07 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id oy12so1172677veb.12 for ; Thu, 20 Mar 2014 08:49:07 -0700 (PDT) X-Received: by 10.220.106.84 with SMTP id w20mr34396839vco.18.1395330546945; Thu, 20 Mar 2014 08:49:06 -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 i9csp398643vck; Thu, 20 Mar 2014 08:49:06 -0700 (PDT) X-Received: by 10.140.81.198 with SMTP id f64mr47953598qgd.38.1395330546519; Thu, 20 Mar 2014 08:49:06 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id v6si940470qas.91.2014.03.20.08.49.06 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 20 Mar 2014 08:49:06 -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 1WQfCH-00055L-8x; Thu, 20 Mar 2014 15:47:57 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WQfCF-000542-PK for xen-devel@lists.xen.org; Thu, 20 Mar 2014 15:47:56 +0000 Received: from [85.158.137.68:35669] by server-7.bemta-3.messagelabs.com id 3A/89-04151-AAD0B235; Thu, 20 Mar 2014 15:47:54 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-8.tower-31.messagelabs.com!1395330472!1945661!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 13188 invoked from network); 20 Mar 2014 15:47:54 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-8.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 20 Mar 2014 15:47:54 -0000 X-IronPort-AV: E=Sophos;i="4.97,695,1389744000"; d="scan'208";a="113309353" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 20 Mar 2014 15:47:52 +0000 Received: from norwich.cam.xci-test.com (10.80.248.129) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.2.342.4; Thu, 20 Mar 2014 11:47:52 -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 1WQfAV-0006O2-18; Thu, 20 Mar 2014 15:46:07 +0000 From: Ian Campbell To: Date: Thu, 20 Mar 2014 15:46:03 +0000 Message-ID: <1395330365-9901-15-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395330336.3104.12.camel@kazak.uk.xensource.com> References: <1395330336.3104.12.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 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.128.181 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 withing 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__ */