[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/27] hvf: Split up hv_vm_create logic per arch
From: |
Peter Maydell |
Subject: |
[PULL 14/27] hvf: Split up hv_vm_create logic per arch |
Date: |
Fri, 13 Sep 2024 16:13:58 +0100 |
From: Danny Canter <danny_canter@apple.com>
This is preliminary work to split up hv_vm_create
logic per platform so we can support creating VMs
with > 64GB of RAM on Apple Silicon machines. This
is done via ARM HVF's hv_vm_config_create() (and
other APIs that modify this config that will be
coming in future patches). This should have no
behavioral difference at all as hv_vm_config_create()
just assigns the same default values as if you just
passed NULL to the function.
Signed-off-by: Danny Canter <danny_canter@apple.com>
Message-id: 20240828111552.93482-3-danny_canter@apple.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
include/sysemu/hvf_int.h | 1 +
accel/hvf/hvf-accel-ops.c | 6 +-----
target/arm/hvf/hvf.c | 9 +++++++++
target/i386/hvf/hvf.c | 5 +++++
4 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/include/sysemu/hvf_int.h b/include/sysemu/hvf_int.h
index 5b28d17ba1f..42ae18433f0 100644
--- a/include/sysemu/hvf_int.h
+++ b/include/sysemu/hvf_int.h
@@ -65,6 +65,7 @@ void assert_hvf_ok_impl(hv_return_t ret, const char *file,
unsigned int line,
#define assert_hvf_ok(EX) assert_hvf_ok_impl((EX), __FILE__, __LINE__, #EX)
const char *hvf_return_string(hv_return_t ret);
int hvf_arch_init(void);
+hv_return_t hvf_arch_vm_create(MachineState *ms, uint32_t pa_range);
int hvf_arch_init_vcpu(CPUState *cpu);
void hvf_arch_vcpu_destroy(CPUState *cpu);
int hvf_vcpu_exec(CPUState *);
diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c
index ac08cfb9f32..dbebf209f48 100644
--- a/accel/hvf/hvf-accel-ops.c
+++ b/accel/hvf/hvf-accel-ops.c
@@ -61,10 +61,6 @@
HVFState *hvf_state;
-#ifdef __aarch64__
-#define HV_VM_DEFAULT NULL
-#endif
-
/* Memory slots */
hvf_slot *hvf_find_overlap_slot(uint64_t start, uint64_t size)
@@ -324,7 +320,7 @@ static int hvf_accel_init(MachineState *ms)
hv_return_t ret;
HVFState *s;
- ret = hv_vm_create(HV_VM_DEFAULT);
+ ret = hvf_arch_vm_create(ms, 0);
assert_hvf_ok(ret);
s = g_new0(HVFState, 1);
diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c
index ace83671b59..19964d241ed 100644
--- a/target/arm/hvf/hvf.c
+++ b/target/arm/hvf/hvf.c
@@ -929,6 +929,15 @@ void hvf_arch_vcpu_destroy(CPUState *cpu)
{
}
+hv_return_t hvf_arch_vm_create(MachineState *ms, uint32_t pa_range)
+{
+ hv_vm_config_t config = hv_vm_config_create();
+ hv_return_t ret = hv_vm_create(config);
+ os_release(config);
+
+ return ret;
+}
+
int hvf_arch_init_vcpu(CPUState *cpu)
{
ARMCPU *arm_cpu = ARM_CPU(cpu);
diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c
index c9c64e29781..68dc5d9cf75 100644
--- a/target/i386/hvf/hvf.c
+++ b/target/i386/hvf/hvf.c
@@ -223,6 +223,11 @@ int hvf_arch_init(void)
return 0;
}
+hv_return_t hvf_arch_vm_create(MachineState *ms, uint32_t pa_range)
+{
+ return hv_vm_create(HV_VM_DEFAULT);
+}
+
int hvf_arch_init_vcpu(CPUState *cpu)
{
X86CPU *x86cpu = X86_CPU(cpu);
--
2.34.1
- [PULL 20/27] hw/net/can/xlnx-versal-canfd: Handle flags correctly, (continued)
- [PULL 20/27] hw/net/can/xlnx-versal-canfd: Handle flags correctly, Peter Maydell, 2024/09/13
- [PULL 10/27] hw/core/qdev: Simplify legacy_reset handling, Peter Maydell, 2024/09/13
- [PULL 12/27] kvm: Use 'unsigned long' for request argument in functions wrapping ioctl(), Peter Maydell, 2024/09/13
- [PULL 18/27] hw/net/can/xlnx-versal-canfd: Fix CAN FD flag check, Peter Maydell, 2024/09/13
- [PULL 22/27] hw/net/can/xlnx-versal-canfd: Simplify DLC conversions, Peter Maydell, 2024/09/13
- [PULL 27/27] hw/intc/arm_gic: fix spurious level triggered interrupts, Peter Maydell, 2024/09/13
- [PULL 19/27] hw/net/can/xlnx-versal-canfd: Translate CAN ID registers, Peter Maydell, 2024/09/13
- [PULL 15/27] hvf: arm: Implement and use hvf_get_physical_address_range, Peter Maydell, 2024/09/13
- [PULL 07/27] hw: Use device_class_set_legacy_reset() instead of opencoding, Peter Maydell, 2024/09/13
- [PULL 11/27] hw/core/resettable: Remove transitional_function machinery, Peter Maydell, 2024/09/13
- [PULL 14/27] hvf: Split up hv_vm_create logic per arch,
Peter Maydell <=
- [PULL 26/27] MAINTAINERS: Add my-self as CAN maintainer, Peter Maydell, 2024/09/13
- Re: [PULL 00/27] target-arm queue, Peter Maydell, 2024/09/13