From patchwork Thu Mar 26 08:25:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 46347 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E04B021584 for ; Thu, 26 Mar 2015 08:27:44 +0000 (UTC) Received: by labow10 with SMTP id ow10sf3871675lab.1 for ; Thu, 26 Mar 2015 01:27:43 -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=FA4kiF1uNf8ig6KoZnrmSxLmfyJeCZFcObC1zC8Ht+M=; b=XmD41BiNdeofaHWeiXQV8LlnQE3jPa52KZt7jinQdpwB7C6YrWGzeNCnzRiMYq0YsL mkzUmdPAIaqUi8gLPezHHPCrThK8E0M677VUNP2zhwrCB1poJkkZEYRCVgg7blsZMzE3 zuxeDLUQReRXfHpC/wngj0q3hW28G8xW+1OHqvTo8xRfN4rG+qScctXod/5Gu8KFJVBM y2xxoo5DezNkN8BmeV9hk8MiRwPH9KnoEpqlQWcwb3u7lHAaowMM2kmrsdE8pKPAOo/q SdwKf+nV7PoQydNL+EqqFc2bS6M4S1GX98etpiGE+sceEN/FBCttSQKFO5nvaKV5x530 xbkw== X-Gm-Message-State: ALoCoQlI4sV31sInYF+Tst0HjZYnvwE1f127BYQpXeisjyMGrlAmQP06uLjzkcvrfeMptY1YtaUL X-Received: by 10.180.9.228 with SMTP id d4mr7017750wib.1.1427358463535; Thu, 26 Mar 2015 01:27:43 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.38 with SMTP id w6ls207236laa.13.gmail; Thu, 26 Mar 2015 01:27:43 -0700 (PDT) X-Received: by 10.112.143.195 with SMTP id sg3mr11643561lbb.95.1427358463229; Thu, 26 Mar 2015 01:27:43 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id wm3si3980670lbb.146.2015.03.26.01.27.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2015 01:27:43 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by labe2 with SMTP id e2so39448414lab.3 for ; Thu, 26 Mar 2015 01:27:43 -0700 (PDT) X-Received: by 10.112.201.231 with SMTP id kd7mr12426861lbc.35.1427358462984; Thu, 26 Mar 2015 01:27:42 -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.57.201 with SMTP id k9csp455599lbq; Thu, 26 Mar 2015 01:27:42 -0700 (PDT) X-Received: by 10.68.222.161 with SMTP id qn1mr24428513pbc.106.1427358461177; Thu, 26 Mar 2015 01:27:41 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dp4si7345720pdb.101.2015.03.26.01.27.38; Thu, 26 Mar 2015 01:27:41 -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 S1752322AbbCZI1d (ORCPT + 27 others); Thu, 26 Mar 2015 04:27:33 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:34492 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752277AbbCZI13 (ORCPT ); Thu, 26 Mar 2015 04:27:29 -0400 Received: by pacwe9 with SMTP id we9so56324533pac.1 for ; Thu, 26 Mar 2015 01:27:29 -0700 (PDT) X-Received: by 10.68.248.39 with SMTP id yj7mr24817782pbc.58.1427358449165; Thu, 26 Mar 2015 01:27:29 -0700 (PDT) Received: from localhost.localdomain (61-205-2-129m5.grp1.mineo.jp. [61.205.2.129]) by mx.google.com with ESMTPSA id xz1sm4722152pbb.47.2015.03.26.01.27.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Mar 2015 01:27:28 -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: [RFC v2 5/5] arm: kvm: add stub implementation for kvm_cpu_reset() Date: Thu, 26 Mar 2015 17:25:26 +0900 Message-Id: <1427358326-3708-6-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427358326-3708-1-git-send-email-takahiro.akashi@linaro.org> References: <1427358326-3708-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.215.52 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: , 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 bf0fe99..dc9543b 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