base-nova: allow MSI for non-PCI devices

DMA remapping hardware units use MSI for fault events. However, MSI
were bound to the presence of a PCI configuration space.

genodelabs/genode#5002
This commit is contained in:
Johannes Schlatow 2023-10-03 15:46:36 +02:00
parent eefaa07024
commit f55d06fd5c
4 changed files with 18 additions and 1 deletions

View File

@ -0,0 +1,13 @@
diff --git a/src/syscall.cpp b/src/syscall.cpp
index 838bfee..5619293 100644
--- a/src/syscall.cpp
+++ b/src/syscall.cpp
@@ -1205,7 +1205,7 @@ void Ec::sys_assign_gsi()
sys_finish<Sys_regs::BAD_DEV>();
}
- if (EXPECT_FALSE (!Gsi::gsi_table[gsi].ioapic && (!Pd::current->Space_mem::lookup (r->dev(), phys) || ((rid = Pci::phys_to_rid (phys)) == ~0U && (rid = Hpet::phys_to_rid (phys)) == ~0U)))) {
+ if (EXPECT_FALSE (!Gsi::gsi_table[gsi].ioapic && r->dev() && (!Pd::current->Space_mem::lookup (r->dev(), phys) || ((rid = Pci::phys_to_rid (phys)) == ~0U && (rid = Hpet::phys_to_rid (phys)) == ~0U)))) {
trace (TRACE_ERROR, "%s: Non-DEV CAP (%#lx)", __func__, r->dev());
sys_finish<Sys_regs::BAD_DEV>();
}

View File

@ -1 +1 @@
e104241c249b88b6e0a4ff74bda67996dfa200c4
851c274f32d9ba3706a20407755ce6d17139afc6

View File

@ -8,3 +8,4 @@ REV(nova) := 3e34fa6c35c55566ae57a1fd654262964ffcf544
DIR(nova) := src/kernel/nova
PATCHES := $(sort $(wildcard $(REP_DIR)/patches/*.patch))
PATCH_OPT := -p1 -d ${DIR(nova)}

View File

@ -64,6 +64,9 @@ static void deassociate(addr_t irq_sel)
static bool associate_msi(addr_t irq_sel, addr_t phys_mem, addr_t &msi_addr,
addr_t &msi_data, Signal_context_capability sig_cap)
{
if (!phys_mem)
return irq_ctrl(irq_sel, msi_addr, msi_data, sig_cap.local_name(), Nova::Gsi_flags(), 0);
return platform().region_alloc().alloc_aligned(4096, 12).convert<bool>(
[&] (void *virt_ptr) {