From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Subject: Re: [PATCH 2/2] KVM: PPC: booke/bookehv: Add guest debug support Date: Mon, 20 Aug 2012 18:55:35 -0500 Message-ID: <5032CE77.1090507@freescale.com> References: <1343280734-3359-1-git-send-email-Bharat.Bhushan@freescale.com> <1343280734-3359-2-git-send-email-Bharat.Bhushan@freescale.com> <5011EEFD.402@freescale.com> <6A3DF150A5B70D4F9B66A25E3F7C888D03DDD096@039-SN2MPN1-023.039d.mgd.msft.net> <50170400 Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Wood Scott-B07421 , "kvm-ppc@vger.kernel.org" , "kvm@vger.kernel.org" , "agraf@suse.de" To: Bhushan Bharat-R65777 Return-path: In-Reply-To: <6A3DF150A5B70D4F9B66A25E3F7C888D03E03460@039-SN2MPN1-022.039d.mgd.msft.net> Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 08/16/2012 10:12 AM, Bhushan Bharat-R65777 wrote: > > >> -----Original Message----- >> From: Wood Scott-B07421 >> Sent: Tuesday, July 31, 2012 3:31 AM >> To: Bhushan Bharat-R65777 >> Cc: Wood Scott-B07421; kvm-ppc@vger.kernel.org; kvm@vger.kernel.org; >> agraf@suse.de >> Subject: Re: [PATCH 2/2] KVM: PPC: booke/bookehv: Add guest debug support >> >> On 07/30/2012 02:37 AM, Bhushan Bharat-R65777 wrote: >>> >>> >>>> -----Original Message----- >>>> From: Wood Scott-B07421 >>>> Sent: Friday, July 27, 2012 7:00 AM >>>> To: Bhushan Bharat-R65777 >>>> Cc: kvm-ppc@vger.kernel.org; kvm@vger.kernel.org; agraf@suse.de; >>>> Bhushan Bharat- >>>> R65777 >>>> Subject: Re: [PATCH 2/2] KVM: PPC: booke/bookehv: Add guest debug >>>> support >>>> >>>>> +#ifndef CONFIG_PPC_FSL_BOOK3E >>>>> + PPC_LD(r7, VCPU_HOST_DBG+KVMPPC_DBG_IAC3, r4) >>>>> + PPC_LD(r8, VCPU_HOST_DBG+KVMPPC_DBG_IAC4, r4) >>>>> + mtspr SPRN_IAC3, r7 >>>>> + mtspr SPRN_IAC4, r8 >>>>> +#endif >>>> >>>> Can you handle this at runtime with a feature section? >>> >>> Why you want this to make run time? Removing config_ ? >> >> Currently KVM hardcodes the target hardware in a way that is unacceptable in >> much of the rest of the kernel. We have a long term goal to stop doing that, >> and we should avoid making it worse by adding random ifdefs for specific CPUs. > > I do not see any CPU_FTR_* which I can use directly. Should I define a new FTR, something like: > > #define CPU_FTR_DEBUG_E500 LONG_ASM_CONST(0x4000000000000000) > > Use this in: CPU_FTRS_E500_2, CPU_FTRS_E500MC, CPU_FTRS_E5500 etc > > BEGIN_FTR_SECTION > PPC_LD(r7, VCPU_HOST_DBG+KVMPPC_DBG_IAC3, r4) > PPC_LD(r8, VCPU_HOST_DBG+KVMPPC_DBG_IAC4, r4) > mtspr SPRN_IAC3, r7 > mtspr SPRN_IAC4, r8 > END_FTR_SECTION_IFCLR(CPU_FTR_DEBUG_E500) It looks like other parts of the kernel use CONFIG_PPC_ADV_DEBUG_IACS for this, though ideally it would be made runtime in the future. -Scott