mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/ehabkost-gl/tags/x86-next-pull-request' into staging
x86 queue, 2020-12-17 Features: * AVX512_FP16 feature (Cathy Zhang) Cleanups: * accel code cleanup (Claudio Fontana) * hyperv initialization cleanup (Vitaly Kuznetsov) # gpg: Signature made Thu 17 Dec 2020 18:44:45 GMT # gpg: using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6 # gpg: issuer "ehabkost@redhat.com" # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full] # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost-gl/tags/x86-next-pull-request: cpu: Remove unnecessary noop methods tcg: Make CPUClass.debug_excp_handler optional tcg: make CPUClass.cpu_exec_* optional tcg: cpu_exec_{enter,exit} helpers i386: tcg: remove inline from cpu_load_eflags i386: move TCG cpu class initialization to tcg/ x86/cpu: Add AVX512_FP16 cpu feature i386: move hyperv_limits initialization to x86_cpu_realizefn() i386: move hyperv_version_id initialization to x86_cpu_realizefn() i386: move hyperv_interface_id initialization to x86_cpu_realizefn() i386: move hyperv_vendor_id initialization to x86_cpu_realizefn() i386: move cpu dump out of helper.c into cpu-dump.c i386: move TCG accel files into tcg/ i386: hvf: remove stale MAINTAINERS entry for old hvf stubs i386: move hax accel files into hax/ i386: move whpx accel files into whpx/ i386: move kvm accel files into kvm/ Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
+3
-8
@@ -426,7 +426,7 @@ M: Paolo Bonzini <pbonzini@redhat.com>
|
||||
M: Marcelo Tosatti <mtosatti@redhat.com>
|
||||
L: kvm@vger.kernel.org
|
||||
S: Supported
|
||||
F: target/i386/kvm.c
|
||||
F: target/i386/kvm/
|
||||
F: scripts/kvm/vmxcap
|
||||
|
||||
Guest CPU Cores (other accelerators)
|
||||
@@ -445,18 +445,13 @@ M: Cameron Esfahani <dirty@apple.com>
|
||||
M: Roman Bolshakov <r.bolshakov@yadro.com>
|
||||
W: https://wiki.qemu.org/Features/HVF
|
||||
S: Maintained
|
||||
F: accel/stubs/hvf-stub.c
|
||||
F: target/i386/hvf/
|
||||
F: include/sysemu/hvf.h
|
||||
|
||||
WHPX CPUs
|
||||
M: Sunil Muthuswamy <sunilmut@microsoft.com>
|
||||
S: Supported
|
||||
F: target/i386/whpx-all.c
|
||||
F: target/i386/whpx-apic.c
|
||||
F: target/i386/whpx-cpus.c
|
||||
F: target/i386/whp-dispatch.h
|
||||
F: accel/stubs/whpx-stub.c
|
||||
F: target/i386/whpx/
|
||||
F: include/sysemu/whpx.h
|
||||
|
||||
Guest CPU Cores (Xen)
|
||||
@@ -496,7 +491,7 @@ W: https://github.com/intel/haxm/issues
|
||||
S: Maintained
|
||||
F: accel/stubs/hax-stub.c
|
||||
F: include/sysemu/hax.h
|
||||
F: target/i386/hax-*
|
||||
F: target/i386/hax/
|
||||
|
||||
Hosts
|
||||
-----
|
||||
|
||||
+27
-7
@@ -236,9 +236,26 @@ static void cpu_exec_nocache(CPUState *cpu, int max_cycles,
|
||||
}
|
||||
#endif
|
||||
|
||||
void cpu_exec_step_atomic(CPUState *cpu)
|
||||
static void cpu_exec_enter(CPUState *cpu)
|
||||
{
|
||||
CPUClass *cc = CPU_GET_CLASS(cpu);
|
||||
|
||||
if (cc->cpu_exec_enter) {
|
||||
cc->cpu_exec_enter(cpu);
|
||||
}
|
||||
}
|
||||
|
||||
static void cpu_exec_exit(CPUState *cpu)
|
||||
{
|
||||
CPUClass *cc = CPU_GET_CLASS(cpu);
|
||||
|
||||
if (cc->cpu_exec_exit) {
|
||||
cc->cpu_exec_exit(cpu);
|
||||
}
|
||||
}
|
||||
|
||||
void cpu_exec_step_atomic(CPUState *cpu)
|
||||
{
|
||||
TranslationBlock *tb;
|
||||
target_ulong cs_base, pc;
|
||||
uint32_t flags;
|
||||
@@ -257,11 +274,11 @@ void cpu_exec_step_atomic(CPUState *cpu)
|
||||
|
||||
/* Since we got here, we know that parallel_cpus must be true. */
|
||||
parallel_cpus = false;
|
||||
cc->cpu_exec_enter(cpu);
|
||||
cpu_exec_enter(cpu);
|
||||
/* execute the generated code */
|
||||
trace_exec_tb(tb, pc);
|
||||
cpu_tb_exec(cpu, tb);
|
||||
cc->cpu_exec_exit(cpu);
|
||||
cpu_exec_exit(cpu);
|
||||
} else {
|
||||
/*
|
||||
* The mmap_lock is dropped by tb_gen_code if it runs out of
|
||||
@@ -465,7 +482,9 @@ static inline void cpu_handle_debug_exception(CPUState *cpu)
|
||||
}
|
||||
}
|
||||
|
||||
cc->debug_excp_handler(cpu);
|
||||
if (cc->debug_excp_handler) {
|
||||
cc->debug_excp_handler(cpu);
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool cpu_handle_exception(CPUState *cpu, int *ret)
|
||||
@@ -606,7 +625,8 @@ static inline bool cpu_handle_interrupt(CPUState *cpu,
|
||||
True when it is, and we should restart on a new TB,
|
||||
and via longjmp via cpu_loop_exit. */
|
||||
else {
|
||||
if (cc->cpu_exec_interrupt(cpu, interrupt_request)) {
|
||||
if (cc->cpu_exec_interrupt &&
|
||||
cc->cpu_exec_interrupt(cpu, interrupt_request)) {
|
||||
if (need_replay_interrupt(interrupt_request)) {
|
||||
replay_interrupt();
|
||||
}
|
||||
@@ -713,7 +733,7 @@ int cpu_exec(CPUState *cpu)
|
||||
|
||||
rcu_read_lock();
|
||||
|
||||
cc->cpu_exec_enter(cpu);
|
||||
cpu_exec_enter(cpu);
|
||||
|
||||
/* Calculate difference between guest clock and host clock.
|
||||
* This delay includes the delay of the last cycle, so
|
||||
@@ -775,7 +795,7 @@ int cpu_exec(CPUState *cpu)
|
||||
}
|
||||
}
|
||||
|
||||
cc->cpu_exec_exit(cpu);
|
||||
cpu_exec_exit(cpu);
|
||||
rcu_read_unlock();
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -199,15 +199,6 @@ static bool cpu_common_virtio_is_big_endian(CPUState *cpu)
|
||||
return target_words_bigendian();
|
||||
}
|
||||
|
||||
static void cpu_common_noop(CPUState *cpu)
|
||||
{
|
||||
}
|
||||
|
||||
static bool cpu_common_exec_interrupt(CPUState *cpu, int int_req)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#if !defined(CONFIG_USER_ONLY)
|
||||
GuestPanicInformation *cpu_get_crash_info(CPUState *cpu)
|
||||
{
|
||||
@@ -425,11 +416,7 @@ static void cpu_class_init(ObjectClass *klass, void *data)
|
||||
k->gdb_read_register = cpu_common_gdb_read_register;
|
||||
k->gdb_write_register = cpu_common_gdb_write_register;
|
||||
k->virtio_is_big_endian = cpu_common_virtio_is_big_endian;
|
||||
k->debug_excp_handler = cpu_common_noop;
|
||||
k->debug_check_watchpoint = cpu_common_debug_check_watchpoint;
|
||||
k->cpu_exec_enter = cpu_common_noop;
|
||||
k->cpu_exec_exit = cpu_common_noop;
|
||||
k->cpu_exec_interrupt = cpu_common_exec_interrupt;
|
||||
k->adjust_watchpoint_address = cpu_adjust_watchpoint_address;
|
||||
set_bit(DEVICE_CATEGORY_CPU, dc->categories);
|
||||
dc->realize = cpu_common_realizefn;
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
#include "hw/timer/hpet.h"
|
||||
#include "hw/nvram/fw_cfg.h"
|
||||
#include "e820_memory_layout.h"
|
||||
#include "kvm_i386.h"
|
||||
#include "kvm/kvm_i386.h"
|
||||
#include CONFIG_DEVICES
|
||||
|
||||
struct hpet_fw_config hpet_cfg = {.count = UINT8_MAX};
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "sysemu/kvm.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
#include "hw/i386/apic_internal.h"
|
||||
#include "kvm_i386.h"
|
||||
#include "kvm/kvm_i386.h"
|
||||
#include "migration/vmstate.h"
|
||||
#include "trace.h"
|
||||
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
#include "hw/pci/msi.h"
|
||||
#include "sysemu/hw_accel.h"
|
||||
#include "sysemu/kvm.h"
|
||||
#include "target/i386/kvm_i386.h"
|
||||
#include "kvm/kvm_i386.h"
|
||||
|
||||
static inline void kvm_apic_set_reg(struct kvm_lapic_state *kapic,
|
||||
int reg_id, uint32_t val)
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
#include "sysemu/kvm.h"
|
||||
#include "sysemu/runstate.h"
|
||||
#include "sysemu/hw_accel.h"
|
||||
#include "kvm_i386.h"
|
||||
#include "kvm/kvm_i386.h"
|
||||
#include "migration/vmstate.h"
|
||||
#include "hw/sysbus.h"
|
||||
#include "hw/kvm/clock.h"
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@
|
||||
|
||||
#include "cpu.h"
|
||||
#include "elf.h"
|
||||
#include "kvm_i386.h"
|
||||
#include "kvm/kvm_i386.h"
|
||||
#include "hw/xen/start_info.h"
|
||||
|
||||
#define MICROVM_QBOOT_FILENAME "qboot.rom"
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@
|
||||
#include "sysemu/qtest.h"
|
||||
#include "sysemu/reset.h"
|
||||
#include "sysemu/runstate.h"
|
||||
#include "kvm_i386.h"
|
||||
#include "kvm/kvm_i386.h"
|
||||
#include "hw/xen/xen.h"
|
||||
#include "hw/xen/start_info.h"
|
||||
#include "ui/qemu-spice.h"
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@
|
||||
#include "elf.h"
|
||||
#include "standard-headers/asm-x86/bootparam.h"
|
||||
#include CONFIG_DEVICES
|
||||
#include "kvm_i386.h"
|
||||
#include "kvm/kvm_i386.h"
|
||||
|
||||
/* Physical Address of PVH entry point read from kernel ELF NOTE */
|
||||
static size_t pvh_start_addr;
|
||||
|
||||
@@ -1497,6 +1497,7 @@ trace_events_subdirs += [
|
||||
'target/arm',
|
||||
'target/hppa',
|
||||
'target/i386',
|
||||
'target/i386/kvm',
|
||||
'target/mips',
|
||||
'target/ppc',
|
||||
'target/riscv',
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+50
-25
@@ -24,6 +24,8 @@
|
||||
#include "qemu/qemu-print.h"
|
||||
|
||||
#include "cpu.h"
|
||||
#include "tcg/tcg-cpu.h"
|
||||
#include "tcg/helper-tcg.h"
|
||||
#include "exec/exec-all.h"
|
||||
#include "sysemu/kvm.h"
|
||||
#include "sysemu/reset.h"
|
||||
@@ -31,7 +33,7 @@
|
||||
#include "sysemu/cpus.h"
|
||||
#include "sysemu/xen.h"
|
||||
#include "sysemu/whpx.h"
|
||||
#include "kvm_i386.h"
|
||||
#include "kvm/kvm_i386.h"
|
||||
#include "sev_i386.h"
|
||||
|
||||
#include "qemu/error-report.h"
|
||||
@@ -979,7 +981,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
|
||||
"avx512-vp2intersect", NULL, "md-clear", NULL,
|
||||
NULL, NULL, "serialize", NULL,
|
||||
"tsx-ldtrk", NULL, NULL /* pconfig */, NULL,
|
||||
NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, "avx512-fp16",
|
||||
NULL, NULL, "spec-ctrl", "stibp",
|
||||
NULL, "arch-capabilities", "core-capability", "ssbd",
|
||||
},
|
||||
@@ -1521,7 +1523,8 @@ static inline uint64_t x86_cpu_xsave_components(X86CPU *cpu)
|
||||
cpu->env.features[FEAT_XSAVE_COMP_LO];
|
||||
}
|
||||
|
||||
const char *get_register_name_32(unsigned int reg)
|
||||
/* Return name of 32-bit register, from a R_* constant */
|
||||
static const char *get_register_name_32(unsigned int reg)
|
||||
{
|
||||
if (reg >= CPU_NB_REGS32) {
|
||||
return NULL;
|
||||
@@ -6544,6 +6547,40 @@ static void x86_cpu_filter_features(X86CPU *cpu, bool verbose)
|
||||
}
|
||||
}
|
||||
|
||||
static void x86_cpu_hyperv_realize(X86CPU *cpu)
|
||||
{
|
||||
size_t len;
|
||||
|
||||
/* Hyper-V vendor id */
|
||||
if (!cpu->hyperv_vendor) {
|
||||
memcpy(cpu->hyperv_vendor_id, "Microsoft Hv", 12);
|
||||
} else {
|
||||
len = strlen(cpu->hyperv_vendor);
|
||||
|
||||
if (len > 12) {
|
||||
warn_report("hv-vendor-id truncated to 12 characters");
|
||||
len = 12;
|
||||
}
|
||||
memset(cpu->hyperv_vendor_id, 0, 12);
|
||||
memcpy(cpu->hyperv_vendor_id, cpu->hyperv_vendor, len);
|
||||
}
|
||||
|
||||
/* 'Hv#1' interface identification*/
|
||||
cpu->hyperv_interface_id[0] = 0x31237648;
|
||||
cpu->hyperv_interface_id[1] = 0;
|
||||
cpu->hyperv_interface_id[2] = 0;
|
||||
cpu->hyperv_interface_id[3] = 0;
|
||||
|
||||
/* Hypervisor system identity */
|
||||
cpu->hyperv_version_id[0] = 0x00001bbc;
|
||||
cpu->hyperv_version_id[1] = 0x00060001;
|
||||
|
||||
/* Hypervisor implementation limits */
|
||||
cpu->hyperv_limits[0] = 64;
|
||||
cpu->hyperv_limits[1] = 0;
|
||||
cpu->hyperv_limits[2] = 0;
|
||||
}
|
||||
|
||||
static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
|
||||
{
|
||||
CPUState *cs = CPU(dev);
|
||||
@@ -6715,6 +6752,8 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
|
||||
env->cache_info_amd.l3_cache = &legacy_l3_cache;
|
||||
}
|
||||
|
||||
/* Process Hyper-V enlightenments */
|
||||
x86_cpu_hyperv_realize(cpu);
|
||||
|
||||
cpu_exec_realizefn(cs, &local_err);
|
||||
if (local_err != NULL) {
|
||||
@@ -7032,13 +7071,6 @@ static void x86_cpu_set_pc(CPUState *cs, vaddr value)
|
||||
cpu->env.eip = value;
|
||||
}
|
||||
|
||||
static void x86_cpu_synchronize_from_tb(CPUState *cs, TranslationBlock *tb)
|
||||
{
|
||||
X86CPU *cpu = X86_CPU(cs);
|
||||
|
||||
cpu->env.eip = tb->pc - tb->cs_base;
|
||||
}
|
||||
|
||||
int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request)
|
||||
{
|
||||
X86CPU *cpu = X86_CPU(cs);
|
||||
@@ -7218,7 +7250,7 @@ static Property x86_cpu_properties[] = {
|
||||
DEFINE_PROP_UINT32("min-xlevel2", X86CPU, env.cpuid_min_xlevel2, 0),
|
||||
DEFINE_PROP_UINT64("ucode-rev", X86CPU, ucode_rev, 0),
|
||||
DEFINE_PROP_BOOL("full-cpuid-auto-level", X86CPU, full_cpuid_auto_level, true),
|
||||
DEFINE_PROP_STRING("hv-vendor-id", X86CPU, hyperv_vendor_id),
|
||||
DEFINE_PROP_STRING("hv-vendor-id", X86CPU, hyperv_vendor),
|
||||
DEFINE_PROP_BOOL("cpuid-0xb", X86CPU, enable_cpuid_0xb, true),
|
||||
DEFINE_PROP_BOOL("lmce", X86CPU, enable_lmce, false),
|
||||
DEFINE_PROP_BOOL("l3-cache", X86CPU, enable_l3_cache, true),
|
||||
@@ -7273,17 +7305,18 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data)
|
||||
cc->class_by_name = x86_cpu_class_by_name;
|
||||
cc->parse_features = x86_cpu_parse_featurestr;
|
||||
cc->has_work = x86_cpu_has_work;
|
||||
|
||||
#ifdef CONFIG_TCG
|
||||
cc->do_interrupt = x86_cpu_do_interrupt;
|
||||
cc->cpu_exec_interrupt = x86_cpu_exec_interrupt;
|
||||
#endif
|
||||
tcg_cpu_common_class_init(cc);
|
||||
#endif /* CONFIG_TCG */
|
||||
|
||||
cc->dump_state = x86_cpu_dump_state;
|
||||
cc->set_pc = x86_cpu_set_pc;
|
||||
cc->synchronize_from_tb = x86_cpu_synchronize_from_tb;
|
||||
cc->gdb_read_register = x86_cpu_gdb_read_register;
|
||||
cc->gdb_write_register = x86_cpu_gdb_write_register;
|
||||
cc->get_arch_id = x86_cpu_get_arch_id;
|
||||
cc->get_paging_enabled = x86_cpu_get_paging_enabled;
|
||||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
cc->asidx_from_attrs = x86_asidx_from_attrs;
|
||||
cc->get_memory_mapping = x86_cpu_get_memory_mapping;
|
||||
@@ -7294,7 +7327,8 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data)
|
||||
cc->write_elf32_note = x86_cpu_write_elf32_note;
|
||||
cc->write_elf32_qemunote = x86_cpu_write_elf32_qemunote;
|
||||
cc->vmsd = &vmstate_x86_cpu;
|
||||
#endif
|
||||
#endif /* !CONFIG_USER_ONLY */
|
||||
|
||||
cc->gdb_arch_name = x86_gdb_arch_name;
|
||||
#ifdef TARGET_X86_64
|
||||
cc->gdb_core_xml_file = "i386-64bit.xml";
|
||||
@@ -7302,15 +7336,6 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data)
|
||||
#else
|
||||
cc->gdb_core_xml_file = "i386-32bit.xml";
|
||||
cc->gdb_num_core_regs = 50;
|
||||
#endif
|
||||
#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY)
|
||||
cc->debug_excp_handler = breakpoint_handler;
|
||||
#endif
|
||||
cc->cpu_exec_enter = x86_cpu_exec_enter;
|
||||
cc->cpu_exec_exit = x86_cpu_exec_exit;
|
||||
#ifdef CONFIG_TCG
|
||||
cc->tcg_initialize = tcg_x86_init;
|
||||
cc->tlb_fill = x86_cpu_tlb_fill;
|
||||
#endif
|
||||
cc->disas_set_info = x86_disas_set_info;
|
||||
|
||||
|
||||
+9
-88
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "sysemu/tcg.h"
|
||||
#include "cpu-qom.h"
|
||||
#include "hyperv-proto.h"
|
||||
#include "kvm/hyperv-proto.h"
|
||||
#include "exec/cpu-defs.h"
|
||||
#include "qapi/qapi-types-common.h"
|
||||
|
||||
@@ -31,9 +31,6 @@
|
||||
|
||||
#define KVM_HAVE_MCE_INJECTION 1
|
||||
|
||||
/* Maximum instruction code size */
|
||||
#define TARGET_MAX_INSN_SIZE 16
|
||||
|
||||
/* support for self modifying code even if the modified instruction is
|
||||
close to the modifying instruction */
|
||||
#define TARGET_HAS_PRECISE_SMC
|
||||
@@ -784,6 +781,8 @@ typedef uint64_t FeatureWordArray[FEATURE_WORDS];
|
||||
#define CPUID_7_0_EDX_SERIALIZE (1U << 14)
|
||||
/* TSX Suspend Load Address Tracking instruction */
|
||||
#define CPUID_7_0_EDX_TSX_LDTRK (1U << 16)
|
||||
/* AVX512_FP16 instruction */
|
||||
#define CPUID_7_0_EDX_AVX512_FP16 (1U << 23)
|
||||
/* Speculation Control */
|
||||
#define CPUID_7_0_EDX_SPEC_CTRL (1U << 26)
|
||||
/* Single Thread Indirect Branch Predictors */
|
||||
@@ -1659,11 +1658,15 @@ struct X86CPU {
|
||||
uint64_t ucode_rev;
|
||||
|
||||
uint32_t hyperv_spinlock_attempts;
|
||||
char *hyperv_vendor_id;
|
||||
char *hyperv_vendor;
|
||||
bool hyperv_synic_kvm_only;
|
||||
uint64_t hyperv_features;
|
||||
bool hyperv_passthrough;
|
||||
OnOffAuto hyperv_no_nonarch_cs;
|
||||
uint32_t hyperv_vendor_id[3];
|
||||
uint32_t hyperv_interface_id[4];
|
||||
uint32_t hyperv_version_id[4];
|
||||
uint32_t hyperv_limits[3];
|
||||
|
||||
bool check_cpuid;
|
||||
bool enforce_cpuid;
|
||||
@@ -1769,12 +1772,6 @@ struct X86CPU {
|
||||
extern VMStateDescription vmstate_x86_cpu;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* x86_cpu_do_interrupt:
|
||||
* @cpu: vCPU the interrupt is to be handled by.
|
||||
*/
|
||||
void x86_cpu_do_interrupt(CPUState *cpu);
|
||||
bool x86_cpu_exec_interrupt(CPUState *cpu, int int_req);
|
||||
int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request);
|
||||
|
||||
int x86_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cpu,
|
||||
@@ -1797,9 +1794,6 @@ hwaddr x86_cpu_get_phys_page_attrs_debug(CPUState *cpu, vaddr addr,
|
||||
int x86_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg);
|
||||
int x86_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
|
||||
|
||||
void x86_cpu_exec_enter(CPUState *cpu);
|
||||
void x86_cpu_exec_exit(CPUState *cpu);
|
||||
|
||||
void x86_cpu_list(void);
|
||||
int cpu_x86_support_mca_broadcast(CPUX86State *env);
|
||||
|
||||
@@ -1924,9 +1918,6 @@ void host_cpuid(uint32_t function, uint32_t count,
|
||||
void host_vendor_fms(char *vendor, int *family, int *model, int *stepping);
|
||||
|
||||
/* helper.c */
|
||||
bool x86_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
|
||||
MMUAccessType access_type, int mmu_idx,
|
||||
bool probe, uintptr_t retaddr);
|
||||
void x86_cpu_set_a20(X86CPU *cpu, int a20_state);
|
||||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
@@ -1951,8 +1942,6 @@ void x86_stl_phys(CPUState *cs, hwaddr addr, uint32_t val);
|
||||
void x86_stq_phys(CPUState *cs, hwaddr addr, uint64_t val);
|
||||
#endif
|
||||
|
||||
void breakpoint_handler(CPUState *cs);
|
||||
|
||||
/* will be suppressed */
|
||||
void cpu_x86_update_cr0(CPUX86State *env, uint32_t new_cr0);
|
||||
void cpu_x86_update_cr3(CPUX86State *env, target_ulong new_cr3);
|
||||
@@ -1962,16 +1951,6 @@ void cpu_x86_update_dr7(CPUX86State *env, uint32_t new_dr7);
|
||||
/* hw/pc.c */
|
||||
uint64_t cpu_get_tsc(CPUX86State *env);
|
||||
|
||||
/* XXX: This value should match the one returned by CPUID
|
||||
* and in exec.c */
|
||||
# if defined(TARGET_X86_64)
|
||||
# define TCG_PHYS_ADDR_BITS 40
|
||||
# else
|
||||
# define TCG_PHYS_ADDR_BITS 36
|
||||
# endif
|
||||
|
||||
#define PHYS_ADDR_MASK MAKE_64BIT_MASK(0, TCG_PHYS_ADDR_BITS)
|
||||
|
||||
#define X86_CPU_TYPE_SUFFIX "-" TYPE_X86_CPU
|
||||
#define X86_CPU_TYPE_NAME(name) (name X86_CPU_TYPE_SUFFIX)
|
||||
#define CPU_RESOLVING_TYPE TYPE_X86_CPU
|
||||
@@ -2008,25 +1987,6 @@ static inline int cpu_mmu_index_kernel(CPUX86State *env)
|
||||
#define CC_SRC2 (env->cc_src2)
|
||||
#define CC_OP (env->cc_op)
|
||||
|
||||
/* n must be a constant to be efficient */
|
||||
static inline target_long lshift(target_long x, int n)
|
||||
{
|
||||
if (n >= 0) {
|
||||
return x << n;
|
||||
} else {
|
||||
return x >> (-n);
|
||||
}
|
||||
}
|
||||
|
||||
/* float macros */
|
||||
#define FT0 (env->ft0)
|
||||
#define ST0 (env->fpregs[env->fpstt].d)
|
||||
#define ST(n) (env->fpregs[(env->fpstt + (n)) & 7].d)
|
||||
#define ST1 ST(1)
|
||||
|
||||
/* translate.c */
|
||||
void tcg_x86_init(void);
|
||||
|
||||
typedef CPUX86State CPUArchState;
|
||||
typedef X86CPU ArchCPU;
|
||||
|
||||
@@ -2056,19 +2016,6 @@ void cpu_x86_inject_mce(Monitor *mon, X86CPU *cpu, int bank,
|
||||
uint64_t status, uint64_t mcg_status, uint64_t addr,
|
||||
uint64_t misc, int flags);
|
||||
|
||||
/* excp_helper.c */
|
||||
void QEMU_NORETURN raise_exception(CPUX86State *env, int exception_index);
|
||||
void QEMU_NORETURN raise_exception_ra(CPUX86State *env, int exception_index,
|
||||
uintptr_t retaddr);
|
||||
void QEMU_NORETURN raise_exception_err(CPUX86State *env, int exception_index,
|
||||
int error_code);
|
||||
void QEMU_NORETURN raise_exception_err_ra(CPUX86State *env, int exception_index,
|
||||
int error_code, uintptr_t retaddr);
|
||||
void QEMU_NORETURN raise_interrupt(CPUX86State *nenv, int intno, int is_int,
|
||||
int error_code, int next_eip_addend);
|
||||
|
||||
/* cc_helper.c */
|
||||
extern const uint8_t parity_table[256];
|
||||
uint32_t cpu_cc_compute_all(CPUX86State *env1, int op);
|
||||
|
||||
static inline uint32_t cpu_compute_eflags(CPUX86State *env)
|
||||
@@ -2080,18 +2027,6 @@ static inline uint32_t cpu_compute_eflags(CPUX86State *env)
|
||||
return eflags;
|
||||
}
|
||||
|
||||
/* NOTE: the translator must set DisasContext.cc_op to CC_OP_EFLAGS
|
||||
* after generating a call to a helper that uses this.
|
||||
*/
|
||||
static inline void cpu_load_eflags(CPUX86State *env, int eflags,
|
||||
int update_mask)
|
||||
{
|
||||
CC_SRC = eflags & (CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C);
|
||||
CC_OP = CC_OP_EFLAGS;
|
||||
env->df = 1 - (2 * ((eflags >> 10) & 1));
|
||||
env->eflags = (env->eflags & ~update_mask) |
|
||||
(eflags & update_mask) | 0x2;
|
||||
}
|
||||
|
||||
/* load efer and update the corresponding hflags. XXX: do consistency
|
||||
checks with cpuid bits? */
|
||||
@@ -2180,16 +2115,6 @@ void helper_lock_init(void);
|
||||
/* svm_helper.c */
|
||||
void cpu_svm_check_intercept_param(CPUX86State *env1, uint32_t type,
|
||||
uint64_t param, uintptr_t retaddr);
|
||||
void QEMU_NORETURN cpu_vmexit(CPUX86State *nenv, uint32_t exit_code,
|
||||
uint64_t exit_info_1, uintptr_t retaddr);
|
||||
void do_vmexit(CPUX86State *env, uint32_t exit_code, uint64_t exit_info_1);
|
||||
|
||||
/* seg_helper.c */
|
||||
void do_interrupt_x86_hardirq(CPUX86State *env, int intno, int is_hw);
|
||||
|
||||
/* smm_helper.c */
|
||||
void do_smm_enter(X86CPU *cpu);
|
||||
|
||||
/* apic.c */
|
||||
void cpu_report_tpr_access(CPUX86State *env, TPRAccess access);
|
||||
void apic_handle_tpr_access_report(DeviceState *d, target_ulong ip,
|
||||
@@ -2228,14 +2153,10 @@ typedef int X86CPUVersion;
|
||||
*/
|
||||
void x86_cpu_set_default_version(X86CPUVersion version);
|
||||
|
||||
/* Return name of 32-bit register, from a R_* constant */
|
||||
const char *get_register_name_32(unsigned int reg);
|
||||
|
||||
void enable_compat_apic_id_mode(void);
|
||||
|
||||
#define APIC_DEFAULT_ADDRESS 0xfee00000
|
||||
#define APIC_SPACE_SIZE 0x100000
|
||||
|
||||
/* cpu-dump.c */
|
||||
void x86_cpu_dump_local_apic_state(CPUState *cs, int flags);
|
||||
|
||||
/* cpu.c */
|
||||
|
||||
@@ -84,13 +84,13 @@ void hax_memory_init(void);
|
||||
|
||||
|
||||
#ifdef CONFIG_POSIX
|
||||
#include "target/i386/hax-posix.h"
|
||||
#include "hax-posix.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_WIN32
|
||||
#include "target/i386/hax-windows.h"
|
||||
#include "hax-windows.h"
|
||||
#endif
|
||||
|
||||
#include "target/i386/hax-interface.h"
|
||||
#include "hax-interface.h"
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user