On 26.01.2026 10:00, Oleksii Kurochko wrote:
> On 1/23/26 12:30 PM, Teddy Astie wrote:
>> Le 22/01/2026 à 17:49, Oleksii Kurochko a écrit :
>>> +    v->arch.xen_saved_context.sp = (register_t)v->arch.cpu_info;
>>> +    v->arch.xen_saved_context.ra = (register_t)continue_new_vcpu;
>>> +
>> You probably also want to set the first parameter of continue_new_vcpu
>> (struct vcpu *prev), or otherwise I don't think we want the "prev"
>> parameter in continue_new_vcpu if it's always going to be 0.
> 
> It will be set by RISC-V ABI (prev will be stored in a0) when 
> __context_switch()
> will be called in context_switch():
>    void context_switch(struct vcpu *prev, struct vcpu *next)
>    {
>      ASSERT(local_irq_is_enabled());
>      ASSERT(prev != next);
>      ASSERT(!vcpu_cpu_dirty(next));
> 
>      local_irq_disable();
> 
>      set_current(next);
> 
>      prev = __context_switch(prev, next);
> 
>      schedule_tail(prev);
>    }
> First call of the __context_switch() will lead to jump to continue_new_vcpu()
> function which will have a0=prev.

Problem being that none of this code exists yet, and hence it's rather hard to
see how things will eventually fit together.

Jan

Reply via email to