Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp491570imm; Fri, 27 Jul 2018 00:23:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcdV6BCAM6zbN9buisC1Tiv8EwaeZarRdC+FfFrxZlkkMOwz5QNqGo/Ln3h26zblKJN/nuv X-Received: by 2002:a63:4c56:: with SMTP id m22-v6mr4833723pgl.299.1532676201929; Fri, 27 Jul 2018 00:23:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532676201; cv=none; d=google.com; s=arc-20160816; b=p6dbUI2jkDmiFI0a7AYM4O0fM/JkZChDQ0iqyudOuGoYkY3syDPeuNKHHLcZK/uphG ie7e/LSRVqQulBvsxbOAdrahleeSsKPI3x8/Nvm5phXE555WDOeLvbWs4yplyM9X/F83 NdvIsk+L3ywtWod3VpImK+UL0IEXkcX0OmprlwiMuEfj7Q+SuODEdeHb3BtSAoZ9/6zY Fbyy+TffO5NgribD97i6W9+WbAQT794buXHQ5CwTukJb5gYGFn60COoEpvOzyTM4+PgX ErY5wltnc/UBxNPTPw4lPJqqxWJb2eCftXFUtyosed45IC3JWs1ENxeZdFVW+BkBt6PO tVow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=NvqMEOX3abAY6bbS1k6sfnl8oyIOMEcePeAC8eVeMIk=; b=LMu+M2hH37NE7qV8Wkr/yM1dD3XsHu7vSS1FfzVNlE3WUUeNDVIKCblDbzaj01abvF 9ZlPc3vAV/DtGC4qNJUEE6hpGNbhBIaxjcY6ikvB970zMb4PTPRDxFgZl+Eh9U/JCpbi UYd2dACq4x4YJqO4WmFWVzRtNqeuWTnWKxaTX7EDbKwUX2WlO6i0KmsS/ZLLv/t2ge4g daZ/E1WB2RcKlYOLvZJoOJHj5oK5jNryKfX4nVu47Z9tAv8p+ZPZJPq0m+Dbv8OLs+Bd 6vAPqbGpBS571jRwRP4Vp9B5BrF9UfGOqUxuzZ/1IAFitOjyf8yikhBqlpMzNlWwvZOu BzoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dAoTVqnN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u123-v6si3271483pgb.414.2018.07.27.00.23.04; Fri, 27 Jul 2018 00:23:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dAoTVqnN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729545AbeG0Iln (ORCPT + 99 others); Fri, 27 Jul 2018 04:41:43 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:47003 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726044AbeG0Iln (ORCPT ); Fri, 27 Jul 2018 04:41:43 -0400 Received: by mail-pg1-f193.google.com with SMTP id p23-v6so2701157pgv.13 for ; Fri, 27 Jul 2018 00:21:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=NvqMEOX3abAY6bbS1k6sfnl8oyIOMEcePeAC8eVeMIk=; b=dAoTVqnN5Aedyv7u2CgMcnTFRL4wPxjRhUza6v1sTClYg0j0xxMU04gzqD888p6yfd NtcE2nUTE7ANH5lftvfwfYO1lDuTii0ELKWeJPYj2lSTv3BSFPuehMCamyaDfliCYutS zbPCIkm1gPiJPcPTIsepRfP4uIxWL4mzPFTAU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=NvqMEOX3abAY6bbS1k6sfnl8oyIOMEcePeAC8eVeMIk=; b=fU/trnCI0sfLlIxnYWfg72kZ02dvMj4rNXlhmeGtb7fqvwaGE3FhvO+oCa+Geut1vP xCRTQz5T8TxplQ8z1d+bJuXXy6QO1xi0TQloUThirKdjYT5W3OLAbMLYRBx28f7lZycX IrJ6uRmxBh8UI+nv1IwEucUjjGYXC4EFg2ql67TtIKTk3SxA79FCV+rwmzkvzhhZgy+6 gStAW28t9zkyY4u76IwHoNhVeTccaR2LV0ROyOz5SsLOi+hxprIbhQNGYECFk9wqUQoM GoFLyDR0M4isMEnFPIbvGvF1hFHjKiDjcwAEke7EZl+xH1J/O6D36h8twXWtGwhxYlEK 1Dbg== X-Gm-Message-State: AOUpUlHg5k3grF1kDag1m4B9u6i8G/fi0r6v/5L2AD1i0H4YD0un0BQu TA6UpSbtgP+CRvv3SPiZcdtENQ== X-Received: by 2002:a62:ca0d:: with SMTP id n13-v6mr5385806pfg.69.1532676069704; Fri, 27 Jul 2018 00:21:09 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id s85-v6sm6283328pfa.116.2018.07.27.00.21.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jul 2018 00:21:09 -0700 (PDT) Date: Fri, 27 Jul 2018 16:22:43 +0900 From: AKASHI Takahiro To: James Morse Cc: catalin.marinas@arm.com, will.deacon@arm.com, dhowells@redhat.com, vgoyal@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, dyoung@redhat.com, bhe@redhat.com, arnd@arndb.de, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, ard.biesheuvel@linaro.org, bhsharma@redhat.com, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v12 13/16] arm64: kexec_file: invoke the kernel without purgatory Message-ID: <20180727072242.GH11258@linaro.org> Mail-Followup-To: AKASHI Takahiro , James Morse , catalin.marinas@arm.com, will.deacon@arm.com, dhowells@redhat.com, vgoyal@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, dyoung@redhat.com, bhe@redhat.com, arnd@arndb.de, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, ard.biesheuvel@linaro.org, bhsharma@redhat.com, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20180724065759.19186-1-takahiro.akashi@linaro.org> <20180724065759.19186-14-takahiro.akashi@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 26, 2018 at 02:36:07PM +0100, James Morse wrote: > Hi Akashi, > > On 24/07/18 07:57, AKASHI Takahiro wrote: > > On arm64, purgatory would do almost nothing. So just invoke secondary > > kernel directly by jumping into its entry code. > > > > While, in this case, cpu_soft_restart() must be called with dtb address > > in the fifth argument, the behavior still stays compatible with kexec_load > > case as long as the argument is null. > > This patch conflicts with commit 76f4e2da45b4 ("arm64: kexec: always reset to > EL2 if present") in the arm64 tree. I haven't noticed Mark's patch. I'm going to have to refresh my memory regarding why I introduced el2_switch when I implemented kdump. According to my current memory, however, I added kvm_arch_hardware_enable/disable(), and associated functions, to gracefully shutdown EL2 in case of kexec. Since we have no chance to call reset function (via notifier) at kdump, I believed that el2_switch was necessary for better chance of successful kdump. Thanks, -Takahiro AKASHI > Thanks, > > James > > > diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c > > index f76ea92dff91..830a5063e09d 100644 > > --- a/arch/arm64/kernel/machine_kexec.c > > +++ b/arch/arm64/kernel/machine_kexec.c > > @@ -205,10 +205,18 @@ void machine_kexec(struct kimage *kimage) > > * uses physical addressing to relocate the new image to its final > > * position and transfers control to the image entry point when the > > * relocation is complete. > > + * In kexec case, kimage->start points to purgatory assuming that > > + * kernel entry and dtb address are embedded in purgatory by > > + * userspace (kexec-tools). > > + * In kexec_file case, the kernel starts directly without purgatory. > > */ > > - > > cpu_soft_restart(kimage != kexec_crash_image, > > - reboot_code_buffer_phys, kimage->head, kimage->start, 0); > > + reboot_code_buffer_phys, kimage->head, kimage->start, > > +#ifdef CONFIG_KEXEC_FILE > > + kimage->arch.dtb_mem); > > +#else > > + 0); > > +#endif > > > > BUG(); /* Should never get here. */ > > }