Skip to content

ARM: add support for Azure instances #2041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 13, 2024
Merged

Conversation

francescolavra
Copy link
Member

This change set adds support for running the kernel with different physical memory layouts, enhances run-time detection of peripheral resources, and ports the Hyper-V drivers to the ARM architecture. This allows Nanos to run on Azure ARM-based instances.

This is done in preparation for porting the Hyper-V drivers to ARM.
Some of the SCSI commands used by the storvsc driver (e.g. the
command to read the device capacity) are only supported by direct
access block devices, thus the driver should ignore other device
types.
This change removes a SCSI sense dump that is printed on the
console when a SCSI error is detected while probing a "Virtual
DVD-ROM" device in Azure instances (issue verified on
Standard_B2pts_v2 ARM-based instances).
The GTDT (Generic Timer Description Table) is now used to retrieve
the interrupt number for the ARM architected timer; the hard-coded
GIC_TIMER_IRQ constant is only used as a fallback.
This change fixes ARM timer operation on Azure ARM-based instances
such as Standard_B2pts_v2 instances.
With this change, it is now possible to run Nanos on platforms
(such as Azure ARM-based Standard_B2pts_v2 instances) where the
range of memory addresses in the kernel ELF file
(0x40400000 - 0x40600000) is not a valid physical memory range; in
these cases, the kernel is loaded at physical addresses different
from the ELF addresses. The offset between the kernel location in
physical memory and the ELF addresses is stored in the
`kernel_phys_offset` global variable.
In addition, the address range for memory-mapped I/O is now
dynamically detected when running on UEFI platforms, instead of
being hard-coded to (0x00000000 - 0x40000000).
This change amends the pci_cfgread() and pci_cfgwrite() functions
so that they don't do any MMIO access if the base address of the
PCI configuration space has not been detected. This prevents access
to invalid memory addresses in platforms (such as Azure ARM-based
instances) where the ECAM base address is not exposed via the
device tree or the MCFG ACPI table.
This allows the serial console to work on Azure ARM-based
Standard_B2pts_v2 instances.
This enables the RTC functionality on platforms (such as Azure
Standard_B2pts_v2 instances) that don't have a PL031 RTC (or where
the PL031 peripheral is mapped at a different adddress than the
address hardcoded in the kernel).
With this change, if no GEN_RDIST entry is present in the ACPI
MADT, the vCPU-specific redistributor addresses are retrieved from
the GEN_INT entries. This allows the GIC driver to work on
platforms such as Azure ARM-based Standard_B2pts_v2 instances.
This change ports the Hyper-V drivers to the ARM architecture,
which allows Nanos to run on Azure ARM-based instances; in
addition, the SMBIOS entry point is passed from the UEFI bootloader
to the kernel so that the cloud_init klib can detect (via DMI)
whether the kernel is running on an Azure instance and finalize
instance deployment according to Azure requirements.
@francescolavra francescolavra merged commit 9995aa3 into master Aug 13, 2024
5 checks passed
@francescolavra francescolavra deleted the feature/arm-azure branch August 13, 2024 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant