From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Subject: Re: [PATCH 2/2 v5] KVM: PPC: booke: Add watchdog emulation Date: Mon, 23 Jul 2012 11:30:23 -0500 Message-ID: <500D7C1F.3050304@freescale.com> References: <1342760428-10858-1-git-send-email-Bharat.Bhushan@freescale.com> <5009CDA4.3080004@freescale.com> <6A3DF150A5B70D4F9B66A25E3F7C888D03DD4D1F@039-SN2MPN1-023.039d.mgd.msft.net> <500D6E8A.5080106@freescale.com> <6A3DF150A5B70D4F9B66A25E3F7C888D03DD599C@039-SN2MPN1-023.039d.mgd.msft.net> <500D752C.6070904@freescale.com> <6A3DF150A5B70D4F9B66A25E3F7C888D03DD5A1C@039-SN2MPN1-023.039d.mgd.msft.net> 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: Received: from va3ehsobe006.messaging.microsoft.com ([216.32.180.16]:31202 "EHLO va3outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754115Ab2GWQaa (ORCPT ); Mon, 23 Jul 2012 12:30:30 -0400 In-Reply-To: <6A3DF150A5B70D4F9B66A25E3F7C888D03DD5A1C@039-SN2MPN1-023.039d.mgd.msft.net> Sender: kvm-owner@vger.kernel.org List-ID: On 07/23/2012 11:04 AM, Bhushan Bharat-R65777 wrote: > > >> -----Original Message----- >> From: Wood Scott-B07421 >> Sent: Monday, July 23, 2012 9:31 PM >> 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 v5] KVM: PPC: booke: Add watchdog emulation >> >> On 07/23/2012 10:43 AM, Bhushan Bharat-R65777 wrote: >>> >>> >>>> -----Original Message----- >>>> From: Wood Scott-B07421 >>>> Sent: Monday, July 23, 2012 9:02 PM >>>> 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 v5] KVM: PPC: booke: Add watchdog emulation >>>> >>>> On 07/22/2012 11:10 PM, Bhushan Bharat-R65777 wrote: >>>>>>> @@ -386,13 +387,23 @@ int kvm_arch_vcpu_init(struct kvm_vcpu >>>>>>> *vcpu) #ifdef CONFIG_KVM_EXIT_TIMING >>>>>>> mutex_init(&vcpu->arch.exit_timing_lock); >>>>>>> #endif >>>>>>> - >>>>>>> +#ifdef CONFIG_BOOKE >>>>>>> + spin_lock_init(&vcpu->arch.wdt_lock); >>>>>>> + /* setup watchdog timer once */ >>>>>>> + setup_timer(&vcpu->arch.wdt_timer, kvmppc_watchdog_func, >>>>>>> + (unsigned long)vcpu); >>>>>>> +#endif >>>>>>> return 0; >>>>>>> } >>>>>> >>>>>> Can you do this in kvmppc_booke_init()? >>>>> >>>>> I do not think we can do this in kvmppc_booke_init(). Watchdog have >>>>> association with vcpu, while there is no vcpu at kvmppc_booke_init(). >>>> >>>> Sorry, I meant kvm_arch_vcpu_setup() in booke.c. >>> >>> Any specific reason to move this in above mentioned function? Want to avoid >> #ifdef config_booke ? >> >> Yes, to avoid the ifdef. We already have a (poorly named) place for booke- >> specific vcpu init. > > Where we want to delete watchdog timer? > > Kvm_arch_vcpu_setup() is in flow of CREATE_VCPU ioctl, I do not see DESTROY_VCPU type of code? > > So is it ok to let del_timer_sync() as is with #ifdef config_booke ? You could add such a function. I suggest correcting the naming issue at the same time -- have kvm_subarch_vcpu_init() and kvm_subarch_vcpu_free(). -Scott