From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Graf Subject: Re: [PATCH 7/9] KVM: PPC: Emulate trap SRR1 flags properly Date: Thu, 21 Jan 2010 13:12:23 +0100 Message-ID: References: <1262915889-11526-1-git-send-email-agraf@suse.de> <1262915889-11526-8-git-send-email-agraf@suse.de> <0A1FE637C2C7E148B9573BB60CC630E5712289@zch01exm26.fsl.freescale.net> Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8BIT Cc: "Hollis Blanchard" , , "kvm-ppc" , "Benjamin Herrenschmidt" To: Liu Yu-B13201 Return-path: Received: from cantor.suse.de ([195.135.220.2]:47587 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750881Ab0AUMM3 convert rfc822-to-8bit (ORCPT ); Thu, 21 Jan 2010 07:12:29 -0500 In-Reply-To: <0A1FE637C2C7E148B9573BB60CC630E5712289@zch01exm26.fsl.freescale.net> Sender: kvm-owner@vger.kernel.org List-ID: On 21.01.2010, at 09:09, Liu Yu-B13201 wrote: > > >> -----Original Message----- >> From: kvm-ppc-owner@vger.kernel.org >> [mailto:kvm-ppc-owner@vger.kernel.org] On Behalf Of Hollis Blanchard >> Sent: Saturday, January 09, 2010 3:30 AM >> To: Alexander Graf >> Cc: kvm@vger.kernel.org; kvm-ppc; Benjamin Herrenschmidt; Liu Yu >> Subject: Re: [PATCH 7/9] KVM: PPC: Emulate trap SRR1 flags properly >> >>> diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c >>> index 338baf9..e283e44 100644 >>> --- a/arch/powerpc/kvm/booke.c >>> +++ b/arch/powerpc/kvm/booke.c >>> @@ -82,8 +82,9 @@ static void >> kvmppc_booke_queue_irqprio(struct kvm_vcpu *vcpu, >>> set_bit(priority, &vcpu->arch.pending_exceptions); >>> } >>> >>> -void kvmppc_core_queue_program(struct kvm_vcpu *vcpu) >>> +void kvmppc_core_queue_program(struct kvm_vcpu *vcpu, ulong flags) >>> { >>> + /* BookE does flags in ESR, so ignore those we get here */ >>> kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_PROGRAM); >>> } >> >> Actually, I think Book E prematurely sets ESR, since it's done before >> the program interrupt is actually delivered. Architecturally, I'm not >> sure if it's a problem, but philosophically I've always wanted it to >> work the way you've just implemented for Book S. >> > > ESR is updated not only by program but by data_tlb, data_storage, etc. > Should we rearrange them all? > Also DEAR has the same situation as ESR. > Should it be updated when we decide to inject interrupt to guest? If that's what the hardware does, then yes. I'm good with taking small steps though. So if you don't have the time to convert all of the handlers, you can easily start off with program interrupts. Alex From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Graf Date: Thu, 21 Jan 2010 12:12:23 +0000 Subject: Re: [PATCH 7/9] KVM: PPC: Emulate trap SRR1 flags properly Message-Id: List-Id: References: <1262915889-11526-1-git-send-email-agraf@suse.de> <1262915889-11526-8-git-send-email-agraf@suse.de> <0A1FE637C2C7E148B9573BB60CC630E5712289@zch01exm26.fsl.freescale.net> In-Reply-To: <0A1FE637C2C7E148B9573BB60CC630E5712289@zch01exm26.fsl.freescale.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Liu Yu-B13201 Cc: Hollis Blanchard , kvm@vger.kernel.org, kvm-ppc , Benjamin Herrenschmidt On 21.01.2010, at 09:09, Liu Yu-B13201 wrote: > > >> -----Original Message----- >> From: kvm-ppc-owner@vger.kernel.org >> [mailto:kvm-ppc-owner@vger.kernel.org] On Behalf Of Hollis Blanchard >> Sent: Saturday, January 09, 2010 3:30 AM >> To: Alexander Graf >> Cc: kvm@vger.kernel.org; kvm-ppc; Benjamin Herrenschmidt; Liu Yu >> Subject: Re: [PATCH 7/9] KVM: PPC: Emulate trap SRR1 flags properly >> >>> diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c >>> index 338baf9..e283e44 100644 >>> --- a/arch/powerpc/kvm/booke.c >>> +++ b/arch/powerpc/kvm/booke.c >>> @@ -82,8 +82,9 @@ static void >> kvmppc_booke_queue_irqprio(struct kvm_vcpu *vcpu, >>> set_bit(priority, &vcpu->arch.pending_exceptions); >>> } >>> >>> -void kvmppc_core_queue_program(struct kvm_vcpu *vcpu) >>> +void kvmppc_core_queue_program(struct kvm_vcpu *vcpu, ulong flags) >>> { >>> + /* BookE does flags in ESR, so ignore those we get here */ >>> kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_PROGRAM); >>> } >> >> Actually, I think Book E prematurely sets ESR, since it's done before >> the program interrupt is actually delivered. Architecturally, I'm not >> sure if it's a problem, but philosophically I've always wanted it to >> work the way you've just implemented for Book S. >> > > ESR is updated not only by program but by data_tlb, data_storage, etc. > Should we rearrange them all? > Also DEAR has the same situation as ESR. > Should it be updated when we decide to inject interrupt to guest? If that's what the hardware does, then yes. I'm good with taking small steps though. So if you don't have the time to convert all of the handlers, you can easily start off with program interrupts. Alex