[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 08/17] xen/riscv: add IMSIC state save/restore
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
- Date: Mon, 17 Aug 2026 11:23:23 +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: Romain Caritey <Romain.Caritey@xxxxxxxxxxxxx>, Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Mon, 17 Aug 2026 09:23:29 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 8/12/26 3:57 PM, Jan Beulich wrote:
On 20.07.2026 18:02, Oleksii Kurochko wrote:
@@ -418,6 +419,28 @@ int imsic_map_guest_file(struct vcpu *v, unsigned int
vsfile_id)
return res;
}
+void imsic_state_save(struct vcpu *v)
+{
+ struct vimsic_state *imsic_state = v->arch.vimsic_state;
+ unsigned long flags;
+
+ /*
+ * SW interrupt file always has ->vsfile_pcpu = NR_CPUS so nothing specific
+ * should be done in this case.
+ */
+ if ( !vcpu_guest_file_id(v) )
+ return;
How does the ->vsfile_pcpu sentinel value matter here, when you're checking
->guest_file_id?
Comment is incorrect. I will fix it.
And anyway, there being dependencies like this one on the other big series
makes it rather hard to review things.
+ write_lock_irqsave(&imsic_state->vsfile_lock, flags);
+ imsic_state->vsfile_pcpu = cpuid_to_hartid(v->processor);
As discussed for another patch in this series, this will need to change then
as well.
I will update that properly.
+ write_unlock_irqrestore(&imsic_state->vsfile_lock, flags);
+}
+
+void imsic_state_restore(struct vcpu *v)
+{
+ /* Nothing to do */
+}
"save" and "restore" have meaning other than what you intend here, aiui. Once
again without call sites it remains unclear when exactly these functions would
be called. Which makes it close to impossible to suggest better names.
I will add some extra context and/or re-shuffle patches to make it more
clearer. Anyway as you explained me in another thread a name is really
incorrect. I will use imsic_ctxt_switch_{to,from}() instead.
Thanks.
~ Oleksii
|