d3d93c6c1e
MIPS KVM trap & emulate guest kernels have a different segment layout compared with traditional MIPS kernels, to allow both the user and kernel code to run from the user address segment without repeatedly trapping to KVM. QEMU currently supports this layout only for KVM, but its sometimes useful to be able to run these kernels in QEMU on a PC, so enable it for TCG too. This also paves the way for MIPS KVM VZ support (which uses the normal virtual memory layout) by abstracting whether user mode kernel segments are in use. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: Yongbok Kim <yongbok.kim@imgtec.com> Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: kvm@vger.kernel.org Reviewed-by: Richard Henderson <rth@twiddle.net> [Yongbok Kim: minor change] Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
22 lines
539 B
C
22 lines
539 B
C
#ifndef HW_MIPS_CPUDEVS_H
|
|
#define HW_MIPS_CPUDEVS_H
|
|
|
|
#include "target/mips/cpu-qom.h"
|
|
|
|
/* Definitions for MIPS CPU internal devices. */
|
|
|
|
/* addr.c */
|
|
uint64_t cpu_mips_kseg0_to_phys(void *opaque, uint64_t addr);
|
|
uint64_t cpu_mips_phys_to_kseg0(void *opaque, uint64_t addr);
|
|
uint64_t cpu_mips_kvm_um_phys_to_kseg0(void *opaque, uint64_t addr);
|
|
bool mips_um_ksegs_enabled(void);
|
|
void mips_um_ksegs_enable(void);
|
|
|
|
/* mips_int.c */
|
|
void cpu_mips_irq_init_cpu(MIPSCPU *cpu);
|
|
|
|
/* mips_timer.c */
|
|
void cpu_mips_clock_init(MIPSCPU *cpu);
|
|
|
|
#endif
|