From patchwork Fri May 8 01:18:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 6362041 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D98B5BEEE1 for ; Fri, 8 May 2015 01:22:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 085502039C for ; Fri, 8 May 2015 01:22:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 20BD620340 for ; Fri, 8 May 2015 01:22:37 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YqWxu-0000w8-MZ; Fri, 08 May 2015 01:20:34 +0000 Received: from mail-pa0-f42.google.com ([209.85.220.42]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YqWx6-0007i4-SB for linux-arm-kernel@lists.infradead.org; Fri, 08 May 2015 01:19:46 +0000 Received: by pacwv17 with SMTP id wv17so54967239pac.0 for ; Thu, 07 May 2015 18:19:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fxhOumnpoZU0ZH7OfbgUDPIscbmgFm31GXz4jCLnz/8=; b=ir9MI+wewgKepiej8VsqbS7BesKhWFrGlwavS3OVv0b2vLpTjpQCWFZEKf/D6FnQOr hmfrBN2ddJhyjC7VsT05i/MzOwo5zM6mepCtVQ523qVs6sCIhzo+M0r2NdILbuTH1EwU L2V4TNhp4A6uyodu90fZsR40RVbx6ob6llb8i0FhGO6SReupzD8UEPjC1OVA5c57BNQT 86HqfiR8A4wHuZQd7TwlDq9NMMv+e5GwGNXCyasFSig37fPBtCCa99SccGM80hFK/Fjo 81fESyerRO0IlYALj8Sphour3SfmlGreIns3A9RuzThtb0e1UhwmNwIF8FMQzLYxBVkr 7KrA== X-Gm-Message-State: ALoCoQmJu8mshmFmw4UFCLsLLuk7a4NZZ5iq3sxR/rNIH3t16ZmE9f14aecgaCsPJO9jsH5RqRMJ X-Received: by 10.66.66.166 with SMTP id g6mr2369601pat.88.1431047963694; Thu, 07 May 2015 18:19:23 -0700 (PDT) Received: from localhost.localdomain (61-205-5-101m5.grp1.mineo.jp. [61.205.5.101]) by mx.google.com with ESMTPSA id z10sm3353675pas.18.2015.05.07.18.19.17 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 May 2015 18:19:22 -0700 (PDT) From: AKASHI Takahiro To: catalin.marinas@arm.com, will.deacon@arm.com, marc.zyngier@arm.com, mark.rutland@arm.com Subject: [v4 4/4] arm: kvm: add stub implementation for kvm_cpu_reset() Date: Fri, 8 May 2015 10:18:04 +0900 Message-Id: <1431047884-5637-5-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431047884-5637-1-git-send-email-takahiro.akashi@linaro.org> References: <1431047884-5637-1-git-send-email-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150507_181944_965521_8798A358 X-CRM114-Status: GOOD ( 11.48 ) X-Spam-Score: -0.7 (/) Cc: linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, geoff@infradead.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, AKASHI Takahiro , broonie@kernel.org, david.griego@linaro.org, christoffer.dall@linaro.org, freddy77@gmail.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Just to avoid compiling errors on arm. Signed-off-by: AKASHI Takahiro --- arch/arm/include/asm/kvm_asm.h | 1 + arch/arm/include/asm/kvm_host.h | 12 ++++++++++++ arch/arm/include/asm/kvm_mmu.h | 5 +++++ arch/arm/kvm/init.S | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/arch/arm/include/asm/kvm_asm.h b/arch/arm/include/asm/kvm_asm.h index 25410b2..462babf 100644 --- a/arch/arm/include/asm/kvm_asm.h +++ b/arch/arm/include/asm/kvm_asm.h @@ -85,6 +85,7 @@ struct kvm_vcpu; extern char __kvm_hyp_init[]; extern char __kvm_hyp_init_end[]; +extern char __kvm_hyp_reset[]; extern char __kvm_hyp_exit[]; extern char __kvm_hyp_exit_end[]; diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h index ca97764..6d38134 100644 --- a/arch/arm/include/asm/kvm_host.h +++ b/arch/arm/include/asm/kvm_host.h @@ -220,6 +220,18 @@ static inline void __cpu_init_hyp_mode(phys_addr_t boot_pgd_ptr, kvm_call_hyp((void*)hyp_stack_ptr, vector_ptr, pgd_ptr); } +static inline void __cpu_reset_hyp_mode(phys_addr_t boot_pgd_ptr, + phys_addr_t phys_idmap_start, + unsigned long stub_vector_ptr, + unsigned long reset_func) +{ + /* + * TODO + * kvm_call_reset(boot_pgd_ptr, phys_idmap_start, stub_vector_ptr, + * reset_func); + */ +} + static inline int kvm_arch_dev_ioctl_check_extension(long ext) { return 0; diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h index 37ca2a4..d85bcd1 100644 --- a/arch/arm/include/asm/kvm_mmu.h +++ b/arch/arm/include/asm/kvm_mmu.h @@ -66,6 +66,7 @@ void kvm_mmu_free_memory_caches(struct kvm_vcpu *vcpu); phys_addr_t kvm_mmu_get_httbr(void); phys_addr_t kvm_mmu_get_boot_httbr(void); phys_addr_t kvm_get_idmap_vector(void); +phys_addr_t kvm_get_idmap_start(void); int kvm_mmu_init(void); void kvm_clear_hyp_idmap(void); @@ -270,6 +271,10 @@ static inline void __kvm_flush_dcache_pud(pud_t pud) void kvm_set_way_flush(struct kvm_vcpu *vcpu); void kvm_toggle_cache(struct kvm_vcpu *vcpu, bool was_enabled); +extern char __hyp_idmap_text_start[]; +#define kvm_virt_to_trampoline(x) \ + (TRAMPOLINE_VA + ((x) - __hyp_idmap_text_start)) + #endif /* !__ASSEMBLY__ */ #endif /* __ARM_KVM_MMU_H__ */ diff --git a/arch/arm/kvm/init.S b/arch/arm/kvm/init.S index 3988e72..9178c9a 100644 --- a/arch/arm/kvm/init.S +++ b/arch/arm/kvm/init.S @@ -156,4 +156,10 @@ target: @ We're now in the trampoline code, switch page tables .globl __kvm_hyp_init_end __kvm_hyp_init_end: + .globl __kvm_hyp_reset +__kvm_hyp_reset: + @ TODO + + eret + .popsection