On 1/26/26 12:47 PM, Jan Beulich wrote:
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.

I am trying to avoid a large patch series, and this needs to be introduced
before we can implement context_switch(). At the moment, I'm trying to introduce
everything that I need for dom0less domain creation and context_switch() isn't
really needed at this stage and continue_to_new_vcpu() isn't really needed to be
implemented at this stage as well as context_switch().

The best I can do at the moment is either to write a better commit message
explaining how this will be used, or, specifically for continue_new_vcpu(), to
avoid introducing it for now and not initialise the ra register until the
remaining pieces are ready. But considering that I've already done in this way
then better commit message(s) should work.

~ Oleksii


Reply via email to