From patchwork Sun Apr 23 17:09:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9695047 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 B4A8E60245 for ; Sun, 23 Apr 2017 17:13:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F56426530 for ; Sun, 23 Apr 2017 17:13:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93E84265B9; Sun, 23 Apr 2017 17:13: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 1E70326530 for ; Sun, 23 Apr 2017 17:13:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163074AbdDWRNd (ORCPT ); Sun, 23 Apr 2017 13:13:33 -0400 Received: from mail-wr0-f172.google.com ([209.85.128.172]:35952 "EHLO mail-wr0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162483AbdDWRKp (ORCPT ); Sun, 23 Apr 2017 13:10:45 -0400 Received: by mail-wr0-f172.google.com with SMTP id l50so5313693wrc.3 for ; Sun, 23 Apr 2017 10:10:45 -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=4PaLV+FAr/bxzzyX93jZCzpVlzZXE+I5zzjXvvrkAgU=; b=bXD+WPjcmJ4QGeSKuhTSiLPetbhbzNaftdLwSXk6+lKnqj8AFPHDyzJhNUiTuduJje 7ZFn05koihWFreXsC1D9J01G70HprOdGSjsxyeAIvgY3jmPxzHRB1SRaxcNy42CLDIC7 eauXvqlHG1ZT+EtUpwsG4aweG20oSCZsJ3rtg= 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=4PaLV+FAr/bxzzyX93jZCzpVlzZXE+I5zzjXvvrkAgU=; b=JbMN1zgUlXOKUsNdh/31O8CCQxqm0kgQFDaX2n3l/HttYglUXtbe/HtmlTZczQRmTu x69NPrOi+X+rm4VMlbWEceE3sG6s8slOIALDde9Rga5mYrZ1VYu5sidmLv2Dn+WgLvvz 9Ry7t7XFY90gX2Kv6d4yQaxHYgIbg1UWmc24L71kOypGzDCS9EYVRY+cIzpU23f5DR5K HU3OiAjd7uNsR6KqE4EwItKS9wxELx2iOoYw+6KSz3thPRH8xpCNT9K1j8poQLK4sThp yedNxujfETx0RzEXGZKiE/p5ruRbcQUmoOD8dezqr/yenb9UJmy2Sc0ZlS+lfppPFDjD vDFA== X-Gm-Message-State: AN3rC/70ECYwnCmRN699j52kk76KQAvehitZAcB9u8ICJeCMFFIUHkKX E9d4458Krtujpy5+ X-Received: by 10.223.133.152 with SMTP id 24mr2710493wrt.86.1492967444274; Sun, 23 Apr 2017 10:10:44 -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.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 23 Apr 2017 10:10:43 -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 68/79] ARM: hyp-stub: Zero r0 on successful stub handling Date: Sun, 23 Apr 2017 19:09:18 +0200 Message-Id: <20170423170929.27334-69-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 We now return HVC_STUB_ERR when a stub hypercall fails, but we leave whatever was in r0 on success. Zeroing it on return seems like a good idea. Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- arch/arm/kernel/hyp-stub.S | 2 ++ arch/arm/kvm/init.S | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/arm/kernel/hyp-stub.S b/arch/arm/kernel/hyp-stub.S index 918c64f..d8523cc 100644 --- a/arch/arm/kernel/hyp-stub.S +++ b/arch/arm/kernel/hyp-stub.S @@ -215,8 +215,10 @@ __hyp_stub_do_trap: beq __hyp_stub_exit ldr r0, =HVC_STUB_ERR + __ERET __hyp_stub_exit: + mov r0, #0 __ERET ENDPROC(__hyp_stub_do_trap) diff --git a/arch/arm/kvm/init.S b/arch/arm/kvm/init.S index 87bcd7a..570ed4a 100644 --- a/arch/arm/kvm/init.S +++ b/arch/arm/kvm/init.S @@ -155,8 +155,10 @@ reset: b exit 1: ldr r0, =HVC_STUB_ERR + eret exit: + mov r0, #0 eret ENDPROC(__kvm_handle_stub_hvc)