Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp868546ybj; Thu, 7 May 2020 09:24:22 -0700 (PDT) X-Google-Smtp-Source: APiQypJgth8tHSVicGp5fQbAlKD+/BDnQlM+P3zSCypfpVwHpsBg/a2Osl3zg18dOG35lUc9nGoK X-Received: by 2002:a50:d79d:: with SMTP id w29mr12170793edi.187.1588868661921; Thu, 07 May 2020 09:24:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588868661; cv=none; d=google.com; s=arc-20160816; b=ZDE6045zNzJHUsC61ngKzqi0xdPMaaRr+1ZQhpI9sJDoCqbJdL5Y2z7D43io/8D0uR HJSojpL8fPbM+8mRbLXRj2D5zy/rLy/N7mW4zK+aQf0ZZlq0yobFrpnrXWFv0P5cNWfj 7oKXeC9LQODOdc8ZbNoqAP6oOPFBHaeaS86h/VgjuEVhufH087QVwIpwm2piO1j9IdNn ryhAROeosNbevXhBaBD/DVds7ujFAWxj62wFMWuRUNYXctOmbNzvlcdkZxDUqTwO27hg wvh9q7YoD227uq5uDadFjFecwZqMHDaaLkALycgeKLuUQDUdCIV1hx6/ASWpYB1pU2AA ilkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:cc:from:references:to:subject; bh=2yTFaFoavwK66ZRcuzCy3h416LWTe83rWGBM4DeMFxA=; b=Cx/1xhI3X3Ect8RTnE434uMxBSlIa5Y2MQrWcjx4TMJ/WfttBgK5RcEfcgsNh8aXmd Eor2Fzpi3H0vBFQNUEU8v3pJh1glVyRMX0f0iYOEOoEykidpbR72NDCCSr+QFW+D084Q VeU6/UwLxtf2+/F0WZbScEHUHAwq/roDxsTNoKrX/GJeMSaI/oUJ85QDbrY1F7slo7lw Zsk6S2C7cGC8GrnfAA903qpyS+8E5408diURSVdEJXzoarM+qCTL9UkDkatx1xFz8zFP XOTNx2qQxYX1HH0sYa63U+0UmMEOn5kGm6VpvSenTo4rrGcINBk3/70GsO/dk4xxEm3m RpmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v16si3495183eda.515.2020.05.07.09.23.57; Thu, 07 May 2020 09:24:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727086AbgEGQWJ (ORCPT + 99 others); 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