Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4150951pxf; Tue, 23 Mar 2021 04:09:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYZRuuEbxBrn+tBjBkAX/giFLc0M/bt9IaUFqDHZKlp1vJbG8K79hrP5+1OvoBr4TG2MId X-Received: by 2002:a17:906:5e4a:: with SMTP id b10mr4399008eju.116.1616497753808; Tue, 23 Mar 2021 04:09:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616497753; cv=none; d=google.com; s=arc-20160816; b=fAnrHdiuSN6myxKWDsuPvtn77P3n+D7YJxhW4dHWuBqHGvrff+95HCLKAeWRbLwKED JzQJx+9SSyf1hMDeHOYxxTlnpUtR+01xEt8iUF9QU+x7SGArC+gdnhXvORDM/Blkqeau HbUO5G7umpPhMLYhCwHkzFOIBYqXXYLBS2KFSTKCm84O4kYBK7TIPhWeR7NGIsPx2Zu0 4v5Qv1SEowLsG7LYpdKHgSJkFw36r7A/wZ+hMLwAuWeuXlO/B7nocTMe+z+gtCp+vf+M cJjMEU4w6qU05deQgCkjGY9DmrXeCg4+UmgvC5cCtRIGtrIuINHDrvgMrJTeIEYPTYF3 gW+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=wRbad9X8NvnTNegQYc7Yz7xFepmfo+K6+CGEbZvLCCM=; b=Jr8p+0ozhwmEZP5E7pkG90ptIrmHKwhyeLlv/lJ2M/McicOzFi3da7xYG4koPKSOd4 hemIexETPaGbPb+cEXcjBbgo6sfkf6PDjx+Km+n+zFre+1Uh398a5dCHLlMj3SskjJsg gXnPK0gLUFg4iMZZMP/YLcmvO1bjtxsdAfBQQ+QzPpp2idLSXyEpZMmQYmLZrSuWBMyM nY5pNHht+PTtqru6nGxxBw21/FUjZojLBQ512leKwIDj83+rTXc361JdFS9pDbzDltPa eLjT+AAyz3Ui6cvCZo3a/UX8k7RW99v/9JZpNh6ojW9gu/L986oKVqel6RTIVQLnDp5W GoPg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z9si12822014edb.10.2021.03.23.04.08.50; Tue, 23 Mar 2021 04:09:13 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230295AbhCWLFj (ORCPT + 99 others); Tue, 23 Mar 2021 07:05:39 -0400 Received: from mga14.intel.com ([192.55.52.115]:31610 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbhCWLF3 (ORCPT ); Tue, 23 Mar 2021 07:05:29 -0400 IronPort-SDR: Iut2h5aE/y4yWu0097pxYK3JTpdav8CHGnopx4JMywUByEfSmOy8mvVMTZ1Oefs9uMuCiL0aa7 AyCbci10ewmg== X-IronPort-AV: E=McAfee;i="6000,8403,9931"; a="189854350" X-IronPort-AV: E=Sophos;i="5.81,271,1610438400"; d="scan'208";a="189854350" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2021 04:05:22 -0700 IronPort-SDR: YuARCY5NsHDZ0ybCrSAyF7P8IWMCmEBQjrkxEsSqxGO0f3YbTLERo0LkkDkr+SuNQVhTQ87zeZ klqIpUGPflxw== X-IronPort-AV: E=Sophos;i="5.81,271,1610438400"; d="scan'208";a="604267746" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2021 04:05:16 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lOeqW-00EzhN-Vs; Tue, 23 Mar 2021 13:05:12 +0200 Date: Tue, 23 Mar 2021 13:05:12 +0200 From: Andy Shevchenko To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Baoquan He , Borislav Petkov , Brijesh Singh , Daniel Vetter , Dan Williams , Dave Hansen , Dave Young , Eric Biederman , Greg Kroah-Hartman , "H. Peter Anvin" , Ingo Molnar , Keith Busch , Mauro Carvalho Chehab , Michal Hocko , Oscar Salvador , Qian Cai , Thomas Gleixner , Tom Lendacky , Vivek Goyal Subject: Re: [PATCH v1 0/3] kernel/resource: make walk_system_ram_res() and walk_mem_res() search the whole tree Message-ID: References: <20210322160200.19633-1-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210322160200.19633-1-david@redhat.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 22, 2021 at 05:01:57PM +0100, David Hildenbrand wrote: > Playing with kdump+virtio-mem I noticed that kexec_file_load() does not > consider System RAM added via dax/kmem and virtio-mem when preparing the > elf header for kdump. Looking into the details, the logic used in > walk_system_ram_res() and walk_mem_res() seems to be outdated. > > walk_system_ram_range() already does the right thing, let's change > walk_system_ram_res() and walk_mem_res(), and clean up. > > Loading a kdump kernel via "kexec -p -s" ... will result in the kdump > kernel to also dump dax/kmem and virtio-mem added System RAM now. > > Note: kexec-tools on x86-64 also have to be updated to consider this > memory in the kexec_load() case when processing /proc/iomem. > Against next-20210322. Hint: `git format-patch --base ...` > > David Hildenbrand (3): > kernel/resource: make walk_system_ram_res() find all busy > IORESOURCE_SYSTEM_RAM resources > kernel/resource: make walk_mem_res() find all busy IORESOURCE_MEM > resources > kernel/resource: remove first_lvl / siblings_only logic > > kernel/resource.c | 45 ++++++++++++--------------------------------- > 1 file changed, 12 insertions(+), 33 deletions(-) > > -- > 2.29.2 > -- With Best Regards, Andy Shevchenko