Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(riscv/iommu): update support for RISC-V IOMMU Device Directory Table #150

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/arch/armv8/armv8-r/mpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ static inline void mpu_entry_set_perms(struct mp_region* mpr, struct mpu_perms m
bool el1_priv = mpu_perms.el1 != PERM_NONE;
perms_t perms = mpu_perms.el1 | mpu_perms.el2;

mpr->mem_flags.prbar &= (uint16_t) ~(PRBAR_PERMS_FLAGS_MSK);
mpr->mem_flags.prbar &= (uint16_t)~(PRBAR_PERMS_FLAGS_MSK);
if (perms & PERM_W) {
mpr->mem_flags.prbar |= PRBAR_AP_RW_EL2;
} else {
Expand Down
11 changes: 11 additions & 0 deletions src/arch/riscv/inc/arch/iommu.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,15 @@ struct iommu_vm_arch {
EMPTY_STRUCT_FIELDS
};

struct vm;
void rv_iommu_fq_irq_handler(irqid_t irq_id);
void alloc_2lvl_vptrs(void);
void up_1lvl_to_2lvl(void);
void alloc_3lvl_vptrs(void);
void up_2lvl_to_3lvl(void);
void ddt_init(void);
void rv_iommu_init(void);
bool rv_iommu_alloc_did(deviceid_t dev_id);
void rv_iommu_write_ddt(deviceid_t dev_id, struct vm* vm, paddr_t root_pt);

#endif /* __IOMMU_ARCH_H__ */
1 change: 0 additions & 1 deletion src/arch/riscv/inc/arch/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ struct arch_platform {

struct {
paddr_t base; // Base address of the IOMMU mmapped IF
unsigned mode; // Overall IOMMU mode (Off, Bypass, DDT-lvl)
irqid_t fq_irq_id; // Fault Queue IRQ ID (wired)
} iommu;

Expand Down
Loading
Loading