[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Scheduler/hypervisor traps, vm_event_vcpu_pause - some details on how they work?

Hey all,

I'm trying to add a vm-event function that would execute just before a vCPU resumes execution. To do this, I need to know precisely how and when this happens. I've been browsing the codebase to try and gain some insight on the matter, but I still need some clarifications as parts of it are not so straight-forward.

Currently my understanding is that a vCPU can be entered in 3 ways:

1) The first entry, when the vCPU is first created. On ARM, the PC of the vCPU is set to continue_new_vcpu.
    Q1. How does this happen on X86?

2) After a hypervisor trap (X86 VMENTER/ARM ERET).
Q2. How does pausing of the current vCPU (vm_event_vcpu_pause) work, specifically where does the context switch to another vCPU happen? Is it reentered through the below mentioned scheduling functions? Q3. Can we resume on another vCPU than the one that trapped if it wasn't paused?
    Q4. Can a hypervisor trap be interrupted by a scheduling operation?

3) Scheduler interrupt -> functions context_switch/continue_running.

Q5. Are these 3 the only ways a vCPU can be entered?

Thank you very much,

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.