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: 9695049 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 D784860245 for ; Sun, 23 Apr 2017 17:13:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2C4E26530 for ; Sun, 23 Apr 2017 17:13:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B7434265B9; Sun, 23 Apr 2017 17:13: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 67A5D26530 for ; Sun, 23 Apr 2017 17:13:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163088AbdDWRNg (ORCPT ); Sun, 23 Apr 2017 13:13:36 -0400 Received: from mail-wr0-f169.google.com ([209.85.128.169]:35950 "EHLO mail-wr0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162478AbdDWRKo (ORCPT ); Sun, 23 Apr 2017 13:10:44 -0400 Received: by mail-wr0-f169.google.com with SMTP id l50so5313562wrc.3 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=PmDt6C7Ji+2o9UnBsHlFgDlt6zg2qxLrC0kopb9tUqZORYVkXrgsfPH2TrzpkOrDoe NEdBVrGW8iXyu4TrqUXiYAhqQ0lJ4Wn60Ei5Ejro1At2tS22btEijIVia8PJr/doAyZS NalcurN3YTo9ea79nwU5QdDOWpDx/n1XAytq4un8EO/n2MM5rrAf96bCtP0FsQhakRAn bSBGgvC7lO/FtTEJVee9JPOaZ1eRI1PYpNLfJb9cORZTIBIQyyxuIB5NXr0sKGpxCwzW +RzWEbWJyp7zCYR62JnIbn2AUVeZ5E7VFZYyPBB9WXERnc2pg3rRqBi9DKzb15rR+a18 g95Q== X-Gm-Message-State: AN3rC/7WvoMvmPJPHALFDbxdEeyTaY1WrKhkS+DWKLMXVwsimsKjul/w CIKJCu4654/+DdSP 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?= Cc: Marc Zyngier , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Christoffer Dall 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> 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 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