From patchwork Tue Mar 21 19:20:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 9637439 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 58300601E9 for ; Tue, 21 Mar 2017 19:26:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4835F27D29 for ; Tue, 21 Mar 2017 19:26:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3CE5928415; Tue, 21 Mar 2017 19:26:48 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham 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 BF9CA27D29 for ; Tue, 21 Mar 2017 19:26:47 +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=64LhJdw/icDdo7uOJ5TfFHhv0UoJsj4hhRq09wP4ta4=; b=S5ejRqWyYrWtTQa8ZiYTh2MEFj 29l2XQWJk81ry9r8AuJUGtBFQJOytLMb+vjeT+2Rkzwh3I1ObatiOPOxbki+WGtXWokZ7csx6VZHT J0qjUm6v6/CnIXg1fZUM6ybBJGFBC+vMrHwz67UAQRGxPd/m1UYki/vcJE31NmKNpItVA604NaveL WzA0xTmQGPoKdsHAS1bMq2XY0HeOKRHM9DfzBKJsQh34CbC/LpxFD1dlBwYvIg6yS7FI+w7a0EpUR G7sl3q1vkCU71d2JNhbGVo9Ge+yeHWchylQsLOPnRgBj1MyG4/QwrJN7vMZoLZbyLyv/g5rIhN21R t97AGg4Q==; 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 1cqPQa-0000Lm-Cg; Tue, 21 Mar 2017 19:26:44 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cqPMu-0003vx-VI for linux-arm-kernel@bombadil.infradead.org; Tue, 21 Mar 2017 19:22:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zWiQbJb+utQU8WWbPMmAJn19dZ6v6ZfQJa9eYhasvJM=; b=2CCVtVS1/PL7XmC91VqFeDwyV vLJlZEsrSsZ6MWs9w2PFE3zw3ZzBA6R5c5Oj4LQVTrINg6lwTbRwT0N0tZ6F40Ho/xFw8zxt+18pS KwzXFTGuDHHRDKpZfB7PgDFHfTXk1OAnnL3vj1/BioCulHSPawKT+Ne4vsVJ45rXL8SsBfkVhDUbH K7EpfYuPQS/2Z7xoi4UYyKJ77pqwHiGkkm4wB1BI1rtljs2f+Zk8Qf/67RgeDzRuOJbqHztMEqNIB pqovZUKmqaSulvZCtTC8CtT/3uA1bzoB+SZvPAqjTb5pnXwUfkbu8WVhH5VucC8R6wjtbp6lFMTsX ON3uQYlVA==; Received: from foss.arm.com ([217.140.101.70]) by merlin.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cqPMq-0005O0-TE for linux-arm-kernel@lists.infradead.org; Tue, 21 Mar 2017 19:22:54 +0000 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 AD5F419CC; Tue, 21 Mar 2017 12:22:26 -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 24E863F2E5; Tue, 21 Mar 2017 12:22:25 -0700 (PDT) From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu Subject: [PATCH v4 20/28] ARM: KVM: Convert __cpu_reset_hyp_mode to using __hyp_reset_vectors Date: Tue, 21 Mar 2017 19:20:50 +0000 Message-Id: <20170321192058.9300-21-marc.zyngier@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170321192058.9300-1-marc.zyngier@arm.com> References: <20170321192058.9300-1-marc.zyngier@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170321_152253_078055_5C4E3D42 X-CRM114-Status: UNSURE ( 9.35 ) 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: Mark Rutland , Russell King , Ard Biesheuvel , Catalin Marinas , James Morse , Keerthy , Christoffer Dall 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 We are now able to use the hyp stub to reset HYP mode. Time to kiss __kvm_hyp_reset goodbye, and use __hyp_reset_vectors. Tested-by: Keerthy Acked-by: Russell King Signed-off-by: Marc Zyngier --- arch/arm/include/asm/kvm_asm.h | 2 -- arch/arm/include/asm/kvm_host.h | 2 +- arch/arm/kvm/init.S | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/arm/include/asm/kvm_asm.h b/arch/arm/include/asm/kvm_asm.h index 8ef05381984b..7ccb6f1aac5b 100644 --- a/arch/arm/include/asm/kvm_asm.h +++ b/arch/arm/include/asm/kvm_asm.h @@ -72,8 +72,6 @@ extern int __kvm_vcpu_run(struct kvm_vcpu *vcpu); extern void __init_stage2_translation(void); -extern void __kvm_hyp_reset(unsigned long); - extern u64 __vgic_v3_get_ich_vtr_el2(void); extern void __vgic_v3_init_lrs(void); #endif diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h index 31ee468ce667..adea30753185 100644 --- a/arch/arm/include/asm/kvm_host.h +++ b/arch/arm/include/asm/kvm_host.h @@ -273,7 +273,7 @@ static inline void __cpu_init_stage2(void) static inline void __cpu_reset_hyp_mode(unsigned long vector_ptr, phys_addr_t phys_idmap_start) { - kvm_call_hyp((void *)virt_to_idmap(__kvm_hyp_reset), vector_ptr); + __hyp_reset_vectors(); } static inline int kvm_arch_dev_ioctl_check_extension(struct kvm *kvm, long ext) diff --git a/arch/arm/kvm/init.S b/arch/arm/kvm/init.S index 0da120b71c2e..7335a510eee4 100644 --- a/arch/arm/kvm/init.S +++ b/arch/arm/kvm/init.S @@ -129,7 +129,6 @@ ENTRY(__kvm_handle_stub_hvc) 1: cmp r0, #HVC_RESET_VECTORS bne 1f -ENTRY(__kvm_hyp_reset) /* We're now in idmap, disable MMU */ mrc p15, 4, r1, c1, c0, 0 @ HSCTLR ldr r0, =(HSCTLR_M | HSCTLR_A | HSCTLR_C | HSCTLR_I) @@ -151,7 +150,6 @@ ENTRY(__kvm_hyp_reset) exit: eret ENDPROC(__kvm_handle_stub_hvc) -ENDPROC(__kvm_hyp_reset) .ltorg