[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 31/45] hvf: Move hvf internal definitions into common header
From: |
Peter Maydell |
Subject: |
[PULL 31/45] hvf: Move hvf internal definitions into common header |
Date: |
Thu, 3 Jun 2021 16:58:50 +0100 |
From: Alexander Graf <agraf@csgraf.de>
Until now, Hypervisor.framework has only been available on x86_64 systems.
With Apple Silicon shipping now, it extends its reach to aarch64. To
prepare for support for multiple architectures, let's start moving common
code out into its own accel directory.
This patch moves a few internal struct and constant defines over.
Signed-off-by: Alexander Graf <agraf@csgraf.de>
Reviewed-by: Sergio Lopez <slp@redhat.com>
Message-id: 20210519202253.76782-5-agraf@csgraf.de
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
include/sysemu/hvf_int.h | 30 ++++++++++++++++++++++++++++++
target/i386/hvf/hvf-i386.h | 31 +------------------------------
2 files changed, 31 insertions(+), 30 deletions(-)
diff --git a/include/sysemu/hvf_int.h b/include/sysemu/hvf_int.h
index 4c657b054c1..ef84a24dd96 100644
--- a/include/sysemu/hvf_int.h
+++ b/include/sysemu/hvf_int.h
@@ -13,6 +13,36 @@
#include <Hypervisor/hv.h>
+/* hvf_slot flags */
+#define HVF_SLOT_LOG (1 << 0)
+
+typedef struct hvf_slot {
+ uint64_t start;
+ uint64_t size;
+ uint8_t *mem;
+ int slot_id;
+ uint32_t flags;
+ MemoryRegion *region;
+} hvf_slot;
+
+typedef struct hvf_vcpu_caps {
+ uint64_t vmx_cap_pinbased;
+ uint64_t vmx_cap_procbased;
+ uint64_t vmx_cap_procbased2;
+ uint64_t vmx_cap_entry;
+ uint64_t vmx_cap_exit;
+ uint64_t vmx_cap_preemption_timer;
+} hvf_vcpu_caps;
+
+struct HVFState {
+ AccelState parent;
+ hvf_slot slots[32];
+ int num_slots;
+
+ hvf_vcpu_caps *hvf_caps;
+};
+extern HVFState *hvf_state;
+
void hvf_set_phys_mem(MemoryRegionSection *, bool);
void assert_hvf_ok(hv_return_t ret);
hvf_slot *hvf_find_overlap_slot(uint64_t, uint64_t);
diff --git a/target/i386/hvf/hvf-i386.h b/target/i386/hvf/hvf-i386.h
index 94e5c788c48..76e9235524c 100644
--- a/target/i386/hvf/hvf-i386.h
+++ b/target/i386/hvf/hvf-i386.h
@@ -18,39 +18,10 @@
#include "qemu/accel.h"
#include "sysemu/hvf.h"
+#include "sysemu/hvf_int.h"
#include "cpu.h"
#include "x86.h"
-/* hvf_slot flags */
-#define HVF_SLOT_LOG (1 << 0)
-
-typedef struct hvf_slot {
- uint64_t start;
- uint64_t size;
- uint8_t *mem;
- int slot_id;
- uint32_t flags;
- MemoryRegion *region;
-} hvf_slot;
-
-typedef struct hvf_vcpu_caps {
- uint64_t vmx_cap_pinbased;
- uint64_t vmx_cap_procbased;
- uint64_t vmx_cap_procbased2;
- uint64_t vmx_cap_entry;
- uint64_t vmx_cap_exit;
- uint64_t vmx_cap_preemption_timer;
-} hvf_vcpu_caps;
-
-struct HVFState {
- AccelState parent;
- hvf_slot slots[32];
- int num_slots;
-
- hvf_vcpu_caps *hvf_caps;
-};
-extern HVFState *hvf_state;
-
void hvf_handle_io(CPUArchState *, uint16_t, void *, int, int, int);
#ifdef NEED_CPU_H
--
2.20.1
- [PULL 21/45] target/arm: Implement bfloat16 dot product (vector), (continued)
- [PULL 21/45] target/arm: Implement bfloat16 dot product (vector), Peter Maydell, 2021/06/03
- [PULL 22/45] target/arm: Implement bfloat16 dot product (indexed), Peter Maydell, 2021/06/03
- [PULL 23/45] target/arm: Implement bfloat16 matrix multiply accumulate, Peter Maydell, 2021/06/03
- [PULL 24/45] target/arm: Implement bfloat widening fma (vector), Peter Maydell, 2021/06/03
- [PULL 26/45] linux-user/aarch64: Enable hwcap bits for bfloat16, Peter Maydell, 2021/06/03
- [PULL 25/45] target/arm: Implement bfloat widening fma (indexed), Peter Maydell, 2021/06/03
- [PULL 27/45] target/arm: Enable BFloat16 extensions, Peter Maydell, 2021/06/03
- [PULL 28/45] hvf: Move assert_hvf_ok() into common directory, Peter Maydell, 2021/06/03
- [PULL 29/45] hvf: Move vcpu thread functions into common directory, Peter Maydell, 2021/06/03
- [PULL 30/45] hvf: Move cpu functions into common directory, Peter Maydell, 2021/06/03
- [PULL 31/45] hvf: Move hvf internal definitions into common header,
Peter Maydell <=
- [PULL 33/45] hvf: Remove use of hv_uvaddr_t and hv_gpaddr_t, Peter Maydell, 2021/06/03
- [PULL 34/45] hvf: Split out common code on vcpu init and destroy, Peter Maydell, 2021/06/03
- [PULL 35/45] hvf: Use cpu_synchronize_state(), Peter Maydell, 2021/06/03
- [PULL 37/45] hvf: Remove hvf-accel-ops.h, Peter Maydell, 2021/06/03
- [PULL 36/45] hvf: Make synchronize functions static, Peter Maydell, 2021/06/03
- [PULL 32/45] hvf: Make hvf_set_phys_mem() static, Peter Maydell, 2021/06/03
- [PULL 39/45] hvf: Simplify post reset/init/loadvm hooks, Peter Maydell, 2021/06/03
- [PULL 40/45] tests/qtest/bios-tables-test: Check for dup2() failure, Peter Maydell, 2021/06/03
- [PULL 44/45] tests/qtest/tpm-tests: Remove unnecessary NULL checks, Peter Maydell, 2021/06/03
- [PULL 41/45] tests/qtest/e1000e-test: Check qemu_recv() succeeded, Peter Maydell, 2021/06/03