mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
Add armv6l Support as guest
Support for armv6l qemu guests has been added. Tested with arm1176 CPU on x86. Signed-off-by: Stefan Schallenberg <infos@nafets.de> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
parent
55f9f486e1
commit
41cc4ca107
@ -406,6 +406,7 @@
|
||||
<choice>
|
||||
<value>aarch64</value>
|
||||
<value>alpha</value>
|
||||
<value>armv6l</value>
|
||||
<value>armv7l</value>
|
||||
<value>cris</value>
|
||||
<value>i686</value>
|
||||
|
@ -625,7 +625,7 @@ static const char *virQEMUCapsArchToString(virArch arch)
|
||||
{
|
||||
if (arch == VIR_ARCH_I686)
|
||||
return "i386";
|
||||
else if (arch == VIR_ARCH_ARMV7L)
|
||||
else if (arch == VIR_ARCH_ARMV6L || arch == VIR_ARCH_ARMV7L)
|
||||
return "arm";
|
||||
else if (arch == VIR_ARCH_OR32)
|
||||
return "or32";
|
||||
@ -2201,7 +2201,7 @@ static const char *preferredMachines[] =
|
||||
{
|
||||
NULL, /* VIR_ARCH_NONE (not a real arch :) */
|
||||
"clipper", /* VIR_ARCH_ALPHA */
|
||||
NULL, /* VIR_ARCH_ARMV6L (no QEMU impl) */
|
||||
"integratorcp", /* VIR_ARCH_ARMV6L */
|
||||
"integratorcp", /* VIR_ARCH_ARMV7L */
|
||||
"integratorcp", /* VIR_ARCH_ARMV7B */
|
||||
|
||||
@ -4179,6 +4179,7 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
|
||||
|
||||
/* GIC capabilities, eg. available GIC versions */
|
||||
if ((qemuCaps->arch == VIR_ARCH_AARCH64 ||
|
||||
qemuCaps->arch == VIR_ARCH_ARMV6L ||
|
||||
qemuCaps->arch == VIR_ARCH_ARMV7L) &&
|
||||
virQEMUCapsProbeQMPGICCapabilities(qemuCaps, mon) < 0)
|
||||
goto cleanup;
|
||||
|
@ -9223,7 +9223,9 @@ static bool
|
||||
qemuChrIsPlatformDevice(const virDomainDef *def,
|
||||
virDomainChrDefPtr chr)
|
||||
{
|
||||
if (def->os.arch == VIR_ARCH_ARMV7L || def->os.arch == VIR_ARCH_AARCH64) {
|
||||
if (def->os.arch == VIR_ARCH_ARMV6L ||
|
||||
def->os.arch == VIR_ARCH_ARMV7L ||
|
||||
def->os.arch == VIR_ARCH_AARCH64) {
|
||||
|
||||
/* pl011 (used on mach-virt) is a platform device */
|
||||
if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL &&
|
||||
|
@ -6024,7 +6024,8 @@ qemuDomainDefaultNetModel(const virDomainDef *def,
|
||||
if (ARCH_IS_S390(def->os.arch))
|
||||
return "virtio";
|
||||
|
||||
if (def->os.arch == VIR_ARCH_ARMV7L ||
|
||||
if (def->os.arch == VIR_ARCH_ARMV6L ||
|
||||
def->os.arch == VIR_ARCH_ARMV7L ||
|
||||
def->os.arch == VIR_ARCH_AARCH64) {
|
||||
if (STREQ(def->os.machine, "versatilepb"))
|
||||
return "smc91c111";
|
||||
@ -9807,7 +9808,8 @@ bool
|
||||
qemuDomainMachineIsARMVirt(const char *machine,
|
||||
const virArch arch)
|
||||
{
|
||||
if (arch != VIR_ARCH_ARMV7L &&
|
||||
if (arch != VIR_ARCH_ARMV6L &&
|
||||
arch != VIR_ARCH_ARMV7L &&
|
||||
arch != VIR_ARCH_AARCH64)
|
||||
return false;
|
||||
|
||||
@ -10613,7 +10615,8 @@ qemuDomainSupportsNicdev(virDomainDefPtr def,
|
||||
virDomainNetDefPtr net)
|
||||
{
|
||||
/* non-virtio ARM nics require legacy -net nic */
|
||||
if (((def->os.arch == VIR_ARCH_ARMV7L) ||
|
||||
if (((def->os.arch == VIR_ARCH_ARMV6L) ||
|
||||
(def->os.arch == VIR_ARCH_ARMV7L) ||
|
||||
(def->os.arch == VIR_ARCH_AARCH64)) &&
|
||||
net->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO &&
|
||||
net->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)
|
||||
|
@ -468,7 +468,8 @@ static void
|
||||
qemuDomainAssignARMVirtioMMIOAddresses(virDomainDefPtr def,
|
||||
virQEMUCapsPtr qemuCaps)
|
||||
{
|
||||
if (def->os.arch != VIR_ARCH_ARMV7L &&
|
||||
if (def->os.arch != VIR_ARCH_ARMV6L &&
|
||||
def->os.arch != VIR_ARCH_ARMV7L &&
|
||||
def->os.arch != VIR_ARCH_AARCH64)
|
||||
return;
|
||||
|
||||
@ -2367,7 +2368,8 @@ static bool
|
||||
qemuDomainSupportsPCI(virDomainDefPtr def,
|
||||
virQEMUCapsPtr qemuCaps)
|
||||
{
|
||||
if ((def->os.arch != VIR_ARCH_ARMV7L) &&
|
||||
if ((def->os.arch != VIR_ARCH_ARMV6L) &&
|
||||
(def->os.arch != VIR_ARCH_ARMV7L) &&
|
||||
(def->os.arch != VIR_ARCH_AARCH64) &&
|
||||
!ARCH_IS_RISCV(def->os.arch))
|
||||
return true;
|
||||
|
@ -81,6 +81,72 @@
|
||||
</features>
|
||||
</guest>
|
||||
|
||||
<guest>
|
||||
<os_type>hvm</os_type>
|
||||
<arch name='armv6l'>
|
||||
<wordsize>32</wordsize>
|
||||
<emulator>/usr/bin/qemu-system-arm</emulator>
|
||||
<machine maxCpus='1'>integratorcp</machine>
|
||||
<machine maxCpus='2'>nuri</machine>
|
||||
<machine maxCpus='1'>mps2-an511</machine>
|
||||
<machine maxCpus='1'>verdex</machine>
|
||||
<machine maxCpus='1'>mps2-an505</machine>
|
||||
<machine maxCpus='512'>virt-3.0</machine>
|
||||
<machine canonical='virt-3.0' maxCpus='512'>virt</machine>
|
||||
<machine maxCpus='1'>ast2500-evb</machine>
|
||||
<machine maxCpus='2'>smdkc210</machine>
|
||||
<machine maxCpus='1'>collie</machine>
|
||||
<machine maxCpus='1'>imx25-pdk</machine>
|
||||
<machine maxCpus='1'>spitz</machine>
|
||||
<machine maxCpus='4'>realview-pbx-a9</machine>
|
||||
<machine maxCpus='1'>realview-eb</machine>
|
||||
<machine maxCpus='1'>realview-pb-a8</machine>
|
||||
<machine maxCpus='1'>versatilepb</machine>
|
||||
<machine maxCpus='1'>emcraft-sf2</machine>
|
||||
<machine maxCpus='255'>virt-2.9</machine>
|
||||
<machine maxCpus='1'>musicpal</machine>
|
||||
<machine maxCpus='1'>z2</machine>
|
||||
<machine maxCpus='1'>akita</machine>
|
||||
<machine maxCpus='255'>virt-2.7</machine>
|
||||
<machine maxCpus='1'>kzm</machine>
|
||||
<machine maxCpus='255'>virt-2.8</machine>
|
||||
<machine maxCpus='4'>realview-eb-mpcore</machine>
|
||||
<machine maxCpus='2'>mcimx7d-sabre</machine>
|
||||
<machine maxCpus='1'>sx1</machine>
|
||||
<machine maxCpus='1'>sx1-v1</machine>
|
||||
<machine maxCpus='255'>virt-2.6</machine>
|
||||
<machine maxCpus='1'>cubieboard</machine>
|
||||
<machine maxCpus='4'>highbank</machine>
|
||||
<machine maxCpus='4'>raspi2</machine>
|
||||
<machine maxCpus='1'>netduino2</machine>
|
||||
<machine maxCpus='1'>terrier</machine>
|
||||
<machine maxCpus='1'>n810</machine>
|
||||
<machine maxCpus='1'>mainstone</machine>
|
||||
<machine maxCpus='1'>palmetto-bmc</machine>
|
||||
<machine maxCpus='4'>sabrelite</machine>
|
||||
<machine maxCpus='4'>midway</machine>
|
||||
<machine maxCpus='1'>romulus-bmc</machine>
|
||||
<machine maxCpus='1'>cheetah</machine>
|
||||
<machine maxCpus='1'>tosa</machine>
|
||||
<machine maxCpus='1'>borzoi</machine>
|
||||
<machine maxCpus='1'>versatileab</machine>
|
||||
<machine maxCpus='1'>lm3s6965evb</machine>
|
||||
<machine maxCpus='1'>n800</machine>
|
||||
<machine maxCpus='255'>virt-2.10</machine>
|
||||
<machine maxCpus='255'>virt-2.11</machine>
|
||||
<machine maxCpus='1'>connex</machine>
|
||||
<machine maxCpus='255'>virt-2.12</machine>
|
||||
<machine maxCpus='1'>witherspoon-bmc</machine>
|
||||
<machine maxCpus='1'>xilinx-zynq-a9</machine>
|
||||
<machine maxCpus='1'>mps2-an385</machine>
|
||||
<machine maxCpus='4'>vexpress-a9</machine>
|
||||
<machine maxCpus='4'>vexpress-a15</machine>
|
||||
<machine maxCpus='1'>canon-a1100</machine>
|
||||
<machine maxCpus='1'>lm3s811evb</machine>
|
||||
<domain type='qemu'/>
|
||||
</arch>
|
||||
</guest>
|
||||
|
||||
<guest>
|
||||
<os_type>hvm</os_type>
|
||||
<arch name='armv7l'>
|
||||
|
@ -392,7 +392,39 @@ static int testQemuAddS390Guest(virCapsPtr caps)
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int testQemuAddArmGuest(virCapsPtr caps)
|
||||
static int testQemuAddArm6Guest(virCapsPtr caps)
|
||||
{
|
||||
static const char *machines[] = { "versatilepb" };
|
||||
virCapsGuestMachinePtr *capsmachines = NULL;
|
||||
virCapsGuestPtr guest;
|
||||
|
||||
capsmachines = virCapabilitiesAllocMachines(machines,
|
||||
ARRAY_CARDINALITY(machines));
|
||||
if (!capsmachines)
|
||||
goto error;
|
||||
|
||||
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_ARMV6L,
|
||||
QEMUBinList[TEST_UTILS_QEMU_BIN_ARM],
|
||||
NULL,
|
||||
ARRAY_CARDINALITY(machines),
|
||||
capsmachines);
|
||||
if (!guest)
|
||||
goto error;
|
||||
|
||||
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_QEMU, NULL, NULL, 0, NULL))
|
||||
goto error;
|
||||
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_KVM,
|
||||
NULL, NULL, 0, NULL))
|
||||
goto error;
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
virCapabilitiesFreeMachines(capsmachines, ARRAY_CARDINALITY(machines));
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int testQemuAddArm7Guest(virCapsPtr caps)
|
||||
{
|
||||
static const char *machines[] = { "vexpress-a9",
|
||||
"vexpress-a15",
|
||||
@ -514,7 +546,10 @@ virCapsPtr testQemuCapsInit(void)
|
||||
if (testQemuAddS390Guest(caps))
|
||||
goto cleanup;
|
||||
|
||||
if (testQemuAddArmGuest(caps))
|
||||
if (testQemuAddArm6Guest(caps))
|
||||
goto cleanup;
|
||||
|
||||
if (testQemuAddArm7Guest(caps))
|
||||
goto cleanup;
|
||||
|
||||
if (testQemuAddAARCH64Guest(caps))
|
||||
|
Loading…
Reference in New Issue
Block a user