Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1201117imu; Thu, 22 Nov 2018 12:00:58 -0800 (PST) X-Google-Smtp-Source: AFSGD/W5EKFjxRG9bkIh7uXLv6sT0R9kr86C19kta9tUrDUsUOq01SVykHa7NeEmtU6kMGu0wfc3 X-Received: by 2002:a17:902:25ab:: with SMTP id y40-v6mr12352571pla.258.1542916858646; Thu, 22 Nov 2018 12:00:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542916858; cv=none; d=google.com; s=arc-20160816; b=WNg4hIL+KYYYl+jJs3uOakicOZDqDyqFb+aR6CaNWFlyAwBF8CbCROL7uMQFcmHBjJ nzU98MCzypw7b8It66GUKKAhzl6MiYN2ccDT2AueL/T/Ei/xTMyH0VYn44QBb7a69dxF vHZYbZYtc47o0ZeL+4knsJIlOJQOESeJLyBsMa/ZDY/n1NDIA1Pe0RlCByZtExH5fiXQ znWxSKttMpPc5yqHwEMo+57biYxBRV5h2zMDSl23KYKkoZdhPteRMexbkq9so9nrYebZ 1+GsFioBCNpA+q37utO8mbxuf0uoKhMa/DqlO+F4+ts7rMVKLmKnH2N4g6JjsibSK214 R8aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=bRmXpptACQk3rYVNPSmJKtewYJq99iFsDxGBV7z9TrQ=; b=oXu5xqmQGH52P5FzlbECb997jiTYs19nnmvvAKjRmhFFgsUU+eLEI2xgErZUz5DMLe /44DbIvBxgS0UxTF++U4pIeFjxbvHoCtIuNWpPKFjmk6G1cBWLmQQHMkEyxrYhGy+q4Z alRo34Yn91u60KTAdm/iHpNIANJnaxeJQvQbq/vn9yh4K/6mfvaw+jfD055xvJ+wGmRQ vbJLo3GEWIm5z38wZkTQlIF60L8pZMbWkSQ/MM7WFZmF9R5TzheBCW4z2Accc5d0zL5x zlTR19ZsrN91W+PvLZ5/BYZB5CdiADdyfm+3QKrCWs4dheZF91297MbIPKZxfYi46FZE 2iKQ== 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 i64si49655161pge.361.2018.11.22.12.00.44; Thu, 22 Nov 2018 12:00:58 -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 S2392899AbeKVTAS (ORCPT + 99 others); Thu, 22 Nov 2018 14:00:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34288 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727486AbeKVTAR (ORCPT ); Thu, 22 Nov 2018 14:00:17 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 012D49F733; Thu, 22 Nov 2018 08:21:55 +0000 (UTC) Received: from localhost.localdomain (ovpn-12-69.pek2.redhat.com [10.72.12.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 539511054FD3; Thu, 22 Nov 2018 08:21:47 +0000 (UTC) Subject: Re: [PATCH 1/2 v7] resource: add the new I/O resource descriptor 'IORES_DESC_RESERVED' To: Dave Young Cc: linux-kernel@vger.kernel.org, bhe@redhat.com, x86@kernel.org, kexec@lists.infradead.org, mingo@redhat.com, bp@alien8.de, tglx@linutronix.de, akpm@linux-foundation.org References: <20181115095529.21220-1-lijiang@redhat.com> <20181115095529.21220-2-lijiang@redhat.com> <20181122074202.GA8524@dhcp-128-65.nay.redhat.com> From: lijiang Message-ID: <1f37d5c8-b919-8163-942a-660e7e7a964d@redhat.com> Date: Thu, 22 Nov 2018 16:21:44 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181122074202.GA8524@dhcp-128-65.nay.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 22 Nov 2018 08:21:55 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2018年11月22日 15:42, Dave Young 写道: > On 11/15/18 at 05:55pm, Lianbo Jiang wrote: >> 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, >> }; > > There more works for a new iores desc. Originally IORES_DESC_NONE > is assumed to include reserved e820 type so all code path relates to > IORES_DESC_NONE should be carefully checked and ensure they still work after > your changes. > Thanks for your reminder. I'm checking it, and also will resend v7 later. Please ignore this patch. Regards, Lianbo >> >> /* helpers to define resources */ >> -- >> 2.17.1 >> >> >> _______________________________________________ >> kexec mailing list >> kexec@lists.infradead.org >> http://lists.infradead.org/mailman/listinfo/kexec > > Thanks > Dave >