)]}'
{
  "commit": "279b706bf800b5967037f492dbe4fc5081ad5d0f",
  "tree": "608b9455cd6af84018bd5096b45e0ca90f9c7619",
  "parents": [
    "92bdaef7b2c5d3cb8abc902faa1f7670a183dcdc"
  ],
  "author": {
    "name": "Stefano Stabellini",
    "email": "stefano.stabellini@eu.citrix.com",
    "time": "Thu Apr 14 15:49:41 2011 +0100"
  },
  "committer": {
    "name": "Konrad Rzeszutek Wilk",
    "email": "konrad.wilk@oracle.com",
    "time": "Thu May 12 13:05:04 2011 -0400"
  },
  "message": "x86,xen: introduce x86_init.mapping.pagetable_reserve\n\nIntroduce a new x86_init hook called pagetable_reserve that at the end\nof init_memory_mapping is used to reserve a range of memory addresses for\nthe kernel pagetable pages we used and free the other ones.\n\nOn native it just calls memblock_x86_reserve_range while on xen it also\ntakes care of setting the spare memory previously allocated\nfor kernel pagetable pages from RO to RW, so that it can be used for\nother purposes.\n\nA detailed explanation of the reason why this hook is needed follows.\n\nAs a consequence of the commit:\n\ncommit 4b239f458c229de044d6905c2b0f9fe16ed9e01e\nAuthor: Yinghai Lu \u003cyinghai@kernel.org\u003e\nDate:   Fri Dec 17 16:58:28 2010 -0800\n\n    x86-64, mm: Put early page table high\n\nat some point init_memory_mapping is going to reach the pagetable pages\narea and map those pages too (mapping them as normal memory that falls\nin the range of addresses passed to init_memory_mapping as argument).\nSome of those pages are already pagetable pages (they are in the range\npgt_buf_start-pgt_buf_end) therefore they are going to be mapped RO and\neverything is fine.\nSome of these pages are not pagetable pages yet (they fall in the range\npgt_buf_end-pgt_buf_top; for example the page at pgt_buf_end) so they\nare going to be mapped RW.  When these pages become pagetable pages and\nare hooked into the pagetable, xen will find that the guest has already\na RW mapping of them somewhere and fail the operation.\nThe reason Xen requires pagetables to be RO is that the hypervisor needs\nto verify that the pagetables are valid before using them. The validation\noperations are called \"pinning\" (more details in arch/x86/xen/mmu.c).\n\nIn order to fix the issue we mark all the pages in the entire range\npgt_buf_start-pgt_buf_top as RO, however when the pagetable allocation\nis completed only the range pgt_buf_start-pgt_buf_end is reserved by\ninit_memory_mapping. Hence the kernel is going to crash as soon as one\nof the pages in the range pgt_buf_end-pgt_buf_top is reused (b/c those\nranges are RO).\n\nFor this reason we need a hook to reserve the kernel pagetable pages we\nused and free the other ones so that they can be reused for other\npurposes.\nOn native it just means calling memblock_x86_reserve_range, on Xen it\nalso means marking RW the pagetable pages that we allocated before but\nthat haven\u0027t been used before.\n\nAnother way to fix this is without using the hook is by adding a \u0027if\n(xen_pv_domain)\u0027 in the \u0027init_memory_mapping\u0027 code and calling the Xen\ncounterpart, but that is just nasty.\n\nSigned-off-by: Stefano Stabellini \u003cstefano.stabellini@eu.citrix.com\u003e\nAcked-by: Yinghai Lu \u003cyinghai@kernel.org\u003e\nAcked-by: H. Peter Anvin \u003chpa@zytor.com\u003e\nCc: Ingo Molnar \u003cmingo@elte.hu\u003e\nSigned-off-by: Konrad Rzeszutek Wilk \u003ckonrad.wilk@oracle.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7db7723d1f325f8016666806f790a015a4005c6b",
      "old_mode": 33188,
      "old_path": "arch/x86/include/asm/pgtable_types.h",
      "new_id": "d56187c6b8385425bb893f8d70003cb70290243a",
      "new_mode": 33188,
      "new_path": "arch/x86/include/asm/pgtable_types.h"
    },
    {
      "type": "modify",
      "old_id": "643ebf2e2ad8733ddbec5ca884ee21bf405c0226",
      "old_mode": 33188,
      "old_path": "arch/x86/include/asm/x86_init.h",
      "new_id": "d3d859035af9e1968d0ad9d4a39000331c27c8f1",
      "new_mode": 33188,
      "new_path": "arch/x86/include/asm/x86_init.h"
    },
    {
      "type": "modify",
      "old_id": "c11514e9128b53cf0b6ad66d844c7703a6a8523a",
      "old_mode": 33188,
      "old_path": "arch/x86/kernel/x86_init.c",
      "new_id": "75ef4b18e9b7963280c808bd59d1abe5579673ca",
      "new_mode": 33188,
      "new_path": "arch/x86/kernel/x86_init.c"
    },
    {
      "type": "modify",
      "old_id": "286d289b039b876ef046565d29552827d76f243c",
      "old_mode": 33188,
      "old_path": "arch/x86/mm/init.c",
      "new_id": "722a4c372ce3dfa7fb9aa830ea09117b9d1ba445",
      "new_mode": 33188,
      "new_path": "arch/x86/mm/init.c"
    },
    {
      "type": "modify",
      "old_id": "cf4ef61e425b7a719ebce4d96476e210d952610c",
      "old_mode": 33188,
      "old_path": "arch/x86/xen/mmu.c",
      "new_id": "0684f3c74d5361a317148c99c468f11e25257ce8",
      "new_mode": 33188,
      "new_path": "arch/x86/xen/mmu.c"
    }
  ]
}
