[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 087/115] i386: hvf: Move HVFState definition into hvf
From: |
Paolo Bonzini |
Subject: |
[PULL 087/115] i386: hvf: Move HVFState definition into hvf |
Date: |
Thu, 11 Jun 2020 15:44:21 -0400 |
From: Roman Bolshakov <r.bolshakov@yadro.com>
"sysemu/hvf.h" is intended for inclusion in generic code. However it
also contains several hvf definitions and declarations, including
HVFState that are used only inside "hvf.c". "hvf-i386.h" would be more
appropriate place to define HVFState as it's only included by "hvf.c"
and "x86_task.c".
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Message-Id: <20200528193758.51454-2-r.bolshakov@yadro.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
include/sysemu/hvf.h | 37 -------------------------------------
target/i386/hvf/hvf-i386.h | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+), 37 deletions(-)
diff --git a/include/sysemu/hvf.h b/include/sysemu/hvf.h
index fe95743124..644bdfc722 100644
--- a/include/sysemu/hvf.h
+++ b/include/sysemu/hvf.h
@@ -15,8 +15,6 @@
#include "cpu.h"
#include "qemu/bitops.h"
-#include "exec/memory.h"
-#include "sysemu/accel.h"
#ifdef CONFIG_HVF
#include <Hypervisor/hv.h>
@@ -32,41 +30,6 @@ extern bool hvf_allowed;
#define hvf_get_supported_cpuid(func, idx, reg) 0
#endif /* !CONFIG_HVF */
-/* 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;
-
-typedef struct HVFState {
- AccelState parent;
- hvf_slot slots[32];
- int num_slots;
-
- hvf_vcpu_caps *hvf_caps;
-} HVFState;
-extern HVFState *hvf_state;
-
-void hvf_set_phys_mem(MemoryRegionSection *, bool);
-void hvf_handle_io(CPUArchState *, uint16_t, void *,
- int, int, int);
-hvf_slot *hvf_find_overlap_slot(uint64_t, uint64_t);
-
/* Disable HVF if |disable| is 1, otherwise, enable it iff it is supported by
* the host CPU. Use hvf_enabled() after this to get the result. */
void hvf_disable(int disable);
diff --git a/target/i386/hvf/hvf-i386.h b/target/i386/hvf/hvf-i386.h
index fbe4a350c5..ef20c73eca 100644
--- a/target/i386/hvf/hvf-i386.h
+++ b/target/i386/hvf/hvf-i386.h
@@ -16,6 +16,7 @@
#ifndef HVF_I386_H
#define HVF_I386_H
+#include "sysemu/accel.h"
#include "sysemu/hvf.h"
#include "cpu.h"
#include "x86.h"
@@ -35,6 +36,40 @@ struct hvf_state {
uint64_t mem_quota;
};
+/* 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;
+
+typedef struct HVFState {
+ AccelState parent;
+ hvf_slot slots[32];
+ int num_slots;
+
+ hvf_vcpu_caps *hvf_caps;
+} HVFState;
+extern HVFState *hvf_state;
+
+void hvf_set_phys_mem(MemoryRegionSection *, bool);
+void hvf_handle_io(CPUArchState *, uint16_t, void *, int, int, int);
+hvf_slot *hvf_find_overlap_slot(uint64_t, uint64_t);
+
#ifdef NEED_CPU_H
/* Functions exported to host specific mode */
--
2.26.2
- [PULL 083/115] sysemu/accel: Restrict machine methods to system-mode, (continued)
- [PULL 083/115] sysemu/accel: Restrict machine methods to system-mode, Paolo Bonzini, 2020/06/11
- [PULL 069/115] KVM: Kick resamplefd for split kernel irqchip, Paolo Bonzini, 2020/06/11
- [PULL 095/115] i386: hvf: Drop regs in HVFX86EmulatorState, Paolo Bonzini, 2020/06/11
- [PULL 080/115] exec: set map length to zero when returning NULL, Paolo Bonzini, 2020/06/11
- [PULL 091/115] i386: hvf: Use IP from CPUX86State, Paolo Bonzini, 2020/06/11
- [PULL 094/115] i386: hvf: Drop copy of RFLAGS defines, Paolo Bonzini, 2020/06/11
- [PULL 097/115] i386: hvf: Move mmio_buf into CPUX86State, Paolo Bonzini, 2020/06/11
- [PULL 096/115] i386: hvf: Move lazy_flags into CPUX86State, Paolo Bonzini, 2020/06/11
- [PULL 098/115] i386: hvf: Drop HVFX86EmulatorState, Paolo Bonzini, 2020/06/11
- [PULL 093/115] i386: hvf: Drop rflags from HVFX86EmulatorState, Paolo Bonzini, 2020/06/11
- [PULL 087/115] i386: hvf: Move HVFState definition into hvf,
Paolo Bonzini <=
- [PULL 101/115] target/i386: sev: Move local structure definitions into .c file, Paolo Bonzini, 2020/06/11
- [PULL 100/115] target/i386: sev: Remove unused QSevGuestInfoClass, Paolo Bonzini, 2020/06/11
- [PULL 102/115] target/i386: sev: Rename QSevGuestInfo, Paolo Bonzini, 2020/06/11
- [PULL 058/115] disas: Let disas::read_memory() handler return EIO on error, Paolo Bonzini, 2020/06/11
- [PULL 104/115] target/i386: sev: Partial cleanup to sev_state global, Paolo Bonzini, 2020/06/11
- [PULL 105/115] target/i386: sev: Remove redundant cbitpos and reduced_phys_bits fields, Paolo Bonzini, 2020/06/11
- [PULL 073/115] replay: implement fair mutex, Paolo Bonzini, 2020/06/11
- [PULL 103/115] target/i386: sev: Embed SEVState in SevGuestState, Paolo Bonzini, 2020/06/11
- [PULL 107/115] target/i386: sev: Remove redundant handle field, Paolo Bonzini, 2020/06/11
- [PULL 108/115] target/i386: sev: Unify SEVState and SevGuestState, Paolo Bonzini, 2020/06/11