From patchwork Sun Apr 23 17:08:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9694967 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 38EED60245 for ; Sun, 23 Apr 2017 17:11:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21E4526530 for ; Sun, 23 Apr 2017 17:11:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16F10265B9; Sun, 23 Apr 2017 17:11:35 +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 9C58026530 for ; Sun, 23 Apr 2017 17:11:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163137AbdDWRLc (ORCPT ); Sun, 23 Apr 2017 13:11:32 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:35110 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162649AbdDWRKK (ORCPT ); Sun, 23 Apr 2017 13:10:10 -0400 Received: by mail-wm0-f47.google.com with SMTP id w64so46376131wma.0 for ; Sun, 23 Apr 2017 10:10:09 -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=QAhxeWM+fdcBS5VE+cXQ3JHFerXEXw+iCh409sT5VWU=; b=NagxhBBFbK01tIGAFAxWvozs+XBj8g132Al5RyD++dFN3hOwbnuJYECF/szlMM3prZ 177faycKpUzHEVwNKy09qi23F+0kCr2l3c2B6eIp8l7XOdD3LuI9nuC+EzpYvJR9CGrP OBL9Rv+QvRwSrOuTK/6ki+xd6CJ/JM3rJPy+w= 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=QAhxeWM+fdcBS5VE+cXQ3JHFerXEXw+iCh409sT5VWU=; b=IdvVGuYDVhaas7eIS6d7QbgH+XuyGd4pZXsgZjSbC3Bkkw//WlVqa30ztiUHjrzBOY YMLxRYz1ChIYWLCJhTQpwpyizAfPN20LG2xPpt49H6OFFYSK5la05mXBPR0YDgC6WdSc oi4pSSce7rN1Cd1hdLWEeGYAHpBB7DLGSzdg8csXscMK9FXPQLrJ+UQ2BvxAedX8Ndh9 fysz2QkSFtlwkXc2JyBWiDvpp3Ywv+r7wwGwMUmtpta8BnuZnDe55fLIR10Lm753d8RV enDt0CQdAHmGj6Iohgxj9esgTuRJziYfYKokITAUABb3QLc7qVNBPC/aCUqxRkMtpirz 94rg== X-Gm-Message-State: AN3rC/6zomHb6g36WsYTqIxfI6qVOhIL74alBSckGMtndkONXbHaqmre E2x1+CfgdUQYWydy X-Received: by 10.80.143.193 with SMTP id y59mr137920edy.132.1492967409016; Sun, 23 Apr 2017 10:10:09 -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.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 23 Apr 2017 10:10:08 -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 36/79] arm64: hyp-stub: Stop pointlessly clobbering lr Date: Sun, 23 Apr 2017 19:08:46 +0200 Message-Id: <20170423170929.27334-37-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 When entering the kernel hyp stub, we check whether or not we've made it here through an HVC instruction, clobbering lr (aka x30) in the process. This is completely pointless, as HVC is the only way to get here (all traps to EL2 are disabled, no interrupt override is applied). So let's remove this bit of code whose only point is to corrupt a valuable register. Acked-by: Catalin Marinas Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- arch/arm64/kernel/hyp-stub.S | 6 ------ 1 file changed, 6 deletions(-) diff --git a/arch/arm64/kernel/hyp-stub.S b/arch/arm64/kernel/hyp-stub.S index d3b5f75..e4215ad 100644 --- a/arch/arm64/kernel/hyp-stub.S +++ b/arch/arm64/kernel/hyp-stub.S @@ -55,12 +55,6 @@ ENDPROC(__hyp_stub_vectors) .align 11 el1_sync: - mrs x30, esr_el2 - lsr x30, x30, #ESR_ELx_EC_SHIFT - - cmp x30, #ESR_ELx_EC_HVC64 - b.ne 9f // Not an HVC trap - cmp x0, #HVC_GET_VECTORS b.ne 1f mrs x0, vbar_el2