)]}'
{
  "commit": "7ec8925df7e76a43e69778b84f7058284bc19b7d",
  "tree": "7094e7eb8b82da93d6057071d770103485307121",
  "parents": [
    "419e8d7d134e781540cc694e78138e80c4a7a541"
  ],
  "author": {
    "name": "Ahmed Genidi",
    "email": "ahmed.genidi@arm.com",
    "time": "Thu Feb 27 18:05:26 2025 +0000"
  },
  "committer": {
    "name": "Quentin Perret",
    "email": "qperret@google.com",
    "time": "Wed Jun 25 13:13:00 2025 +0000"
  },
  "message": "KVM: arm64: Initialize SCTLR_EL1 in __kvm_hyp_init_cpu()\n\nWhen KVM is in protected mode, host calls to PSCI are proxied via EL2,\nand cold entries from CPU_ON, CPU_SUSPEND, and SYSTEM_SUSPEND bounce\nthrough __kvm_hyp_init_cpu() at EL2 before entering the host kernel\u0027s\nentry point at EL1. While __kvm_hyp_init_cpu() initializes SPSR_EL2 for\nthe exception return to EL1, it does not initialize SCTLR_EL1.\n\nDue to this, it\u0027s possible to enter EL1 with SCTLR_EL1 in an UNKNOWN\nstate. In practice this has been seen to result in kernel crashes after\nCPU_ON as a result of SCTLR_EL1.M being 1 in violation of the initial\ncore configuration specified by PSCI.\n\nFix this by initializing SCTLR_EL1 for cold entry to the host kernel.\nAs it\u0027s necessary to write to SCTLR_EL12 in VHE mode, this\ninitialization is moved into __kvm_host_psci_cpu_entry() where we can\nuse write_sysreg_el1().\n\nThe remnants of the \u0027__init_el2_nvhe_prepare_eret\u0027 macro are folded into\nits only caller, as this is clearer than having the macro.\n\nFixes: cdf367192766ad11 (\"KVM: arm64: Intercept host\u0027s CPU_ON SMCs\")\nReported-by: Leo Yan \u003cleo.yan@arm.com\u003e\nSigned-off-by: Ahmed Genidi \u003cahmed.genidi@arm.com\u003e\n[ Mark: clarify commit message, handle E2H, move to C, remove macro ]\nSigned-off-by: Mark Rutland \u003cmark.rutland@arm.com\u003e\nCc: Ahmed Genidi \u003cahmed.genidi@arm.com\u003e\nCc: Ben Horgan \u003cben.horgan@arm.com\u003e\nCc: Catalin Marinas \u003ccatalin.marinas@arm.com\u003e\nCc: Leo Yan \u003cleo.yan@arm.com\u003e\nCc: Marc Zyngier \u003cmaz@kernel.org\u003e\nCc: Oliver Upton \u003coliver.upton@linux.dev\u003e\nCc: Will Deacon \u003cwill@kernel.org\u003e\nReviewed-by: Leo Yan \u003cleo.yan@arm.com\u003e\nLink: https://lore.kernel.org/r/20250227180526.1204723-3-mark.rutland@arm.com\nSigned-off-by: Marc Zyngier \u003cmaz@kernel.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "56034a394b43793e27fa38c5e2d50d77fa867d89",
      "old_mode": 33188,
      "old_path": "arch/arm64/include/asm/el2_setup.h",
      "new_id": "555c613fd2324afe0a4872c08907c5db61c98638",
      "new_mode": 33188,
      "new_path": "arch/arm64/include/asm/el2_setup.h"
    },
    {
      "type": "modify",
      "old_id": "2d56459d6c94c51b47d5261c7c08d0a8998fb4ad",
      "old_mode": 33188,
      "old_path": "arch/arm64/kernel/head.S",
      "new_id": "2ce73525de2c95bd72ce9ee6a73540b04b220623",
      "new_mode": 33188,
      "new_path": "arch/arm64/kernel/head.S"
    },
    {
      "type": "modify",
      "old_id": "3fb5504a7d7fc203ad3b427778b81650a870e79c",
      "old_mode": 33188,
      "old_path": "arch/arm64/kvm/hyp/nvhe/hyp-init.S",
      "new_id": "f8af11189572fce7e6ab153e45ae745b611edb51",
      "new_mode": 33188,
      "new_path": "arch/arm64/kvm/hyp/nvhe/hyp-init.S"
    },
    {
      "type": "modify",
      "old_id": "9c2ce1e0e99a55043f00d57cf4870385a93bdd25",
      "old_mode": 33188,
      "old_path": "arch/arm64/kvm/hyp/nvhe/psci-relay.c",
      "new_id": "c3e196fb8b18fb2daefa7f7f6cb420873c3a13b7",
      "new_mode": 33188,
      "new_path": "arch/arm64/kvm/hyp/nvhe/psci-relay.c"
    }
  ]
}
