Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3801395rdb; Thu, 14 Sep 2023 03:08:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFtbcDALOK4tmo/0XYKGDrbpTKFp2olkvDAnlMfc+DnDni5FyHBedWt4b+OiBx56zVWw5vS X-Received: by 2002:a05:6358:8a3:b0:135:499a:382b with SMTP id m35-20020a05635808a300b00135499a382bmr6925075rwj.7.1694686137100; Thu, 14 Sep 2023 03:08:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694686137; cv=none; d=google.com; s=arc-20160816; b=EswkVCcSNMBr06c2z+fifjCylQufiBdg2tw5dKVJEv+clfjB6Iy+D4ck8iXZ99rYnu ngADCdgeWhd1rUHLJbub4nF4G6aLRuw1bYnDWJx2478w2BSYqk0UQY0u9aIqAkEnoXuV nBEpw4LoksI4gLKW8FhuNNgrJezD8cPEHuKgnT5ydHx7oEmJMgDh/d3zYihPPGewi0yk bozdx4hRN99zulT8LmT/CR8t7gxiDSvNYqxgEwa4q68sv7dpc5bEglpndcDJXTFEm3w0 7vDDkoOw5Lvm8aNuh+UaWdQJL1CuIXZp9yE4P6fjLu3Ekb0ptqwGaxGqtgkkrl0VPoJf EVTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=gXhGZ4r4I1glj6Lql+/mnOOXVMF05GnccbGV18evrsY=; fh=e9JvlmcAGZRuR/BfURkfe+hznuhRXehHid83aBVrjbU=; b=LpkqkwiwXpn8Dg+qq+TH9yDJhD9v/o/cpnyo9BZz8KtehZ6T+bxGzZJg0veCfE6jWP lpqz5pzMcT8YGoOtwmZpHNFR/MFQx02maJI+HKVxZgTGtL9wTKNPZRd0SG8tTDiLHh7B n8xv0h0uPxIKA7hmg9hC6XrsbR9apUdzuZFzkVlCO4UTaeq7kqnV0uU1i3T/6Iav+u2m 59oZFr5I5/JA09fR6hQxmjyDRWuHKm1yVxh7z6QbHOdc31NIitEHKa+B0mIwXP350Nby NxMqSJYXhFAPllBpNlebE5XEcLEp8zj7o5weDupK3G8+1TvCNMeeDtxrNowdUCQ8BBcc 053g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=idRpOPTG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id s3-20020a63d043000000b0056c4189d6c6si1127155pgi.829.2023.09.14.03.08.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 03:08:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=idRpOPTG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id CF25182DF480; Wed, 13 Sep 2023 21:43:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233796AbjINEm4 (ORCPT + 99 others); Thu, 14 Sep 2023 00:42:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234535AbjINEmu (ORCPT ); Thu, 14 Sep 2023 00:42:50 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7B0831985 for ; Wed, 13 Sep 2023 21:42:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694666522; 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=gXhGZ4r4I1glj6Lql+/mnOOXVMF05GnccbGV18evrsY=; b=idRpOPTGg7jESA1+DTY1WhHelCAqQ1fxZyET17gswbhWaSNtz2SWNxvEN2PVvYtZkwQwy3 6FJfkfyahzgtNCcXUWtU8uWPOsiUUC/Hf0ikodze+MjoG66/9y91z2cUvAyo9+Ujm60FuB lkCo60OmwTE28kvhk+BW0GxlvlLOpAk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-412-Y8Vp1GdGOnaFVVQXkIOowA-1; Thu, 14 Sep 2023 00:41:58 -0400 X-MC-Unique: Y8Vp1GdGOnaFVVQXkIOowA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 086B2101A529; Thu, 14 Sep 2023 04:41:58 +0000 (UTC) Received: from localhost (unknown [10.72.112.51]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 01CD92026D4B; Thu, 14 Sep 2023 04:41:56 +0000 (UTC) Date: Thu, 14 Sep 2023 12:41:53 +0800 From: Baoquan He To: Hari Bathini Cc: lkml , linuxppc-dev , Kexec-ml , Dave Young , Mahesh J Salgaonkar , Sourabh Jain , Michael Ellerman Subject: Re: [PATCH v3 2/2] powerpc/fadump: make is_kdump_kernel() return false when fadump is active Message-ID: References: <20230912082950.856977-1-hbathini@linux.ibm.com> <20230912082950.856977-2-hbathini@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230912082950.856977-2-hbathini@linux.ibm.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 13 Sep 2023 21:43:04 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email On 09/12/23 at 01:59pm, Hari Bathini wrote: > Currently, is_kdump_kernel() returns true in crash dump capture kernel > for both kdump and fadump crash dump capturing methods, as both these > methods set elfcorehdr_addr. Some restrictions enforced for crash dump > capture kernel, based on is_kdump_kernel(), are specifically meant for > kdump case and not desirable for fadump - eg. IO queues restriction in > device drivers. So, define is_kdump_kernel() to return false when f/w > assisted dump is active. > > Signed-off-by: Hari Bathini > --- > arch/powerpc/include/asm/kexec.h | 8 ++++++-- > arch/powerpc/kernel/crash_dump.c | 12 ++++++++++++ > 2 files changed, 18 insertions(+), 2 deletions(-) LGTM, Acked-by: Baoquan He > > diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h > index a1ddba01e7d1..e1b43aa12175 100644 > --- a/arch/powerpc/include/asm/kexec.h > +++ b/arch/powerpc/include/asm/kexec.h > @@ -99,10 +99,14 @@ void relocate_new_kernel(unsigned long indirection_page, unsigned long reboot_co > > void kexec_copy_flush(struct kimage *image); > > -#if defined(CONFIG_CRASH_DUMP) && defined(CONFIG_PPC_RTAS) > +#if defined(CONFIG_CRASH_DUMP) > +bool is_kdump_kernel(void); > +#define is_kdump_kernel is_kdump_kernel > +#if defined(CONFIG_PPC_RTAS) > void crash_free_reserved_phys_range(unsigned long begin, unsigned long end); > #define crash_free_reserved_phys_range crash_free_reserved_phys_range > -#endif > +#endif /* CONFIG_PPC_RTAS */ > +#endif /* CONFIG_CRASH_DUMP */ > > #ifdef CONFIG_KEXEC_FILE > extern const struct kexec_file_ops kexec_elf64_ops; > diff --git a/arch/powerpc/kernel/crash_dump.c b/arch/powerpc/kernel/crash_dump.c > index 9a3b85bfc83f..2086fa6cdc25 100644 > --- a/arch/powerpc/kernel/crash_dump.c > +++ b/arch/powerpc/kernel/crash_dump.c > @@ -19,6 +19,7 @@ > #include > #include > #include > +#include > > #ifdef DEBUG > #include > @@ -92,6 +93,17 @@ ssize_t copy_oldmem_page(struct iov_iter *iter, unsigned long pfn, > return csize; > } > > +/* > + * Return true only when kexec based kernel dump capturing method is used. > + * This ensures all restritions applied for kdump case are not automatically > + * applied for fadump case. > + */ > +bool is_kdump_kernel(void) > +{ > + return !is_fadump_active() && elfcorehdr_addr != ELFCORE_ADDR_MAX; > +} > +EXPORT_SYMBOL_GPL(is_kdump_kernel); > + > #ifdef CONFIG_PPC_RTAS > /* > * The crashkernel region will almost always overlap the RTAS region, so > -- > 2.41.0 >