diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-default.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-default.args
new file mode 120000
index 0000000000000000000000000000000000000000..323403903d7064ec0eaeaacff97e95beae2bd820
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-default.args
@@ -0,0 +1 @@
+qemuxml2argv-aarch64-gic-v2.args
\ No newline at end of file
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-default.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-default.xml
new file mode 100644
index 0000000000000000000000000000000000000000..b219972b385966ed5ddb74012dcf8a8bc054cc1a
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-default.xml
@@ -0,0 +1,22 @@
+
+ aarch64test
+ 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f
+ 1048576
+ 1048576
+ 1
+
+ hvm
+
+
+
+
+
+
+
+ destroy
+ restart
+ destroy
+
+ /usr/bin/qemu-system-aarch64
+
+
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-host.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-host.args
new file mode 100644
index 0000000000000000000000000000000000000000..56adc72b05b9fa9f339a9e47fe60b12f94d37729
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-host.args
@@ -0,0 +1,20 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-aarch64 \
+-name aarch64test \
+-S \
+-machine virt,accel=kvm,gic-version=host \
+-cpu host \
+-m 1024 \
+-smp 1 \
+-uuid 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f \
+-nographic \
+-nodefaults \
+-monitor unix:/tmp/test-monitor,server,nowait \
+-no-acpi \
+-boot c \
+-usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-host.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-host.xml
new file mode 100644
index 0000000000000000000000000000000000000000..445b35857a78250689c6b1a52d5d40c7b7d948f4
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-host.xml
@@ -0,0 +1,22 @@
+
+ aarch64test
+ 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f
+ 1048576
+ 1048576
+ 1
+
+ hvm
+
+
+
+
+
+
+
+ destroy
+ restart
+ destroy
+
+ /usr/bin/qemu-system-aarch64
+
+
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-invalid.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-invalid.xml
new file mode 100644
index 0000000000000000000000000000000000000000..1cf9ea88dbf35e61f41147bc5ecc4d8252b2d66f
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-invalid.xml
@@ -0,0 +1,22 @@
+
+ aarch64test
+ 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f
+ 1048576
+ 1048576
+ 1
+
+ hvm
+
+
+
+
+
+
+
+ destroy
+ restart
+ destroy
+
+ /usr/bin/qemu-system-aarch64
+
+
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none.args
new file mode 120000
index 0000000000000000000000000000000000000000..323403903d7064ec0eaeaacff97e95beae2bd820
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none.args
@@ -0,0 +1 @@
+qemuxml2argv-aarch64-gic-v2.args
\ No newline at end of file
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none.xml
new file mode 100644
index 0000000000000000000000000000000000000000..272d0c85755b7ab15944de1695cb0be26120a43f
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none.xml
@@ -0,0 +1,19 @@
+
+ aarch64test
+ 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f
+ 1048576
+ 1048576
+ 1
+
+ hvm
+
+
+
+
+ destroy
+ restart
+ destroy
+
+ /usr/bin/qemu-system-aarch64
+
+
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-not-arm.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-not-arm.xml
new file mode 100644
index 0000000000000000000000000000000000000000..3b907bc411d695b647e6188239e0eb523a0dc104
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-not-arm.xml
@@ -0,0 +1,22 @@
+
+ aarch64test
+ 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f
+ 1048576
+ 1048576
+ 1
+
+ hvm
+
+
+
+
+
+
+
+ destroy
+ restart
+ destroy
+
+ /usr/bin/qemu-system-ppc64
+
+
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-not-virt.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-not-virt.xml
new file mode 100644
index 0000000000000000000000000000000000000000..256664ed844ea563d573256cd84ddb31346f2e8d
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-not-virt.xml
@@ -0,0 +1,22 @@
+
+ aarch64test
+ 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f
+ 1048576
+ 1048576
+ 1
+
+ hvm
+
+
+
+
+
+
+
+ destroy
+ restart
+ destroy
+
+ /usr/bin/qemu-system-aarch64
+
+
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 360ba25c79ef04c62df61881c108b68cc07f4baa..32697e72937a737784e794035552b48fdb1e8def 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1679,14 +1679,40 @@ mymain(void)
DO_TEST("aarch64-cpu-passthrough",
QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DEVICE_VIRTIO_MMIO,
QEMU_CAPS_CPU_HOST, QEMU_CAPS_KVM);
+ DO_TEST("aarch64-gic-none",
+ QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST,
+ QEMU_CAPS_MACH_VIRT_GIC_VERSION);
+ DO_TEST("aarch64-gic-none",
+ QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST);
+ DO_TEST("aarch64-gic-default",
+ QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST,
+ QEMU_CAPS_MACH_VIRT_GIC_VERSION);
+ DO_TEST("aarch64-gic-default",
+ QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST);
DO_TEST("aarch64-gic-v2",
QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST,
QEMU_CAPS_MACH_VIRT_GIC_VERSION);
+ DO_TEST("aarch64-gic-v2",
+ QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST);
DO_TEST("aarch64-gic-v3",
QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST,
QEMU_CAPS_MACH_VIRT_GIC_VERSION);
DO_TEST_FAILURE("aarch64-gic-v3",
QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST);
+ DO_TEST("aarch64-gic-host", QEMU_CAPS_DEVICE,
+ QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST,
+ QEMU_CAPS_MACH_VIRT_GIC_VERSION);
+ DO_TEST_FAILURE("aarch64-gic-host", QEMU_CAPS_DEVICE,
+ QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST);
+ DO_TEST_PARSE_ERROR("aarch64-gic-invalid", QEMU_CAPS_DEVICE,
+ QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST,
+ QEMU_CAPS_MACH_VIRT_GIC_VERSION);
+ DO_TEST_FAILURE("aarch64-gic-not-virt", QEMU_CAPS_DEVICE,
+ QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST,
+ QEMU_CAPS_MACH_VIRT_GIC_VERSION);
+ DO_TEST_FAILURE("aarch64-gic-not-arm", QEMU_CAPS_DEVICE,
+ QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_CPU_HOST,
+ QEMU_CAPS_MACH_VIRT_GIC_VERSION);
driver.caps->host.cpu->arch = VIR_ARCH_AARCH64;
DO_TEST("aarch64-kvm-32-on-64",
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-default.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-default.xml
new file mode 120000
index 0000000000000000000000000000000000000000..80a01c2185335dac0bdc22dd0caf604da6b52ec8
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-default.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/qemuxml2argv-aarch64-gic-v2.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-host.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-host.xml
new file mode 120000
index 0000000000000000000000000000000000000000..da3e79b365791ecac808ad7d11ca675c5ed8ad3e
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-host.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/qemuxml2argv-aarch64-gic-host.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none.xml
new file mode 120000
index 0000000000000000000000000000000000000000..80a01c2185335dac0bdc22dd0caf604da6b52ec8
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/qemuxml2argv-aarch64-gic-v2.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index b13e2bd95de65f4c4b58bad3a9921e03510cc077..56dc82197f9c457d62c8f4284ed219506502b799 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -737,8 +737,12 @@ mymain(void)
QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM,
QEMU_CAPS_OBJECT_GPEX, QEMU_CAPS_DEVICE_PCI_BRIDGE,
QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_VIRTIO_SCSI);
+
+ DO_TEST("aarch64-gic-none");
+ DO_TEST("aarch64-gic-default");
DO_TEST("aarch64-gic-v2");
DO_TEST("aarch64-gic-v3");
+ DO_TEST("aarch64-gic-host");
DO_TEST("memory-hotplug");
DO_TEST("memory-hotplug-nonuma");