[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC 1/4] hw/core: Prepare for introducing AMD IOMMU
From: |
David Kiarie |
Subject: |
[Qemu-devel] [RFC 1/4] hw/core: Prepare for introducing AMD IOMMU |
Date: |
Tue, 25 Aug 2015 02:19:26 +0300 |
From: David <address@hidden>
Add AMD IOMMU as one of the devices that can possibly be
emulated by Qemu. Also, add some helper functions for
manipulating presence/absence of IOMMU
Signed-off-by: David Kiarie <address@hidden>
---
hw/core/machine.c | 25 +++++++++++++++++++++++++
include/hw/boards.h | 2 ++
2 files changed, 27 insertions(+)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index ac4654e..b326a80 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -255,6 +255,20 @@ static void machine_set_iommu(Object *obj, bool value,
Error **errp)
ms->iommu = value;
}
+static bool machine_get_amd_iommu(Object *obj, Error **errp)
+{
+ MachineState *ms = MACHINE(obj);
+
+ return ms->amd_iommu;
+}
+
+static void machine_set_amd_iommu(Object *obj, bool value, Error **errp)
+{
+ MachineState *ms = MACHINE(obj);
+
+ ms->amd_iommu = value;
+}
+
static void machine_set_suppress_vmdesc(Object *obj, bool value, Error **errp)
{
MachineState *ms = MACHINE(obj);
@@ -400,6 +414,12 @@ static void machine_initfn(Object *obj)
object_property_set_description(obj, "iommu",
"Set on/off to enable/disable Intel IOMMU
(VT-d)",
NULL);
+ object_property_add_bool(obj, "amd-iommu",
+ machine_get_amd_iommu,
+ machine_set_amd_iommu, NULL);
+ object_property_set_description(obj, "amd-iommu",
+ "Set on/off to enable/disable AMD-Vi",
+ NULL);
object_property_add_bool(obj, "suppress-vmdesc",
machine_get_suppress_vmdesc,
machine_set_suppress_vmdesc, NULL);
@@ -436,6 +456,11 @@ bool machine_iommu(MachineState *machine)
return machine->iommu;
}
+bool machine_amd_iommu(MachineState *machine)
+{
+ return machine->amd_iommu;
+}
+
bool machine_kernel_irqchip_allowed(MachineState *machine)
{
return machine->kernel_irqchip_allowed;
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 3f84afd..88324b2 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -54,6 +54,7 @@ extern MachineState *current_machine;
bool machine_usb(MachineState *machine);
bool machine_iommu(MachineState *machine);
+bool machine_amd_iommu(MachineState *machine);
bool machine_kernel_irqchip_allowed(MachineState *machine);
bool machine_kernel_irqchip_required(MachineState *machine);
int machine_kvm_shadow_mem(MachineState *machine);
@@ -139,6 +140,7 @@ struct MachineState {
bool usb_disabled;
char *firmware;
bool iommu;
+ bool amd_iommu;
bool suppress_vmdesc;
ram_addr_t ram_size;
--
2.1.4
- [Qemu-devel] [RFC 0/4] AMD IOMMU, David Kiarie, 2015/08/24
- [Qemu-devel] [RFC 1/4] hw/core: Prepare for introducing AMD IOMMU,
David Kiarie <=
- [Qemu-devel] [RFC 2/4] hw/i386: Introduce AMD IOMMU, David Kiarie, 2015/08/24
- Re: [Qemu-devel] [RFC 2/4] hw/i386: Introduce AMD IOMMU, Valentine Sinitsyn, 2015/08/25
- Re: [Qemu-devel] [RFC 2/4] hw/i386: Introduce AMD IOMMU, David kiarie, 2015/08/25
- Re: [Qemu-devel] [RFC 2/4] hw/i386: Introduce AMD IOMMU, Valentine Sinitsyn, 2015/08/25
- Re: [Qemu-devel] [RFC 2/4] hw/i386: Introduce AMD IOMMU, David kiarie, 2015/08/25
- Re: [Qemu-devel] [RFC 2/4] hw/i386: Introduce AMD IOMMU, David kiarie, 2015/08/25
- Re: [Qemu-devel] [RFC 2/4] hw/i386: Introduce AMD IOMMU, Valentine Sinitsyn, 2015/08/25
[Qemu-devel] [RFC 3/4] hw/i386: Introduce IVRS for AMD IOMMU, David Kiarie, 2015/08/24
[Qemu-devel] [RFC 4/4] hw/pci-host: Add AMD IOMMU emulation to q35 and PIIX, David Kiarie, 2015/08/24