qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] hvf: arm: Support creating VMs with 64+GB of RAM on macOS 15+
@ 2024-08-28 11:15 Danny Canter
  2024-08-28 11:15 ` [PATCH v2 1/3] hw/boards: Add hvf_get_physical_address_range to MachineClass Danny Canter
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Danny Canter @ 2024-08-28 11:15 UTC (permalink / raw)
  To: qemu-devel, qemu-arm
  Cc: dirty, rbolshakov, agraf, peter.maydell, pbonzini,
	richard.henderson, eduardo, mst, marcel.apfelbaum, philmd,
	wangyanan55, zhao1.liu, danny_canter

This patchsets focus is on lighting up the ability to create VMs with 64+GB
of RAM through using some new APIs introduced in macOS 13. Due to the IPA sizes
supported in macOS, the first version we can properly support this requirement
is macOS 15 as (if the hardware supports it also) the kernel adds support for a
40b IPA size, which is the first supported ARM PARange value after 36b, so we
can advertise this to the guest properly as well in id_aa64mmfr0_el1.

Today if you asked for a > 64GB VM you'd be met with a pretty unwieldy
HV_BAD_ARGUMENT. On machines without 40b IPA support this patchset also
improves this, and the message mirrors the kvm_type error you'd get on ARM:

"qemu-system-aarch64: -accel hvf: Addressing limited to 36 bits, but memory
exceeds it by 18253611008 bytes"

Changes from V1 to V2 (Thanks Peter for review!):

- Added a new function pointer to MachineClass to be able to freeze the memory
map and compute the highest guest physical address. We use this to inform VM
creation on what IPA size we should ask the kernel for. This is very similar to
what ARM's kvm_type() does.

- Fixed redundant loop in `round_down_to_parange_bit_size`

- Move the splitting up of hv_vm_create logic per platform to a separate patch.
This is mostly for readability.

Danny Canter (3):
  hw/boards: Add hvf_get_physical_address_range to MachineClass
  hvf: Split up hv_vm_create logic per arch
  hvf: arm: Allow creating VMs with 64+GB of RAM on macOS 15+

 accel/hvf/hvf-accel-ops.c | 16 +++++++---
 hw/arm/virt.c             | 42 ++++++++++++++++++++++++-
 hw/i386/x86.c             |  2 ++
 include/hw/boards.h       |  5 +++
 include/sysemu/hvf_int.h  |  1 +
 target/arm/hvf/hvf.c      | 66 +++++++++++++++++++++++++++++++++++++++
 target/arm/hvf_arm.h      |  3 ++
 target/arm/internals.h    | 19 +++++++++++
 target/arm/ptw.c          | 15 +++++++++
 target/i386/hvf/hvf.c     |  5 +++
 10 files changed, 168 insertions(+), 6 deletions(-)

-- 
2.39.5 (Apple Git-154)


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-02-10 20:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-28 11:15 [PATCH v2 0/3] hvf: arm: Support creating VMs with 64+GB of RAM on macOS 15+ Danny Canter
2024-08-28 11:15 ` [PATCH v2 1/3] hw/boards: Add hvf_get_physical_address_range to MachineClass Danny Canter
2024-09-06 15:30   ` Peter Maydell
2024-08-28 11:15 ` [PATCH v2 2/3] hvf: Split up hv_vm_create logic per arch Danny Canter
2024-09-06 15:31   ` Peter Maydell
2024-08-28 11:15 ` [PATCH v2 3/3] hvf: arm: Implement and use hvf_get_physical_address_range Danny Canter
2024-09-06 15:31   ` Peter Maydell
2025-02-10 17:26   ` Philippe Mathieu-Daudé
2025-02-10 18:20     ` Danny Canter
2025-02-10 18:24       ` Peter Maydell
2025-02-10 20:39         ` Danny Canter
2024-09-06 15:32 ` [PATCH v2 0/3] hvf: arm: Support creating VMs with 64+GB of RAM on macOS 15+ Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).