Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp422021rwr; Thu, 27 Apr 2023 03:22:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4IQMLS97ffpJGthLO37xR1Htg+a+upyrKDK/ha9W3XODYGk/tprwTxOVqENB/csYhA4UTa X-Received: by 2002:a05:6a00:4192:b0:624:bf7e:9d8c with SMTP id ca18-20020a056a00419200b00624bf7e9d8cmr1584892pfb.1.1682590978745; Thu, 27 Apr 2023 03:22:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682590978; cv=none; d=google.com; s=arc-20160816; b=JtzZLE4S89Rh+7hXXnFjsObkYUwxYYQ7M6b5c2v3WkiacsiUfoCpkAqtGPUySowWN6 soaH8zugH64MOJyhhc/zvUkaPthW5k9JkY/V/tAD6/P8Tawhqmg2Mdki1lfEQbKP02y3 am3FFuodc36kxvffo71wbZAIZ3NtIn8pu9e35QilQU44LCuiZ25+L/oVBHS2DDmc9rD6 jc90TwUT70XVrHIa1ax5z3vxCjvYnYF1vT1RdX1hjXQ12AWAQPcAoWDJ8QFxf3jpdEfi bUWdTNz8Pd6MNvxydtIrWXhIjSXsHIOPILbHwjfExtLd75Eo3pE1YQ0RxTqTDeBh41K4 5FxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=DW2zIBRONoCN+QmQ6wTz3AdiUuJgsQ8W+CKH9BBr9JI=; b=Bc6MnYApeVl6cr6dhG5oK8MjPnQPvHehrM5DHWj5168jG4JgyY6yHVtH4IXL4Do9Bj mu1lk5CGaf5/FnTLJ4+OyWpnLTNF7xYYoVCF0X8Ry5FL9/KE8aR92AUFcRc9UMzBde9Y vzq1ojuwlYmpjVvs/nH5ldfBUVf12MzCaA1pJWFeMQTOvnpsZVuULkmgUmMvtmfu/jrN 0rJOLYFuBL3qXbZSQ5q7dcuq48F4cbIzcFE1UQvWeFTeXtrR+czzFfIrJfkF5LR4sq17 xCjaKn6VJeS/zBpG8RWLuTU2UvHf86RaIJmW5kRRk6SYnD9QX20L1beVx41zfwduexq3 iasA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n190-20020a6340c7000000b0051bb433f5d3si17672155pga.862.2023.04.27.03.22.44; Thu, 27 Apr 2023 03:22:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243489AbjD0KUm (ORCPT + 99 others); Thu, 27 Apr 2023 06:20:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243369AbjD0KUK (ORCPT ); Thu, 27 Apr 2023 06:20:10 -0400 Received: from esa12.hc1455-7.c3s2.iphmx.com (esa12.hc1455-7.c3s2.iphmx.com [139.138.37.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E85255B7 for ; Thu, 27 Apr 2023 03:20:05 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6600,9927,10692"; a="94534342" X-IronPort-AV: E=Sophos;i="5.99,230,1677510000"; d="scan'208";a="94534342" Received: from unknown (HELO yto-r1.gw.nic.fujitsu.com) ([218.44.52.217]) by esa12.hc1455-7.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2023 19:18:54 +0900 Received: from yto-m3.gw.nic.fujitsu.com (yto-nat-yto-m3.gw.nic.fujitsu.com [192.168.83.66]) by yto-r1.gw.nic.fujitsu.com (Postfix) with ESMTP id 52709D66A0 for ; Thu, 27 Apr 2023 19:18:52 +0900 (JST) Received: from kws-ab1.gw.nic.fujitsu.com (kws-ab1.gw.nic.fujitsu.com [192.51.206.11]) by yto-m3.gw.nic.fujitsu.com (Postfix) with ESMTP id 9DC8F16E60 for ; Thu, 27 Apr 2023 19:18:51 +0900 (JST) Received: from FNSTPC.g08.fujitsu.local (unknown [10.167.226.45]) by kws-ab1.gw.nic.fujitsu.com (Postfix) with ESMTP id 9369C114147F; Thu, 27 Apr 2023 19:18:49 +0900 (JST) From: Li Zhijian To: x86@kernel.org, nvdimm@lists.linux.dev, kexec@lists.infradead.org Cc: linux-kernel@vger.kernel.org, y-goto@fujitsu.com, yangx.jy@fujitsu.com, ruansy.fnst@fujitsu.com, Li Zhijian , Baoquan He , Vivek Goyal , Dave Young Subject: [RFC PATCH v2 kexec-tools] kexec: Add and mark pmem region into PT_LOADs Date: Thu, 27 Apr 2023 18:18:35 +0800 Message-Id: <20230427101838.12267-5-lizhijian@fujitsu.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230427101838.12267-1-lizhijian@fujitsu.com> References: <20230427101838.12267-1-lizhijian@fujitsu.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSS-9.1.0.1408-9.0.0.1002-27590.006 X-TM-AS-User-Approved-Sender: Yes X-TMASE-Version: IMSS-9.1.0.1408-9.0.1002-27590.006 X-TMASE-Result: 10--6.121700-10.000000 X-TMASE-MatchedRID: JUGAxiLh1cNSuJfEWZSQfBmCYUYerLHrwTlc9CcHMZerwqxtE531VIpb wG9fIuITIqMWro5FhUiisum7bT5AftDFhoVadDNxfUkgDiuGxn/jmgMQ17h56yS30GKAkBxWCu1 ja6drUTmG9aEScwNGm4Ay6p60ZV62yA7duzCw6dLdB/CxWTRRu25FeHtsUoHuUiwP+xLbq3AxYM d1N0VknfHRdUVXE7DT6INmePPYNPFgO21BQaodlQ== X-TMASE-SNAP-Result: 1.821001.0001-0-1-22:0,33:0,34:0-0 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It does: 1. Add pmem region into PT_LOADs of vmcore 2. Mark pmem region's p_flags as PF_DEV CC: Baoquan He CC: Vivek Goyal CC: Dave Young Signed-off-by: Li Zhijian --- kexec/crashdump-elf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kexec/crashdump-elf.c b/kexec/crashdump-elf.c index b8bb686a17ca..ab257e825187 100644 --- a/kexec/crashdump-elf.c +++ b/kexec/crashdump-elf.c @@ -25,6 +25,8 @@ do { \ } while(0) #endif +#define PF_DEV (1 << 4) + /* Prepares the crash memory headers and stores in supplied buffer. */ int FUNC(struct kexec_info *info, struct crash_elf_info *elf_info, @@ -199,7 +201,7 @@ int FUNC(struct kexec_info *info, * A seprate program header for Backup Region*/ for (i = 0; i < ranges; i++, range++) { unsigned long long mstart, mend; - if (range->type != RANGE_RAM) + if (range->type != RANGE_RAM && range->type != RANGE_PMEM) continue; mstart = range->start; mend = range->end; @@ -209,6 +211,8 @@ int FUNC(struct kexec_info *info, bufp += sizeof(PHDR); phdr->p_type = PT_LOAD; phdr->p_flags = PF_R|PF_W|PF_X; + if (range->type == RANGE_PMEM) + phdr->p_flags |= PF_DEV; phdr->p_offset = mstart; if (mstart == info->backup_src_start -- 2.29.2