From patchwork Mon Apr 3 18:37:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 9660073 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 C280460352 for ; Mon, 3 Apr 2017 18:39:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8904284F5 for ; Mon, 3 Apr 2017 18:39:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD9D128500; Mon, 3 Apr 2017 18:39:08 +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=-6.9 required=2.0 tests=BAYES_00,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 1060C284F5 for ; Mon, 3 Apr 2017 18:39:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754127AbdDCSjB (ORCPT ); Mon, 3 Apr 2017 14:39:01 -0400 Received: from foss.arm.com ([217.140.101.70]:34822 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754003AbdDCSi5 (ORCPT ); Mon, 3 Apr 2017 14:38:57 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6CE2D1991; Mon, 3 Apr 2017 11:38:57 -0700 (PDT) Received: from approximate.cambridge.arm.com (approximate.cambridge.arm.com [10.1.207.16]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D6A0B3F3E1; Mon, 3 Apr 2017 11:38:55 -0700 (PDT) From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu Cc: Russell King , Christoffer Dall , Mark Rutland , Catalin Marinas , James Morse , Ard Biesheuvel , Keerthy Subject: [PATCH v5 14/34] ARM: KVM: Convert KVM to use HVC_GET_VECTORS Date: Mon, 3 Apr 2017 19:37:47 +0100 Message-Id: <20170403183807.1620-15-marc.zyngier@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170403183807.1620-1-marc.zyngier@arm.com> References: <20170403183807.1620-1-marc.zyngier@arm.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 6dae1956c74d..4ea16fcaf2ed 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 82915231c6f8..8301db963d83 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 96beb53934c9..1f8db7d21fc5 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