Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
home:Alexander_Naumov:SLE-12:Update
qemu.4227
0081-KVM-PPC-Enable-compatibility-mode.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0081-KVM-PPC-Enable-compatibility-mode.patch of Package qemu.4227
From 54d4223e4ac8fe471dfcfbb1c31c9977b209d765 Mon Sep 17 00:00:00 2001 From: Alexey Kardashevskiy <aik@ozlabs.ru> Date: Fri, 23 May 2014 12:26:58 +1000 Subject: [PATCH] KVM: PPC: Enable compatibility mode The host kernel implements a KVM_REG_PPC_ARCH_COMPAT register which this uses to enable a compatibility mode if any chosen. This sets the KVM_REG_PPC_ARCH_COMPAT register in KVM. ppc_set_compat() signals the caller if the mode cannot be enabled by the host kernel. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> [agraf: fix TCG compat setting] Signed-off-by: Alexander Graf <agraf@suse.de> --- target-ppc/kvm.c | 5 +++++ target-ppc/kvm_ppc.h | 6 ++++++ target-ppc/translate_init.c | 5 +++++ 3 files changed, 16 insertions(+) diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c index 8e49b71c48..31b2b52c9a 100644 --- a/target-ppc/kvm.c +++ b/target-ppc/kvm.c @@ -1525,6 +1525,11 @@ void kvmppc_set_papr(PowerPCCPU *cpu) cap_papr = 1; } +int kvmppc_set_compat(PowerPCCPU *cpu, uint32_t cpu_version) +{ + return kvm_set_one_reg(CPU(cpu), KVM_REG_PPC_ARCH_COMPAT, &cpu_version); +} + void kvmppc_set_mpic_proxy(PowerPCCPU *cpu, int mpic_proxy) { CPUState *cs = CPU(cpu); diff --git a/target-ppc/kvm_ppc.h b/target-ppc/kvm_ppc.h index ff077ec502..716c33dfee 100644 --- a/target-ppc/kvm_ppc.h +++ b/target-ppc/kvm_ppc.h @@ -23,6 +23,7 @@ int kvmppc_get_hasidle(CPUPPCState *env); int kvmppc_get_hypercall(CPUPPCState *env, uint8_t *buf, int buf_len); int kvmppc_set_interrupt(PowerPCCPU *cpu, int irq, int level); void kvmppc_set_papr(PowerPCCPU *cpu); +int kvmppc_set_compat(PowerPCCPU *cpu, uint32_t cpu_version); void kvmppc_set_mpic_proxy(PowerPCCPU *cpu, int mpic_proxy); int kvmppc_smt_threads(void); int kvmppc_clear_tsr_bits(PowerPCCPU *cpu, uint32_t tsr_bits); @@ -95,6 +96,11 @@ static inline void kvmppc_set_papr(PowerPCCPU *cpu) { } +static inline int kvmppc_set_compat(PowerPCCPU *cpu, uint32_t cpu_version) +{ + return 0; +} + static inline void kvmppc_set_mpic_proxy(PowerPCCPU *cpu, int mpic_proxy) { } diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index 2c33881e54..67803ac79b 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -8234,6 +8234,11 @@ int ppc_set_compat(PowerPCCPU *cpu, uint32_t cpu_version) break; } + if (kvm_enabled() && kvmppc_set_compat(cpu, cpu->max_compat) < 0) { + error_report("Unable to set compatibility mode in KVM"); + ret = -1; + } + return ret; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor