Skip to content

Commit 51632f5

Browse files
committed
F #5671: Support for ARM and KVM hypervisor
1 parent b88e478 commit 51632f5

File tree

3 files changed

+16
-24
lines changed

3 files changed

+16
-24
lines changed

src/vmm/LibVirtDriverKVM.cc

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -628,10 +628,6 @@ int LibVirtDriver::deployment_description_kvm(
628628
std::string sd_bus;
629629
std::string disk_bus;
630630

631-
bool pm_defaults = true;
632-
std::string pm_suspend_to_disk = "yes";
633-
std::string pm_suspend_to_mem = "yes";
634-
635631
string vm_xml;
636632

637633
Nebula& nd = Nebula::instance();
@@ -799,17 +795,18 @@ int LibVirtDriver::deployment_description_kvm(
799795
}
800796

801797
bool boot_secure = false;
802-
803798
string firmware;
804-
799+
805800
get_attribute(vm, nullptr, nullptr, "OS", "FIRMWARE", firmware);
806-
807-
if ( !firmware.empty() && !one_util::icasecmp(firmware, "BIOS") )
801+
802+
bool is_uefi = !firmware.empty() && !one_util::icasecmp(firmware, "BIOS");
803+
804+
if ( is_uefi )
808805
{
809806
string firmware_secure = "no";
810-
811-
if ( get_attribute(vm, nullptr, nullptr, "OS", "FIRMWARE_SECURE", boot_secure) &&
812-
boot_secure)
807+
808+
if ( get_attribute(vm, nullptr, nullptr, "OS", "FIRMWARE_SECURE",
809+
boot_secure) && boot_secure)
813810
{
814811
firmware_secure = "yes";
815812
}
@@ -821,26 +818,20 @@ int LibVirtDriver::deployment_description_kvm(
821818
file << "\t\t<nvram>"
822819
<< vm->get_system_dir() << "/" << vm->get_name() << "_VARS.fd"
823820
<< "</nvram>\n";
824-
825-
// Suspend to mem and disk disabled to avoid boot problems with UEFI
826-
// firmware
827-
pm_defaults = false;
828-
pm_suspend_to_disk = "no";
829-
pm_suspend_to_mem = "no";
830821
}
831822

832823
file << "\t</os>" << endl;
833824

834825
// ------------------------------------------------------------------------
835826
// POWER MANAGEMENT SECTION
836827
// ------------------------------------------------------------------------
837-
if (!pm_defaults)
828+
if ( is_uefi && arch != "aarch64" )
838829
{
830+
// Suspend to mem and disk disabled to avoid boot problems with UEFI
831+
// firmware in x86 arch
839832
file << "\t<pm>\n"
840-
<< "\t\t<suspend-to-disk enabled=\"" << pm_suspend_to_disk
841-
<< "\"/>\n"
842-
<< "\t\t<suspend-to-mem enabled=\"" << pm_suspend_to_mem
843-
<< "\"/>\n"
833+
<< "\t\t<suspend-to-disk enabled=\"no\"/>\n"
834+
<< "\t\t<suspend-to-mem enabled=\"no\"/>\n"
844835
<< "\t</pm>\n";
845836
}
846837

@@ -1852,7 +1843,7 @@ int LibVirtDriver::deployment_description_kvm(
18521843
file << "\t\t<pae/>" << endl;
18531844
}
18541845

1855-
if ( acpi )
1846+
if ( acpi && (arch != "aarch64" || is_uefi ))
18561847
{
18571848
file << "\t\t<acpi/>" << endl;
18581849
}

src/vmm_mad/exec/vmm_exec_kvm.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,4 @@ SPICE_OPTIONS = "
9090
#
9191
# Open Virtual Machine Firware (UEFI Firmware)
9292
# List of valid firmware available to users (full path in the hosts)
93-
OVMF_UEFIS = "/usr/share/OVMF/OVMF_CODE.fd /usr/share/OVMF/OVMF_CODE.secboot.fd"
93+
OVMF_UEFIS = "/usr/share/OVMF/OVMF_CODE.fd /usr/share/OVMF/OVMF_CODE.secboot.fd /usr/share/AAVMF/AAVMF_CODE.fd"

src/vmm_mad/remotes/kvm/kvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,5 @@ DEFAULT_ATTACH_NIC_MODEL=virtio
9393
#DEFAULT_ATTACH_NIC_FILTER=clean-traffic
9494

9595
# Virtual Machine Firmware path to the NVRAM file
96+
# OVMF_NVRAM="/usr/share/AAVMF/AAVMF_VARS.fd" for aarch64 guests
9697
OVMF_NVRAM="/usr/share/OVMF/OVMF_VARS.fd"

0 commit comments

Comments
 (0)