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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 02610C48BF6 for ; Thu, 29 Feb 2024 07:28:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4PiEdcmv9jswwcM4KyEG9fZ7T/AcuCq+3yq3M8n/JR4=; b=e80/IGNEIrL9H1 Z6WNpcbpjQfAXxlbFI1xoTHyWM5wBM1NQ2Wte6VD+oY0qR4J8nUD+HpFM/42lFh/3gFABL/vr6SNn ZAsrkF/+UBeHXfbguHySi5d8REKP+8cyvtQx8ot/Kl5cfu3LufpInbOEiwXd7sXoxGtk9oJbbWs8F VJv5QIBfc3DVsvHfcnxD78Ko+UIGPZHQT6MMLOr1w66R9BN03LxL6qJp9sr88FHWwAS0aSm2TZjzT ry5BhgiptMsnhcSbw6C48YbgwfxtwU3IsikZz8G2UxV3+FmQjIUKlTkgxwMGW9vbkiJkJQ0jKjYgl z4B8YIkatsIwPeRVsS8w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfaqd-0000000CUaJ-2lSz; Thu, 29 Feb 2024 07:28:55 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfaqa-0000000CUZV-0Nnt for kexec@lists.infradead.org; Thu, 29 Feb 2024 07:28:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709191731; 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=WjeQ56VOGA1WFtppcigJ9UXKw4JH8chQbvOVc59Qmq8=; b=HBigwIkfWHxBjuj4WD2xWlNvmOPxNJGwg3pSlSvVYMAypNZ0NZq3qVeXKjvfLXi/Fazrzn F0SdJM1ErrQ7t2GB8uCWLaJJPCl2HFTS4tkiCMB7F+3fQ7rr7j+cucYbfoUT+tM2wwChwG lqtXw2TKv4REonyt1xtD0WI6SVMwhpw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-274-IYV0fPyPMAusx3-Xnse5iw-1; Thu, 29 Feb 2024 02:28:48 -0500 X-MC-Unique: IYV0fPyPMAusx3-Xnse5iw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C441784AC61; Thu, 29 Feb 2024 07:28:47 +0000 (UTC) Received: from localhost (unknown [10.72.116.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E7C1740C6EBA; Thu, 29 Feb 2024 07:28:45 +0000 (UTC) Date: Thu, 29 Feb 2024 15:28:42 +0800 From: Baoquan He To: Sourabh Jain Cc: linuxppc-dev@ozlabs.org, Akhil Raj , Andrew Morton , "Aneesh Kumar K . V" , Borislav Petkov , Boris Ostrovsky , Christophe Leroy , Dave Hansen , Dave Young , David Hildenbrand , Eric DeVolder , Greg Kroah-Hartman , Hari Bathini , Laurent Dufour , Mahesh Salgaonkar , Michael Ellerman , Mimi Zohar , Naveen N Rao , Oscar Salvador , Thomas Gleixner , Valentin Schneider , Vivek Goyal , kexec@lists.infradead.org, x86@kernel.org Subject: Re: [PATCH v17 2/6] crash: add a new kexec flag for hotplug support Message-ID: References: <20240226084118.16310-1-sourabhjain@linux.ibm.com> <20240226084118.16310-3-sourabhjain@linux.ibm.com> MIME-Version: 1.0 In-Reply-To: <20240226084118.16310-3-sourabhjain@linux.ibm.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240228_232852_258669_CADE1BFE X-CRM114-Status: GOOD ( 17.93 ) X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+kexec=archiver.kernel.org@lists.infradead.org On 02/26/24 at 02:11pm, Sourabh Jain wrote: ......snip... > diff --git a/kernel/crash_core.c b/kernel/crash_core.c > index 70fa8111a9d6..630c4fd7ea39 100644 > --- a/kernel/crash_core.c > +++ b/kernel/crash_core.c > @@ -496,7 +496,7 @@ static DEFINE_MUTEX(__crash_hotplug_lock); > * It reflects the kernel's ability/permission to update the crash > * elfcorehdr directly. ~~~~~~~~~ this should be updated too. > */ > -int crash_check_update_elfcorehdr(void) > +int crash_check_hotplug_support(void) > { > int rc = 0; > > @@ -508,10 +508,7 @@ int crash_check_update_elfcorehdr(void) > return 0; > } > if (kexec_crash_image) { > - if (kexec_crash_image->file_mode) > - rc = 1; > - else > - rc = kexec_crash_image->update_elfcorehdr; > + rc = kexec_crash_image->hotplug_support; > } > /* Release lock now that update complete */ > kexec_unlock(); > @@ -552,8 +549,8 @@ static void crash_handle_hotplug_event(unsigned int hp_action, unsigned int cpu, > > image = kexec_crash_image; > > - /* Check that updating elfcorehdr is permitted */ > - if (!(image->file_mode || image->update_elfcorehdr)) > + /* Check that kexec segments update is permitted */ > + if (!image->hotplug_support) > goto out; > > if (hp_action == KEXEC_CRASH_HP_ADD_CPU || > diff --git a/kernel/kexec.c b/kernel/kexec.c > index bab542fc1463..a6b3f96bb50c 100644 > --- a/kernel/kexec.c > +++ b/kernel/kexec.c > @@ -135,8 +135,8 @@ static int do_kexec_load(unsigned long entry, unsigned long nr_segments, > image->preserve_context = 1; > > #ifdef CONFIG_CRASH_HOTPLUG > - if (flags & KEXEC_UPDATE_ELFCOREHDR) > - image->update_elfcorehdr = 1; > + if ((flags & KEXEC_ON_CRASH) && arch_crash_hotplug_support(image, flags)) > + image->hotplug_support = 1; > #endif > > ret = machine_kexec_prepare(image); > diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c > index 2d1db05fbf04..3d64290d24c9 100644 > --- a/kernel/kexec_file.c > +++ b/kernel/kexec_file.c > @@ -376,6 +376,11 @@ SYSCALL_DEFINE5(kexec_file_load, int, kernel_fd, int, initrd_fd, > if (ret) > goto out; > > +#ifdef CONFIG_CRASH_HOTPLUG > + if ((flags & KEXEC_FILE_ON_CRASH) && arch_crash_hotplug_support(image, flags)) > + image->hotplug_support = 1; > +#endif > + > ret = machine_kexec_prepare(image); > if (ret) > goto out; Other than the tiny part, the overall looks good to me. Acked-by: Baoquan He _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec