From patchwork Mon Jul 9 06:43:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharat Bhushan X-Patchwork-Id: 169696 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 8397E2C021D for ; Mon, 9 Jul 2012 16:43:58 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751580Ab2GIGn5 (ORCPT ); Mon, 9 Jul 2012 02:43:57 -0400 Received: from co1ehsobe001.messaging.microsoft.com ([216.32.180.184]:38952 "EHLO co1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751105Ab2GIGn4 convert rfc822-to-8bit (ORCPT ); Mon, 9 Jul 2012 02:43:56 -0400 Received: from mail38-co1-R.bigfish.com (10.243.78.238) by CO1EHSOBE015.bigfish.com (10.243.66.78) with Microsoft SMTP Server id 14.1.225.23; Mon, 9 Jul 2012 06:41:40 +0000 Received: from mail38-co1 (localhost [127.0.0.1]) by mail38-co1-R.bigfish.com (Postfix) with ESMTP id 21F8B9200B6; Mon, 9 Jul 2012 06:41:40 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zz1432Izz1202hzzz2dh2a8h668h839h8e2h8e3h944hd25hf0ah107ahbe9i) Received: from mail38-co1 (localhost.localdomain [127.0.0.1]) by mail38-co1 (MessageSwitch) id 1341816097753014_24056; Mon, 9 Jul 2012 06:41:37 +0000 (UTC) Received: from CO1EHSMHS015.bigfish.com (unknown [10.243.78.248]) by mail38-co1.bigfish.com (Postfix) with ESMTP id B5A91580059; Mon, 9 Jul 2012 06:41:37 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CO1EHSMHS015.bigfish.com (10.243.66.25) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 9 Jul 2012 06:41:37 +0000 Received: from 039-SN2MPN1-023.039d.mgd.msft.net ([169.254.3.105]) by 039-SN1MMR1-002.039d.mgd.msft.net ([10.84.1.15]) with mapi id 14.02.0298.005; Mon, 9 Jul 2012 01:43:40 -0500 From: Bhushan Bharat-R65777 To: Alexander Graf CC: "kvm-ppc@vger.kernel.org" , "kvm@vger.kernel.org" Subject: RE: [PATCH 2/2] KVM: PPC: booke: Add watchdog emulation Thread-Topic: [PATCH 2/2] KVM: PPC: booke: Add watchdog emulation Thread-Index: AQHNVPUX4l4l1y97Ik64EBytYkY6EJccnWSAgAPz7MA= Date: Mon, 9 Jul 2012 06:43:40 +0000 Message-ID: <6A3DF150A5B70D4F9B66A25E3F7C888D03DBF9C9@039-SN2MPN1-023.039d.mgd.msft.net> References: <1340864262-31651-1-git-send-email-Bharat.Bhushan@freescale.com> <19D972D8-56CB-4C79-9430-E1AFBA39D01F@suse.de> In-Reply-To: <19D972D8-56CB-4C79-9430-E1AFBA39D01F@suse.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.232.14.18] MIME-Version: 1.0 X-OriginatorOrg: freescale.com Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org > > + > > +/* > > + * Return the number of jiffies until the next timeout. If the > > +timeout is > > + * longer than the MAX_TIMEOUT, that we return MAX_TIMEOUT instead. > > + */ > > +static unsigned long watchdog_next_timeout(struct kvm_vcpu *vcpu) { > > + unsigned long long tb, mask, nr_jiffies = 0; > > u64? > > > + u32 period = TCR_GET_FSL_WP(vcpu->arch.tcr); > > Doesn't sound like something booke generic to me. the name '*FSL*' does not look good, right? > > > +#ifdef CONFIG_BOOKE > > + ret = ret || (v->arch.tsr & TCR_WRC_MASK); > > Please make this a callback. In a header if you think it's performance critical, > but I don't want to see #ifdef CONFIG_BOOKE too often in powerpc.c. Not sure: do you mean something like this: Thanks -Bharat --- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h index f0e0c6a..7bbc6cd 100644 --- a/arch/powerpc/include/asm/kvm_book3s.h +++ b/arch/powerpc/include/asm/kvm_book3s.h @@ -446,6 +446,11 @@ static inline bool kvmppc_critical_section(struct kvm_vcpu *vcpu) } #endif +static inline u32 kvmppc_get_tsr_wrc(struct kvm_vcpu *vcpu) +{ + return 0; +} + /* Magic register values loaded into r3 and r4 before the 'sc' assembly * instruction for the OSI hypercalls */ #define OSI_SC_MAGIC_R3 0x113724FA diff --git a/arch/powerpc/include/asm/kvm_booke.h b/arch/powerpc/include/asm/kvm_booke.h index b7cd335..e5b86c1 100644 --- a/arch/powerpc/include/asm/kvm_booke.h +++ b/arch/powerpc/include/asm/kvm_booke.h @@ -100,4 +100,9 @@ static inline ulong kvmppc_get_msr(struct kvm_vcpu *vcpu) { return vcpu->arch.shared->msr; } + +static inline u32 kvmppc_get_tsr_wrc(struct kvm_vcpu *vcpu) +{ + return vcpu->arch.tsr & TCR_WRC_MASK; +}