xen/riscv: introduce aia_init() and aia_usable()

aia_init() is going to contain all the logic related to AIA initialization.

At the moment, it only checks whether the SSAIA extension is available,
and if so, sets is_aia_usable (which  indicates more than just the
availability of the extension) to true; it also signifies that the necessary
components (to be introduced in follow-up patches) have been initialized.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Oleksii Kurochko authored and Jan Beulich committed 2026-09-21 10:08:09 +02:00
1 parent ff930346ef
commit 24a61ce264
4 files changed
+37

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
obj-y += aia.o
obj-y += aplic.o
obj-y += cpufeature.o
obj-y += domain.o
+23
View File
@@ -0,0 +1,23 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <xen/errno.h>
#include <xen/init.h>
#include <xen/sections.h>
#include <xen/types.h>
#include <asm/cpufeature.h>
static bool __ro_after_init _aia_usable;
bool aia_usable(void)
{
return _aia_usable;
}
void __init aia_init(void)
{
if ( !riscv_isa_extension_available(NULL, RISCV_ISA_EXT_ssaia) )
return;
_aia_usable = true;
}
+10
View File
@@ -0,0 +1,10 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef RISCV_AIA_H
#define RISCV_AIA_H
bool aia_usable(void);
void aia_init(void);
#endif /* RISCV_AIA_H */
+3
View File
@@ -9,6 +9,7 @@
#include <xen/lib.h>
#include <xen/spinlock.h>
#include <asm/aia.h>
#include <asm/intc.h>
static const struct intc_hw_operations *__ro_after_init intc_hw_ops;
@@ -33,6 +34,8 @@ void __init intc_init(void)
{
ASSERT(intc_hw_init_ops && intc_hw_init_ops->init);
aia_init();
if ( intc_hw_init_ops->init() )
panic("Failed to initialize the interrupt controller drivers\n");
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.