From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Aneesh Kumar K.V" Date: Fri, 20 Dec 2013 04:49:07 +0000 Subject: Re: [PATCH] powerpc: book3s: kvm: Use the saved dsisr and dar values Message-Id: <8738lo9lzg.fsf@linux.vnet.ibm.com> List-Id: References: <1384178577-23721-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <0AB88010-F2B7-44A1-8FA9-2A40079706BB@suse.de> <87bo0d9vc5.fsf@linux.vnet.ibm.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Alexander Graf Cc: Paul Mackerras , "linuxppc-dev@lists.ozlabs.org" , "kvm-ppc@vger.kernel.org" , "kvm@vger.kernel.org mailing list" Alexander Graf writes: >> Am 19.12.2013 um 08:02 schrieb "Aneesh Kumar K.V" : >> >> Alexander Graf writes: >> >>>> On 11.11.2013, at 15:02, Aneesh Kumar K.V wrote: >>>> >>>> From: "Aneesh Kumar K.V" >>>> >>>> Don't try to compute these values. >>>> >>>> Signed-off-by: Aneesh Kumar K.V >>>> --- >>>> >>>> NOTE: I am not sure why we were originally computing dsisr and dar. So may be >>>> we need a variant of this patch. But with this and the additional patch >>>> "powerpc: book3s: PR: Enable Little Endian PR guest" I am able to get a Little Endian >>>> PR guest to boot. >>> >>> It's quite easy to find out - git blame tells you all the history and points you to commit ca7f4203b. >>> >>> commit ca7f4203b9b66e12d0d9968ff7dfe781f3a9695a >>> Author: Alexander Graf >>> Date: Wed Mar 24 21:48:28 2010 +0100 >>> >>> KVM: PPC: Implement alignment interrupt >>> >>> Mac OS X has some applications - namely the Finder - that require alignment >>> interrupts to work properly. So we need to implement them. >>> >>> But the spec for 970 and 750 also looks different. While 750 requires the >>> DSISR and DAR fields to reflect some instruction bits (DSISR) and the fault >>> address (DAR), the 970 declares this as an optional feature. So we need >>> to reconstruct DSISR and DAR manually. >>> >>> Signed-off-by: Alexander Graf >>> Signed-off-by: Avi Kivity >>> >>> Read this as "on 970, alignment interrupts don't give us DSISR and DAR of the faulting instruction" as otherwise I wouldn't have implemented it. >>> >>> So this is clearly a nack on this patch :). >> >> I can possibly do a if (cpu_has_feature(CPU_FTR_ARCH_201)). But do we need >> to do that ? According to Paul we should always find DAR. > > Paul only mentioned DAR, not DSISR. Please verify whether 970 gives us a proper DAR value - we can then remove that part. > > But for DSISR I'm not convinced CPUs above 970 handle this > correctly. So we would at least need a guest cpu check to find out > whether the vcpu expects a working dsisr and emulate it then. > > I don't really fully understand the problem though. Why does the > calculation break at all for you? IIRC this was to get little endian PR setup to work. This is to avoid handling new instructions, because in little endian mode we get alignment interrupt for a larger instructon set -aneesh From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e28smtp07.in.ibm.com (e28smtp07.in.ibm.com [122.248.162.7]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id F012E2C02A6 for ; Fri, 20 Dec 2013 15:37:19 +1100 (EST) Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 20 Dec 2013 10:07:13 +0530 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id 599D8E0024 for ; Fri, 20 Dec 2013 10:09:37 +0530 (IST) Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rBK4b1YZ2949402 for ; Fri, 20 Dec 2013 10:07:02 +0530 Received: from d28av02.in.ibm.com (localhost [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rBK4b8wo001191 for ; Fri, 20 Dec 2013 10:07:08 +0530 From: "Aneesh Kumar K.V" To: Alexander Graf Subject: Re: [PATCH] powerpc: book3s: kvm: Use the saved dsisr and dar values In-Reply-To: References: <1384178577-23721-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <0AB88010-F2B7-44A1-8FA9-2A40079706BB@suse.de> <87bo0d9vc5.fsf@linux.vnet.ibm.com> Date: Fri, 20 Dec 2013 10:07:07 +0530 Message-ID: <8738lo9lzg.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain Cc: Paul Mackerras , "linuxppc-dev@lists.ozlabs.org" , "kvm-ppc@vger.kernel.org" , "kvm@vger.kernel.org mailing list" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Alexander Graf writes: >> Am 19.12.2013 um 08:02 schrieb "Aneesh Kumar K.V" : >> >> Alexander Graf writes: >> >>>> On 11.11.2013, at 15:02, Aneesh Kumar K.V wrote: >>>> >>>> From: "Aneesh Kumar K.V" >>>> >>>> Don't try to compute these values. >>>> >>>> Signed-off-by: Aneesh Kumar K.V >>>> --- >>>> >>>> NOTE: I am not sure why we were originally computing dsisr and dar. So may be >>>> we need a variant of this patch. But with this and the additional patch >>>> "powerpc: book3s: PR: Enable Little Endian PR guest" I am able to get a Little Endian >>>> PR guest to boot. >>> >>> It's quite easy to find out - git blame tells you all the history and points you to commit ca7f4203b. >>> >>> commit ca7f4203b9b66e12d0d9968ff7dfe781f3a9695a >>> Author: Alexander Graf >>> Date: Wed Mar 24 21:48:28 2010 +0100 >>> >>> KVM: PPC: Implement alignment interrupt >>> >>> Mac OS X has some applications - namely the Finder - that require alignment >>> interrupts to work properly. So we need to implement them. >>> >>> But the spec for 970 and 750 also looks different. While 750 requires the >>> DSISR and DAR fields to reflect some instruction bits (DSISR) and the fault >>> address (DAR), the 970 declares this as an optional feature. So we need >>> to reconstruct DSISR and DAR manually. >>> >>> Signed-off-by: Alexander Graf >>> Signed-off-by: Avi Kivity >>> >>> Read this as "on 970, alignment interrupts don't give us DSISR and DAR of the faulting instruction" as otherwise I wouldn't have implemented it. >>> >>> So this is clearly a nack on this patch :). >> >> I can possibly do a if (cpu_has_feature(CPU_FTR_ARCH_201)). But do we need >> to do that ? According to Paul we should always find DAR. > > Paul only mentioned DAR, not DSISR. Please verify whether 970 gives us a proper DAR value - we can then remove that part. > > But for DSISR I'm not convinced CPUs above 970 handle this > correctly. So we would at least need a guest cpu check to find out > whether the vcpu expects a working dsisr and emulate it then. > > I don't really fully understand the problem though. Why does the > calculation break at all for you? IIRC this was to get little endian PR setup to work. This is to avoid handling new instructions, because in little endian mode we get alignment interrupt for a larger instructon set -aneesh