Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7819307imu; Thu, 15 Nov 2018 01:58:07 -0800 (PST) X-Google-Smtp-Source: AJdET5fKpB4CUsRp7OXEh46N7Q7FQwzcA31OeS6eZqE3y+p4GjhWnes6j/xGOZ1VfwnXM11h1A30 X-Received: by 2002:a62:2cca:: with SMTP id s193-v6mr5650437pfs.10.1542275887129; Thu, 15 Nov 2018 01:58:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542275887; cv=none; d=google.com; s=arc-20160816; b=adZaHedCRKhhmQbiQfe7zQ+z5n8taubx+BeL+A+TQI5+gUCIQb/L25ImAdBkUCOJk5 yyExsPhOKKBNVT+8gRu713SjHKpWs4MimwLxDVaPrNdTAhWP7lfp+TjgQOn/Tl7UGU6x VIn4GWyMgsJ2U8zTZCmCPt4IlRlGIAsd/Xr7c9D4cQwDAAuwHAuI7i4TNhtVlqyWk3Ma zM3ULRM/YCfbFg9Xzohw36HAWjpq11deNjZTUOCHcSuIpychDn41YDQrHsw5x18ZJOYY x8QEa2LCRjuIT19USDsuU7htlPq3gQy3DnnFlpIQm5bXNVVZlwJEvVNJfITvvA/axHr9 UdXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=chucxq9A89Ej4TiTEe9ICBTmVincRVOVH/uDLZE8BKM=; b=wCtlr64YP28GEe4WYpYzFM+OUvj4gPEbIgMVV3s0XkCiJdOLT1/c2qnnYjn+Pap1OZ bAe/Ym4VfYFFx5nYQjWUaeTRUvy0alJQFTn9jdiMYu0Ad1TgoKMHt/9gVGH9sBC6+EUc 2pwF6FlLAh0+rXdzoMqK5aWc5jK8UZ7MGdkOkw7fvUu5gyMBZ3ZnplD7ZwRPBUTlEDvE xioD9zNgMQu3in/cnw0ynpwhUzihA/E8bF3cjluqCB/E2ob+pwLcsVlNsiSWmzegw+u3 1n2poFxJt7dfQ8u30cr6UxCY/5HDJr62JXZx3dlE5NYSquJ5FEBPk3EAlgQQpFMWSUko ynQQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q17si13629380pfc.198.2018.11.15.01.57.52; Thu, 15 Nov 2018 01:58:07 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387867AbeKOUCz (ORCPT + 99 others); Thu, 15 Nov 2018 15:02:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41566 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728609AbeKOUCz (ORCPT ); Thu, 15 Nov 2018 15:02:55 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8FC2980F83; Thu, 15 Nov 2018 09:55:48 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-12-127.pek2.redhat.com [10.72.12.127]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4E9119C65; Thu, 15 Nov 2018 09:55:41 +0000 (UTC) From: Lianbo Jiang To: linux-kernel@vger.kernel.org Cc: kexec@lists.infradead.org, x86@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, akpm@linux-foundation.org, dyoung@redhat.com, bhe@redhat.com Subject: [PATCH 1/2 v7] resource: add the new I/O resource descriptor 'IORES_DESC_RESERVED' Date: Thu, 15 Nov 2018 17:55:28 +0800 Message-Id: <20181115095529.21220-2-lijiang@redhat.com> In-Reply-To: <20181115095529.21220-1-lijiang@redhat.com> References: <20181115095529.21220-1-lijiang@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 15 Nov 2018 09:55:48 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The upstream kernel can not accurately add the e820 reserved type to kdump krenel e820 table. Kdump uses walk_iomem_res_desc() to iterate io resources, then adds the matched resource ranges to the e820 table for kdump kernel. But, when convert the e820 type into the iores descriptor, several e820 types are converted to 'IORES_DESC_NONE' in this function e820_type _to_iores_desc(). So the walk_iomem_res_desc() will get unnecessary types(such as E820_TYPE_RAM/E820_TYPE_UNUSABLE/E820_TYPE_KERN) when walk through io resources by the descriptor 'IORES_DESC_NONE'. This patch adds the new I/O resource descriptor 'IORES_DESC_RESERVED' for the iomem resources search interfaces. It is helpful to exactly match the reserved resource ranges when walking through iomem resources. Suggested-by: Dave Young Signed-off-by: Lianbo Jiang --- Changes since v5: 1. Improve the patch log Changes since v6: 1. Modify this patch, and add the new I/O resource descriptor 'IORES_DESC_RESERVED' for the iomem resources search interfaces. 2. Improve patch log. arch/x86/kernel/e820.c | 2 +- include/linux/ioport.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index 50895c2f937d..57fafdafb860 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c @@ -1048,10 +1048,10 @@ static unsigned long __init e820_type_to_iores_desc(struct e820_entry *entry) case E820_TYPE_NVS: return IORES_DESC_ACPI_NV_STORAGE; case E820_TYPE_PMEM: return IORES_DESC_PERSISTENT_MEMORY; case E820_TYPE_PRAM: return IORES_DESC_PERSISTENT_MEMORY_LEGACY; + case E820_TYPE_RESERVED: return IORES_DESC_RESERVED; case E820_TYPE_RESERVED_KERN: /* Fall-through: */ case E820_TYPE_RAM: /* Fall-through: */ case E820_TYPE_UNUSABLE: /* Fall-through: */ - case E820_TYPE_RESERVED: /* Fall-through: */ default: return IORES_DESC_NONE; } } diff --git a/include/linux/ioport.h b/include/linux/ioport.h index da0ebaec25f0..6ed59de48bd5 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h @@ -133,6 +133,7 @@ enum { IORES_DESC_PERSISTENT_MEMORY_LEGACY = 5, IORES_DESC_DEVICE_PRIVATE_MEMORY = 6, IORES_DESC_DEVICE_PUBLIC_MEMORY = 7, + IORES_DESC_RESERVED = 8, }; /* helpers to define resources */ -- 2.17.1