public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf-l3A5Bk7waGM@public.gmane.org>
To: Hollis Blanchard <hollis-yUx37fBWTUITNcAmw9vGhQ@public.gmane.org>
Cc: kvm-ppc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 2/3] Improve DEC handling
Date: Mon, 21 Dec 2009 19:20:36 +0100	[thread overview]
Message-ID: <4B2FBC74.3080705@suse.de> (raw)
In-Reply-To: <fb412d760912211017i3f47fce2oc3b67c9c5c645b6-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hollis Blanchard wrote:
> On Mon, Dec 21, 2009 at 10:13 AM, Hollis Blanchard
> <hollis-yUx37fBWTUITNcAmw9vGhQ@public.gmane.org> wrote:
>   
>>  void kvmppc_emulate_dec(struct kvm_vcpu *vcpu)
>>  {
>>        unsigned long dec_nsec;
>>
>>        pr_debug("mtDEC: %x\n", vcpu->arch.dec);
>>  #ifdef CONFIG_PPC64
>>        /* POWER4+ triggers a dec interrupt if the value is < 0 */
>>        if (vcpu->arch.dec & 0x80000000) {
>>                hrtimer_try_to_cancel(&vcpu->arch.dec_timer);
>>                kvmppc_core_queue_dec(vcpu);
>> +               /* keep queuing interrupts until guest clears high MSR bit */
>> +               hrtimer_start(&vcpu->arch.dec_timer, ktime_set(0, 100),
>> +                             HRTIMER_MODE_REL);
>>                return;
>>        }
>>  #endif
>>     
>
> Of course, removing the hardcoded 100-ns timer would be better, and
> indeed we can do that. What we *really* want is to key off of MSR[EE]
> changes (there's no point in queuing anything until then).

Yes. mtmsr with EE=1 triggers a #VMEXIT which then goes off into a VM
entry which on entering checks that the DEC interrupt is still active
and fires it.

> So why not
> move your "AGGRESSIVE_DEC" check into Book 3S's kvmppc_set_msr()?
>   

The idea was to get rid of AGGRESSIVE_DEC :-).

Alex

  parent reply	other threads:[~2009-12-21 18:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-21 14:22 [PATCH 0/3] Improve Decrementor Implementation Alexander Graf
2009-12-21 14:22 ` [PATCH 1/3] Move vector to irqprio resolving to separate function Alexander Graf
2009-12-21 14:22 ` [PATCH 2/3] Improve DEC handling Alexander Graf
2009-12-21 14:22 ` [PATCH 3/3] Remove AGGRESSIVE_DEC Alexander Graf
     [not found] ` <1261405373-8008-3-git-send-email-agraf@suse.de>
     [not found]   ` <1261405373-8008-3-git-send-email-agraf-l3A5Bk7waGM@public.gmane.org>
2009-12-21 18:13     ` [PATCH 2/3] Improve DEC handling Hollis Blanchard
     [not found]       ` <fb412d760912211013w265d3d30i99498ab136a15e00-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-12-21 18:17         ` Hollis Blanchard
     [not found]           ` <fb412d760912211017i3f47fce2oc3b67c9c5c645b6-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-12-21 18:20             ` Alexander Graf [this message]
     [not found]               ` <4B2FBC74.3080705-l3A5Bk7waGM@public.gmane.org>
2009-12-21 19:04                 ` Hollis Blanchard
2009-12-21 18:19         ` Alexander Graf
  -- strict thread matches above, loose matches on Subject: below --
2009-12-21 19:21 [PATCH 0/3] Improve Decrementor Implementation v2 Alexander Graf
     [not found] ` <1261423285-12715-1-git-send-email-agraf-l3A5Bk7waGM@public.gmane.org>
2009-12-21 19:21   ` [PATCH 2/3] Improve DEC handling Alexander Graf

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=4B2FBC74.3080705@suse.de \
    --to=agraf-l3a5bk7wagm@public.gmane.org \
    --cc=hollis-yUx37fBWTUITNcAmw9vGhQ@public.gmane.org \
    --cc=kvm-ppc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.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