mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'afaerber/qom-cpu' into staging
# By Andreas Färber
# Via Andreas Färber
* afaerber/qom-cpu: (24 commits)
cpu: Turn cpu_unassigned_access() into a CPUState hook
hwaddr: Make hwaddr type usable beyond softmmu
cpu: Change qemu_init_vcpu() argument to CPUState
cpus: Change qemu_dummy_start_vcpu() argument to CPUState
cpus: Change qemu_kvm_start_vcpu() argument to CPUState
cpus: Change cpu_handle_guest_debug() argument to CPUState
gdbstub: Set gdb_set_stop_cpu() argument to CPUState
kvm: Change kvm_cpu_exec() argument to CPUState
kvm: Change kvm_handle_internal_error() argument to CPUState
cpu: Turn cpu_dump_{state,statistics}() into CPUState hooks
cpus: Change qemu_kvm_init_cpu_signals() argument to CPUState
kvm: Change kvm_set_signal_mask() argument to CPUState
cpus: Change qemu_kvm_wait_io_event() argument to CPUState
cpus: Change cpu_thread_is_idle() argument to CPUState
cpu: Change cpu_exit() argument to CPUState
kvm: Change cpu_synchronize_state() argument to CPUState
kvm: Change kvm_cpu_synchronize_state() argument to CPUState
gdbstub: Simplify find_cpu()
cpu: Guard cpu_{save,load}() definitions
target-openrisc: Register VMStateDescription for OpenRISCCPU
...
This commit is contained in:
+2
-1
@@ -511,6 +511,7 @@ static void flush_windows(CPUSPARCState *env)
|
||||
|
||||
void cpu_loop(CPUSPARCState *env)
|
||||
{
|
||||
CPUState *cs = CPU(sparc_env_get_cpu(env));
|
||||
int trapnr, ret, syscall_nr;
|
||||
//target_siginfo_t info;
|
||||
|
||||
@@ -659,7 +660,7 @@ void cpu_loop(CPUSPARCState *env)
|
||||
badtrap:
|
||||
#endif
|
||||
printf ("Unhandled trap: 0x%x\n", trapnr);
|
||||
cpu_dump_state(env, stderr, fprintf, 0);
|
||||
cpu_dump_state(cs, stderr, fprintf, 0);
|
||||
exit (1);
|
||||
}
|
||||
process_pending_signals (env);
|
||||
|
||||
@@ -62,10 +62,8 @@
|
||||
|
||||
static CPUArchState *next_cpu;
|
||||
|
||||
static bool cpu_thread_is_idle(CPUArchState *env)
|
||||
static bool cpu_thread_is_idle(CPUState *cpu)
|
||||
{
|
||||
CPUState *cpu = ENV_GET_CPU(env);
|
||||
|
||||
if (cpu->stop || cpu->queued_work_first) {
|
||||
return false;
|
||||
}
|
||||
@@ -84,7 +82,7 @@ static bool all_cpu_threads_idle(void)
|
||||
CPUArchState *env;
|
||||
|
||||
for (env = first_cpu; env != NULL; env = env->next_cpu) {
|
||||
if (!cpu_thread_is_idle(env)) {
|
||||
if (!cpu_thread_is_idle(ENV_GET_CPU(env))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -399,7 +397,7 @@ void hw_error(const char *fmt, ...)
|
||||
for (env = first_cpu; env != NULL; env = env->next_cpu) {
|
||||
cpu = ENV_GET_CPU(env);
|
||||
fprintf(stderr, "CPU #%d:\n", cpu->cpu_index);
|
||||
cpu_dump_state(env, stderr, fprintf, CPU_DUMP_FPU);
|
||||
cpu_dump_state(cpu, stderr, fprintf, CPU_DUMP_FPU);
|
||||
}
|
||||
va_end(ap);
|
||||
abort();
|
||||
@@ -407,10 +405,10 @@ void hw_error(const char *fmt, ...)
|
||||
|
||||
void cpu_synchronize_all_states(void)
|
||||
{
|
||||
CPUArchState *cpu;
|
||||
CPUArchState *env;
|
||||
|
||||
for (cpu = first_cpu; cpu; cpu = cpu->next_cpu) {
|
||||
cpu_synchronize_state(cpu);
|
||||
for (env = first_cpu; env; env = env->next_cpu) {
|
||||
cpu_synchronize_state(ENV_GET_CPU(env));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -461,11 +459,9 @@ static bool cpu_can_run(CPUState *cpu)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void cpu_handle_guest_debug(CPUArchState *env)
|
||||
static void cpu_handle_guest_debug(CPUState *cpu)
|
||||
{
|
||||
CPUState *cpu = ENV_GET_CPU(env);
|
||||
|
||||
gdb_set_stop_cpu(env);
|
||||
gdb_set_stop_cpu(cpu);
|
||||
qemu_system_debug_request();
|
||||
cpu->stopped = true;
|
||||
}
|
||||
@@ -473,7 +469,7 @@ static void cpu_handle_guest_debug(CPUArchState *env)
|
||||
static void cpu_signal(int sig)
|
||||
{
|
||||
if (cpu_single_env) {
|
||||
cpu_exit(cpu_single_env);
|
||||
cpu_exit(ENV_GET_CPU(cpu_single_env));
|
||||
}
|
||||
exit_request = 1;
|
||||
}
|
||||
@@ -570,7 +566,7 @@ static void dummy_signal(int sig)
|
||||
{
|
||||
}
|
||||
|
||||
static void qemu_kvm_init_cpu_signals(CPUArchState *env)
|
||||
static void qemu_kvm_init_cpu_signals(CPUState *cpu)
|
||||
{
|
||||
int r;
|
||||
sigset_t set;
|
||||
@@ -583,7 +579,7 @@ static void qemu_kvm_init_cpu_signals(CPUArchState *env)
|
||||
pthread_sigmask(SIG_BLOCK, NULL, &set);
|
||||
sigdelset(&set, SIG_IPI);
|
||||
sigdelset(&set, SIGBUS);
|
||||
r = kvm_set_signal_mask(env, &set);
|
||||
r = kvm_set_signal_mask(cpu, &set);
|
||||
if (r) {
|
||||
fprintf(stderr, "kvm_set_signal_mask: %s\n", strerror(-r));
|
||||
exit(1);
|
||||
@@ -605,7 +601,7 @@ static void qemu_tcg_init_cpu_signals(void)
|
||||
}
|
||||
|
||||
#else /* _WIN32 */
|
||||
static void qemu_kvm_init_cpu_signals(CPUArchState *env)
|
||||
static void qemu_kvm_init_cpu_signals(CPUState *cpu)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
@@ -719,11 +715,9 @@ static void qemu_tcg_wait_io_event(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void qemu_kvm_wait_io_event(CPUArchState *env)
|
||||
static void qemu_kvm_wait_io_event(CPUState *cpu)
|
||||
{
|
||||
CPUState *cpu = ENV_GET_CPU(env);
|
||||
|
||||
while (cpu_thread_is_idle(env)) {
|
||||
while (cpu_thread_is_idle(cpu)) {
|
||||
qemu_cond_wait(cpu->halt_cond, &qemu_global_mutex);
|
||||
}
|
||||
|
||||
@@ -733,14 +727,13 @@ static void qemu_kvm_wait_io_event(CPUArchState *env)
|
||||
|
||||
static void *qemu_kvm_cpu_thread_fn(void *arg)
|
||||
{
|
||||
CPUArchState *env = arg;
|
||||
CPUState *cpu = ENV_GET_CPU(env);
|
||||
CPUState *cpu = arg;
|
||||
int r;
|
||||
|
||||
qemu_mutex_lock(&qemu_global_mutex);
|
||||
qemu_thread_get_self(cpu->thread);
|
||||
cpu->thread_id = qemu_get_thread_id();
|
||||
cpu_single_env = env;
|
||||
cpu_single_env = cpu->env_ptr;
|
||||
|
||||
r = kvm_init_vcpu(cpu);
|
||||
if (r < 0) {
|
||||
@@ -748,7 +741,7 @@ static void *qemu_kvm_cpu_thread_fn(void *arg)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
qemu_kvm_init_cpu_signals(env);
|
||||
qemu_kvm_init_cpu_signals(cpu);
|
||||
|
||||
/* signal CPU creation */
|
||||
cpu->created = true;
|
||||
@@ -756,12 +749,12 @@ static void *qemu_kvm_cpu_thread_fn(void *arg)
|
||||
|
||||
while (1) {
|
||||
if (cpu_can_run(cpu)) {
|
||||
r = kvm_cpu_exec(env);
|
||||
r = kvm_cpu_exec(cpu);
|
||||
if (r == EXCP_DEBUG) {
|
||||
cpu_handle_guest_debug(env);
|
||||
cpu_handle_guest_debug(cpu);
|
||||
}
|
||||
}
|
||||
qemu_kvm_wait_io_event(env);
|
||||
qemu_kvm_wait_io_event(cpu);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -773,8 +766,7 @@ static void *qemu_dummy_cpu_thread_fn(void *arg)
|
||||
fprintf(stderr, "qtest is not supported under Windows\n");
|
||||
exit(1);
|
||||
#else
|
||||
CPUArchState *env = arg;
|
||||
CPUState *cpu = ENV_GET_CPU(env);
|
||||
CPUState *cpu = arg;
|
||||
sigset_t waitset;
|
||||
int r;
|
||||
|
||||
@@ -789,7 +781,7 @@ static void *qemu_dummy_cpu_thread_fn(void *arg)
|
||||
cpu->created = true;
|
||||
qemu_cond_signal(&qemu_cpu_cond);
|
||||
|
||||
cpu_single_env = env;
|
||||
cpu_single_env = cpu->env_ptr;
|
||||
while (1) {
|
||||
cpu_single_env = NULL;
|
||||
qemu_mutex_unlock_iothread();
|
||||
@@ -802,7 +794,7 @@ static void *qemu_dummy_cpu_thread_fn(void *arg)
|
||||
exit(1);
|
||||
}
|
||||
qemu_mutex_lock_iothread();
|
||||
cpu_single_env = env;
|
||||
cpu_single_env = cpu->env_ptr;
|
||||
qemu_wait_io_event_common(cpu);
|
||||
}
|
||||
|
||||
@@ -1037,48 +1029,41 @@ static void qemu_tcg_init_vcpu(CPUState *cpu)
|
||||
}
|
||||
}
|
||||
|
||||
static void qemu_kvm_start_vcpu(CPUArchState *env)
|
||||
static void qemu_kvm_start_vcpu(CPUState *cpu)
|
||||
{
|
||||
CPUState *cpu = ENV_GET_CPU(env);
|
||||
|
||||
cpu->thread = g_malloc0(sizeof(QemuThread));
|
||||
cpu->halt_cond = g_malloc0(sizeof(QemuCond));
|
||||
qemu_cond_init(cpu->halt_cond);
|
||||
qemu_thread_create(cpu->thread, qemu_kvm_cpu_thread_fn, env,
|
||||
qemu_thread_create(cpu->thread, qemu_kvm_cpu_thread_fn, cpu,
|
||||
QEMU_THREAD_JOINABLE);
|
||||
while (!cpu->created) {
|
||||
qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex);
|
||||
}
|
||||
}
|
||||
|
||||
static void qemu_dummy_start_vcpu(CPUArchState *env)
|
||||
static void qemu_dummy_start_vcpu(CPUState *cpu)
|
||||
{
|
||||
CPUState *cpu = ENV_GET_CPU(env);
|
||||
|
||||
cpu->thread = g_malloc0(sizeof(QemuThread));
|
||||
cpu->halt_cond = g_malloc0(sizeof(QemuCond));
|
||||
qemu_cond_init(cpu->halt_cond);
|
||||
qemu_thread_create(cpu->thread, qemu_dummy_cpu_thread_fn, env,
|
||||
qemu_thread_create(cpu->thread, qemu_dummy_cpu_thread_fn, cpu,
|
||||
QEMU_THREAD_JOINABLE);
|
||||
while (!cpu->created) {
|
||||
qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex);
|
||||
}
|
||||
}
|
||||
|
||||
void qemu_init_vcpu(void *_env)
|
||||
void qemu_init_vcpu(CPUState *cpu)
|
||||
{
|
||||
CPUArchState *env = _env;
|
||||
CPUState *cpu = ENV_GET_CPU(env);
|
||||
|
||||
cpu->nr_cores = smp_cores;
|
||||
cpu->nr_threads = smp_threads;
|
||||
cpu->stopped = true;
|
||||
if (kvm_enabled()) {
|
||||
qemu_kvm_start_vcpu(env);
|
||||
qemu_kvm_start_vcpu(cpu);
|
||||
} else if (tcg_enabled()) {
|
||||
qemu_tcg_init_vcpu(cpu);
|
||||
} else {
|
||||
qemu_dummy_start_vcpu(env);
|
||||
qemu_dummy_start_vcpu(cpu);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1088,7 +1073,7 @@ void cpu_stop_current(void)
|
||||
CPUState *cpu_single_cpu = ENV_GET_CPU(cpu_single_env);
|
||||
cpu_single_cpu->stop = false;
|
||||
cpu_single_cpu->stopped = true;
|
||||
cpu_exit(cpu_single_env);
|
||||
cpu_exit(cpu_single_cpu);
|
||||
qemu_cond_signal(&qemu_pause_cond);
|
||||
}
|
||||
}
|
||||
@@ -1176,7 +1161,7 @@ static void tcg_exec_all(void)
|
||||
if (cpu_can_run(cpu)) {
|
||||
r = tcg_cpu_exec(env);
|
||||
if (r == EXCP_DEBUG) {
|
||||
cpu_handle_guest_debug(env);
|
||||
cpu_handle_guest_debug(cpu);
|
||||
break;
|
||||
}
|
||||
} else if (cpu->stop || cpu->stopped) {
|
||||
@@ -1219,7 +1204,7 @@ CpuInfoList *qmp_query_cpus(Error **errp)
|
||||
CPUState *cpu = ENV_GET_CPU(env);
|
||||
CpuInfoList *info;
|
||||
|
||||
cpu_synchronize_state(env);
|
||||
cpu_synchronize_state(cpu);
|
||||
|
||||
info = g_malloc0(sizeof(*info));
|
||||
info->value = g_malloc0(sizeof(*info->value));
|
||||
|
||||
@@ -331,12 +331,15 @@ tb_page_addr_t get_page_addr_code(CPUArchState *env1, target_ulong addr)
|
||||
pd = env1->iotlb[mmu_idx][page_index] & ~TARGET_PAGE_MASK;
|
||||
mr = iotlb_to_region(pd);
|
||||
if (memory_region_is_unassigned(mr)) {
|
||||
#if defined(TARGET_ALPHA) || defined(TARGET_MIPS) || defined(TARGET_SPARC)
|
||||
cpu_unassigned_access(env1, addr, 0, 1, 0, 4);
|
||||
#else
|
||||
cpu_abort(env1, "Trying to execute code outside RAM or ROM at 0x"
|
||||
TARGET_FMT_lx "\n", addr);
|
||||
#endif
|
||||
CPUState *cpu = ENV_GET_CPU(env1);
|
||||
CPUClass *cc = CPU_GET_CLASS(cpu);
|
||||
|
||||
if (cc->do_unassigned_access) {
|
||||
cc->do_unassigned_access(cpu, addr, false, true, 0, 4);
|
||||
} else {
|
||||
cpu_abort(env1, "Trying to execute code outside RAM or ROM at 0x"
|
||||
TARGET_FMT_lx "\n", addr);
|
||||
}
|
||||
}
|
||||
p = (void *)((uintptr_t)addr + env1->tlb_table[mmu_idx][page_index].addend);
|
||||
return qemu_ram_addr_from_host_nofail(p);
|
||||
|
||||
@@ -330,7 +330,7 @@ static int cpu_common_post_load(void *opaque, int version_id)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const VMStateDescription vmstate_cpu_common = {
|
||||
const VMStateDescription vmstate_cpu_common = {
|
||||
.name = "cpu_common",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
@@ -342,8 +342,7 @@ static const VMStateDescription vmstate_cpu_common = {
|
||||
VMSTATE_END_OF_LIST()
|
||||
}
|
||||
};
|
||||
#else
|
||||
#define vmstate_cpu_common vmstate_dummy
|
||||
|
||||
#endif
|
||||
|
||||
CPUState *qemu_get_cpu(int index)
|
||||
@@ -599,16 +598,9 @@ void cpu_single_step(CPUArchState *env, int enabled)
|
||||
#endif
|
||||
}
|
||||
|
||||
void cpu_exit(CPUArchState *env)
|
||||
{
|
||||
CPUState *cpu = ENV_GET_CPU(env);
|
||||
|
||||
cpu->exit_request = 1;
|
||||
cpu->tcg_exit_req = 1;
|
||||
}
|
||||
|
||||
void cpu_abort(CPUArchState *env, const char *fmt, ...)
|
||||
{
|
||||
CPUState *cpu = ENV_GET_CPU(env);
|
||||
va_list ap;
|
||||
va_list ap2;
|
||||
|
||||
@@ -617,7 +609,7 @@ void cpu_abort(CPUArchState *env, const char *fmt, ...)
|
||||
fprintf(stderr, "qemu: fatal: ");
|
||||
vfprintf(stderr, fmt, ap);
|
||||
fprintf(stderr, "\n");
|
||||
cpu_dump_state(env, stderr, fprintf, CPU_DUMP_FPU | CPU_DUMP_CCOP);
|
||||
cpu_dump_state(cpu, stderr, fprintf, CPU_DUMP_FPU | CPU_DUMP_CCOP);
|
||||
if (qemu_log_enabled()) {
|
||||
qemu_log("qemu: fatal: ");
|
||||
qemu_log_vprintf(fmt, ap2);
|
||||
|
||||
@@ -2033,7 +2033,7 @@ static void gdb_breakpoint_remove_all(void)
|
||||
|
||||
static void gdb_set_cpu_pc(GDBState *s, target_ulong pc)
|
||||
{
|
||||
cpu_synchronize_state(s->c_cpu);
|
||||
cpu_synchronize_state(ENV_GET_CPU(s->c_cpu));
|
||||
#if defined(TARGET_I386)
|
||||
s->c_cpu->eip = pc;
|
||||
#elif defined (TARGET_PPC)
|
||||
@@ -2071,17 +2071,13 @@ static void gdb_set_cpu_pc(GDBState *s, target_ulong pc)
|
||||
|
||||
static CPUArchState *find_cpu(uint32_t thread_id)
|
||||
{
|
||||
CPUArchState *env;
|
||||
CPUState *cpu;
|
||||
|
||||
for (env = first_cpu; env != NULL; env = env->next_cpu) {
|
||||
cpu = ENV_GET_CPU(env);
|
||||
if (cpu_index(cpu) == thread_id) {
|
||||
return env;
|
||||
}
|
||||
cpu = qemu_get_cpu(thread_id);
|
||||
if (cpu == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return cpu->env_ptr;
|
||||
}
|
||||
|
||||
static int gdb_handle_packet(GDBState *s, const char *line_buf)
|
||||
@@ -2232,7 +2228,7 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf)
|
||||
}
|
||||
break;
|
||||
case 'g':
|
||||
cpu_synchronize_state(s->g_cpu);
|
||||
cpu_synchronize_state(ENV_GET_CPU(s->g_cpu));
|
||||
env = s->g_cpu;
|
||||
len = 0;
|
||||
for (addr = 0; addr < num_g_regs; addr++) {
|
||||
@@ -2243,7 +2239,7 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf)
|
||||
put_packet(s, buf);
|
||||
break;
|
||||
case 'G':
|
||||
cpu_synchronize_state(s->g_cpu);
|
||||
cpu_synchronize_state(ENV_GET_CPU(s->g_cpu));
|
||||
env = s->g_cpu;
|
||||
registers = mem_buf;
|
||||
len = strlen(p) / 2;
|
||||
@@ -2411,7 +2407,7 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf)
|
||||
env = find_cpu(thread);
|
||||
if (env != NULL) {
|
||||
CPUState *cpu = ENV_GET_CPU(env);
|
||||
cpu_synchronize_state(env);
|
||||
cpu_synchronize_state(cpu);
|
||||
len = snprintf((char *)mem_buf, sizeof(mem_buf),
|
||||
"CPU#%d [%s]", cpu->cpu_index,
|
||||
cpu->halted ? "halted " : "running");
|
||||
@@ -2510,8 +2506,10 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf)
|
||||
return RS_IDLE;
|
||||
}
|
||||
|
||||
void gdb_set_stop_cpu(CPUArchState *env)
|
||||
void gdb_set_stop_cpu(CPUState *cpu)
|
||||
{
|
||||
CPUArchState *env = cpu->env_ptr;
|
||||
|
||||
gdbserver_state->c_cpu = env;
|
||||
gdbserver_state->g_cpu = env;
|
||||
}
|
||||
@@ -2659,7 +2657,7 @@ void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...)
|
||||
is still in the running state, which can cause packets to be dropped
|
||||
and state transition 'T' packets to be sent while the syscall is still
|
||||
being processed. */
|
||||
cpu_exit(s->c_cpu);
|
||||
cpu_exit(ENV_GET_CPU(s->c_cpu));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
+10
-4
@@ -197,7 +197,8 @@ static uint64_t cchip_read(void *opaque, hwaddr addr, unsigned size)
|
||||
break;
|
||||
|
||||
default:
|
||||
cpu_unassigned_access(cpu_single_env, addr, 0, 0, 0, size);
|
||||
cpu = CPU(alpha_env_get_cpu(cpu_single_env));
|
||||
cpu_unassigned_access(cpu, addr, false, false, 0, size);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -214,6 +215,7 @@ static uint64_t dchip_read(void *opaque, hwaddr addr, unsigned size)
|
||||
static uint64_t pchip_read(void *opaque, hwaddr addr, unsigned size)
|
||||
{
|
||||
TyphoonState *s = opaque;
|
||||
CPUState *cs;
|
||||
uint64_t ret = 0;
|
||||
|
||||
if (addr & 4) {
|
||||
@@ -300,7 +302,8 @@ static uint64_t pchip_read(void *opaque, hwaddr addr, unsigned size)
|
||||
break;
|
||||
|
||||
default:
|
||||
cpu_unassigned_access(cpu_single_env, addr, 0, 0, 0, size);
|
||||
cs = CPU(alpha_env_get_cpu(cpu_single_env));
|
||||
cpu_unassigned_access(cs, addr, false, false, 0, size);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -312,6 +315,7 @@ static void cchip_write(void *opaque, hwaddr addr,
|
||||
uint64_t v32, unsigned size)
|
||||
{
|
||||
TyphoonState *s = opaque;
|
||||
CPUState *cpu_single_cpu = CPU(alpha_env_get_cpu(cpu_single_env));
|
||||
uint64_t val, oldval, newval;
|
||||
|
||||
if (addr & 4) {
|
||||
@@ -461,7 +465,7 @@ static void cchip_write(void *opaque, hwaddr addr,
|
||||
break;
|
||||
|
||||
default:
|
||||
cpu_unassigned_access(cpu_single_env, addr, 1, 0, 0, size);
|
||||
cpu_unassigned_access(cpu_single_cpu, addr, true, false, 0, size);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -476,6 +480,7 @@ static void pchip_write(void *opaque, hwaddr addr,
|
||||
uint64_t v32, unsigned size)
|
||||
{
|
||||
TyphoonState *s = opaque;
|
||||
CPUState *cs;
|
||||
uint64_t val, oldval;
|
||||
|
||||
if (addr & 4) {
|
||||
@@ -577,7 +582,8 @@ static void pchip_write(void *opaque, hwaddr addr,
|
||||
break;
|
||||
|
||||
default:
|
||||
cpu_unassigned_access(cpu_single_env, addr, 1, 0, 0, size);
|
||||
cs = CPU(alpha_env_get_cpu(cpu_single_env));
|
||||
cpu_unassigned_access(cs, addr, true, false, 0, size);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -129,7 +129,7 @@ static void do_inject_external_nmi(void *data)
|
||||
uint32_t lvt;
|
||||
int ret;
|
||||
|
||||
cpu_synchronize_state(&s->cpu->env);
|
||||
cpu_synchronize_state(cpu);
|
||||
|
||||
lvt = s->lvt[APIC_LVT_LINT1];
|
||||
if (!(lvt & APIC_LVT_MASKED) && ((lvt >> 8) & 7) == APIC_DM_NMI) {
|
||||
|
||||
+2
-2
@@ -456,7 +456,7 @@ void vapic_report_tpr_access(DeviceState *dev, CPUState *cs, target_ulong ip,
|
||||
X86CPU *cpu = X86_CPU(cs);
|
||||
CPUX86State *env = &cpu->env;
|
||||
|
||||
cpu_synchronize_state(env);
|
||||
cpu_synchronize_state(cs);
|
||||
|
||||
if (evaluate_tpr_instruction(s, env, &ip, access) < 0) {
|
||||
if (s->state == VAPIC_ACTIVE) {
|
||||
@@ -627,7 +627,7 @@ static void vapic_write(void *opaque, hwaddr addr, uint64_t data,
|
||||
hwaddr rom_paddr;
|
||||
VAPICROMState *s = opaque;
|
||||
|
||||
cpu_synchronize_state(env);
|
||||
cpu_synchronize_state(CPU(x86_env_get_cpu(env)));
|
||||
|
||||
/*
|
||||
* The VAPIC supports two PIO-based hypercalls, both via port 0x7E.
|
||||
|
||||
+1
-1
@@ -1109,7 +1109,7 @@ static void cpu_request_exit(void *opaque, int irq, int level)
|
||||
CPUX86State *env = cpu_single_env;
|
||||
|
||||
if (env && level) {
|
||||
cpu_exit(env);
|
||||
cpu_exit(CPU(x86_env_get_cpu(env)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -253,7 +253,7 @@ static void cpu_request_exit(void *opaque, int irq, int level)
|
||||
CPUMIPSState *env = cpu_single_env;
|
||||
|
||||
if (env && level) {
|
||||
cpu_exit(env);
|
||||
cpu_exit(CPU(mips_env_get_cpu(env)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -102,7 +102,7 @@ static void cpu_request_exit(void *opaque, int irq, int level)
|
||||
CPUMIPSState *env = cpu_single_env;
|
||||
|
||||
if (env && level) {
|
||||
cpu_exit(env);
|
||||
cpu_exit(CPU(mips_env_get_cpu(env)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -773,7 +773,7 @@ static void cpu_request_exit(void *opaque, int irq, int level)
|
||||
CPUMIPSState *env = cpu_single_env;
|
||||
|
||||
if (env && level) {
|
||||
cpu_exit(env);
|
||||
cpu_exit(CPU(mips_env_get_cpu(env)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ static uint64_t vmport_ioport_read(void *opaque, hwaddr addr,
|
||||
unsigned char command;
|
||||
uint32_t eax;
|
||||
|
||||
cpu_synchronize_state(env);
|
||||
cpu_synchronize_state(CPU(x86_env_get_cpu(env)));
|
||||
|
||||
eax = env->regs[R_EAX];
|
||||
if (eax != VMPORT_MAGIC)
|
||||
|
||||
@@ -98,7 +98,7 @@ static void spin_kick(void *data)
|
||||
hwaddr map_size = 64 * 1024 * 1024;
|
||||
hwaddr map_start;
|
||||
|
||||
cpu_synchronize_state(env);
|
||||
cpu_synchronize_state(cpu);
|
||||
stl_p(&curspin->pir, env->spr[SPR_PIR]);
|
||||
env->nip = ldq_p(&curspin->addr) & (map_size - 1);
|
||||
env->gpr[3] = ldq_p(&curspin->r3);
|
||||
|
||||
+1
-1
@@ -420,7 +420,7 @@ static void cpu_request_exit(void *opaque, int irq, int level)
|
||||
CPUPPCState *env = cpu_single_env;
|
||||
|
||||
if (env && level) {
|
||||
cpu_exit(env);
|
||||
cpu_exit(CPU(ppc_env_get_cpu(env)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -184,7 +184,7 @@ static void rtas_start_cpu(sPAPREnvironment *spapr,
|
||||
/* This will make sure qemu state is up to date with kvm, and
|
||||
* mark it dirty so our changes get flushed back before the
|
||||
* new cpu enters */
|
||||
kvm_cpu_synchronize_state(env);
|
||||
kvm_cpu_synchronize_state(cs);
|
||||
|
||||
env->msr = (1ULL << MSR_SF) | (1ULL << MSR_ME);
|
||||
env->nip = start;
|
||||
|
||||
@@ -355,16 +355,6 @@ int page_check_range(target_ulong start, target_ulong len, int flags);
|
||||
|
||||
CPUArchState *cpu_copy(CPUArchState *env);
|
||||
|
||||
#define CPU_DUMP_CODE 0x00010000
|
||||
#define CPU_DUMP_FPU 0x00020000 /* dump FPU register state, not just integer */
|
||||
/* dump info about TCG QEMU's condition code optimization state */
|
||||
#define CPU_DUMP_CCOP 0x00040000
|
||||
|
||||
void cpu_dump_state(CPUArchState *env, FILE *f, fprintf_function cpu_fprintf,
|
||||
int flags);
|
||||
void cpu_dump_statistics(CPUArchState *env, FILE *f, fprintf_function cpu_fprintf,
|
||||
int flags);
|
||||
|
||||
void QEMU_NORETURN cpu_abort(CPUArchState *env, const char *fmt, ...)
|
||||
GCC_FMT_ATTR(2, 3);
|
||||
extern CPUArchState *first_cpu;
|
||||
@@ -421,8 +411,6 @@ DECLARE_TLS(CPUArchState *,cpu_single_env);
|
||||
| CPU_INTERRUPT_TGT_EXT_3 \
|
||||
| CPU_INTERRUPT_TGT_EXT_4)
|
||||
|
||||
void cpu_exit(CPUArchState *s);
|
||||
|
||||
/* Breakpoint/watchpoint flags */
|
||||
#define BP_MEM_READ 0x01
|
||||
#define BP_MEM_WRITE 0x02
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
|
||||
/* CPU interfaces that are target independent. */
|
||||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
#include "exec/hwaddr.h"
|
||||
#endif
|
||||
|
||||
#ifndef NEED_CPU_H
|
||||
#include "exec/poison.h"
|
||||
|
||||
@@ -28,7 +28,9 @@
|
||||
#include <inttypes.h>
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/queue.h"
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
#include "exec/hwaddr.h"
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_LONG_BITS
|
||||
#error TARGET_LONG_BITS must be defined before including this header
|
||||
|
||||
@@ -16,7 +16,7 @@ typedef void (*gdb_syscall_complete_cb)(CPUArchState *env,
|
||||
|
||||
void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...);
|
||||
int use_gdb_syscalls(void);
|
||||
void gdb_set_stop_cpu(CPUArchState *env);
|
||||
void gdb_set_stop_cpu(CPUState *cpu);
|
||||
void gdb_exit(CPUArchState *, int);
|
||||
#ifdef CONFIG_USER_ONLY
|
||||
int gdb_queuesig (void);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user