From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Thu, 24 Sep 2015 22:17:01 +0000 Subject: Re: [PATCH] KVM: PPC: e500: Emulate TMCFG0 TMRN register Message-Id: <1443133021.32298.60.camel@freescale.com> List-Id: References: <56039EB7.8060701@freescale.com> In-Reply-To: <56039EB7.8060701@freescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ppc@vger.kernel.org On Thu, 2015-09-24 at 09:56 +0300, Laurentiu Tudor wrote: > Emulate TMCFG0 TMRN register exposing one HW thread per vcpu. > > Signed-off-by: Mihai Caraman > [Laurentiu.Tudor@freescale.com: rebased on latest kernel, > use define instead of hardcoded value] > Signed-off-by: Laurentiu Tudor > --- > Needs this patch: https://patchwork.ozlabs.org/patch/521752/ > > arch/powerpc/include/asm/disassemble.h | 5 +++++ > arch/powerpc/kvm/e500_emulate.c | 11 +++++++++++ > 2 files changed, 16 insertions(+) KVM patches should be sent to kvm@vger.kernel.org in addition to kvm- ppc@vger.kernel.org. > @@ -165,6 +167,15 @@ int kvmppc_core_emulate_op_e500(struct kvm_run *run, > struct kvm_vcpu *vcpu, > emulated = kvmppc_e500_emul_tlbivax(vcpu, ea); > break; > > + case XOP_MFTMR: > + /* Expose one thread per vcpu */ > + if (get_tmrn(inst) = TMRN_TMCFG0) > + kvmppc_set_gpr(vcpu, rt, > + 1 | (1 << TMRN_TMCFG0_NATHRD_SHIFT)); > + else > + emulated = EMULATE_FAIL; > + break; Line length. Please move the implementation into its own function like all the others. -Scott