)]}'
{
  "commit": "f396c217a53d9b7960dd002fbb07cfe1d46b27aa",
  "tree": "be4ce2fca8ed375bda039e163dfa29622d39c0da",
  "parents": [
    "d3b6f1742c36e3a3c1e74cb60646ee98a4e39ea3"
  ],
  "author": {
    "name": "Daniel Henrique Barboza",
    "email": "dbarboza@ventanamicro.com",
    "time": "Tue Apr 29 09:44:18 2025 -0300"
  },
  "committer": {
    "name": "Alistair Francis",
    "email": "alistair.francis@wdc.com",
    "time": "Mon May 19 13:42:34 2025 +1000"
  },
  "message": "target/riscv/kvm: do not read unavailable CSRs\n\n[1] reports that commit 4db19d5b21 broke a KVM guest running kernel 6.6.\nThis happens because the kernel does not know \u0027senvcfg\u0027, making it\nunable to boot because QEMU is reading/wriiting it without any checks.\n\nAfter converting the CSRs to do \"automated\" get/put reg procedures in\nthe previous patch we can now scan for availability. Two functions are\ncreated:\n\n- kvm_riscv_read_csr_cfg_legacy() will check if the CSR exists by brute\n  forcing KVM_GET_ONE_REG in each one of them, interpreting an EINVAL\n  return as indication that the CSR isn\u0027t available. This will be use in\n  absence of KVM_GET_REG_LIST;\n\n- kvm_riscv_read_csr_cfg() will use the existing result of get_reg_list\n  to check if the CSRs ids are present.\n\nkvm_riscv_init_multiext_cfg() is now kvm_riscv_init_cfg() to reflect that\nthe function is also dealing with CSRs.\n\n[1] https://lore.kernel.org/qemu-riscv/CABJz62OfUDHYkQ0T3rGHStQprf1c7_E0qBLbLKhfv\u003d+jb0SYAw@mail.gmail.com/\n\nFixes: 4db19d5b21 (\"target/riscv/kvm: add missing KVM CSRs\")\nReported-by: Andrea Bolognani \u003cabologna@redhat.com\u003e\nSigned-off-by: Daniel Henrique Barboza \u003cdbarboza@ventanamicro.com\u003e\nReviewed-by: Andrew Jones \u003cajones@ventanamicro.com\u003e\nAcked-by: Alistair Francis \u003calistair.francis@wdc.com\u003e\nMessage-ID: \u003c20250429124421.223883-7-dbarboza@ventanamicro.com\u003e\nSigned-off-by: Alistair Francis \u003calistair.francis@wdc.com\u003e\nCc: qemu-stable@nongnu.org\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "3740514bba6f617cd90af8d45d6bce19c048f60d",
      "old_mode": 33188,
      "old_path": "target/riscv/kvm/kvm-cpu.c",
      "new_id": "344616c1ccb28b606cffafdb306e81e91c916878",
      "new_mode": 33188,
      "new_path": "target/riscv/kvm/kvm-cpu.c"
    }
  ]
}
