Ok, I figured out that Context is not for every OS process but represents a
hardware context in a smp.
Also realized that ptl_create_new_context is called to create a new context
during cpu initialization phase.
Now, can someone explain the difference between setup_qemu_switch and
setup_qemu_switch_all_ctx? More importantly, when should I call the former
and the latter?

Thanks,
- Bhushan



On Thu, Sep 20, 2012 at 5:15 PM, Vidyabhushan Mohan
<[email protected]>wrote:

> Hi,
> I have a few questions regarding how a context is created and how context
> switching happens in PTLSim.
> *) When and where is a Context object created? struct Context is defined
> in ptlhwdef.h
> *) My understanding is that since Context is derived from CPUX86State,
> each "OS" process would have it own context object. If so, when a context
> switch happens in the OS, how does PTLSim switch from one Context object to
> another.
> *) I'm trying to pass a value stored in a register in one context, lets
> say ctx.cr[3] (the page table base address stored in the cr3 register) to
> a register in another context.
>  i.e. new_ctx.my_register = old_ctx.cr[3]. Could anyone point me to the
> right way of doing this?
>
> Thanks a lot,
> - Bhushan
>
>
_______________________________________________
http://www.marss86.org
Marss86-Devel mailing list
[email protected]
https://www.cs.binghamton.edu/mailman/listinfo/marss86-devel

Reply via email to