[PATCH v2 1/6] RISC-V: KVM: Change zicbom/zicboz block size to depend on the host isa
Troy Mitchell
troy.mitchell at linux.spacemit.com
Mon Aug 18 18:17:40 PDT 2025
On Fri, Aug 08, 2025 at 06:18:21PM +0800, zhouquan at iscas.ac.cn wrote:
> From: Quan Zhou <zhouquan at iscas.ac.cn>
>
> The zicbom/zicboz block size registers should depend on the host's isa,
> the reason is that we otherwise create an ioctl order dependency on the VMM.
>
> Signed-off-by: Quan Zhou <zhouquan at iscas.ac.cn>
> ---
> arch/riscv/kvm/vcpu_onereg.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
Reviwed-by: Troy Mitchell <troy.mitchell at linux.spacemit.com>
Best regards,
Troy
>
> diff --git a/arch/riscv/kvm/vcpu_onereg.c b/arch/riscv/kvm/vcpu_onereg.c
> index cce6a38ea54f..6bd64ae17b80 100644
> --- a/arch/riscv/kvm/vcpu_onereg.c
> +++ b/arch/riscv/kvm/vcpu_onereg.c
> @@ -277,12 +277,12 @@ static int kvm_riscv_vcpu_get_reg_config(struct kvm_vcpu *vcpu,
> reg_val = vcpu->arch.isa[0] & KVM_RISCV_BASE_ISA_MASK;
> break;
> case KVM_REG_RISCV_CONFIG_REG(zicbom_block_size):
> - if (!riscv_isa_extension_available(vcpu->arch.isa, ZICBOM))
> + if (!riscv_isa_extension_available(NULL, ZICBOM))
> return -ENOENT;
> reg_val = riscv_cbom_block_size;
> break;
> case KVM_REG_RISCV_CONFIG_REG(zicboz_block_size):
> - if (!riscv_isa_extension_available(vcpu->arch.isa, ZICBOZ))
> + if (!riscv_isa_extension_available(NULL, ZICBOZ))
> return -ENOENT;
> reg_val = riscv_cboz_block_size;
> break;
> @@ -366,13 +366,13 @@ static int kvm_riscv_vcpu_set_reg_config(struct kvm_vcpu *vcpu,
> }
> break;
> case KVM_REG_RISCV_CONFIG_REG(zicbom_block_size):
> - if (!riscv_isa_extension_available(vcpu->arch.isa, ZICBOM))
> + if (!riscv_isa_extension_available(NULL, ZICBOM))
> return -ENOENT;
> if (reg_val != riscv_cbom_block_size)
> return -EINVAL;
> break;
> case KVM_REG_RISCV_CONFIG_REG(zicboz_block_size):
> - if (!riscv_isa_extension_available(vcpu->arch.isa, ZICBOZ))
> + if (!riscv_isa_extension_available(NULL, ZICBOZ))
> return -ENOENT;
> if (reg_val != riscv_cboz_block_size)
> return -EINVAL;
> @@ -817,10 +817,10 @@ static int copy_config_reg_indices(const struct kvm_vcpu *vcpu,
> * was not available.
> */
> if (i == KVM_REG_RISCV_CONFIG_REG(zicbom_block_size) &&
> - !riscv_isa_extension_available(vcpu->arch.isa, ZICBOM))
> + !riscv_isa_extension_available(NULL, ZICBOM))
> continue;
> else if (i == KVM_REG_RISCV_CONFIG_REG(zicboz_block_size) &&
> - !riscv_isa_extension_available(vcpu->arch.isa, ZICBOZ))
> + !riscv_isa_extension_available(NULL, ZICBOZ))
> continue;
>
> size = IS_ENABLED(CONFIG_32BIT) ? KVM_REG_SIZE_U32 : KVM_REG_SIZE_U64;
> --
> 2.34.1
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
More information about the kvm-riscv
mailing list