Skip to content

Commit 955853c

Browse files
bibo-maochenhuacai
authored andcommitted
LoongArch: KVM: Disable updating of "num_cpu" and "feature"
Property "num_cpu" and "feature" are read-only once eiointc is created, which are set with KVM_DEV_LOONGARCH_EXTIOI_GRP_CTRL attr group before device creation. Attr group KVM_DEV_LOONGARCH_EXTIOI_GRP_SW_STATUS is to update register and software state for migration and reset usage, property "num_cpu" and "feature" can not be update again if it is created already. Here discard write operation with property "num_cpu" and "feature" in attr group KVM_DEV_LOONGARCH_EXTIOI_GRP_CTRL. Cc: [email protected] Fixes: 1ad7efa ("LoongArch: KVM: Add EIOINTC user mode read and write functions") Signed-off-by: Bibo Mao <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent cc8d5b2 commit 955853c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/loongarch/kvm/intc/eiointc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -926,9 +926,15 @@ static int kvm_eiointc_sw_status_access(struct kvm_device *dev,
926926
data = (void __user *)attr->addr;
927927
switch (addr) {
928928
case KVM_DEV_LOONGARCH_EXTIOI_SW_STATUS_NUM_CPU:
929+
if (is_write)
930+
return ret;
931+
929932
p = &s->num_cpu;
930933
break;
931934
case KVM_DEV_LOONGARCH_EXTIOI_SW_STATUS_FEATURE:
935+
if (is_write)
936+
return ret;
937+
932938
p = &s->features;
933939
break;
934940
case KVM_DEV_LOONGARCH_EXTIOI_SW_STATUS_STATE:

0 commit comments

Comments
 (0)