Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1740817ybi; Thu, 20 Jun 2019 03:01:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzZXy5MZPBivb5ZtOpWlR/U+Q236hS1QxocM4B7bwVR1ZgpUe6n6IX3qhTV0iKT7uzA8cWR X-Received: by 2002:a63:8b44:: with SMTP id j65mr1062115pge.241.1561024891751; Thu, 20 Jun 2019 03:01:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561024891; cv=none; d=google.com; s=arc-20160816; b=w8W9jsMVtdVUasNPJweIbzzO9B5cCV5rWu6TBD/4x5/579mjSJX5eIdw4F5IRk4TQ2 Ye7eOJoZ+XTDngfCh7QNhyAweULh0GppjYfmVgzeMtqA/N0hxehZvO2bKslZCNZ/7M7Q lnT77P4Q0RQpQipqP0JI3LpdpySOuR1LZo2hIKqrHoG194iqb5XcFIzQ78Jgd6R0kfA3 HPvVQFnzCVLABXT1J/Up8ttX8Ry0yAoFKYV7wT3im9UahQ37VEj6CbioBX3AuexVGKkN vh3EXqLIbZjaTaANx8+vOoVTAK/6i55kOx+WTqEvi/hoRyew7Ksei2RNfX/pdjsvUczI 6gpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=kFQhygwJI2YkpLXnj1Aw7bCa1lb+mr1aCmZ9wGLIuC8=; b=ni9+vEmzIc1s63U4+a1109OP+M0x7rDf4f/MQyTD/vv2SLNh1EKBAnHBVzBgkK35Y7 Bd2NvL6EmqZCybGh8aggQD76THVM+mwk19P7TwYn4eLiNiLZjHvC2gMCUalxEMWAs80p i9eChnQUwuiibT85Lg8bFCBezRNZFl6Lq0rHDZa9aInEdSh5uIRgmTDUogEQKf+Ho5JO AIo9lWC3Qu2NLOkGUyGiem4ztxTodtjktrL3p9O54SkA26PJzhhrDMMMxrKO3pZaS5vM uanpeQPczS3C0KK95hNvL+bx4zmeXwwNxThSv+vD3NFI+nJWkM0vecYczEVpOZkVtJDu 8Peg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019061801 header.b=L4+UrVzH; 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=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l36si5761693pgm.45.2019.06.20.03.01.14; Thu, 20 Jun 2019 03:01:31 -0700 (PDT) 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; dkim=pass header.i=@zytor.com header.s=2019061801 header.b=L4+UrVzH; 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=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730428AbfFTKAz (ORCPT + 99 others); Thu, 20 Jun 2019 06:00:55 -0400 Received: from terminus.zytor.com ([198.137.202.136]:36233 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726082AbfFTKAy (ORCPT ); Thu, 20 Jun 2019 06:00:54 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x5K9xgAF906831 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 20 Jun 2019 02:59:43 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x5K9xgAF906831 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019061801; t=1561024783; bh=kFQhygwJI2YkpLXnj1Aw7bCa1lb+mr1aCmZ9wGLIuC8=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=L4+UrVzHPj8D3FP8WxA7IC8PSDqrjeDGBq8GATUQHyl2hhNO5j389UYGKq2V0CuVA 20AjPaOLK/Yk+7wJmO80rwXHVMs8mirbYzt1AnKzJFfnsMHjB221XoelvHj3cdnKrG 5Cm6eTC220Fz9yA8qDtesZyyhJu0qv7rAeLyI/tjQbJJauuemiIzHLWtwIy7vyWCMi hgK0jZVqouQGNaXRZ1gb3oEPSRGPfWMhY6kY77WnYtyK8nUV7SY3k68YNKDrzOz5lL bSAcM5jKOZnbIpDgehHgA0ij/rGhW4csJMOH8mjzAdQPOvCb1rid7viraCJpRK1j/s 4q66rznsNta6Q== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x5K9xfxx906820; Thu, 20 Jun 2019 02:59:41 -0700 Date: Thu, 20 Jun 2019 02:59:41 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Lianbo Jiang Message-ID: Cc: bp@suse.de, rppt@linux.ibm.com, mingo@kernel.org, huang.zijiang@zte.com.cn, n-horiguchi@ah.jp.nec.com, x86@kernel.org, linux-kernel@vger.kernel.org, m.mizuma@jp.fujitsu.com, jgross@suse.com, mhocko@suse.com, peterz@infradead.org, joe@perches.com, luto@amacapital.net, thomas.lendacky@amd.com, tglx@linutronix.de, lijiang@redhat.com, hpa@zytor.com, mingo@redhat.com, akpm@linux-foundation.org Reply-To: luto@amacapital.net, tglx@linutronix.de, thomas.lendacky@amd.com, lijiang@redhat.com, hpa@zytor.com, akpm@linux-foundation.org, mingo@redhat.com, bp@suse.de, mingo@kernel.org, rppt@linux.ibm.com, huang.zijiang@zte.com.cn, x86@kernel.org, n-horiguchi@ah.jp.nec.com, jgross@suse.com, m.mizuma@jp.fujitsu.com, linux-kernel@vger.kernel.org, joe@perches.com, mhocko@suse.com, peterz@infradead.org In-Reply-To: <20190423013007.17838-2-lijiang@redhat.com> References: <20190423013007.17838-2-lijiang@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/kdump] x86/e820, ioport: Add a new I/O resource descriptor IORES_DESC_RESERVED Git-Commit-ID: ae9e13d621d6795ec1ad6bf10bd2549c6c3feca4 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, DKIM_VALID_EF autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: ae9e13d621d6795ec1ad6bf10bd2549c6c3feca4 Gitweb: https://git.kernel.org/tip/ae9e13d621d6795ec1ad6bf10bd2549c6c3feca4 Author: Lianbo Jiang AuthorDate: Tue, 23 Apr 2019 09:30:05 +0800 Committer: Borislav Petkov CommitDate: Thu, 20 Jun 2019 09:54:31 +0200 x86/e820, ioport: Add a new I/O resource descriptor IORES_DESC_RESERVED When executing the kexec_file_load() syscall, the first kernel needs to pass the e820 reserved ranges to the second kernel because some devices (PCI, for example) need them present in the kdump kernel for proper initialization. But the kernel can not exactly match the e820 reserved ranges when walking through the iomem resources using the default IORES_DESC_NONE descriptor, because there are several types of e820 ranges which are marked IORES_DESC_NONE, see e820_type_to_iores_desc(). Therefore, add a new I/O resource descriptor called IORES_DESC_RESERVED to mark exactly those ranges. It will be used to match the reserved resource ranges when walking through iomem resources. [ bp: Massage commit message. ] Suggested-by: Borislav Petkov Signed-off-by: Lianbo Jiang Signed-off-by: Borislav Petkov Cc: Andrew Morton Cc: Andy Lutomirski Cc: bhe@redhat.com Cc: dave.hansen@linux.intel.com Cc: dyoung@redhat.com Cc: "H. Peter Anvin" Cc: Huang Zijiang Cc: Ingo Molnar Cc: Joe Perches Cc: Juergen Gross Cc: kexec@lists.infradead.org Cc: Masayoshi Mizuma Cc: Michal Hocko Cc: Mike Rapoport Cc: Naoya Horiguchi Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Tom Lendacky Cc: x86-ml Link: https://lkml.kernel.org/r/20190423013007.17838-2-lijiang@redhat.com --- 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 8f32e705a980..e69408bf664b 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c @@ -1063,10 +1063,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 */