From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Subject: Re: [PATCH] KVM: PPC: BookE: Include trap in pt_regs Date: Thu, 17 May 2012 16:08:52 -0500 Message-ID: <4FB568E4.3080106@freescale.com> References: <1337174756-6998-1-git-send-email-agraf@suse.de> <4FB52959.2070107@freescale.com> <4FB5668D.8000602@freescale.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Cc: kvm-ppc , kvm list To: Alexander Graf Return-path: In-Reply-To: Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 05/17/2012 04:03 PM, Alexander Graf wrote: > > On 17.05.2012, at 22:58, Scott Wood wrote: > >> On 05/17/2012 03:56 PM, Alexander Graf wrote: >>> >>> On 17.05.2012, at 18:37, Scott Wood wrote: >>> >>>> On 05/16/2012 08:25 AM, Alexander Graf wrote: >>>>> When reinjecting host interrupt requests in the exit handler code, >>>>> let's also tell the interrupt handler which interrupt number we're >>>>> coming from. >>>>> >>>>> Signed-off-by: Alexander Graf >>>>> --- >>>>> arch/powerpc/kvm/booke.c | 12 +++++++----- >>>>> 1 files changed, 7 insertions(+), 5 deletions(-) >>>>> >>>>> diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c >>>>> index 72f13f4..0512bd7 100644 >>>>> --- a/arch/powerpc/kvm/booke.c >>>>> +++ b/arch/powerpc/kvm/booke.c >>>>> @@ -596,7 +596,8 @@ static int emulation_exit(struct kvm_run *run, struct kvm_vcpu *vcpu) >>>>> } >>>>> } >>>>> >>>>> -static void kvmppc_fill_pt_regs(struct pt_regs *regs) >>>>> +static void kvmppc_fill_pt_regs(struct pt_regs *regs, >>>>> + int exit_nr) >>>>> { >>>>> ulong r1, ip, msr, lr; >>>>> >>>>> @@ -610,6 +611,7 @@ static void kvmppc_fill_pt_regs(struct pt_regs *regs) >>>>> regs->nip = ip; >>>>> regs->msr = msr; >>>>> regs->link = lr; >>>>> + regs->trap = exit_nr; >>>>> } >>>>> >>>>> static void kvmppc_restart_interrupt(struct kvm_vcpu *vcpu, >>>>> @@ -619,16 +621,16 @@ static void kvmppc_restart_interrupt(struct kvm_vcpu *vcpu, >>>>> >>>>> switch (exit_nr) { >>>>> case BOOKE_INTERRUPT_EXTERNAL: >>>>> - kvmppc_fill_pt_regs(®s); >>>>> + kvmppc_fill_pt_regs(®s, exit_nr); >>>>> do_IRQ(®s); >>>>> break; >>>> >>>> exit_nr is not the same as the trap number that the rest of the kernel >>>> wants to see. >>> >>> It's not? What does the kernel want to see then? >> >> Remember the commit message in the e500mc patchset about an >> undocumented, unnamed mess of magic numbers? > > Yeah. So in KVM we're using the IVOR numbers, right? Any reason we can't do the same for the generic handler? That should simplify the code significantly, no? Yeah, I had that as a FIXME on the original patch. You just need to make sure all users are updated, which is more difficult due to the fact that they're just numbers and not symbolic names. -Scott