)]}'
{
  "commit": "c2415c407a2cde01290d52ce2a1f81b0616379a3",
  "tree": "c221c26ce886a337be80d8b04de622393845bb97",
  "parents": [
    "fcf8239ad6a5de54fa7ce18e464c6b5951b982cb"
  ],
  "author": {
    "name": "K Prateek Nayak",
    "email": "kprateek.nayak@amd.com",
    "time": "Mon Aug 25 07:57:29 2025 +0000"
  },
  "committer": {
    "name": "Borislav Petkov (AMD)",
    "email": "bp@alien8.de",
    "time": "Wed Aug 27 11:31:11 2025 +0200"
  },
  "message": "x86/cpu/topology: Use initial APIC ID from XTOPOLOGY leaf on AMD/HYGON\n\nPrior to the topology parsing rewrite and the switchover to the new parsing\nlogic for AMD processors in\n\n  c749ce393b8f (\"x86/cpu: Use common topology code for AMD\"),\n\nthe initial_apicid on these platforms was:\n\n- First initialized to the LocalApicId from CPUID leaf 0x1 EBX[31:24].\n\n- Then overwritten by the ExtendedLocalApicId in CPUID leaf 0xb\n  EDX[31:0] on processors that supported topoext.\n\nWith the new parsing flow introduced in\n\n  f7fb3b2dd92c (\"x86/cpu: Provide an AMD/HYGON specific topology parser\"),\n\nparse_8000_001e() now unconditionally overwrites the initial_apicid already\nparsed during cpu_parse_topology_ext().\n\nAlthough this has not been a problem on baremetal platforms, on virtualized AMD\nguests that feature more than 255 cores, QEMU zeros out the CPUID leaf\n0x8000001e on CPUs with CoreID \u003e 255 to prevent collision of these IDs in\nEBX[7:0] which can only represent a maximum of 255 cores [1].\n\nThis results in the following FW_BUG being logged when booting a guest\nwith more than 255 cores:\n\n    [Firmware Bug]: CPU 512: APIC ID mismatch. CPUID: 0x0000 APIC: 0x0200\n\nAMD64 Architecture Programmer\u0027s Manual Volume 2: System Programming Pub.\n24593 Rev. 3.42 [2] Section 16.12 \"x2APIC_ID\" mentions the Extended\nEnumeration leaf 0xb (Fn0000_000B_EDX[31:0])(which was later superseded by the\nextended leaf 0x80000026) provides the full x2APIC ID under all circumstances\nunlike the one reported by CPUID leaf 0x8000001e EAX which depends on the mode\nin which APIC is configured.\n\nRely on the APIC ID parsed during cpu_parse_topology_ext() from CPUID leaf\n0x80000026 or 0xb and only use the APIC ID from leaf 0x8000001e if\ncpu_parse_topology_ext() failed (has_topoext is false).\n\nOn platforms that support the 0xb leaf (Zen2 or later, AMD guests on\nQEMU) or the extended leaf 0x80000026 (Zen4 or later), the\ninitial_apicid is now set to the value parsed from EDX[31:0].\n\nOn older AMD/Hygon platforms that do not support the 0xb leaf but support the\nTOPOEXT extension (families 0x15, 0x16, 0x17[Zen1], and Hygon), retain current\nbehavior where the initial_apicid is set using the 0x8000001e leaf.\n\nIssue debugged by Naveen N Rao (AMD) \u003cnaveen@kernel.org\u003e and Sairaj Kodilkar\n\u003csarunkod@amd.com\u003e.\n\n  [ bp: Massage commit message. ]\n\nFixes: c749ce393b8f (\"x86/cpu: Use common topology code for AMD\")\nSuggested-by: Thomas Gleixner \u003ctglx@linutronix.de\u003e\nSigned-off-by: K Prateek Nayak \u003ckprateek.nayak@amd.com\u003e\nSigned-off-by: Borislav Petkov (AMD) \u003cbp@alien8.de\u003e\nTested-by: Naveen N Rao (AMD) \u003cnaveen@kernel.org\u003e\nCc: stable@vger.kernel.org\nLink: https://github.com/qemu/qemu/commit/35ac5dfbcaa4b [1]\nLink: https://bugzilla.kernel.org/show_bug.cgi?id\u003d206537 [2]\nLink: https://lore.kernel.org/20250825075732.10694-2-kprateek.nayak@amd.com\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "843b1655ab45dffb55f7288a7f22c07cab0cbc90",
      "old_mode": 33188,
      "old_path": "arch/x86/kernel/cpu/topology_amd.c",
      "new_id": "827dd0dbb6e9d2b997913d1df5b597896ea7325a",
      "new_mode": 33188,
      "new_path": "arch/x86/kernel/cpu/topology_amd.c"
    }
  ]
}
