Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1151124pxb; Fri, 21 Jan 2022 10:57:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJzjHI7fdurfJHwBTeZhzCInCnLxdHPcReJn4gAMUZKGWSDP4FUHJpZr1j1OwyUSdZ/kWB7R X-Received: by 2002:a63:1d1:: with SMTP id 200mr3898638pgb.290.1642791432765; Fri, 21 Jan 2022 10:57:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642791432; cv=none; d=google.com; s=arc-20160816; b=twyWK1ZTODnc05lxRmhYu/Rf4dQjjKKwk4bcHy6Sj9w6VMWBMKWQeblofE+YtXMJar cE/QhrTSmuXafldDGmSg2C27Gsx6ZzaE3yEcZEiZOGtLj291k3sGZBwz51WFVXnGcahW n51t9wkyi6jNLOl7CyicfpRcCNC7i5fxjfWqYG+UNDrU94Om0F6ddPNJ7MR/kFknChLX 1GCpv6ulUZS2HunOfFB6ZYB9dA7CbzJBYvdbiLA3ZQ9Vh4zH9vDaP+ipmyN/Se8LtCPq qzN80fWUZO1cMu50xoYItJ7VTkKUrrPXu6HL5egOOBwiTZmuhEK6DVo61OcsXlhmGf2u I5dw== 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=iKUiNgUusNJV8EMUHx8TbC8tPQnDy1EG1e5Lk1edtDk=; b=lAG37yR9ZF/mGdlt3xhcAr9sU8nzIQwh9ICiNK1Bq4bGpupYj59OvLrtbbjaJspZHV oBiXNPCsctIv90sto08dRta3WTZ9HUZQSJjOCKNr387iSo+zgGN/o80uZxRbPZSLo/rg tTOd3aoz8z2xCBJQO5yUNgNNTcVXHaBFs4G6zIN/iW9wbG2FUA5oWUtoqqraheRQ2VE2 tn9KF2GFTQtFBdU68ZXBilnwCq+Op2KtY0xkUibJXI+p41JEnn7RoKkB6fM9b4c1zmPc VfR56fUVrIrI9MrO30cszcziodgaT5WYm4bCHuO/4PaCqHwBPEK5HkeWCKf5G2bcpu79 imqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DojoDmEJ; 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 g70si7469455pgc.514.2022.01.21.10.57.00; Fri, 21 Jan 2022 10:57:12 -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=DojoDmEJ; 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 S1348195AbiASIXd (ORCPT + 99 others); Wed, 19 Jan 2022 03:23:33 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:57048 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238265AbiASIXc (ORCPT ); Wed, 19 Jan 2022 03:23:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642580612; 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=iKUiNgUusNJV8EMUHx8TbC8tPQnDy1EG1e5Lk1edtDk=; b=DojoDmEJUg8ubkiCUIf63CyIhvb13YoFjoktipJWdJzVNlTpHnZfqBY08V5dBKZgdE4l6f vPQuNl/y89C2KI3G2ibu6nJn+M2yQcSLfyTgGHxRs1E3/sXRfYJbcpunY3ouwzIcJdE3+Y NSMW/DHUy4eQVPx2jiaDveT+s4OYdMQ= 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-669-5SoPtEwOPzOoT5vaw6AZbw-1; Wed, 19 Jan 2022 03:23:26 -0500 X-MC-Unique: 5SoPtEwOPzOoT5vaw6AZbw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8DB84100C620; Wed, 19 Jan 2022 08:23:24 +0000 (UTC) Received: from localhost (ovpn-12-206.pek2.redhat.com [10.72.12.206]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3BD74108B0; Wed, 19 Jan 2022 08:23:08 +0000 (UTC) Date: Wed, 19 Jan 2022 16:23:06 +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: [RFC v2 3/6] crash hp: definitions and prototype changes Message-ID: <20220119082306.GA5158@MiWiFi-R3L-srv> References: <20211207195204.1582-1-eric.devolder@oracle.com> <20211207195204.1582-4-eric.devolder@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211207195204.1582-4-eric.devolder@oracle.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/07/21 at 02:52pm, 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 >