From patchwork Fri Mar 19 10:01:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Perret X-Patchwork-Id: 12150511 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C4B1C43603 for ; Fri, 19 Mar 2021 10:03:41 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 11F9264DFB for ; Fri, 19 Mar 2021 10:03:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 11F9264DFB Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Cc:To:From:Subject:References:Mime-Version: Message-Id:In-Reply-To:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4PjXpBhO852bW5nWWxicc6ZVQ4FSVUvHveHeBI9Mdhc=; b=BHgYJN1KCdjOGk QhXvrZ5SNtZGJ7CJTsEVCi/3z3X0ggPaJIPlzlVIk3P2f/FO11+c2cNuamE2Q0KgCB/FF1jJf8C77 Jy4pkA8nPiOAawNKatoDHmwxgklrGV4FreCkxUjAtnZesfvdCX5emb8LIGX7TaGiAAzYflDlTGbkW x5VJ0oLdcnyVVgPom3Coq1WaR1kmcPDhxKlSoVRGSsf2qH0tixd3rwXsynWszN0jK8XrsicUso2fc /HUmhjKoo8t6dSyGnoH3d9XdojHJjTTWCPlE+6kWtNKQPD6bBnmU487iAiEe724NwvFm6dvQ2Hg3d R9H8Rj4Crkb8Rzsy4Zkw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNBx7-007070-R4; Fri, 19 Mar 2021 10:01:57 +0000 Received: from mail-qk1-x74a.google.com ([2607:f8b0:4864:20::74a]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNBx3-00705n-MR for linux-arm-kernel@lists.infradead.org; Fri, 19 Mar 2021 10:01:55 +0000 Received: by mail-qk1-x74a.google.com with SMTP id x11so30349141qki.22 for ; Fri, 19 Mar 2021 03:01:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=V8Xuh8uPnnLxOiVNiwLjLFxuzBpy6trzUPCuAOE2xx0=; b=E47utFiCvPDllFOUvdxw5MOKvubX8x5bac8nRQH/7SYG0fJYbAZBV+9CZ/3/4SbXMZ j/uDGzouAkaKWs+7hEm10fD00d/SyVEbDAMqbhYgqNeNjIlmJM0PYnTX2O+aKOARK+Vb gbZbhRoVoGb3LNyn4TqH0HkYIwH3lwLBG/2AZz5tZrcGXcmbrkaH3290cEpVtdLR06fD DyXwM0GgpUVDslfY8U5L/SyeyQPbEDSvuoBChD14M7n5FhlE1Uy+0aOlFXFmKJQDIkfC 4vPQ4BwQRHdoYMNoSh3I971jrh4yi5kOOUOv9jiWyNZlueB+yL2JezBSdvDXQltjetQV SfhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=V8Xuh8uPnnLxOiVNiwLjLFxuzBpy6trzUPCuAOE2xx0=; b=f9XpLWmX1hD2s0mR1NHtzXmm+MAdaB9Lu8Gwc+43c0luPqFSmi/tlVwfGTT891YVYc yyhKA1qzeiDICh/+1AcQIviKhkT0Eli0/NWe5JTBchIx2igeml9jtb+spZWpPN0/gpAR YD++BDiQx5FreMXZBA+PaJuRgCKdcc2jQzwXHsH4XBXOAdTk7J50nb8Y7maWLWBr3ybJ Rq344L+L2FmSxQ8+CNgkKEMs8aewgbwXz5n7//CC3HyQaHzBs2wTDFdqQwYk49Burk1T t/nRTSHlSQbGmPjb9FmQCxPxoOTQmwGpvmeKddPQvV1J1fV9V+RGNwpIDh+OeP/iGnRB cfUw== X-Gm-Message-State: AOAM530+iqcteXwiQuGK5N6bJCa+QapG1ULy3MgRMDJD4/0kXJbnoT52 Bwazi6o9ro3C50bTSLCCScDVafs4sWyS X-Google-Smtp-Source: ABdhPJwrKxoMwoQgKcQKrC1l3pkp1V724TOKMdk4pKAw8/iqqYX6l7isxjYsCfysPkn+0D6rQZUe8Z4Ko+sg X-Received: from r2d2-qp.c.googlers.com ([fda3:e722:ac3:10:28:9cb1:c0a8:1652]) (user=qperret job=sendgmr) by 2002:ad4:4aa8:: with SMTP id i8mr8745734qvx.22.1616148112063; Fri, 19 Mar 2021 03:01:52 -0700 (PDT) Date: Fri, 19 Mar 2021 10:01:09 +0000 In-Reply-To: <20210319100146.1149909-1-qperret@google.com> Message-Id: <20210319100146.1149909-2-qperret@google.com> Mime-Version: 1.0 References: <20210319100146.1149909-1-qperret@google.com> X-Mailer: git-send-email 2.31.0.rc2.261.g7f71774620-goog Subject: [PATCH v6 01/38] arm64: lib: Annotate {clear, copy}_page() as position-independent From: Quentin Perret To: catalin.marinas@arm.com, will@kernel.org, maz@kernel.org, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com Cc: android-kvm@google.com, seanjc@google.com, mate.toth-pal@arm.com, linux-kernel@vger.kernel.org, robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org, kernel-team@android.com, kvmarm@lists.cs.columbia.edu, tabba@google.com, ardb@kernel.org, mark.rutland@arm.com, dbrazdil@google.com, qperret@google.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210319_100153_805857_DA1019DC X-CRM114-Status: UNSURE ( 9.47 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Will Deacon clear_page() and copy_page() are suitable for use outside of the kernel address space, so annotate them as position-independent code. Signed-off-by: Will Deacon Signed-off-by: Quentin Perret --- arch/arm64/lib/clear_page.S | 4 ++-- arch/arm64/lib/copy_page.S | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm64/lib/clear_page.S b/arch/arm64/lib/clear_page.S index 073acbf02a7c..b84b179edba3 100644 --- a/arch/arm64/lib/clear_page.S +++ b/arch/arm64/lib/clear_page.S @@ -14,7 +14,7 @@ * Parameters: * x0 - dest */ -SYM_FUNC_START(clear_page) +SYM_FUNC_START_PI(clear_page) mrs x1, dczid_el0 and w1, w1, #0xf mov x2, #4 @@ -25,5 +25,5 @@ SYM_FUNC_START(clear_page) tst x0, #(PAGE_SIZE - 1) b.ne 1b ret -SYM_FUNC_END(clear_page) +SYM_FUNC_END_PI(clear_page) EXPORT_SYMBOL(clear_page) diff --git a/arch/arm64/lib/copy_page.S b/arch/arm64/lib/copy_page.S index e7a793961408..29144f4cd449 100644 --- a/arch/arm64/lib/copy_page.S +++ b/arch/arm64/lib/copy_page.S @@ -17,7 +17,7 @@ * x0 - dest * x1 - src */ -SYM_FUNC_START(copy_page) +SYM_FUNC_START_PI(copy_page) alternative_if ARM64_HAS_NO_HW_PREFETCH // Prefetch three cache lines ahead. prfm pldl1strm, [x1, #128] @@ -75,5 +75,5 @@ alternative_else_nop_endif stnp x16, x17, [x0, #112 - 256] ret -SYM_FUNC_END(copy_page) +SYM_FUNC_END_PI(copy_page) EXPORT_SYMBOL(copy_page)