Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751881AbdI0UBs (ORCPT ); Wed, 27 Sep 2017 16:01:48 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:24171 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750981AbdI0UBq (ORCPT ); Wed, 27 Sep 2017 16:01:46 -0400 Subject: Re: [PATCH v2] Call xen_cleanhighmap() with 4MB aligned for page tables mapping To: Juergen Gross , Zhenzhong Duan , mingo@redhat.com, tglx@linutronix.de, hpa@zytor.com References: <85bd42d5-b0d2-40f5-81a9-14cb51ec4503@default> Cc: x86@kernel.org, xen-devel@lists.xenproject.org, srinivas.eeda@oracle.com, joe.jin@oracle.com, linux-kernel@vger.kernel.org From: Boris Ostrovsky Message-ID: Date: Wed, 27 Sep 2017 16:01:15 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2850 Lines: 62 On 09/27/2017 05:43 AM, Juergen Gross wrote: > On 27/09/17 11:41, Zhenzhong Duan wrote: >> When bootup a PVM guest with large memory(Ex.240GB), XEN provided initial >> mapping overlaps with kernel module virtual space. When mapping in this space >> is cleared by xen_cleanhighmap(), in certain case there could be an 2MB mapping >> left. This is due to XEN initialize 4MB aligned mapping but xen_cleanhighmap() >> finish at 2MB boundary. >> >> When module loading is just on top of the 2MB space, got below warning: >> >> WARNING: at mm/vmalloc.c:106 vmap_pte_range+0x14e/0x190() >> Call Trace: >> [] warn_alloc_failed+0xf3/0x160 >> [] __vmalloc_area_node+0x182/0x1c0 >> [] ? module_alloc_update_bounds+0x1e/0x80 >> [] __vmalloc_node_range+0xa7/0x110 >> [] ? module_alloc_update_bounds+0x1e/0x80 >> [] module_alloc+0x64/0x70 >> [] ? module_alloc_update_bounds+0x1e/0x80 >> [] module_alloc_update_bounds+0x1e/0x80 >> [] move_module+0x27/0x150 >> [] layout_and_allocate+0x120/0x1b0 >> [] load_module+0x78/0x640 >> [] ? security_file_permission+0x8b/0x90 >> [] sys_init_module+0x62/0x1e0 >> [] system_call_fastpath+0x16/0x1b >> >> Then the mapping of 2MB is cleared, finally oops when the page in that space is >> accessed. >> >> BUG: unable to handle kernel paging request at ffff880022600000 >> IP: [] clear_page_c_e+0x7/0x10 >> PGD 1788067 PUD 178c067 PMD 22434067 PTE 0 >> Oops: 0002 [#1] SMP >> Call Trace: >> [] ? prep_new_page+0x127/0x1c0 >> [] get_page_from_freelist+0x1e2/0x550 >> [] ? ii_iovec_copy_to_user+0x90/0x140 >> [] __alloc_pages_nodemask+0x12d/0x230 >> [] alloc_pages_vma+0xc6/0x1a0 >> [] ? pte_mfn_to_pfn+0x7d/0x100 >> [] do_anonymous_page+0x16b/0x350 >> [] handle_pte_fault+0x1e4/0x200 >> [] ? xen_pmd_val+0xe/0x10 >> [] ? __raw_callee_save_xen_pmd_val+0x11/0x1e >> [] handle_mm_fault+0x15b/0x270 >> [] do_page_fault+0x140/0x470 >> [] page_fault+0x25/0x30 >> >> Call xen_cleanhighmap() with 4MB aligned for page tables mapping to fix it. >> The unnecessory call of xen_cleanhighmap() in DEBUG mode is also removed. >> >> -v2: add comment about XEN alignment from Juergen. >> >> References: https://lists.xen.org/archives/html/xen-devel/2012-07/msg01562.html >> Signed-off-by: Zhenzhong Duan > Reviewed-by: Juergen Gross Applied to for-linus-14b -boris