diff options
author | Daniel Henrique Barboza <dbarboza@ventanamicro.com> | 2025-04-29 09:44:17 -0300 |
---|---|---|
committer | Alistair Francis <alistair.francis@wdc.com> | 2025-05-19 13:42:18 +1000 |
commit | d3b6f1742c36e3a3c1e74cb60646ee98a4e39ea3 (patch) | |
tree | 8b2d100230d7d7322cab1883af5dae3049762aa4 /python | |
parent | 11766e17616a5a4181d4a63f88adf67ac52c553b (diff) | |
download | qemu-d3b6f1742c36e3a3c1e74cb60646ee98a4e39ea3.zip qemu-d3b6f1742c36e3a3c1e74cb60646ee98a4e39ea3.tar.gz qemu-d3b6f1742c36e3a3c1e74cb60646ee98a4e39ea3.tar.bz2 |
target/riscv/kvm: add kvm_csr_cfgs[]
At this moment we're not checking if the host has support for any
specific CSR before doing get/put regs. This will cause problems if the
host KVM doesn't support it (see [1] as an example).
We'll use the same approach done with the CPU extensions: read all known
KVM CSRs during init() to check for availability, then read/write them
if they are present. This will be made by either using get-reglist or by
directly reading the CSRs.
For now we'll just convert the CSRs to use a kvm_csr_cfg[] array,
reusing the same KVMCPUConfig abstraction we use for extensions, and use
the array in (get|put)_csr_regs() instead of manually listing them. A
lot of boilerplate will be added but at least we'll automate the get/put
procedure for CSRs, i.e. adding a new CSR in the future will be a matter
of adding it in kvm_csr_regs[] and everything else will be taken care
of.
Despite all the code changes no behavioral change is made.
[1] https://lore.kernel.org/qemu-riscv/CABJz62OfUDHYkQ0T3rGHStQprf1c7_E0qBLbLKhfv=+jb0SYAw@mail.gmail.com/
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20250429124421.223883-6-dbarboza@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Cc: qemu-stable@nongnu.org
Diffstat (limited to 'python')
0 files changed, 0 insertions, 0 deletions