public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Bhushan Bharat-R65777 <R65777@freescale.com>
Cc: Wood Scott-B07421 <B07421@freescale.com>,
	Alexander Graf <agraf@suse.de>,
	"kvm-ppc@vger.kernel.org" <kvm-ppc@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"bharatb.yadav@gmail.com" <bharatb.yadav@gmail.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Kumar Gala <galak@kernel.crashing.org>
Subject: Re: [PATCH 2/2 v2] KVM: PPC: booke: Add watchdog emulation
Date: Tue, 17 Jul 2012 12:25:13 -0500	[thread overview]
Message-ID: <50059FF9.7010107@freescale.com> (raw)
In-Reply-To: <6A3DF150A5B70D4F9B66A25E3F7C888D03DCBB24@039-SN2MPN1-023.039d.mgd.msft.net>

On 07/17/2012 12:10 PM, Bhushan Bharat-R65777 wrote:
> 
> 
>> -----Original Message-----
>> From: Wood Scott-B07421
>> Sent: Tuesday, July 17, 2012 10:31 PM
>> To: Bhushan Bharat-R65777
>> Cc: Wood Scott-B07421; Alexander Graf; kvm-ppc@vger.kernel.org;
>> kvm@vger.kernel.org; bharatb.yadav@gmail.com; Benjamin Herrenschmidt; Kumar Gala
>> Subject: Re: [PATCH 2/2 v2] KVM: PPC: booke: Add watchdog emulation
>>
>> On 07/17/2012 11:56 AM, Bhushan Bharat-R65777 wrote:
>>>
>>>
>>>> -----Original Message-----
>>>> From: Wood Scott-B07421
>>>> Sent: Tuesday, July 17, 2012 10:08 PM
>>>> To: Bhushan Bharat-R65777
>>>> Cc: Wood Scott-B07421; Alexander Graf; kvm-ppc@vger.kernel.org;
>>>> kvm@vger.kernel.org; bharatb.yadav@gmail.com; Benjamin Herrenschmidt;
>>>> Kumar Gala
>>>> Subject: Re: [PATCH 2/2 v2] KVM: PPC: booke: Add watchdog emulation
>>>>
>>>> On 07/17/2012 06:31 AM, Bhushan Bharat-R65777 wrote:
>>>>>>>>  int kvm_arch_vcpu_runnable(struct kvm_vcpu *v)  {
>>>>>>>> -    return !(v->arch.shared->msr & MSR_WE) ||
>>>>>>>> -           !!(v->arch.pending_exceptions) ||
>>>>>>>> -           v->requests;
>>>>>>>> +    bool ret = !(v->arch.shared->msr & MSR_WE) ||
>>>>>>>> +           !!(v->arch.pending_exceptions) ||
>>>>>>>> +           v->requests;
>>>>>>>> +
>>>>>>>> +    ret = ret || kvmppc_get_tsr_wrc(v);
>>>>>>>
>>>>>>> Why do you need to declare the cpu as non-runnable when a watchdog
>>>>>>> event occured?
>>>>>>
>>>>>> It's the other way around -- it's always runnable when a watchdog
>>>>>> exit is pending.  It's like a pending exception.
>>>>>
>>>>> With the above check, Are we trying to handle the case where
>>>>> watchdog interrupt bit in pending_exception is cleared by guest
>>>>> after final expiry but before the qemu exit?
>>>>
>>>> No, we're just trying to test the actual condition we want to exit on.
>>>> The watchdog interrupt might be masked (either with WIE or CE).
>>>
>>> If the interrupt is masked then still the pending_exception will be set.
>>
>> Not if it's masked by WIE -- and even when masked by CE, it's a bug that we
>> currently consider the vcpu runnable.  We shouldn't depend on that bug.
> 
> Scott can you please describe what is bug?

If an interrupt is masked by EE, CE, ME, etc. it is still in
pending_exceptions, so runnable still returns true, and we can't go idle.

> What I remember is that if
> vcpu is not run-able then we halt vcpu and cannot cause qemu exit
> also.

I agree that we want to be considered runnable if we have a final
expiration with an action.  What I disagree with is using the same
pending_exceptions bit as is used for the ordinary watchdog interrupt.
They're not the same thing.

-Scott

  reply	other threads:[~2012-07-17 17:25 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-09 10:34 [PATCH 2/2 v2] KVM: PPC: booke: Add watchdog emulation Bharat Bhushan
2012-07-16 17:18 ` Alexander Graf
2012-07-17  1:02   ` Scott Wood
2012-07-17  7:20     ` Alexander Graf
2012-07-17  9:57       ` Bhushan Bharat-R65777
2012-07-17 12:51         ` Alexander Graf
2012-07-17 13:15           ` Bhushan Bharat-R65777
2012-07-17 14:01             ` Alexander Graf
2012-07-17 14:13               ` Bhushan Bharat-R65777
2012-07-17 14:35                 ` Alexander Graf
2012-07-17 16:10                   ` Bhushan Bharat-R65777
2012-07-17 16:27                   ` Scott Wood
2012-07-17 16:51                     ` Alexander Graf
2012-07-17 18:00                       ` Scott Wood
2012-07-17 11:31     ` Bhushan Bharat-R65777
2012-07-17 16:37       ` Scott Wood
2012-07-17 16:56         ` Bhushan Bharat-R65777
2012-07-17 17:00           ` Scott Wood
2012-07-17 17:10             ` Bhushan Bharat-R65777
2012-07-17 17:25               ` Scott Wood [this message]
2012-07-17 17:29                 ` Bhushan Bharat-R65777

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50059FF9.7010107@freescale.com \
    --to=scottwood@freescale.com \
    --cc=B07421@freescale.com \
    --cc=R65777@freescale.com \
    --cc=agraf@suse.de \
    --cc=benh@kernel.crashing.org \
    --cc=bharatb.yadav@gmail.com \
    --cc=galak@kernel.crashing.org \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox