On 06/12/2021 14:34, Ralf Ramsauer wrote:
If we want to use the qemu-x86.c on AMD platforms, we must not define
Intel IOMMU units. Build an extra variant for AMD platforms.
Signed-off-by: Ralf Ramsauer <[email protected]>
---
README.md | 8 ++++++--
configs/Makefile | 11 +++++++++++
configs/x86/qemu-x86.c | 2 ++
3 files changed, 19 insertions(+), 2 deletions(-)
… The stats and the Makefile-fiddling show why I still prefer v1 of this
patch over this one.
Ralf
diff --git a/README.md b/README.md
index f1b0cbe3..ac457119 100644
--- a/README.md
+++ b/README.md
@@ -288,11 +288,15 @@ installation steps.
The Jailhouse QEMU cell config will block use of the serial port by the guest
OS, so make sure that the guest kernel command line does NOT have its console
set to log to the serial port (ie remove any 'console=ttyS0' arguments from
the
-grub config). Reboot the guest and load jailhouse.ko. Then enable Jailhouse
-like this:
+grub config). Reboot the guest and load jailhouse.ko. On Intel x86 platforms,
+enable Jailhouse like this:
jailhouse enable /path/to/qemu-x86.cell
+On AMD platforms, use:
+
+ jailhouse enable /path/to/qemu-x86-amd.cell
+
Next you can create a cell with a demonstration application as follows:
jailhouse cell create /path/to/apic-demo.cell
diff --git a/configs/Makefile b/configs/Makefile
index 327043b7..5af0647a 100644
--- a/configs/Makefile
+++ b/configs/Makefile
@@ -28,6 +28,17 @@ OBJCOPYFLAGS := -O binary --remove-section=.note.gnu.property
CONFIGS = $(shell cd $(src); ls $(SRCARCH)/*.c)
always-y := $(CONFIGS:.c=.cell)
+ifeq ($(SRCARCH),x86)
+ always-y += x86/qemu-x86-amd.cell
+ targets += x86/qemu-x86-amd.o
+endif
+
+$(obj)/x86/qemu-x86-amd.cell: $(obj)/x86/qemu-x86-amd.o
+
+$(obj)/x86/qemu-x86-amd.o: $(obj)/x86/qemu-x86.c FORCE
+ $(call if_changed,cc_o_c)
+
+CFLAGS_x86/qemu-x86-amd.o += -D__IS_AMD
targets += $(CONFIGS:.c=.o) $(CONFIGS:.c=.cell)
diff --git a/configs/x86/qemu-x86.c b/configs/x86/qemu-x86.c
index 9ca5c528..3f8f673b 100644
--- a/configs/x86/qemu-x86.c
+++ b/configs/x86/qemu-x86.c
@@ -45,6 +45,7 @@ struct {
.platform_info = {
.pci_mmconfig_base = 0xb0000000,
.pci_mmconfig_end_bus = 0xff,
+#ifndef __IS_AMD
.iommu_units = {
{
.type = JAILHOUSE_IOMMU_INTEL,
@@ -52,6 +53,7 @@ struct {
.size = 0x1000,
},
},
+#endif /* !__IS_AMD */
.x86 = {
.pm_timer_address = 0x608,
.vtd_interrupt_limit = 256,
--
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/f030cdc5-c6ea-78d0-8e39-93b098b27036%40oth-regensburg.de.