)]}'
{
  "commit": "d0f35f6fdd1d3cff1e4c73765699fb843075310f",
  "tree": "7dd25e1be67a3ed8a73af10908bf910701742417",
  "parents": [
    "ed4d95d033e359f9445e85bf5a768a5859a5830b"
  ],
  "author": {
    "name": "Ard Biesheuvel",
    "email": "ardb@kernel.org",
    "time": "Fri Apr 25 09:48:54 2025 +0200"
  },
  "committer": {
    "name": "Ard Biesheuvel",
    "email": "ardb@kernel.org",
    "time": "Mon May 05 07:59:46 2025 +0200"
  },
  "message": "x86/boot: Set LA57 boot CPU capability very early during boot\n\nCurrently, some source files in the core kernel #define\nUSE_EARLY_PGTABLE_L5 to opt into an alternative implementation of\npgtable_l5_enabled(), which is based on a variable that is set during\nearly boot. This is needed because the late version relies on CPU\nfeatures, which are detected only much later, and pgtable_l5_enabled()\nis used very early, when populating the kernel page tables.\n\nHaving two sources of truth is problematic, given that VA space related\nconstants (such as KASAN_SHADOW_START) are derived from it, and may\ntherefore assume different values depending on which object they are\nreferenced from.\n\nSo instead, set the LA57 capability on the boot CPU before setting up\nthe page tables. This removes the need for two different sources of\ntruth in the core kernel, and allows a single, efficient implementation\nof pgtable_l5_enabled() to be used (one that uses code patching to\noptimize away the capability mask test entirely). This also removes the\nneed for exposing the variable __pgtable_l5_enabled to the startup code.\n\nNote that even the decompressor does not manipulate any page tables\nbefore updating CR4.LA57, so it can also avoid the associated global\nvariables entirely. In this case, just access CR4.LA57 directly in its\nimplementation of pgtable_l5_enabled().\n\nThis change also removes the need to disable KASAN while performing\nalternatives patching, as KASAN_SHADOW_START no longer assumes different\nvalues depending on whether the source file that pulls it in #define\u0027s\nUSE_EARLY_PGTABLE_L5 or not.\n\nSigned-off-by: Ard Biesheuvel \u003cardb@kernel.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "db1048621ea2eda52c346f9ee5bd9e59b6458bf5",
      "old_mode": 33188,
      "old_path": "arch/x86/boot/compressed/misc.h",
      "new_id": "bce7cc2e0f96fd4cd8df42b3a6ecc26e24b9c968",
      "new_mode": 33188,
      "new_path": "arch/x86/boot/compressed/misc.h"
    },
    {
      "type": "modify",
      "old_id": "5a6c7a190e5bce7add3ad60fae0ed8b2af843898",
      "old_mode": 33188,
      "old_path": "arch/x86/boot/compressed/pgtable_64.c",
      "new_id": "25c8585ca592755451b4a1e17754e293ecf991c9",
      "new_mode": 33188,
      "new_path": "arch/x86/boot/compressed/pgtable_64.c"
    },
    {
      "type": "modify",
      "old_id": "099ae25593361aa2c5fd4550aff34f8f65520276",
      "old_mode": 33188,
      "old_path": "arch/x86/boot/startup/map_kernel.c",
      "new_id": "3a8c4101c4658fb510cd69465697652fd9f62bb8",
      "new_mode": 33188,
      "new_path": "arch/x86/boot/startup/map_kernel.c"
    },
    {
      "type": "modify",
      "old_id": "753cd2094080bdc3539fdba7a9706218ebf4bebf",
      "old_mode": 33188,
      "old_path": "arch/x86/boot/startup/sme.c",
      "new_id": "c791f6b8a92f414d7daa35e40a386df0c9e34641",
      "new_mode": 33188,
      "new_path": "arch/x86/boot/startup/sme.c"
    },
    {
      "type": "modify",
      "old_id": "5bb782d856f2c43e1d5750848f865f5ca87477cf",
      "old_mode": 33188,
      "old_path": "arch/x86/include/asm/pgtable_64_types.h",
      "new_id": "c5a66d9185828b5d2739a2d575e1fe729810f824",
      "new_mode": 33188,
      "new_path": "arch/x86/include/asm/pgtable_64_types.h"
    },
    {
      "type": "modify",
      "old_id": "bf82c6f7d690557dd76efef6fab216f94005ed54",
      "old_mode": 33188,
      "old_path": "arch/x86/kernel/alternative.c",
      "new_id": "f4a8b81aac43778e32ba4167683b0e3c0c5f3ebd",
      "new_mode": 33188,
      "new_path": "arch/x86/kernel/alternative.c"
    },
    {
      "type": "modify",
      "old_id": "f0f85482a73b4c9fea9cb28cbf46b86aa51ac98f",
      "old_mode": 33188,
      "old_path": "arch/x86/kernel/cpu/common.c",
      "new_id": "847e3d619883cf8f4e60b1d4965a545fee82a85d",
      "new_mode": 33188,
      "new_path": "arch/x86/kernel/cpu/common.c"
    },
    {
      "type": "modify",
      "old_id": "510fb41f55fce7521943f6c0f065509b7cb726e0",
      "old_mode": 33188,
      "old_path": "arch/x86/kernel/head64.c",
      "new_id": "b9b37e3de86a7ce672df9b3b366213214be0ceaa",
      "new_mode": 33188,
      "new_path": "arch/x86/kernel/head64.c"
    },
    {
      "type": "modify",
      "old_id": "0539efd0d216b99db014469e14602178154d9a9a",
      "old_mode": 33188,
      "old_path": "arch/x86/mm/kasan_init_64.c",
      "new_id": "7c4fafbd52cc999288aa7695b40f677245494b95",
      "new_mode": 33188,
      "new_path": "arch/x86/mm/kasan_init_64.c"
    }
  ]
}
