From dcb60beef2f0287393c18c30ba5b4616874ccfc0 Mon Sep 17 00:00:00 2001 From: Rhitayu Chattopadhyay <32809048+rhitayu2@users.noreply.github.com> Date: Fri, 8 May 2026 16:48:05 +0530 Subject: [PATCH] Add iommu definitions. --- shellcode_hypervisor/boot_linux.c | 2 +- shellcode_hypervisor/boot_linux.h | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/shellcode_hypervisor/boot_linux.c b/shellcode_hypervisor/boot_linux.c index 8a2f811..78537aa 100644 --- a/shellcode_hypervisor/boot_linux.c +++ b/shellcode_hypervisor/boot_linux.c @@ -159,7 +159,7 @@ void entry(void) { } // Disable IOMMU. - *(volatile uint64_t *)0xfdd80018 &= ~1; + *(volatile uint64_t *)(AMDIOMMU_MMIO_BASE + AMDIOMMU_CTRL) &= ~1; memcpy(&info, (void *)(cave_linux_info), sizeof(struct linux_info)); diff --git a/shellcode_hypervisor/boot_linux.h b/shellcode_hypervisor/boot_linux.h index fbe3510..452a36b 100644 --- a/shellcode_hypervisor/boot_linux.h +++ b/shellcode_hypervisor/boot_linux.h @@ -37,7 +37,10 @@ #define DCHUBBUB_WHITELIST_BASE_ADDR_0 0x24878 #define DCHUBBUB_WHITELIST_TOP_ADDR_0 0x2487c +#define AMDIOMMU_MMIO_BASE 0xfdd80000 +#define AMDIOMMU_CTRL 0x18 + #define MAXCPU 16 void entry(void); -void boot_linux(void); \ No newline at end of file +void boot_linux(void);