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