From patchwork Sun Apr 23 17:08:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9694969 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8ACD260245 for ; Sun, 23 Apr 2017 17:11:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 70FD126530 for ; Sun, 23 Apr 2017 17:11:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6598E265B9; Sun, 23 Apr 2017 17:11:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03B7826530 for ; Sun, 23 Apr 2017 17:11:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163154AbdDWRLf (ORCPT ); Sun, 23 Apr 2017 13:11:35 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:38649 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162659AbdDWRKL (ORCPT ); Sun, 23 Apr 2017 13:10:11 -0400 Received: by mail-wm0-f44.google.com with SMTP id r190so50451116wme.1 for ; Sun, 23 Apr 2017 10:10:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZAkXvVoqpYywI4qvZ8hP8HLE++t6HK3x1ydkZeCkBek=; b=GQuZuqMRDogeIsRXHZolyc2AElBy6zSU2d5kiKCnEbcdLTUf+Fm13CLK0GT0QiaCba EFWeETq4sjbGRi/tIo8KcQf/jpfBdyDPCln04TTxfpYplfEx/8Zy64C7rkruE2lf5Lx5 hkWfWRKgA609qKQ6K89T5BjSxi2M2leOZ3MpM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZAkXvVoqpYywI4qvZ8hP8HLE++t6HK3x1ydkZeCkBek=; b=TlOrUyOKlVbAr4HEpttudoC6QoQU8i/AW+dLy34H/r8DlHhZfJRveC3aiE4gfF5f2p chx22w9EBF/X97xPq67fyL2o21q09nA0s3nTph4oCNlHhxQePIuwlJJla4ite3Xml6lp sPqZDTwVuPlYTAqiIUDRIPZ3rKAqAyYjpiAAo3RjSyHKWFt1FUpreQ1TRbZBv26Fgq3Q prUnrknzK8+DFYtdR+0B48XCv66NV/NxpcFLQX4okC8PKwxeOSukWbeXUMdV3Kk5/VTX IsHG7SXuv6kAorasrF3lIqbUrF4NrmIXGBVKE3pH6tCC9cQlaykYcrbIyXg3SQtkyDmX 7+Og== X-Gm-Message-State: AN3rC/6isbbFdoDYLXyBwpmqsPEM4YyL8ykNX2VmGMUd6SdR4TKuvJU1 lwRGTaTXEV3ppWqe X-Received: by 10.80.151.183 with SMTP id e52mr141971edb.61.1492967410122; Sun, 23 Apr 2017 10:10:10 -0700 (PDT) Received: from localhost.localdomain (xd93ddc2d.cust.hiper.dk. [217.61.220.45]) by smtp.gmail.com with ESMTPSA id 58sm2803521edz.2.2017.04.23.10.10.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 23 Apr 2017 10:10:09 -0700 (PDT) From: Christoffer Dall To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Cc: Marc Zyngier , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Christoffer Dall Subject: [PULL 37/79] arm64: KVM: Move lr save/restore to do_el2_call Date: Sun, 23 Apr 2017 19:08:47 +0200 Message-Id: <20170423170929.27334-38-cdall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170423170929.27334-1-cdall@linaro.org> References: <20170423170929.27334-1-cdall@linaro.org> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Marc Zyngier At the moment, we only save/restore lr if on VHE, as we rely only the EL1 code to have preserved it in the non-VHE case. As we're about to get rid of the latter, let's move the save/restore code to the do_el2_call macro, unifying both code paths. Acked-by: Catalin Marinas Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- arch/arm64/kvm/hyp.S | 3 --- arch/arm64/kvm/hyp/hyp-entry.S | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S index 2726635..f6f20b5 100644 --- a/arch/arm64/kvm/hyp.S +++ b/arch/arm64/kvm/hyp.S @@ -38,13 +38,10 @@ * A function pointer with a value less than 0xfff has a special meaning, * and is used to implement __hyp_get_vectors in the same way as in * arch/arm64/kernel/hyp_stub.S. - * HVC behaves as a 'bl' call and will clobber lr. */ ENTRY(__kvm_call_hyp) alternative_if_not ARM64_HAS_VIRT_HOST_EXTN - str lr, [sp, #-16]! hvc #0 - ldr lr, [sp], #16 ret alternative_else_nop_endif b __vhe_hyp_call diff --git a/arch/arm64/kvm/hyp/hyp-entry.S b/arch/arm64/kvm/hyp/hyp-entry.S index 5e9052f..d8ef788 100644 --- a/arch/arm64/kvm/hyp/hyp-entry.S +++ b/arch/arm64/kvm/hyp/hyp-entry.S @@ -32,17 +32,17 @@ * Shuffle the parameters before calling the function * pointed to in x0. Assumes parameters in x[1,2,3]. */ + str lr, [sp, #-16]! mov lr, x0 mov x0, x1 mov x1, x2 mov x2, x3 blr lr + ldr lr, [sp], #16 .endm ENTRY(__vhe_hyp_call) - str lr, [sp, #-16]! do_el2_call - ldr lr, [sp], #16 /* * We used to rely on having an exception return to get * an implicit isb. In the E2H case, we don't have it anymore.