Skip to contentSkip to conversation

switch vcpu on physical cpu

DISCUSSION xennn 2 participants 3 messages Mar 3, 2014 – Mar 4, 2014

lore
Share & tools
lore

xennn

author
#0 lore raw

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

--
View this message in context: http://xen.1045712.n5.nabble.com/switch-vcpu-on-physical-cpu-tp5721484.html
Sent from the Xen - Dev mailing list archive at Nabble.com.

#1 lore raw
Quoted 21 lines · xennn

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.

Quoted 4 lines

Is that correct?

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

Hi xennn,

I think TSS here is referring to "Task State Segment". It's an x86 specific feature [0]. If you would like an accurate description, you can look at IA{32,64} Software Developers Manual [1]

[0] http://en.wikipedia.org/wiki/Task_State_Segment
[1] http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html

Quoted 14 lines

Best Regards

--
View this message in context: http://xen.1045712.n5.nabble.com/switch-vcpu-on-physical-cpu-tp5721484.html
Sent from the Xen - Dev mailing list archive at Nabble.com.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Signature · 1 line
Karim Allah Ahmed.