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: 48144 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 926AF20553 for ; Fri, 8 May 2015 01:19:40 +0000 (UTC) Received: by wgin8 with SMTP id n8sf17331762wgi.0 for ; Thu, 07 May 2015 18:19:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=VdzyKF7pZXn6LrsPM3Jwv/qtnQ1M9XJucBUQ5G6Dxdc=; b=bRXAh+DKjQZTGfHhrEfIixmyozfdJ/Nr1GaVtdZ8KJhFko0jb98jE/OuNkFWSLe1jP Dwo+fTW9bZ6TeQmEfzhoRWLd/1H93eKINgpS71bV8GdF7FPTtaR11frH3S+LqGVorf/7 r6tP+7BzKprcZkops/95JskRh0tUfLK049kFVBDvMpN89bxpWLAyf8WqU5eHsZws0eBW Mj8GGB8b1oFxpODgDnIkXzd6uEZ3CY20adac6hCH4jCMRIndF3ahw7dSGersAxR960KP QfQ+RaIrP2o3vyA5+f0UB8FkUqUSMy8Y0rEKC4KVF+J1bSJfkm0GzbYzWq5LFK7hNXrO /xUg== X-Gm-Message-State: ALoCoQl2CRVvUvSlh6jPUyQbXp3OCB/Ijt5QatAT+fYAwhrN3lQ7fNxa0BKtBijkJlZMQZf7RFoI X-Received: by 10.180.86.226 with SMTP id s2mr259015wiz.0.1431047979874; Thu, 07 May 2015 18:19:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.5.2 with SMTP id ci2ls243900lad.17.gmail; Thu, 07 May 2015 18:19:39 -0700 (PDT) X-Received: by 10.112.125.33 with SMTP id mn1mr991459lbb.82.1431047979681; Thu, 07 May 2015 18:19:39 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id ur11si2313746lac.39.2015.05.07.18.19.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 May 2015 18:19:39 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbcga7 with SMTP id ga7so43389281lbc.1 for ; Thu, 07 May 2015 18:19:39 -0700 (PDT) X-Received: by 10.152.4.72 with SMTP id i8mr1033087lai.32.1431047979261; Thu, 07 May 2015 18:19:39 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp175175lbb; Thu, 7 May 2015 18:19:38 -0700 (PDT) X-Received: by 10.66.233.132 with SMTP id tw4mr2291722pac.80.1431047977463; Thu, 07 May 2015 18:19:37 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id py8si4929216pdb.157.2015.05.07.18.19.36; Thu, 07 May 2015 18:19:37 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752512AbbEHBT1 (ORCPT + 28 others); Thu, 7 May 2015 21:19:27 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:36589 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752463AbbEHBTY (ORCPT ); Thu, 7 May 2015 21:19:24 -0400 Received: by pabsx10 with SMTP id sx10so54899889pab.3 for ; Thu, 07 May 2015 18:19:23 -0700 (PDT) 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 Cc: christoffer.dall@linaro.org, geoff@infradead.org, broonie@kernel.org, david.griego@linaro.org, freddy77@gmail.com, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, AKASHI Takahiro 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: takahiro.akashi@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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