Add RISC-V cell-specific fields.

Unlike ARM, for example, the PLIC doesn't support hardware injection of
external IRQs. So we need to do it in software, sigh...

Prepare the fields that are needed for software injection. The
irq_bitmap, just like on ARM, denotes physical IRQs that the cell is
allowed to manage.

Signed-off-by: Ralf Ramsauer <[email protected]>
---
 hypervisor/arch/riscv/include/asm/cell.h  | 11 +++++++----
 hypervisor/arch/riscv/include/asm/types.h |  1 +
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/hypervisor/arch/riscv/include/asm/cell.h 
b/hypervisor/arch/riscv/include/asm/cell.h
index 63ba43ce..9da228d4 100644
--- a/hypervisor/arch/riscv/include/asm/cell.h
+++ b/hypervisor/arch/riscv/include/asm/cell.h
@@ -2,9 +2,11 @@
  * Jailhouse, a Linux-based partitioning hypervisor
  *
  * Copyright (c) Siemens AG, 2020
+ * Copyright (c) OTH Regensburg, 2022
  *
  * Authors:
- *  Jan Kiszka <[email protected]>
+ *  Konrad Schwarz <[email protected]>
+ *  Ralf Ramsauer <[email protected]>
  *
  * This work is licensed under the terms of the GNU GPL, version 2.  See
  * the COPYING file in the top-level directory.
@@ -13,12 +15,13 @@
 #ifndef _JAILHOUSE_ASM_CELL_H
 #define _JAILHOUSE_ASM_CELL_H
 
+#include <jailhouse/paging.h>
 #include <jailhouse/types.h>
 
-// this shouldn't be here
-#include <jailhouse/cell-config.h>
-
 struct arch_cell {
+       struct paging_structures mm;
+
+       u32 irq_bitmap[MAX_IRQS / (sizeof(u32) * 8)];
 };
 
 #endif /* !_JAILHOUSE_ASM_CELL_H */
diff --git a/hypervisor/arch/riscv/include/asm/types.h 
b/hypervisor/arch/riscv/include/asm/types.h
index 120859e0..adf58120 100644
--- a/hypervisor/arch/riscv/include/asm/types.h
+++ b/hypervisor/arch/riscv/include/asm/types.h
@@ -11,4 +11,5 @@
  */
 
 #define MAX_CPUS       __riscv_xlen
+#define MAX_IRQS       1024
 #define BITS_PER_LONG  64
-- 
2.40.1

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/20230519204033.643200-34-ralf.ramsauer%40oth-regensburg.de.

Reply via email to