Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756632AbdGXTL7 (ORCPT ); Mon, 24 Jul 2017 15:11:59 -0400 Received: from mail-sn1nam01on0078.outbound.protection.outlook.com ([104.47.32.78]:14752 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756369AbdGXTJc (ORCPT ); Mon, 24 Jul 2017 15:09:32 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; From: Brijesh Singh To: linux-kernel@vger.kernel.org, x86@kernel.org, linux-efi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org Cc: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Borislav Petkov , Andy Lutomirski , Tony Luck , Piotr Luc , Tom Lendacky , Fenghua Yu , Lu Baolu , Reza Arbab , David Howells , Matt Fleming , "Kirill A . Shutemov" , Laura Abbott , Ard Biesheuvel , Andrew Morton , Eric Biederman , Benjamin Herrenschmidt , Paul Mackerras , Konrad Rzeszutek Wilk , Jonathan Corbet , Dave Airlie , Kees Cook , Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Arnd Bergmann , Tejun Heo , Christoph Lameter , Brijesh Singh Subject: [RFC Part1 PATCH v3 10/17] resource: Provide resource struct in resource walk callback Date: Mon, 24 Jul 2017 14:07:50 -0500 Message-Id: <20170724190757.11278-11-brijesh.singh@amd.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170724190757.11278-1-brijesh.singh@amd.com> References: <20170724190757.11278-1-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: CY4PR04CA0049.namprd04.prod.outlook.com (10.171.243.142) To CY1PR12MB0150.namprd12.prod.outlook.com (10.161.173.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9f430960-9536-4e77-ae3c-08d4d2c76116 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY1PR12MB0150; X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0150;3:r3h7JtJdTY6Tf2UVIoyNp2yqqQwWpGOqE6+hKcGTd1BnuK4SJJoUNGfyqdKQnOXRFx/soraTysmt7/4U3dyHSxZxm0U4g8guvFnnafdblUYSQFlj9IuWSIwhNg6C21D6fq6k7rRXbvdnm4046tAsMF4ujU9EhRc49I6IepBAdu3M1jy0RVQJB4vJZx+3kcHaIpME1xyGM+SpZa4hG9Lii29VAgdwl8+VB3B4F29i/dDAXAIPABw9DUWNl1mk9IXvdidNh6Xoxk2oD1Ujbtc4O2YjpDYA3uenv51oX+LSJckgjlTUSsIQPRFMRe2uejkFA+LDD8dU+tpWPWnA8/h7BWt+vq/cZZEhZzq6a2DB6Jqzs/4x4FX7xZj6bkF4JK9tvZMJuTouXGJaow7nYkSVjjNxWCkwXwUzBWAiIFS7NevUEOE77lK5+HT3sOaHWsZydxDOMCLzm0ryY35/DY4g3IYW8iccGqY7+vbdqC1SzxJ0Un9fHZyamaViuvOq6cDaza11KYJHSWt0XhHoqqBs9tcmxBDo+xYkGUKvQS61yE5//krW0E/HurtZvhju5DiQqcaQbf78c6qepWI6taLwLzxmPhUqoNayQGRCRhCfr44LB2/VG3syEeUmweasSeF7YrIgS6sx6UB9cGcrVdSkTg1euDlMFiAiWTglaVCm4rpto9pV/q7M/QKcC+pvaEy+C6P2WxrdPpilXLJPRy6fAsVF5eCpSHfcAyJZH+WGy9bKXhZIDfhF/2fTMYFpQquEwWLxP+IujnBLvzhloz85sw== X-MS-TrafficTypeDiagnostic: CY1PR12MB0150: X-Microsoft-Exchange-Diagn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+RVJu14NKw/xDy9PlmmX7e47AXILz2hSa1hSoz36nMk+gDE2ai8QAhlZ+MVYjxiLybIV++bldJnArtJ5 X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123564025)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY1PR12MB0150;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY1PR12MB0150; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR12MB0150;4:W8UZc5bgK9yQGw7mw/h+w9/fntCqK8AxSP5nhNOiK9?= =?us-ascii?Q?ifOEtJUot9sVMt7rCpKex1ZiBr1/Xa7gLgk/Gkcw/pQ9lF6B2QgQMosX6Ic9?= =?us-ascii?Q?5EvL0Q6+aD0JElXry73EU4OJPSmV9/Vb2o98rDtIc/fc9bEwP8eDylJ4OdvF?= =?us-ascii?Q?mDjja5JW1BS3vd9zFGi0KoJeMmOdtk/Uhd2eKIRWUEkD38ibF99f6Rc37d6y?= =?us-ascii?Q?kSjK5zQMCsc5NoSW6aP7k58qyDj4hI/I8yl8qOJglUKV/AJ6bYBL+zmAnf6d?= =?us-ascii?Q?SOrIcFaAjx7EFzBvugfLw5xp1pnlMbVjkOj4lvBestVlSciNrzDvpK+IMYvx?= =?us-ascii?Q?9y492S0AWUswrKPTnG5/FvLjZcy+66gKC48wGZXHDUSZYVTW8D3nzHTi90GO?= =?us-ascii?Q?OrqWjpm7kQQsonbK5I6y6uHDYeXRo+f7APRhY4UUXDa95h+eFohuTtzasJ96?= =?us-ascii?Q?qH4WJJciMD/vz8JJxkmZUyc5Pzyf7NTpzbjQYNrJ919U+nbX4HWFwVVu+boT?= =?us-ascii?Q?k1ecl3DbPM3LYnkImnxtzbpIIcBkvM6ycRd0BNh6CRtv06NRLJp5wtZXYrVH?= =?us-ascii?Q?1m9+o8b2arGDeLvwL+w2yXJaQJn6Srapt53FhuSPzqoPcd7s2Dlxic0BfpLW?= =?us-ascii?Q?H10u5eugCLqDfwbipZAVJLjgnZGE94dLvYVQWeHqLIc9BpnpKYNplS0SVsgM?= =?us-ascii?Q?HqRXlfAj/46v0TpuDyZL91YOyg8YLRnsMrDCme6FhgjyP2jOAB60YXsbdbEQ?= =?us-ascii?Q?+avQAckaID6h+jPy3UjoeyfX/iAL5zG/XyFXC5NUZ6SKRvFIXRf0TuP2w8RB?= =?us-ascii?Q?f3S8Brwzsw5BsqHsby481z3o7ObLgg6rTmMXhVXuRIdxu8QLLkOKnqDuijpt?= =?us-ascii?Q?1SZ/tHrIdWvitdY2ldgrFhnVUOSDDsHmsWVrmT1asKSooeCumqEA1xWW37NM?= =?us-ascii?Q?RbiWVE9NQH+c9EcM1t8I3DT3lsQr9tbDTJtFY73R8CFtACE1V4R2t7yyJcPS?= =?us-ascii?Q?aAFYRUeD/5biKzC6MXnk9byO/MC+GKVOydfbj+BWCvgDHBxjUIiwyruR5g7W?= =?us-ascii?Q?wRYj7DN6wWkwlAZyJJpuDicx4Arg2nk8y1MwhWcICjn2lhESKo2hdXe6xi/x?= =?us-ascii?Q?KkEq2XXN1/dS1mVr5Ozbl1r0bXFMJeAB8haeGrFybxC8KqsX7a9kBUvVJLFb?= =?us-ascii?Q?XXR0dxOrqHyyG12gImoUeUDLmUmNQ8Oh/N?= X-Forefront-PRVS: 0378F1E47A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(7370300001)(6009001)(39840400002)(39850400002)(39450400003)(39400400002)(39410400002)(39860400002)(199003)(189002)(4326008)(81156014)(7350300001)(81166006)(50226002)(50466002)(68736007)(36756003)(38730400002)(1076002)(110136004)(53936002)(6116002)(25786009)(48376002)(575784001)(8676002)(86362001)(305945005)(54906002)(7736002)(2950100002)(6666003)(50986999)(101416001)(47776003)(105586002)(5660300001)(5003940100001)(7416002)(33646002)(106356001)(66066001)(6486002)(7406005)(97736004)(189998001)(3846002)(76176999)(2906002)(53416004)(42186005)(478600001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR12MB0150;H:ubuntu-010236106000.amd.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR12MB0150;23:L80Plj+CabqafjpNO/4zK5HOLdlfgzUwy3bfr7FPd?= =?us-ascii?Q?1Wqv8I9Sn2gepD6DNa+lUL2BIAViqLs23845SBz4/dEYy+eZAM+hP6HZTWi5?= =?us-ascii?Q?7CW6BI7eKpFyrDL/vw69mqWRXIWbz1g6WEPOOppGbud2ytuiKeWd7G7FoOvQ?= =?us-ascii?Q?8YNghGC7R+510GMOMdYeza0Ca+/zyk3htKlMVYGBTP7DdRFYwk9NmmaEKLqY?= =?us-ascii?Q?pAVXUWOl/LhRszzxlAb1fkYjst8bmFxuWjmn+EgPjNDd2PcFx/xWuDDJB6cY?= =?us-ascii?Q?DHLLAxU+beW30goegBs6g1jWfebBgzoP636AQQg1EEK1fjB9Xx1OG7dRwk6M?= =?us-ascii?Q?Nmo50XJQvLr1djz4tUY3H0ceLxAZhF5O6xamvILi+QVqRzamsBrg7dRF51KJ?= =?us-ascii?Q?hhte67hp1whHfK3EgEBp0aZlb6p/0dyDOphSS6DNWGsYSZNWihl+dJoyOQTq?= =?us-ascii?Q?W3eeI3E9UBNda5NCXEU4kUoZfGNDLnnuSW+liUrbeh/XeFsrNBY1fyS3sATY?= =?us-ascii?Q?YGSq/xdkrFjo9CWRCD5V15qVxrLAnD7tcHHp2IkrpwVZ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tf/QdYTLkzLruNhMLu45py6ynifpu0Vk4qg1HAOHjTfEGaOSTyZFsMFRXuUexb7VmULVedC07fNEh9oQnXUux8Kfl/GQI04ev/RHtkS6TdwHXK425nv6/GZdxrqY8/U/flvGRfVU32+wfrCFI7cAefan+s472/l0saxkdQYINr73NrLGIMg8uJufKCdSqVBLBaUaJhsNZyhfdKuB8GDcCZJV28+zVlN1JAa5prob6OM+GylxpzuGjldSGBB6/1EvcsYAJye+d4eLnzaKp8RTrbLpPoImhacucTaIkeG9hq3NJG1FQDEv62DAxrJu15Or5rScLp3TrLA+xPB9wJQmrXWkHcD4HdpqNOrMQI0PPlsdpCao9m10wzNf7RWPRLp33KvCaQ8Z5jHqvOLEVQ63EWRT9rpmXsMbGdj7BpYf2MOrkzpLuf+usVsUFWGf5KHNMNUkCGx2+39QSBCFAirqxcBlzcK6+5qiKbnkqsBVcWpXwu7oa360F16cnL1AuEUOyiq3/JFaGlS0rQs837VmvSSFhMKXskI/asInuIj3tCBWM79so5mv7JkqCq3ZNuwH4VLBPd3bFA= X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0150;20:Lb5ctdcu2So05h3tyIZgQPvh8MqpXdrv3GXc+BQU7O2K9G3LdbaPfVkZeiutMUmtJ8nKUs8mfXUDgbKNcX09ee557Jk9jEh+7dhk8wvdBafAZnRrN4fCtcUudWkzmYXYumVV93zgGGztev+G77bMuOhnP6wm+9iXqZ5qsW8XgerfDD3qwv7Ukj21+Fyx0YuZ+Oa4kF37GoUYWAzm6nW8pDMTTXXqw0U2b7mVadSjbfiek+/GAAeT+eMxKPO1dqrs X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2017 19:08:32.0440 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0150 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 8505 Lines: 236 From: Tom Lendacky In prep for a new function that will need additional resource information during the resource walk, update the resource walk callback to pass the resource structure. Since the current callback start and end arguments are pulled from the resource structure, the callback functions can obtain them from the resource structure directly. Signed-off-by: Tom Lendacky Signed-off-by: Brijesh Singh --- arch/powerpc/kernel/machine_kexec_file_64.c | 12 +++++++++--- arch/x86/kernel/crash.c | 18 +++++++++--------- arch/x86/kernel/pmem.c | 2 +- include/linux/ioport.h | 4 ++-- include/linux/kexec.h | 2 +- kernel/kexec_file.c | 5 +++-- kernel/resource.c | 9 +++++---- 7 files changed, 30 insertions(+), 22 deletions(-) diff --git a/arch/powerpc/kernel/machine_kexec_file_64.c b/arch/powerpc/kernel/machine_kexec_file_64.c index 992c0d2..e4395f9 100644 --- a/arch/powerpc/kernel/machine_kexec_file_64.c +++ b/arch/powerpc/kernel/machine_kexec_file_64.c @@ -91,11 +91,13 @@ int arch_kimage_file_post_load_cleanup(struct kimage *image) * and that value will be returned. If all free regions are visited without * func returning non-zero, then zero will be returned. */ -int arch_kexec_walk_mem(struct kexec_buf *kbuf, int (*func)(u64, u64, void *)) +int arch_kexec_walk_mem(struct kexec_buf *kbuf, + int (*func)(struct resource *, void *)) { int ret = 0; u64 i; phys_addr_t mstart, mend; + struct resource res = { }; if (kbuf->top_down) { for_each_free_mem_range_reverse(i, NUMA_NO_NODE, 0, @@ -105,7 +107,9 @@ int arch_kexec_walk_mem(struct kexec_buf *kbuf, int (*func)(u64, u64, void *)) * range while in kexec, end points to the last byte * in the range. */ - ret = func(mstart, mend - 1, kbuf); + res.start = mstart; + res.end = mend - 1; + ret = func(&res, kbuf); if (ret) break; } @@ -117,7 +121,9 @@ int arch_kexec_walk_mem(struct kexec_buf *kbuf, int (*func)(u64, u64, void *)) * range while in kexec, end points to the last byte * in the range. */ - ret = func(mstart, mend - 1, kbuf); + res.start = mstart; + res.end = mend - 1; + ret = func(&res, kbuf); if (ret) break; } diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c index 44404e2..815008c 100644 --- a/arch/x86/kernel/crash.c +++ b/arch/x86/kernel/crash.c @@ -209,7 +209,7 @@ void native_machine_crash_shutdown(struct pt_regs *regs) } #ifdef CONFIG_KEXEC_FILE -static int get_nr_ram_ranges_callback(u64 start, u64 end, void *arg) +static int get_nr_ram_ranges_callback(struct resource *res, void *arg) { unsigned int *nr_ranges = arg; @@ -342,7 +342,7 @@ static int elf_header_exclude_ranges(struct crash_elf_data *ced, return ret; } -static int prepare_elf64_ram_headers_callback(u64 start, u64 end, void *arg) +static int prepare_elf64_ram_headers_callback(struct resource *res, void *arg) { struct crash_elf_data *ced = arg; Elf64_Ehdr *ehdr; @@ -355,7 +355,7 @@ static int prepare_elf64_ram_headers_callback(u64 start, u64 end, void *arg) ehdr = ced->ehdr; /* Exclude unwanted mem ranges */ - ret = elf_header_exclude_ranges(ced, start, end); + ret = elf_header_exclude_ranges(ced, res->start, res->end); if (ret) return ret; @@ -518,14 +518,14 @@ static int add_e820_entry(struct boot_params *params, struct e820_entry *entry) return 0; } -static int memmap_entry_callback(u64 start, u64 end, void *arg) +static int memmap_entry_callback(struct resource *res, void *arg) { struct crash_memmap_data *cmd = arg; struct boot_params *params = cmd->params; struct e820_entry ei; - ei.addr = start; - ei.size = end - start + 1; + ei.addr = res->start; + ei.size = res->end - res->start + 1; ei.type = cmd->type; add_e820_entry(params, &ei); @@ -619,12 +619,12 @@ int crash_setup_memmap_entries(struct kimage *image, struct boot_params *params) return ret; } -static int determine_backup_region(u64 start, u64 end, void *arg) +static int determine_backup_region(struct resource *res, void *arg) { struct kimage *image = arg; - image->arch.backup_src_start = start; - image->arch.backup_src_sz = end - start + 1; + image->arch.backup_src_start = res->start; + image->arch.backup_src_sz = res->end - res->start + 1; /* Expecting only one range for backup region */ return 1; diff --git a/arch/x86/kernel/pmem.c b/arch/x86/kernel/pmem.c index 0c5315d..297bb71 100644 --- a/arch/x86/kernel/pmem.c +++ b/arch/x86/kernel/pmem.c @@ -6,7 +6,7 @@ #include #include -static int found(u64 start, u64 end, void *data) +static int found(struct resource *res, void *data) { return 1; } diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 6230064..1c66b9c 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h @@ -269,10 +269,10 @@ walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages, void *arg, int (*func)(unsigned long, unsigned long, void *)); extern int walk_system_ram_res(u64 start, u64 end, void *arg, - int (*func)(u64, u64, void *)); + int (*func)(struct resource *, void *)); extern int walk_iomem_res_desc(unsigned long desc, unsigned long flags, u64 start, u64 end, - void *arg, int (*func)(u64, u64, void *)); + void *arg, int (*func)(struct resource *, void *)); /* True if any part of r1 overlaps r2 */ static inline bool resource_overlaps(struct resource *r1, struct resource *r2) diff --git a/include/linux/kexec.h b/include/linux/kexec.h index 2b7590f..d672f95 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h @@ -159,7 +159,7 @@ struct kexec_buf { }; int __weak arch_kexec_walk_mem(struct kexec_buf *kbuf, - int (*func)(u64, u64, void *)); + int (*func)(struct resource *, void *)); extern int kexec_add_buffer(struct kexec_buf *kbuf); int kexec_locate_mem_hole(struct kexec_buf *kbuf); #endif /* CONFIG_KEXEC_FILE */ diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c index 9f48f44..e5bcd94 100644 --- a/kernel/kexec_file.c +++ b/kernel/kexec_file.c @@ -406,9 +406,10 @@ static int locate_mem_hole_bottom_up(unsigned long start, unsigned long end, return 1; } -static int locate_mem_hole_callback(u64 start, u64 end, void *arg) +static int locate_mem_hole_callback(struct resource *res, void *arg) { struct kexec_buf *kbuf = (struct kexec_buf *)arg; + u64 start = res->start, end = res->end; unsigned long sz = end - start + 1; /* Returning 0 will take to next memory range */ @@ -437,7 +438,7 @@ static int locate_mem_hole_callback(u64 start, u64 end, void *arg) * func returning non-zero, then zero will be returned. */ int __weak arch_kexec_walk_mem(struct kexec_buf *kbuf, - int (*func)(u64, u64, void *)) + int (*func)(struct resource *, void *)) { if (kbuf->image->type == KEXEC_TYPE_CRASH) return walk_iomem_res_desc(crashk_res.desc, diff --git a/kernel/resource.c b/kernel/resource.c index 7b20b3e..5f9ee7bb0 100644 --- a/kernel/resource.c +++ b/kernel/resource.c @@ -403,14 +403,15 @@ static int find_next_iomem_res(struct resource *res, unsigned long desc, static int __walk_iomem_res_desc(struct resource *res, unsigned long desc, bool first_level_children_only, - void *arg, int (*func)(u64, u64, void *)) + void *arg, + int (*func)(struct resource *, void *)) { u64 orig_end = res->end; int ret = -1; while ((res->start < res->end) && !find_next_iomem_res(res, desc, first_level_children_only)) { - ret = (*func)(res->start, res->end, arg); + ret = (*func)(res, arg); if (ret) break; @@ -436,7 +437,7 @@ static int __walk_iomem_res_desc(struct resource *res, unsigned long desc, * and set it in 'desc' of a target resource entry. */ int walk_iomem_res_desc(unsigned long desc, unsigned long flags, u64 start, - u64 end, void *arg, int (*func)(u64, u64, void *)) + u64 end, void *arg, int (*func)(struct resource *, void *)) { struct resource res; @@ -455,7 +456,7 @@ int walk_iomem_res_desc(unsigned long desc, unsigned long flags, u64 start, * ranges. */ int walk_system_ram_res(u64 start, u64 end, void *arg, - int (*func)(u64, u64, void *)) + int (*func)(struct resource *, void *)) { struct resource res; -- 2.9.4