Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932181Ab2JJBxg (ORCPT ); Tue, 9 Oct 2012 21:53:36 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]:49405 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755250Ab2JJBxe (ORCPT ); Tue, 9 Oct 2012 21:53:34 -0400 MIME-Version: 1.0 In-Reply-To: <1349827115-16600-7-git-send-email-yinghai@kernel.org> References: <1349827115-16600-1-git-send-email-yinghai@kernel.org> <1349827115-16600-7-git-send-email-yinghai@kernel.org> Date: Tue, 9 Oct 2012 18:53:31 -0700 X-Google-Sender-Auth: 5oRuxSeefMv6tV5rsdGhl8Nk9q0 Message-ID: Subject: Re: [PATCH 6/7] x86, mm: setup page table from top-down From: Yinghai Lu To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Jacob Shin , Tejun Heo Cc: Stefano Stabellini , linux-kernel@vger.kernel.org, Yinghai Lu Content-Type: multipart/mixed; boundary=0015175cd7eacd889c04cbaab8f1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 17224 Lines: 238 --0015175cd7eacd889c04cbaab8f1 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Oct 9, 2012 at 4:58 PM, Yinghai Lu wrote: > Get pgt_buf early from BRK, and use it to map PMD_SIZE to top at first. > then use page from PMD_SIZE to map next blow range. > > alloc_low_page will use page from BRK at first, then will switch to use > to memblock to find and reserve page for page table usage. > > At last we could get rid of calculation and find early pgt related code. > > Suggested-by: "H. Peter Anvin" > Signed-off-by: Yinghai Lu sorry , there one typo in this patch, please use attached one instead. --0015175cd7eacd889c04cbaab8f1 Content-Type: application/octet-stream; name="fix_max_pfn_xx_13.patch" Content-Disposition: attachment; filename="fix_max_pfn_xx_13.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_h83sbjt90 U3ViamVjdDogW1BBVENIXS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0JaWYgKHBmbiA+PSBwZ3RfYnVmX3RvcCkKLQkJcGFuaWMoImFsbG9jX2xvd19wYWdlOiBy YW4gb3V0IG9mIG1lbW9yeSIpOworCWlmICgocGd0X2J1Zl9lbmQgKyAxKSA+PSBwZ3RfYnVmX3Rv cCkgeworCQl1bnNpZ25lZCBsb25nIHJldDsKKwkJaWYgKG1pbl9wZm5fbWFwcGVkID49IG1heF9w Zm5fbWFwcGVkKQorCQkJcGFuaWMoImFsbG9jX2xvd19wYWdlOiByYW4gb3V0IG9mIG1lbW9yeSIp OworCQlyZXQgPSBtZW1ibG9ja19maW5kX2luX3JhbmdlKG1pbl9wZm5fbWFwcGVkIDw8IFBBR0Vf U0hJRlQsCisJCQkJCW1heF9wZm5fbWFwcGVkIDw8IFBBR0VfU0hJRlQsCisJCQkJCVBBR0VfU0la RSwgUEFHRV9TSVpFKTsKKwkJaWYgKCFyZXQpCisJCQlwYW5pYygiYWxsb2NfbG93X3BhZ2U6IGNh biBub3QgYWxsb2MgbWVtb3J5Iik7CisJCW1lbWJsb2NrX3Jlc2VydmUocmV0LCBQQUdFX1NJWkUp OworCQlwZm4gPSByZXQgPj4gUEFHRV9TSElGVDsKKwl9IGVsc2UKKwkJcGZuID0gcGd0X2J1Zl9l bmQrKzsKIAogCWFkciA9IGVhcmx5X21lbXJlbWFwKHBmbiAqIFBBR0VfU0laRSwgUEFHRV9TSVpF KTsKIAljbGVhcl9wYWdlKGFkcik7Cg== --0015175cd7eacd889c04cbaab8f1-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/