Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3666826pxj; Mon, 7 Jun 2021 17:19:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuc9WNqWdlYZtWhahhsQgzDmuiskaLF+zBAn/Oz5oHerBFJ+syZvv6JVvoYfPEMqCsem/t X-Received: by 2002:aa7:d755:: with SMTP id a21mr22972055eds.146.1623111598192; Mon, 07 Jun 2021 17:19:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623111598; cv=none; d=google.com; s=arc-20160816; b=lJub8mEUEhzan2RL7Iz7/P2+XqFeKxWFPypaqA4QaKbdclcKhcCEpDdOaoYrzZZBR1 pFkUmJc+4CKjnwiX3to9h49CmXIK9ucl7EIE/VcATHZ1xfeaTA/AR3uNCU29nunnwtv2 1yi27sYR4a8UHnyTcgMXzEGC2wvd+YqFd+DTxQrdRc8XIo2Vq9OWcGC4gpQcAvS30biO zyOp7KE4KneHXWzakiyZbUQiriOlokcmwWX1FANbFSncSJOqbkgrZbGdMPq/ifLSdQxT JJEta4uRZCuCA3en0lLCjdFqloxjCVqNGLtwywielqtRnfmkcwXRpcsATJlI7m9ITUhJ SlIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=1MJDjKZ79w7kCWDlMVM1dLwUQr67p1YkFN01zbVuA7A=; b=O1VrgsSQHklA/Z1PqNojXdLXSb/ER2YmRNDIH88Wn3Y3wKe6TtYQoLeWLqVJ91Idgp HV4PzypP7ZwE/95Nt8EGBh4NxF31vVzu9ueqRJKiRbnRvoLkUnCzTaaEE6VVgogobkLP FS9dQsEt3FRj54rikcvCCeSjETmIkJf7/cHHF9QCky4e2Xg5VnSZpVAWR1ikYSKXS9yO d81D4rBNtY9Xu+uBp/hya8lxgjTOI+X6dGd9itUtDFk9eVrlbvWXTIkW9DpVQf6hwRfj 4tu9JQBJlHku3Wtj2sFwwUe3GzwAznycZFZOT7sIKU56LAgfmKqdJCCPEThrlEtfPGdF Si+Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z21si13108129eja.498.2021.06.07.17.19.22; Mon, 07 Jun 2021 17:19:58 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230351AbhFHATD (ORCPT + 99 others); Mon, 7 Jun 2021 20:19:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230209AbhFHATC (ORCPT ); Mon, 7 Jun 2021 20:19:02 -0400 Received: from angie.orcam.me.uk (unknown [IPv6:2001:4190:8020::4]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6B4ADC061574; Mon, 7 Jun 2021 17:17:10 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 70A1992009C; Tue, 8 Jun 2021 02:16:54 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 6926C92009B; Tue, 8 Jun 2021 02:16:54 +0200 (CEST) Date: Tue, 8 Jun 2021 02:16:54 +0200 (CEST) From: "Maciej W. Rozycki" To: Youling Tang cc: Jiaxun Yang , Thomas Bogendoerfer , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Huacai Chen Subject: Re: [PATCH] mips: kdump: Crash kernel should be able to see old memories In-Reply-To: Message-ID: References: <1618829807-12522-1-git-send-email-tangyouling@loongson.cn> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 20 Apr 2021, Youling Tang wrote: > > Why depend on a config instead of a runtime variable? > > > If not depend on config, we can determine whether the command line contains > the "elfcorehdr=" parameter, because the "mem=" and "elfcorhdr=" parameters > are automatically added in kexec-tools. So if there is an "elfcorehdr=" > parameter in the command line, it means that the currently running kernel > is a capture kernel, and the memblock_remove() operation is not called. > > The revised patch is as follows: > if (usermem == 0) { > usermem = 1; > - memblock_remove(memblock_start_of_DRAM(), > - memblock_end_of_DRAM() - memblock_start_of_DRAM()); > + if (!strstr(boot_command_line, "elfcorehdr")) { > + memblock_remove(memblock_start_of_DRAM(), > + memblock_end_of_DRAM() - > memblock_start_of_DRAM()); > + } > > Do you think it is feasible? This looks like a hack to me. How do other platforms solve it, e.g. x86? Maciej