From patchwork Sun Apr 23 17:09:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9695103 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 19B0460245 for ; Sun, 23 Apr 2017 17:18:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0708B26530 for ; Sun, 23 Apr 2017 17:18:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE33F267EC; Sun, 23 Apr 2017 17:18:38 +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=-1.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 92C0426530 for ; Sun, 23 Apr 2017 17:18:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=b43K1OJIxVAJ+pMATT6c0zl94fGiawP5WJdqUnBBcrw=; b=gXajGwEJ0psKgyZanidmJ7bPaf qG33UMTMrwWUPLRcsf4XNqm7Kb3Kc6gERuDgPJrQagQHAzYPpa8yIluififx7iol0VX83MYBj1JYy QufF9ijMVPmG2r3FdI+sRZNRvKsT6UuHXCBl19Bq4dzR/Nbslb1/6XLbaprzBXejThXiJnWitrqmA wc9Ts/jZmUu1ZvnG/Fp2wxCmJysI11FiPBUoOmoXSGpXQyFDnPexo7sA6+FN1TiL50igrKwifYYKl F0ZdHmdpEwnrhdC6nWzT8twmeVUsxzV7kBWcqmFAQMXulZ9Gj7GpfCCZxrUI6vD6AGl8yjwadBSyt P2WjYfJw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d2L9h-0007zP-ME; Sun, 23 Apr 2017 17:18:37 +0000 Received: from mail-wr0-f171.google.com ([209.85.128.171]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d2L2P-0006ji-EO for linux-arm-kernel@lists.infradead.org; Sun, 23 Apr 2017 17:11:18 +0000 Received: by mail-wr0-f171.google.com with SMTP id z52so37737904wrc.2 for ; Sun, 23 Apr 2017 10:10:44 -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=mq9IE83IjJ5xBiwVtPinKEWLsuiYldhf+mhdOvfMJRk=; b=jBzJFJRg0Squzt0p1sQJ13Qo1gH0P4hsLLy8dYXyfDZ32PTZOjsGAHU4NYOLjIwQFI M6BZn4cOA6axc/aPfYKWWVAbSZIODoD26N1wwziK1CR+Mjlv1w7SE9BRaIOMbGZ3LrCg Rjzvy3azwXrERjeeN7uNhjNlH9xIzd+7Qxkvc= 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=mq9IE83IjJ5xBiwVtPinKEWLsuiYldhf+mhdOvfMJRk=; b=uSk1xHSzBfbxqXMLEL3bMc0tuKJOimuzxPVu49Lk0O7WsQQIZZ8mwM5x4FyhfK4d28 FlaE2Ioax0kb7I5elhwYg3xghJZC3c2J5YaKVaMeSwDL9ESNj+6EuFrXsPVDrULHk98H TRvczcLzYen+PdFSwhWVD7rNTzn9eL7WHr3QSEy9WXgGdJlybnJDid2dfjBlmfEI9EGf 0D0tAFMY2qXLTyjLaUrDH7vk5bM5863TtULkpiCjN/xkQs8A9mUeBMKRTRNWb7cGNZNl JUv4aFsT9fCmnzlIauLqUa6+8RzaQdMY8RjZHa+MWownO6eO2bdSqHmxebQDVocXO6Zi mKFQ== X-Gm-Message-State: AN3rC/7L06K32NPQWfQJ1atjsKFNKVzTXEbIKym1/rHDG9vxqlF5P/iP 82q25SDjRE/hNyeY X-Received: by 10.223.128.101 with SMTP id 92mr2684761wrk.108.1492967443245; Sun, 23 Apr 2017 10:10:43 -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.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 23 Apr 2017 10:10:42 -0700 (PDT) From: Christoffer Dall To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PULL 67/79] arm64: hyp-stub: Zero x0 on successful stub handling Date: Sun, 23 Apr 2017 19:09:17 +0200 Message-Id: <20170423170929.27334-68-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170423_101105_986121_40747E8E X-CRM114-Status: UNSURE ( 9.33 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Zyngier , Christoffer Dall , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 x0 on success. Zeroing it on return seems like a good idea. Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- arch/arm64/kernel/hyp-stub.S | 4 +++- arch/arm64/kvm/hyp-init.S | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/arm64/kernel/hyp-stub.S b/arch/arm64/kernel/hyp-stub.S index d55604d..e1261fb 100644 --- a/arch/arm64/kernel/hyp-stub.S +++ b/arch/arm64/kernel/hyp-stub.S @@ -73,8 +73,10 @@ el1_sync: /* Someone called kvm_call_hyp() against the hyp-stub... */ ldr x0, =HVC_STUB_ERR + eret -9: eret +9: mov x0, xzr + eret ENDPROC(el1_sync) .macro invalid_vector label diff --git a/arch/arm64/kvm/hyp-init.S b/arch/arm64/kvm/hyp-init.S index 3734e63..839425c 100644 --- a/arch/arm64/kvm/hyp-init.S +++ b/arch/arm64/kvm/hyp-init.S @@ -154,13 +154,13 @@ reset: /* Install stub vectors */ adr_l x5, __hyp_stub_vectors msr vbar_el2, x5 - b exit + mov x0, xzr + eret 1: /* Bad stub call */ ldr x0, =HVC_STUB_ERR - -exit: eret + ENDPROC(__kvm_handle_stub_hvc) .ltorg