# Re: \[PATCH v2 0/4\] implement vcpu preempted check

- From: Peter Zijlstra \<peterz@infradead.org\>
- Date: 2016-07-07 11:16:15 
- List: virtualization
- Page: https://ratatoskr.run/virtualization/2016/07/4790073
- Thread: https://ratatoskr.run/linux-s390/2016/06/4784167/t.md

```text
On Thu, Jul 07, 2016 at 06:27:26PM +0800, Wanpeng Li wrote:
> In addition, I see xen's vcpu_runstate_info::state is updated during
> schedule, so I think I can do this similarly through kvm preemption
> notifier. IIUC, xen hypervisor has VCPUOP_get_runstate_info hypercall
> implemention, so the desired interface can be implemented if they add
> hypercall callsite in domU. I can add hypercall to kvm similarly.

So I suspect Xen has the page its writing to pinned in memory; so that a
write to it is guaranteed to not fault.

Otherwise I cannot see this working.

That is part of the larger surgery required for KVM steal time to get
'fixed'. Currently that steal time stuff uses kvm_write_guest_cached()
which appears to be able to fault in guest pages.

Or I'm not reading this stuff right; which is entirely possible.
```
