@@ -19,6 +19,8 @@ Groups:
KVM_VGIC_V2_ADDR_TYPE_CPU (rw, 64-bit)
Base address in the guest physical address space of the GIC virtual cpu
interface register mappings.
+ Errors:
+ -EBUSY: VGIC already is initialized
KVM_DEV_ARM_VGIC_GRP_DIST_REGS
Attributes:
@@ -2427,6 +2427,9 @@ static int vgic_set_attr(struct kvm_device *dev, struct kvm_device_attr *attr)
u64 addr;
unsigned long type = (unsigned long)attr->attr;
+ if (vgic_initialized(dev->kvm))
+ return -EBUSY;
+
if (copy_from_user(&addr, uaddr, sizeof(addr)))
return -EFAULT;
This patch prevents user-space from changing VGIC base addresses if the vgic already is initialized. Signed-off-by: Eric Auger <eric.auger@linaro.org> --- Documentation/virtual/kvm/devices/arm-vgic.txt | 2 ++ virt/kvm/arm/vgic.c | 3 +++ 2 files changed, 5 insertions(+)