qemu/hw
Danny Canter d54ffa54fb hvf: arm: Implement and use hvf_get_physical_address_range
This patch's main focus is to use the previously added
hvf_get_physical_address_range to inform VM creation
about the IPA size we need for the VM, so we can extend
the default 36b IPA size and support VMs with 64+GB of
RAM. This is done by freezing the memory map, computing
the highest GPA and then (depending on if the platform
supports an IPA size that large) telling the kernel to
use a size >= for the VM. In pursuit of this a couple of
things related to how we handle the physical address range
we expose to guests were altered, but for an explanation of
what we were doing:

Today, to get the IPA size we were reading id_aa64mmfr0_el1's
PARange field from a newly made vcpu. Unfortunately, HVF just
returns the hosts PARange directly for the initial value and
not the IPA size that will actually back the VM, so we believe
we have much more address space than we actually do today it seems.

Starting in macOS 13.0 some APIs were introduced to be able to
query the maximum IPA size the kernel supports, and to set the IPA
size for a given VM. However, this still has a couple of issues
on < macOS 15. Up until macOS 15 (and if the hardware supported
it) the max IPA size was 39 bits which is not a valid PARange
value, so we can't clamp down what we advertise in the vcpu's
id_aa64mmfr0_el1 to our IPA size. Starting in macOS 15 however,
the maximum IPA size is 40 bits (if it's supported in the hardware
as well) which is also a valid PARange value so we can set our IPA
size to the maximum as well as clamp down the PARange we advertise
to the guest. This allows VMs with 64+ GB of RAM and should fix the
oddness of the PARange situation as well.

Signed-off-by: Danny Canter <danny_canter@apple.com>
Message-id: 20240828111552.93482-4-danny_canter@apple.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2024-09-13 15:31:47 +01:00
..
9pfs
acpi hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
adc hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
alpha
arm hvf: arm: Implement and use hvf_get_physical_address_range 2024-09-13 15:31:47 +01:00
audio hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
avr
block hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
char hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
core hw/core/resettable: Remove transitional_function machinery 2024-09-13 15:31:46 +01:00
cpu
cris
cxl hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
display hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
dma hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
fsi hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
gpio hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
hppa
hyperv hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
i2c hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
i386 hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
ide hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
input hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
intc hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
ipack
ipmi
isa hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
loongarch hw/loongarch: Add acpi SPCR table support 2024-09-12 20:57:54 +08:00
m68k hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
mem hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
microblaze
mips hw/mips/loongson3_virt: Fix condition of IPI IOCSR connection 2024-08-20 00:28:24 +02:00
misc hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
net hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
nubus hw/nubus/nubus-device: Range check 'slot' property 2024-09-08 11:49:49 +02:00
nvme hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
nvram hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
openrisc
pci hw/pci/pci-hmp-cmds: Avoid displaying bogus size in 'info pci' 2024-09-11 09:46:04 -04:00
pci-bridge hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
pci-host hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
pcmcia
ppc hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
remote hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
riscv Revert "hw/riscv/virt.c: imsics DT: add '#msi-cells'" 2024-08-19 14:34:49 +10:00
rtc hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
rx
s390x hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
scsi hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
sd hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
sensor hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
sh4
smbios smbios: make memory device size configurable per Machine 2024-07-22 20:15:41 -04:00
sparc hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
sparc64 hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
ssi hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
timer hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
tpm hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
tricore hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
ufs hw/ufs: minor bug fixes related to ufs-test 2024-09-06 18:04:16 +09:00
usb hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
vfio hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
virtio hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
watchdog hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
xen hw/xen: pvh-common: Add support for creating PCIe/GPEX 2024-09-04 16:50:43 +02:00
xenpv
xtensa
Kconfig
meson.build