From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FE98C38A2A for ; Thu, 7 May 2020 16:22:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3A48E2053B for ; Thu, 7 May 2020 16:22:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727798AbgEGQWJ (ORCPT ); Thu, 7 May 2020 12:22:09 -0400 Received: from foss.arm.com ([217.140.110.172]:34980 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726308AbgEGQWI (ORCPT ); Thu, 7 May 2020 12:22:08 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 393D61FB; Thu, 7 May 2020 09:22:08 -0700 (PDT) Received: from [192.168.0.14] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0949C3F71F; Thu, 7 May 2020 09:22:04 -0700 (PDT) Subject: Re: [PATCH v9 15/18] arm64: kexec: kexec EL2 vectors To: Pavel Tatashin References: <20200326032420.27220-1-pasha.tatashin@soleen.com> <20200326032420.27220-16-pasha.tatashin@soleen.com> From: James Morse Cc: jmorris@namei.org, sashal@kernel.org, ebiederm@xmission.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, corbet@lwn.net, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, maz@kernel.org, vladimir.murzin@arm.com, matthias.bgg@gmail.com, bhsharma@redhat.com, linux-mm@kvack.org, mark.rutland@arm.com, steve.capper@arm.com, rfontana@redhat.com, tglx@linutronix.de, selindag@gmail.com Message-ID: Date: Thu, 7 May 2020 17:21:59 +0100 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20200326032420.27220-16-pasha.tatashin@soleen.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Pavel, What happened to the subject? (it really needs a verb to make any sense) On 26/03/2020 03:24, Pavel Tatashin wrote: > If we have a EL2 mode without VHE, the EL2 vectors are needed in order > to switch to EL2 and jump to new world with hyperivsor privileges. Yes, but the hyp-stub has an API to let you do this... but you need your own version. Could you explain why in the commit message? (spelling: hyperivsor) > diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c > index ab571fca9bd1..bd398def7627 100644 > --- a/arch/arm64/kernel/machine_kexec.c > +++ b/arch/arm64/kernel/machine_kexec.c > @@ -84,6 +84,11 @@ int machine_kexec_post_load(struct kimage *kimage) > kern_reloc_arg->head = kimage->head; > kern_reloc_arg->entry_addr = kimage->start; > kern_reloc_arg->kern_arg0 = kimage->arch.dtb_mem; > + /* Setup vector table only when EL2 is available, but no VHE */ > + if (is_hyp_mode_available() && !is_kernel_in_hyp_mode()) { > + kern_reloc_arg->el2_vector = __pa(reloc_code) > + + kexec_el2_vectors_offset; > + } Why does the asm relocation code need to know where the vector is? It must access it via HVC. Thanks, James