Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1152345pxb; Fri, 21 Jan 2022 10:59:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZXpSyiTER1LZc0nsfYMvi3+tBbCiN7hy+SNZTjwjewglo2m9etYnIxdz6TjG5jirNClqV X-Received: by 2002:a17:902:e5c9:b0:14a:2da3:e60f with SMTP id u9-20020a170902e5c900b0014a2da3e60fmr5025970plf.100.1642791550724; Fri, 21 Jan 2022 10:59:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642791550; cv=none; d=google.com; s=arc-20160816; b=L3PUfMyfoKPLD509WrTtk488be2HAY82ugdmpkQl32EJkEQKZ/gUXdeUT6Qlt+OG3m az0JGHD1G0ZbKB1coppbphl+eYwZZ+4CcrsAGA7/Og0G2o11bgKj+ZyfojfTgGi9b3HO BrbLrZJ9JtebjdQSKKLdaipZ5HaGhdok7I2O1G2FNIKg25YG6FjnQiA7EBxIENqHvpux DYG5TtpYBqQNI9RxgjBSf9Gdk0hZqXt3HiYdh5vNfiOrtzICef7s7fHUMax8ScH3qo0I UQkSH2FOfka4u+0/CXx1iTxXDtoxLwFE/KzGDdu7y6RlA85m3/S5WoTSK6D5RnycnPpz 9hNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=6HfB/CCibhN76Cw5SwhZEDbSHmGjrJsGRZEl273e4Qw=; b=LFQF0ADIoUaFeCBkFiaQ7AZ0z3+3N3M0OtpYs8vQcRREPLObK0zZbkI5Vd74IRylPD 8gddBxPY4xTtGyAdy94XlF7FNpvPJPA7GFTNeqiR9FUag4KgR1bLgeYkulwkfcdaBHAQ KJIXnGSz3XkrQaYP38GTfYLolMK8akkBrCGKCi9o4I93ZW9o0edDxrNfl0WULY4HQOwJ gL+6SMO7LXECnBbLzUBmmSvgr/Usdrt375YDSgEkRLHaH87F6MD5TdIKEJ2MsJR2twrX UWrn9pHnTgmyZQA0jt2bdjuziz/Q92/MmbJ8lQj+HRRbwqWWTOitkSOCBmf4EqpLjmrq iexg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KnEwe1oT; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t37si7126187pgl.543.2022.01.21.10.58.58; Fri, 21 Jan 2022 10:59:10 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KnEwe1oT; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352455AbiASI13 (ORCPT + 99 others); Wed, 19 Jan 2022 03:27:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:24428 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352447AbiASI12 (ORCPT ); Wed, 19 Jan 2022 03:27:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642580847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6HfB/CCibhN76Cw5SwhZEDbSHmGjrJsGRZEl273e4Qw=; b=KnEwe1oTV3kvBNGjj/OkMWtMz1VuUQQDNy0FQGC79QWPtQDJOiyUErBmVynaWHO4oW6900 fDjFL8H1ky7oItnZ8ntPY3L5g364CvzvmA7mKRI4AJhSX2/aMbbjvBOEIPSv7m8r5ggZtc xOZTytvsR8XkcqeSEo5C1vy+UQDazDQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-375-dKLtk-rbNmGJpfr8Z28wbw-1; Wed, 19 Jan 2022 03:27:24 -0500 X-MC-Unique: dKLtk-rbNmGJpfr8Z28wbw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3060E1006AA7; Wed, 19 Jan 2022 08:27:22 +0000 (UTC) Received: from localhost (ovpn-12-206.pek2.redhat.com [10.72.12.206]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A4A0A5E4BB; Wed, 19 Jan 2022 08:26:48 +0000 (UTC) Date: Wed, 19 Jan 2022 16:26:45 +0800 From: Baoquan He To: Eric DeVolder Cc: linux-kernel@vger.kernel.org, x86@kernel.org, kexec@lists.infradead.org, ebiederm@xmission.com, dyoung@redhat.com, vgoyal@redhat.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, nramas@linux.microsoft.com, thomas.lendacky@amd.com, robh@kernel.org, efault@gmx.de, rppt@kernel.org, konrad.wilk@oracle.com, boris.ostrovsky@oracle.com Subject: Re: [PATCH v3 3/6] crash hp: definitions and prototype changes Message-ID: <20220119082645.GA6349@MiWiFi-R3L-srv> References: <20220110195727.1682-1-eric.devolder@oracle.com> <20220110195727.1682-4-eric.devolder@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220110195727.1682-4-eric.devolder@oracle.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/10/22 at 02:57pm, Eric DeVolder wrote: > This change adds members to struct kimage to facilitate crash > hotplug support. > > This change also defines crash hotplug events and associated > prototypes. > > Signed-off-by: Eric DeVolder > --- > include/linux/kexec.h | 21 +++++++++++++++++++-- > 1 file changed, 19 insertions(+), 2 deletions(-) > > diff --git a/include/linux/kexec.h b/include/linux/kexec.h > index 0c994ae37729..068f853f1c65 100644 > --- a/include/linux/kexec.h > +++ b/include/linux/kexec.h > @@ -221,8 +221,9 @@ struct crash_mem { > extern int crash_exclude_mem_range(struct crash_mem *mem, > unsigned long long mstart, > unsigned long long mend); > -extern int crash_prepare_elf64_headers(struct crash_mem *mem, int kernel_map, > - void **addr, unsigned long *sz); > +extern int crash_prepare_elf64_headers(struct kimage *image, > + struct crash_mem *mem, int kernel_map, > + void **addr, unsigned long *sz); > #endif /* CONFIG_KEXEC_FILE */ > > #ifdef CONFIG_KEXEC_ELF > @@ -299,6 +300,13 @@ struct kimage { > > /* Information for loading purgatory */ > struct purgatory_info purgatory_info; > + > +#ifdef CONFIG_CRASH_HOTPLUG > + bool hotplug_event; > + int offlinecpu; > + bool elf_index_valid; > + int elf_index; Do we really need elf_index_valid? Can we initialize elf_index to , e.g '-1', then check if the value is valid? > +#endif > #endif > > #ifdef CONFIG_IMA_KEXEC > @@ -315,6 +323,15 @@ struct kimage { > unsigned long elf_load_addr; > }; > > +#ifdef CONFIG_CRASH_HOTPLUG > +void arch_crash_hotplug_handler(struct kimage *image, > + unsigned int hp_action, unsigned long a, unsigned long b); > +#define KEXEC_CRASH_HP_REMOVE_CPU 0 > +#define KEXEC_CRASH_HP_ADD_CPU 1 > +#define KEXEC_CRASH_HP_REMOVE_MEMORY 2 > +#define KEXEC_CRASH_HP_ADD_MEMORY 3 > +#endif /* CONFIG_CRASH_HOTPLUG */ > + > /* kexec interface functions */ > extern void machine_kexec(struct kimage *image); > extern int machine_kexec_prepare(struct kimage *image); > -- > 2.27.0 >