From patchwork Mon Jan 25 19:19:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 12044195 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_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 42BA2C433DB for ; Mon, 25 Jan 2021 19:45:48 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 C758F2251F for ; Mon, 25 Jan 2021 19:45:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C758F2251F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6Rb9ztuAj51wsXtQj1Z96DHR9hriY/PsrHnNV3lddaQ=; b=FwdioyOYAbHvjWCsvDc4J4s9HC zsUpB6SuPjYfHqG634NJEOLiDeVycdMaO/6mSLnZS6/IYZS78VG2F2k3WYCLumm1I6b2qzupDhiKd Olsk2PIliydNrnMES3u6cXOJq+WJEyBGeRw+YNjKuCR6im+7fSMcyxjfxs5zXCEuJFTyCZRN3Vxp+ IQGaywtk+5TKp+oUZnso7qoB9YmVuLmaGEGoe+yKmWLy7pSihwmm7qmVKFdto7eqAYEdF6GyKvCUw TnQxoHlCb5kyJcVKvL5LyTBjOt2xNUjkMPMWZuKVpUJ0bvZr+7l9nqEFjTAEPEtd4T6sib2qKIhs+ ORN8OXuw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l47mb-0005zr-8d; Mon, 25 Jan 2021 19:44:17 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l47mX-0005aF-Ft for linux-arm-kernel@merlin.infradead.org; Mon, 25 Jan 2021 19:44:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description; bh=tiSMngDA2ABiEtmeVcai+dAKxWkYAh1htex3hJFUjpk=; b=JuimPJqLSeGNobAii6k71IZ9Nj 6KPR+WoVfHsI7WMxroKioWxD/VqM5EUwUp4mr4recBzQNGzuMqulTHJHXotv6tEFKj2EfaX9EVGrz Q84IYPaJx6aX+65G2W8qN5vkik0bRbBmYIfNZ413dH/XAhv74gu5kl7hHwBN1KY7TaMghgoe9xZ2Q RupYGpsRr955GWgp5jITMJbYp3eB1r3qDqXjoy2xnlRv/FcO/vjQUtGitbMAoiRiLhso4vj+PPjRV kUrtNimyQEOJIHxyxy9TsWxesGJhHYFZWCLNnVh3kXF9rW1pl9uPjWflnpmffHj8guDe4Xez808F5 ZbWiBJDg==; Received: from mail-qt1-x82e.google.com ([2607:f8b0:4864:20::82e]) by casper.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1l47PA-004Z4U-KX for linux-arm-kernel@lists.infradead.org; Mon, 25 Jan 2021 19:20:40 +0000 Received: by mail-qt1-x82e.google.com with SMTP id e17so10529524qto.3 for ; Mon, 25 Jan 2021 11:19:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=tiSMngDA2ABiEtmeVcai+dAKxWkYAh1htex3hJFUjpk=; b=ViZk57Ck4HUJG00kgKhICCWv1eeMV2KNwvtWbX+xyUO32m6U7YnxxkY3kd7tyt7Ng+ XrR64IVqIQXWuSCO/zvWvsnc220koQtIQ6BeCpcN3m5qJtxE8hQd+lqOk1SSUws39mJ5 2UU0xjoEra/u8cu7+zZxLeSEhnlev+FK43G7b4wigJE0ZW7Fxmwc4f+5WKP6PGVvLDKD CevQSfsHTtUhlePppvfpl/vrZuOFENi0k/k70Vz6s/LnbGLcFohCKRaCw+y6dHHnaupf dxxTdXFgaF41aR4eCDsfpBOzusaAodDscncPCsGYESYFYQ62GgZzY2GbN4qZLZDAgGys GB3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tiSMngDA2ABiEtmeVcai+dAKxWkYAh1htex3hJFUjpk=; b=dkJQLxpvq5TbAaBGJNTO3HwjaQ2qDRSA50V1qgwzn0a0d98greDpMRpAuoKsmym2Mz KBmnfv5fGLQ8gV86qnWayxXFxX9QW+s/4jIuseakGbhDtZ+CwZzTljfdDh0ujpIVpBOW QFG/iKh+ltXSGJYmXMeF8e/Mwdc0gNQ2l2KcpOnLStbQ+CodXxsmytx1+DKXEVLFicyB Sd8IM1tNqo2R6l1vOdosSJwRNAXDI38FW9Rm2W6wLdn8Q1uQGC9/0/sEVreZTww/e9d/ lDOO0+RcLy45fH57d8Pb3LtliiUq4LD1rzgwxUeyxnFNoMHXNY34iGycvt1SPNgCtJ/B 1e+w== X-Gm-Message-State: AOAM533NHg6Zd2pPvC3n1aSLu6aCSAnJQG4MVY2lWxz+/Qitd7TIPTq7 OMPnB6DtITZxB976oojQ1iOLXg== X-Google-Smtp-Source: ABdhPJzn7ahPtOGX/KTR0Kc/e2td2Abo5VWVmrRWEDIeC/ylKNtmaaW0TcaryJ7Q6EPO8SaSfFQgTQ== X-Received: by 2002:ac8:4d93:: with SMTP id a19mr1928434qtw.356.1611602383884; Mon, 25 Jan 2021 11:19:43 -0800 (PST) Received: from localhost.localdomain (c-73-69-118-222.hsd1.nh.comcast.net. [73.69.118.222]) by smtp.gmail.com with ESMTPSA id s6sm9047638qtx.63.2021.01.25.11.19.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jan 2021 11:19:43 -0800 (PST) From: Pavel Tatashin To: pasha.tatashin@soleen.com, jmorris@namei.org, sashal@kernel.org, ebiederm@xmission.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, corbet@lwn.net, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, maz@kernel.org, james.morse@arm.com, vladimir.murzin@arm.com, matthias.bgg@gmail.com, linux-mm@kvack.org, mark.rutland@arm.com, steve.capper@arm.com, rfontana@redhat.com, tglx@linutronix.de, selindag@gmail.com, tyhicks@linux.microsoft.com Subject: [PATCH v10 12/18] arm64: kexec: arm64_relocate_new_kernel don't use x0 as temp Date: Mon, 25 Jan 2021 14:19:17 -0500 Message-Id: <20210125191923.1060122-13-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210125191923.1060122-1-pasha.tatashin@soleen.com> References: <20210125191923.1060122-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210125_192040_131431_F8E1195F X-CRM114-Status: GOOD ( 10.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 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 x0 will contain the only argument to arm64_relocate_new_kernel; don't use it as a temp. Reassigned registers to free-up x0 so we won't need to copy argument, and can use it at the beginning and at the end of the function. Signed-off-by: Pavel Tatashin Reviewed-by: James Morse --- arch/arm64/kernel/relocate_kernel.S | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/arm64/kernel/relocate_kernel.S b/arch/arm64/kernel/relocate_kernel.S index 462ffbc37071..b78ea5de97a4 100644 --- a/arch/arm64/kernel/relocate_kernel.S +++ b/arch/arm64/kernel/relocate_kernel.S @@ -34,7 +34,7 @@ SYM_CODE_START(arm64_relocate_new_kernel) mov x13, xzr /* x13 = copy dest */ /* Check if the new image needs relocation. */ tbnz x16, IND_DONE_BIT, .Ldone - raw_dcache_line_size x15, x0 /* x15 = dcache line size */ + raw_dcache_line_size x15, x1 /* x15 = dcache line size */ .Lloop: and x12, x16, PAGE_MASK /* x12 = addr */ @@ -43,17 +43,17 @@ SYM_CODE_START(arm64_relocate_new_kernel) tbz x16, IND_SOURCE_BIT, .Ltest_indirection /* Invalidate dest page to PoC. */ - mov x0, x13 - add x20, x0, #PAGE_SIZE + mov x2, x13 + add x20, x2, #PAGE_SIZE sub x1, x15, #1 - bic x0, x0, x1 -2: dc ivac, x0 - add x0, x0, x15 - cmp x0, x20 + bic x2, x2, x1 +2: dc ivac, x2 + add x2, x2, x15 + cmp x2, x20 b.lo 2b dsb sy - copy_page x13, x12, x0, x1, x2, x3, x4, x5, x6, x7 + copy_page x13, x12, x1, x2, x3, x4, x5, x6, x7, x8 b .Lnext .Ltest_indirection: tbz x16, IND_INDIRECTION_BIT, .Ltest_destination