From patchwork Sun Apr 23 17:08:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9695007 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 C1AD160245 for ; Sun, 23 Apr 2017 17:12:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB5B820564 for ; Sun, 23 Apr 2017 17:12:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0319212BE; Sun, 23 Apr 2017 17:12:26 +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 3E7E720564 for ; Sun, 23 Apr 2017 17:12:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162782AbdDWRMX (ORCPT ); Sun, 23 Apr 2017 13:12:23 -0400 Received: from mail-wm0-f53.google.com ([74.125.82.53]:35146 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162779AbdDWRK3 (ORCPT ); Sun, 23 Apr 2017 13:10:29 -0400 Received: by mail-wm0-f53.google.com with SMTP id w64so46378002wma.0 for ; Sun, 23 Apr 2017 10:10:29 -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=2HALoMJg0UCcqHsyQCHI2FpFdlvDmfsaXm3e7+uASK8=; b=Amqkrm108lPbHkY/JNOV9ExufH2+U74Y3nDgXm74P/h5xx8p1pwOkFoD8Az+Tkgvtz 7gbFQ1Hd66M3rPKPxAuE3E64mpuapmjyfMrWZK3xOq3RWBAUaxcpPkLrsq78o3iMEfm+ xtAdgDEAdbxf7NAK6ilK9ZYRDGe9ib4cho8ZQ= 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=2HALoMJg0UCcqHsyQCHI2FpFdlvDmfsaXm3e7+uASK8=; b=G5gcRoBgAEkxfJPi5YhqGEJJkfBxqeN8A4GTDFGpr39BUaX8RKGgD3sJsHGOTFXKrf KjDCK3JpjjKGfEiUx0GTH5Hg22ukEhxtc2ZjM4SKAW/Ukoqzgwt1m3mlE9QVe+VnSfvH 4jEKKJQh3pf5hQ7fIPeIkgRuFnY8+5hh+H4jLgyOSmPFul2o1TGE4vY7NCyJVfV6KShV jgFETTrsG9KVbjl7zOZxdRoKuMJcFtuXYfWInPXg+2JZTIV13VWvh3YDwFR1sGm/Mjpp mFPL2ICZ58wdjld43USHceSEETOBz6TLQfn/Xz6hvB27UFzhKQz/QKoBNvYxNBZUT7Fn WSQA== X-Gm-Message-State: AN3rC/60B00GZYqb1HaKeZnRRmpqfN7kTAJ8Di82EyBYD2ogji0vgHo5 vAF7nRJUr+HinzEL X-Received: by 10.28.60.6 with SMTP id j6mr6466651wma.19.1492967423203; Sun, 23 Apr 2017 10:10:23 -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.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 23 Apr 2017 10:10:22 -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 49/79] ARM: KVM: Convert KVM to use HVC_GET_VECTORS Date: Sun, 23 Apr 2017 19:08:59 +0200 Message-Id: <20170423170929.27334-50-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 The conversion of the HYP stub ABI to something similar to arm64 left the KVM code broken, as it doesn't know about the new stub numbering. Let's move the various #defines to virt.h, and let KVM use HVC_GET_VECTORS. Tested-by: Keerthy Acked-by: Russell King Acked-by: Catalin Marinas Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- arch/arm/include/asm/virt.h | 8 ++++++++ arch/arm/kernel/hyp-stub.S | 4 ---- arch/arm/kvm/hyp/hyp-entry.S | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/arch/arm/include/asm/virt.h b/arch/arm/include/asm/virt.h index 6dae195..4ea16fc 100644 --- a/arch/arm/include/asm/virt.h +++ b/arch/arm/include/asm/virt.h @@ -94,6 +94,14 @@ extern char __hyp_text_start[]; extern char __hyp_text_end[]; #endif +#else + +/* Only assembly code should need those */ + +#define HVC_GET_VECTORS 0 +#define HVC_SET_VECTORS 1 +#define HVC_SOFT_RESTART 2 + #endif /* __ASSEMBLY__ */ #endif /* ! VIRT_H */ diff --git a/arch/arm/kernel/hyp-stub.S b/arch/arm/kernel/hyp-stub.S index 8291523..8301db9 100644 --- a/arch/arm/kernel/hyp-stub.S +++ b/arch/arm/kernel/hyp-stub.S @@ -22,10 +22,6 @@ #include #include -#define HVC_GET_VECTORS 0 -#define HVC_SET_VECTORS 1 -#define HVC_SOFT_RESTART 2 - #ifndef ZIMAGE /* * For the kernel proper, we need to find out the CPU boot mode long after diff --git a/arch/arm/kvm/hyp/hyp-entry.S b/arch/arm/kvm/hyp/hyp-entry.S index 96beb53..1f8db7d 100644 --- a/arch/arm/kvm/hyp/hyp-entry.S +++ b/arch/arm/kvm/hyp/hyp-entry.S @@ -127,7 +127,7 @@ hyp_hvc: pop {r0, r1, r2} /* Check for __hyp_get_vectors */ - cmp r0, #-1 + cmp r0, #HVC_GET_VECTORS mrceq p15, 4, r0, c12, c0, 0 @ get HVBAR beq 1f