[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 13/23] xen/riscv: introduce per-vCPU IMSIC state
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
- Date: Wed, 24 Jun 2026 13:55:26 +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:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
- Cc: Romain Caritey <Romain.Caritey@xxxxxxxxxxxxx>, 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.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Wed, 24 Jun 2026 11:55:38 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 6/22/26 4:46 PM, Jan Beulich wrote:
On 17.06.2026 13:17, Oleksii Kurochko wrote:
@@ -61,7 +62,24 @@ struct imsic_config {
spinlock_t lock;
};
+struct vimsic_state {
+ /* IMSIC VS-file */
+ rwlock_t vsfile_lock;
+ /*
+ * (guest_file_id == 0) -> s/w IMSIC VS-file
+ * (guest_file_id > 0) -> h/w IMSIC VS-file
+ */
+ unsigned int guest_file_id;
+ /*
+ * (vsfile_pcpu >= 0) => h/w IMSIC VS-file
DYM "< NR_CPUS"? Else the above conflicts with ...
Agree, it should be '< NR_CPUS'.
+ * (vsfile_pcpu == NR_CPUS) => s/w IMSIC VS-file
... this.
As to the h/w vs s/w options: I take it that e.g. guest_file_id > 0 and
vsfile_pcpu == NR_CPUS is an impossible combination?
Yes, if we have assigned h/w guest interrupt file it should be connected
to pCPU.
In which case
re-arranging commentary may want considering:
/*
* s/w IMSIC VS-file -> guest_file_id == 0
* h/w IMSIC VS-file -> guest_file_id > 0
*/
unsigned int guest_file_id;
/*
* s/w IMSIC VS-file -> vsfile_pcpu == NR_CPUS
* h/w IMSIC VS-file -> vsfile_pcpu < NR_CPUS
*/
unsigned int vsfile_pcpu;
Good point. I will apply this.
As to guest_file_id: In vcpu_imsic_init() you store IMPOSSIBLE_GUEST_FILE_ID,
yet that value isn't mentioned here at all.
Good point too. Actually I think that this definition isn't really
needed as software IMSIC interrupt file could be counted as always
available and so IMPOSSIBLE_GUEST_FILE_ID could be just dropped.
Thanks.
~ Oleksii
|