switch vcpu on physical cpu

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

switch vcpu on physical cpu

xennn
This post has NOT been accepted by the mailing list yet.
hello all

I would like to ask about switching vcpu-s on physcial one when we have paravirtualization.

I think tha actual switching is happaning at switch_kernel_stack(struct vcpu *v) function in domain.c file.


static inline void switch_kernel_stack(struct vcpu *v)
{
    struct tss_struct *tss = &this_cpu(init_tss);
    tss->esp1 = v->arch.pv_vcpu.kernel_sp;
    tss->ss1  = v->arch.pv_vcpu.kernel_ss;
}

Here the actual task switching is happen - the kernel stack of the current physical cpu is get by this_cpu()
and afther that the kernel stack of that current task is changed to the vcpu's one.  So the task is swiched to the new vcpu state.

Is that correct?

I would like to ask what is tss_struct - task structure, task stack segment structure or something else?

Best Regards
Reply | Threaded
Open this post in threaded view
|

Re: switch vcpu on physical cpu

xennn
This post has NOT been accepted by the mailing list yet.
ok, 10x

so the task switching is happening here at switch_kernel_stack(struct vcpu *v) function by changing the kernel task ... is it right?

Best Regards