|
@@ -289,11 +289,9 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
-int kvm_arm_vcpu_get_events(struct kvm_vcpu *vcpu,
|
|
|
- struct kvm_vcpu_events *events)
|
|
|
+int __kvm_arm_vcpu_get_events(struct kvm_vcpu *vcpu,
|
|
|
+ struct kvm_vcpu_events *events)
|
|
|
{
|
|
|
- memset(events, 0, sizeof(*events));
|
|
|
-
|
|
|
events->exception.serror_pending = !!(vcpu->arch.hcr_el2 & HCR_VSE);
|
|
|
events->exception.serror_has_esr = cpus_have_const_cap(ARM64_HAS_RAS_EXTN);
|
|
|
|
|
@@ -303,23 +301,12 @@ int kvm_arm_vcpu_get_events(struct kvm_vcpu *vcpu,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-int kvm_arm_vcpu_set_events(struct kvm_vcpu *vcpu,
|
|
|
- struct kvm_vcpu_events *events)
|
|
|
+int __kvm_arm_vcpu_set_events(struct kvm_vcpu *vcpu,
|
|
|
+ struct kvm_vcpu_events *events)
|
|
|
{
|
|
|
- int i;
|
|
|
bool serror_pending = events->exception.serror_pending;
|
|
|
bool has_esr = events->exception.serror_has_esr;
|
|
|
|
|
|
- /* check whether the reserved field is zero */
|
|
|
- for (i = 0; i < ARRAY_SIZE(events->reserved); i++)
|
|
|
- if (events->reserved[i])
|
|
|
- return -EINVAL;
|
|
|
-
|
|
|
- /* check whether the pad field is zero */
|
|
|
- for (i = 0; i < ARRAY_SIZE(events->exception.pad); i++)
|
|
|
- if (events->exception.pad[i])
|
|
|
- return -EINVAL;
|
|
|
-
|
|
|
if (serror_pending && has_esr) {
|
|
|
if (!cpus_have_const_cap(ARM64_HAS_RAS_EXTN))
|
|
|
return -EINVAL;
|