All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hvm/vpt: Check that an irq is not blocked before waking the vcpu
@ 2009-03-09 11:45 George Dunlap
  2009-03-09 12:01 ` Keir Fraser
  0 siblings, 1 reply; 4+ messages in thread
From: George Dunlap @ 2009-03-09 11:45 UTC (permalink / raw)
  To: Xen-devel

[-- Attachment #1: Type: text/plain, Size: 264 bytes --]

Currently, when a timer fires for a vpt interrupt, the interrupt
handler calls vcpu_kick() without checking to see if the IRQ is
blocked.  This causes the vcpu to wake up out of a halt when it
shouldn't.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

[-- Attachment #2: check-event-before-wake.diff --]
[-- Type: text/x-diff, Size: 352 bytes --]

diff -r b249f3e979a5 xen/arch/x86/hvm/vpt.c
--- a/xen/arch/x86/hvm/vpt.c	Mon Mar 09 10:32:24 2009 +0000
+++ b/xen/arch/x86/hvm/vpt.c	Mon Mar 09 11:32:14 2009 +0000
@@ -209,7 +209,8 @@
         set_timer(&pt->timer, pt->scheduled);
     }
 
-    vcpu_kick(pt->vcpu);
+    if ( !pt_irq_masked(pt) )
+        vcpu_kick(pt->vcpu);
 
     pt_unlock(pt);
 }

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] hvm/vpt: Check that an irq is not blocked before waking the vcpu
  2009-03-09 11:45 [PATCH] hvm/vpt: Check that an irq is not blocked before waking the vcpu George Dunlap
@ 2009-03-09 12:01 ` Keir Fraser
  2009-03-09 12:22   ` George Dunlap
  0 siblings, 1 reply; 4+ messages in thread
From: Keir Fraser @ 2009-03-09 12:01 UTC (permalink / raw)
  To: George Dunlap, Xen-devel

On 09/03/2009 11:45, "George Dunlap" <George.Dunlap@eu.citrix.com> wrote:

> Currently, when a timer fires for a vpt interrupt, the interrupt
> handler calls vcpu_kick() without checking to see if the IRQ is
> blocked.  This causes the vcpu to wake up out of a halt when it
> shouldn't.
> 
> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

Only one question: could this race an unmask operation? Before this patch,
pt_irq_masked() is only executed for the local vcpu, so such races may not
have been considered.

 -- Keir

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] hvm/vpt: Check that an irq is not blocked before waking the vcpu
  2009-03-09 12:01 ` Keir Fraser
@ 2009-03-09 12:22   ` George Dunlap
  2009-03-09 12:34     ` How do I restrict a Domu to a CPU Venefax
  0 siblings, 1 reply; 4+ messages in thread
From: George Dunlap @ 2009-03-09 12:22 UTC (permalink / raw)
  To: Keir Fraser; +Cc: Xen-devel, Yang, Xiaowei

I can't think of a way this race could be a problem.  Even if the vcpu
in question were to unmask right after the check, it would still call
pt_update_irq() on the way out to the vmexit (just for good measure),
which would catch the IRQ just as it should.

Conversely, if the vcpu were to mask right after the check, there
should be enough delay between the mask and executing a HLT that the
kick() wouldn't have any significant effect.  Even if it did, this
patch would reduce the false wake-ups from "every time the timer fires
when masked" to "only when a very specific race happens".

But the timer code is complicated enough that I'd like some
corroboration with someone who knows it better...

 -George

On Mon, Mar 9, 2009 at 12:01 PM, Keir Fraser <keir.fraser@eu.citrix.com> wrote:
> On 09/03/2009 11:45, "George Dunlap" <George.Dunlap@eu.citrix.com> wrote:
>
>> Currently, when a timer fires for a vpt interrupt, the interrupt
>> handler calls vcpu_kick() without checking to see if the IRQ is
>> blocked.  This causes the vcpu to wake up out of a halt when it
>> shouldn't.
>>
>> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
>
> Only one question: could this race an unmask operation? Before this patch,
> pt_irq_masked() is only executed for the local vcpu, so such races may not
> have been considered.
>
>  -- Keir
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* How do I restrict a Domu to a CPU
  2009-03-09 12:22   ` George Dunlap
@ 2009-03-09 12:34     ` Venefax
  0 siblings, 0 replies; 4+ messages in thread
From: Venefax @ 2009-03-09 12:34 UTC (permalink / raw)
  Cc: 'Xen-devel', 'Yang, Xiaowei'

In Xen 3.3 (SLES 11) I am adding (cpu 2-15) in the *.sxp file, but after
that the Vir-manager cannot open the console. If I remove that line, it
works fine. I need to both be able to restrict the domain to a set of CPU's
and see the VNC console. Any idea??
Federico

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-03-09 12:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-09 11:45 [PATCH] hvm/vpt: Check that an irq is not blocked before waking the vcpu George Dunlap
2009-03-09 12:01 ` Keir Fraser
2009-03-09 12:22   ` George Dunlap
2009-03-09 12:34     ` How do I restrict a Domu to a CPU Venefax

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.