On 11/01/21 20:57, David Woodhouse wrote:
+ v->arch.xen.runstate_set = true;
+ v->arch.xen.current_runstate = RUNSTATE_blocked;
+ v->arch.xen.last_state_ns = ktime_get_ns();
Can you explain current_runstate and also why last_state_ns is not part
of the struct that userspace gets/sets?
Paolo
+ break;
+
default:
break;
}
@@ -157,6 +292,17 @@ int kvm_xen_hvm_get_attr(struct kvm *kvm, struct kvm_xen_hvm_attr *data)
}
break;
+ case KVM_XEN_ATTR_TYPE_VCPU_RUNSTATE:
+ v = kvm_get_vcpu_by_id(kvm, data->u.vcpu_attr.vcpu_id);
+ if (!v)
+ return -EINVAL;
+
+ if (v->arch.xen.runstate_set) {
+ data->u.vcpu_attr.gpa = v->arch.xen.runstate_cache.gpa;
+ r = 0;
+ }
+ break;