[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 14/39] xen/riscv: introduce vintc_ctxt_switch_{from,to}()
- To: Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>
- From: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
- Date: Fri, 4 Sep 2026 18:54:09 +0200
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Romain Caritey <Romain.Caritey@xxxxxxxxxxxxx>, Zheng Zhang <zhangzheng@xxxxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
- Delivery-date: Fri, 04 Sep 2026 16:54:17 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 9/4/26 1:25 PM, Baptiste Le Duc wrote:
Virtual interrupt controller state must be preserved across vCPU context
switches.
Introduce vintc_ctxt_switch_{from,to}() wrappers around new
ctxt_switch_{from,to}() hooks in struct vintc_ops, and call them from the
context switch path, so that this state can be saved/restored without
knowing which vINTC variant a domain uses.
No vINTC variant implements the hooks yet: the vAPLIC implementation is
added separately.
So this patch couldn't be applied alone as, at the time of this commit, you
only set in vaplic.c:
static const struct vintc_ops vintc_ops = {
.vcpu_init = vcpu_imsic_init,
.vcpu_deinit = vcpu_imsic_deinit,
};
So ops->ctxt_switch_from(v) or ops->ctxt_switch_to(v) will try to
deference NULL pointer causing segfault. I don't know if it's matter but
worth to mention somewhere.
Just abstraction is introduced here and context switch isn't happen for
now so we are safe.
~ Oleksii
|