[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 14/39] xen/riscv: add IMSIC vCPU context switch handlers



> IMSIC state currently needs to track only which physical CPU owns a vCPU's
> IMSIC guest interrupt file, as the CPU id is part of the physical address
> the file is mapped at.
> 
> Add imsic_ctxt_switch_from() to record that CPU when a vCPU is switched
> out. A vCPU running on the s/w VS-file has no h/w file bound to a CPU, so
> there is nothing to record for it. Nothing reads the recorded value yet.
> 
> imsic_ctxt_switch_to() has nothing to do: switching a vCPU in on the CPU
> which owns its guest interrupt file needs no IMSIC update. Only a move to
> another CPU does (a new VGEIN and a remapped file), and that isn't part of
> the context switch.
Nit: I think it could make sense to mention that if a migration happen,
it would go anyway in imsic_migrate_vcpu() before
imsic_ctxt_switch_to().
> 
> Install both as the ctxt_switch_{from,to} hooks of struct vintc_ops. MSI
> delivery is the only mode Xen supports (aplic_init() panics on an APLIC
> without an "msi-parent" property) and the only one vAPLIC emulates, so the
> vAPLIC state to save and restore is always the IMSIC one and no
> vAPLIC-level forwarder is needed. Being indirect call targets, both
> handlers get cf_check.
> 
> Co-developed-by: Romain Caritey <Romain.Caritey@xxxxxxxxxxxxx>
Should add Signed-off-by Romain Caritey.
Without that, everything is ok from my side
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
> --- a/xen/arch/riscv/vaplic.c
> +++ b/xen/arch/riscv/vaplic.c
> @@ -456,6 +456,12 @@ static const struct mmio_handler_ops vaplic_mmio_ops = {
>  static const struct vintc_ops vintc_ops = {
>      .vcpu_init = vcpu_imsic_init,
>      .vcpu_deinit = vcpu_imsic_deinit,
> +    /*
> +     * MSI delivery is the only supported mode, so the vAPLIC state to save
Nit: Do we want to always support only MSI delivery? If not, maybe adapt
the comment.

Reviewed-by: Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>

-- 
Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.