x86/mm: factor out of top-down direct mapping setup
x86/mm: factor out of top-down direct mapping setup

Create a new function memory_map_top_down to factor out of the top-down
direct memory mapping pagetable setup.  This is also a preparation for the
following patch, which will introduce the bottom-up memory mapping.  That
said, we will put the two ways of pagetable setup into separate functions,
and choose to use which way in init_mem_mapping, which makes the code more
clear.

Signed-off-by: Tang Chen <4f61c4810b5ff5aa3e373c07e6d9ef9c55e4952f@cn.fujitsu.com>
Signed-off-by: Zhang Yanfei <534d7ac402faa9bfcaa7a720189a515766d4eb1f@cn.fujitsu.com>
Acked-by: Tejun Heo <546b05909706652891a87f7bfe385ae147f61f91@kernel.org>
Acked-by: Toshi Kani <322b9f75d3806917607539efc168804d71b9503d@hp.com>
Cc: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>
Cc: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>
Cc: "H. Peter Anvin" <8a453bad9912ffe59bc0f0b8abe03df9be19379e@zytor.com>
Cc: Wanpeng Li <86d530c4a0b810dc887df1e4e084ed44c9b7acac@linux.vnet.ibm.com>
Cc: Thomas Renninger <dc31099191a1a231a41b126c85d59916cd0f555f@suse.de>
Cc: Yinghai Lu <0674548f4d596393408a51d6287a76ebba2f42aa@kernel.org>
Cc: Jiang Liu <68ee766e574f18b34b683085865827393efe88bd@huawei.com>
Cc: Wen Congyang <59c7438a9275f5dd0b96a91958b493a9d005ad46@cn.fujitsu.com>
Cc: Lai Jiangshan <4c9eb49378914b743bdd32292c04df29b820d73e@cn.fujitsu.com>
Cc: Yasuaki Ishimatsu <9b26f769475fafc2d25107053b1bdd774d49438a@jp.fujitsu.com>
Cc: Taku Izumi <23ca3fc138fbd3784aec73bbc7a412bdd1fcadfc@jp.fujitsu.com>
Cc: Mel Gorman <39ea6a09710987173e32e37c86918024a0f441c1@suse.de>
Cc: Michal Nazarewicz <605208d9b4c769ca62e9f9f8b592c9cd465fe6d7@mina86.com>
Cc: Minchan Kim <eee62f459f15dcddf87a8df69e8328e2a2562028@kernel.org>
Cc: Rik van Riel <a21938f5d463ddf41aa718934c205ca2cce8ebbc@redhat.com>
Cc: Johannes Weiner <331be22c6b63ca3e0a03d408c2d906b1b02cd5f2@cmpxchg.org>
Cc: Kamezawa Hiroyuki <634f508bd7c47cf0ee4126243675c3e598920fbc@jp.fujitsu.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs