mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
KVM: arm64: vgic-its: KVM_DEV_ARM_VGIC_GRP_ITS_REGS group
The ITS KVM device exposes a new KVM_DEV_ARM_VGIC_GRP_ITS_REGS group which allows the userspace to save/restore ITS registers. At this stage the get/set/has operations are not yet implemented. Signed-off-by: Eric Auger <[email protected]> Reviewed-by: Andre Przywara <[email protected]> Reviewed-by: Christoffer Dall <[email protected]> Acked-by: Marc Zyngier <[email protected]>
This commit is contained in:
parent
4b7171ac56
commit
876ae234cb
3 changed files with 37 additions and 1 deletions
|
|
@ -1466,6 +1466,19 @@ static void vgic_its_destroy(struct kvm_device *kvm_dev)
|
|||
kfree(its);
|
||||
}
|
||||
|
||||
int vgic_its_has_attr_regs(struct kvm_device *dev,
|
||||
struct kvm_device_attr *attr)
|
||||
{
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
int vgic_its_attr_regs_access(struct kvm_device *dev,
|
||||
struct kvm_device_attr *attr,
|
||||
u64 *reg, bool is_write)
|
||||
{
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
static int vgic_its_has_attr(struct kvm_device *dev,
|
||||
struct kvm_device_attr *attr)
|
||||
{
|
||||
|
|
@ -1482,6 +1495,8 @@ static int vgic_its_has_attr(struct kvm_device *dev,
|
|||
return 0;
|
||||
}
|
||||
break;
|
||||
case KVM_DEV_ARM_VGIC_GRP_ITS_REGS:
|
||||
return vgic_its_has_attr_regs(dev, attr);
|
||||
}
|
||||
return -ENXIO;
|
||||
}
|
||||
|
|
@ -1521,6 +1536,15 @@ static int vgic_its_set_attr(struct kvm_device *dev,
|
|||
return 0;
|
||||
}
|
||||
break;
|
||||
case KVM_DEV_ARM_VGIC_GRP_ITS_REGS: {
|
||||
u64 __user *uaddr = (u64 __user *)(long)attr->addr;
|
||||
u64 reg;
|
||||
|
||||
if (get_user(reg, uaddr))
|
||||
return -EFAULT;
|
||||
|
||||
return vgic_its_attr_regs_access(dev, attr, ®, true);
|
||||
}
|
||||
}
|
||||
return -ENXIO;
|
||||
}
|
||||
|
|
@ -1541,10 +1565,20 @@ static int vgic_its_get_attr(struct kvm_device *dev,
|
|||
if (copy_to_user(uaddr, &addr, sizeof(addr)))
|
||||
return -EFAULT;
|
||||
break;
|
||||
}
|
||||
case KVM_DEV_ARM_VGIC_GRP_ITS_REGS: {
|
||||
u64 __user *uaddr = (u64 __user *)(long)attr->addr;
|
||||
u64 reg;
|
||||
int ret;
|
||||
|
||||
ret = vgic_its_attr_regs_access(dev, attr, ®, false);
|
||||
if (ret)
|
||||
return ret;
|
||||
return put_user(reg, uaddr);
|
||||
}
|
||||
default:
|
||||
return -ENXIO;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue