aboutsummaryrefslogtreecommitdiff
path: root/target/riscv/XVentanaCondOps.decode
diff options
context:
space:
mode:
authorDaniel Henrique Barboza <dbarboza@ventanamicro.com>2023-07-06 07:17:24 -0300
committerAlistair Francis <alistair.francis@wdc.com>2023-07-10 22:29:15 +1000
commit492265ae8be70537391c08390cb7c64580c902d9 (patch)
tree67709150cf6230d1764ef258f54d2ad53dd46070 /target/riscv/XVentanaCondOps.decode
parentd6a427e2c0b249bc8d3e0b4d7c5150f829d0907a (diff)
downloadqemu-492265ae8be70537391c08390cb7c64580c902d9.zip
qemu-492265ae8be70537391c08390cb7c64580c902d9.tar.gz
qemu-492265ae8be70537391c08390cb7c64580c902d9.tar.bz2
target/riscv: use KVM scratch CPUs to init KVM properties
Certain validations, such as the validations done for the machine IDs (mvendorid/marchid/mimpid), are done before starting the CPU. Non-dynamic (named) CPUs tries to match user input with a preset default. As it is today we can't prefetch a KVM default for these cases because we're only able to read/write KVM regs after the vcpu is spinning. Our target/arm friends use a concept called "scratch CPU", which consists of creating a vcpu for doing queries and validations and so on, which is discarded shortly after use [1]. This is a suitable solution for what we need so let's implement it in target/riscv as well. kvm_riscv_init_machine_ids() will be used to do any pre-launch setup for KVM CPUs, via riscv_cpu_add_user_properties(). The function will create a KVM scratch CPU, fetch KVM regs that work as default values for user properties, and then discard the scratch CPU afterwards. We're starting by initializing 'mvendorid'. This concept will be used to init other KVM specific properties in the next patches as well. [1] target/arm/kvm.c, kvm_arm_create_scratch_host_vcpu() Suggested-by: Andrew Jones <ajones@ventanamicro.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: <20230706101738.460804-7-dbarboza@ventanamicro.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'target/riscv/XVentanaCondOps.decode')
0 files changed, 0 insertions, 0 deletions