lkml.org 
[lkml]   [2023]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC 42/48] RISC-V: Allow host to inject any ext interrupt id to a CoVE guest.
Date
From: Rajnesh Kanwal <rkanwal@rivosinc.com>

Ideally, host must not inject any external interrupt until explicitly
allowed by the guest. This should be done per interrupt id but currently
adding allow-all call in init_IRQ. In future, it will be modified
to allow specific interrupts only.

Signed-off-by: Rajnesh Kanwal <rkanwal@rivosinc.com>
Signed-off-by: Atish Patra <atishp@rivosinc.com>
---
arch/riscv/kernel/irq.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/arch/riscv/kernel/irq.c b/arch/riscv/kernel/irq.c
index eb9a68a..b5e0fd8 100644
--- a/arch/riscv/kernel/irq.c
+++ b/arch/riscv/kernel/irq.c
@@ -11,6 +11,8 @@
#include <linux/module.h>
#include <linux/seq_file.h>
#include <asm/sbi.h>
+#include <asm/covg_sbi.h>
+#include <asm/cove.h>

static struct fwnode_handle *(*__get_intc_node)(void);

@@ -36,8 +38,18 @@ int arch_show_interrupts(struct seq_file *p, int prec)

void __init init_IRQ(void)
{
+ int ret;
+
irqchip_init();
if (!handle_arch_irq)
panic("No interrupt controller found.");
sbi_ipi_init();
+
+ if (is_cove_guest()) {
+ /* FIXME: For now just allow all interrupts. */
+ ret = sbi_covg_allow_all_external_interrupt();
+
+ if (ret)
+ pr_err("Failed to allow external interrupts.\n");
+ }
}
--
2.25.1
\
 
 \ /
  Last update: 2023-04-20 00:32    [W:0.265 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site