]> git.dujemihanovic.xyz Git - linux.git/commitdiff
LoongArch: KVM: Rename _kvm_get_cpucfg() to _kvm_get_cpucfg_mask()
authorWANG Xuerui <git@xen0n.name>
Fri, 23 Feb 2024 06:36:31 +0000 (14:36 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Fri, 23 Feb 2024 06:36:31 +0000 (14:36 +0800)
The function is not actually a getter of guest CPUCFG, but rather
validation of the input CPUCFG ID plus information about the supported
bit flags of that CPUCFG leaf. So rename it to avoid confusion.

Reviewed-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: WANG Xuerui <git@xen0n.name>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/kvm/vcpu.c

index c8452aa5c11a763de86518a6217e01353f8abca7..98c4290af9c49de2689b38307e6bdc3c254aac77 100644 (file)
@@ -298,7 +298,7 @@ static int _kvm_setcsr(struct kvm_vcpu *vcpu, unsigned int id, u64 val)
        return ret;
 }
 
-static int _kvm_get_cpucfg(int id, u64 *v)
+static int _kvm_get_cpucfg_mask(int id, u64 *v)
 {
        if (id < 0 || id >= KVM_MAX_CPUCFG_REGS)
                return -EINVAL;
@@ -339,7 +339,7 @@ static int kvm_check_cpucfg(int id, u64 val)
        int ret;
        u64 mask = 0;
 
-       ret = _kvm_get_cpucfg(id, &mask);
+       ret = _kvm_get_cpucfg_mask(id, &mask);
        if (ret)
                return ret;
 
@@ -567,7 +567,7 @@ static int kvm_loongarch_get_cpucfg_attr(struct kvm_vcpu *vcpu,
        uint64_t val;
        uint64_t __user *uaddr = (uint64_t __user *)attr->addr;
 
-       ret = _kvm_get_cpucfg(attr->attr, &val);
+       ret = _kvm_get_cpucfg_mask(attr->attr, &val);
        if (ret)
                return ret;