Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6553676imu; Wed, 14 Nov 2018 03:26:48 -0800 (PST) X-Google-Smtp-Source: AJdET5e9JKQtvOx8vJw5Es6dk7b5WyW6l5U4KC/zHSCAV9oPKtTs6ljhuYHAJUdqN92TCS6nCbaX X-Received: by 2002:a17:902:f83:: with SMTP id 3-v6mr1554025plz.254.1542194808805; Wed, 14 Nov 2018 03:26:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542194808; cv=none; d=google.com; s=arc-20160816; b=VH7o6n4FBCE6OKmTQEOFY7q0VmLPmY75iACFfT5CQYMz3wABUtIpoEMBC3FhG8QA96 9rBNDYvBFFDat4CvyVY+6rjVoD+Qm1uzuA5yrsiGet9Q5dKMMJoKk/34s35MH8x48PAm Bygr2SBkc3LK66xy9uri5gX+1j1Y+d2A+oU1ACbgJlAKWHRbisdgqD7CPPxStvPU9rxS +q2s003Zn8DSkI+ecwDOuKi6yWPXYY7FFrRWFSxiU0YZjyTqX/N8NfdlCLjKX1AYxmUq SpTgrdEOA1dku274Ka54HN3n/KBj/P56Xy0yAHBtLZZjbq7w6WCTip6H8SOLX0+dCwJb Woxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=aWQAkJ/rh6e9KTZ6wYVXOpHcwsVJCdZYX6nd6y8XgaY=; b=YM5HqC1v5+W1oWzQfjZSaC7I9H4gQHK3s8d24lMVPHn/KEeJkpuKivVug8nS07vAm0 J/M60d6NtEEvBieEyVKXivg+SXbIPeV53bUknmycfMb0ChCgBStD4lBOXmqIlkkWVdFL 4GFBG+HM9G32nsQe7GlOam+XH5Yh8FTnZBpgdK08sMed0yK+mQj6LvR4aEx5L6onbkg3 y/H2UBf8ghcsVLIKS/WJLhIs72GzbA7SxY4FKpnow87VrIPAQARmOGaL/7EyACHaxThq efMF2mJcRicXRZWXieAhkbofvzO4PIJYxW3z8op34tIEAxD/B8NZZSN6Cd7H3tr0KcK7 nXkg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j29si22358604pgm.554.2018.11.14.03.26.28; Wed, 14 Nov 2018 03:26:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728141AbeKNV25 (ORCPT + 99 others); Wed, 14 Nov 2018 16:28:57 -0500 Received: from mail.skyhub.de ([5.9.137.197]:56978 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727598AbeKNV25 (ORCPT ); Wed, 14 Nov 2018 16:28:57 -0500 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id IAXa0CHwVd4C; Wed, 14 Nov 2018 12:26:05 +0100 (CET) Received: from zn.tnic (p200300EC2BD0D200D5714500C00E26FD.dip0.t-ipconnect.de [IPv6:2003:ec:2bd0:d200:d571:4500:c00e:26fd]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id E786A1EC0322; Wed, 14 Nov 2018 12:26:04 +0100 (CET) Date: Wed, 14 Nov 2018 12:26:01 +0100 From: Borislav Petkov To: Lianbo Jiang Cc: linux-kernel@vger.kernel.org, kexec@lists.infradead.org, x86@kernel.org, tglx@linutronix.de, mingo@redhat.com, akpm@linux-foundation.org, dyoung@redhat.com, bhe@redhat.com Subject: Re: [PATCH 1/2 v6] x86/kexec_file: add e820 entry in case e820 type string matches to io resource name Message-ID: <20181114112600.GD13926@zn.tnic> References: <20181114072926.13312-1-lijiang@redhat.com> <20181114072926.13312-2-lijiang@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20181114072926.13312-2-lijiang@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 14, 2018 at 03:29:25PM +0800, Lianbo Jiang wrote: > When load the kernel image and initramfs by kexec_file_load syscall, it can > not add exact e820 reserved type to kdump kernel e820 table. > > Kdump uses walk_iomem_res_desc() to iterate io resources, then adds matched > desc to e820 table for kdump kernel. But, when convert the e820 type into > the iores descriptors, several e820 types are converted to 'IORES_DES_NONE' > in this function e820_type_to_iores_desc(). So the walk_iomem_res_desc() > will get these unnecessary types(E820_TYPE_RAM/E820_TYPE_UNUSABLE/E820_TYPE > _KERN) when iterate io resources by the 'IORES_DES_NONE'. > > It needs filter out these redundant type(such as E820_TYPE_RAM/E820_TYPE_ > UNUSABLE/E820_TYPE_KERN) in order to add exact e820 reserved type to kdump > kernel e820 table. Thus it also needs an extra checking in memmap_entry_ > callback() to match the e820 type and resource name. Ok, it took me a while to parse what this is trying to say so let's start from the top: * What resource type do you do need in the second kernel? * The most important question: why? * If it is the reserved resource, why aren't you adding IORES_DESC_RESERVED or so which to look for instead of this hacky string comparison? -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.