All of lore.kernel.org
 help / color / mirror / Atom feed
* Xen 4.4 Testing: Platform Op XENPF_microcode_update Leaves VCPU Lock Set?
@ 2014-04-24 13:35 John McDermott
  2014-04-24 14:10 ` Ian Campbell
  2014-04-24 14:10 ` Andrew Cooper
  0 siblings, 2 replies; 5+ messages in thread
From: John McDermott @ 2014-04-24 13:35 UTC (permalink / raw)
  To: xen-devel

Xen Developers,

In arch/x86/platform_hypercall.c, in function do_platform_op, the case XENPF_microcode_update appears to leave the vcpu_alloc_lock set when creating a hypercall continuation, but I don't understand the hypercall continuation code as releasing that lock. The lock is not released at target label of the following goto, in case XENPF_microcode_update.

I don't have the facilities to exercise this case on my development platform, but it looks like a possible problem or does the hypercall continuation somehow take care of this lock?

Sincerely,

John

ps. I tried subscribing to the Xen dev list 3 times but it never worked.
----
What is the formal meaning of the one-line program
#include "/dev/tty"

J.P. McDermott			building 12
Code 5542			john.mcdermott@nrl.navy.mil
Naval Research Laboratory	voice: +1 202.404.8301
Washington, DC 20375, US	fax:   +1 202.404.7942

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

* Re: Xen 4.4 Testing: Platform Op XENPF_microcode_update Leaves VCPU Lock Set?
  2014-04-24 13:35 Xen 4.4 Testing: Platform Op XENPF_microcode_update Leaves VCPU Lock Set? John McDermott
@ 2014-04-24 14:10 ` Ian Campbell
  2014-04-24 16:39   ` John McDermott
  2014-04-24 14:10 ` Andrew Cooper
  1 sibling, 1 reply; 5+ messages in thread
From: Ian Campbell @ 2014-04-24 14:10 UTC (permalink / raw)
  To: John McDermott; +Cc: xen-devel

On Thu, 2014-04-24 at 09:35 -0400, John McDermott wrote:
> Xen Developers,
> 
> In arch/x86/platform_hypercall.c, in function do_platform_op, the case
> XENPF_microcode_update appears to leave the vcpu_alloc_lock set when
> creating a hypercall continuation,

Are you referring to:
       /*
         * alloc_vcpu() will access data which is modified during
         * microcode update
         */
        while ( !spin_trylock(&vcpu_alloc_lock) )
        {
            if ( hypercall_preempt_check() )
            {
                ret = hypercall_create_continuation(
                    __HYPERVISOR_platform_op, "h", u_xenpf_op);
                goto out;
            }
        }
?

Notice that the continuation is inside the !spin_trylock loop -- IOW it
will only reach that point with the lock *not* held. If spin_trylock
succeeds in taking the lock then we don't go into the loop body.

Ian.

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

* Re: Xen 4.4 Testing: Platform Op XENPF_microcode_update Leaves VCPU Lock Set?
  2014-04-24 13:35 Xen 4.4 Testing: Platform Op XENPF_microcode_update Leaves VCPU Lock Set? John McDermott
  2014-04-24 14:10 ` Ian Campbell
@ 2014-04-24 14:10 ` Andrew Cooper
  2014-04-24 16:36   ` John McDermott
  1 sibling, 1 reply; 5+ messages in thread
From: Andrew Cooper @ 2014-04-24 14:10 UTC (permalink / raw)
  To: John McDermott; +Cc: xen-devel

On 24/04/14 14:35, John McDermott wrote:
> Xen Developers,
>
> In arch/x86/platform_hypercall.c, in function do_platform_op, the case XENPF_microcode_update appears to leave the vcpu_alloc_lock set when creating a hypercall continuation, but I don't understand the hypercall continuation code as releasing that lock. The lock is not released at target label of the following goto, in case XENPF_microcode_update.
>
> I don't have the facilities to exercise this case on my development platform, but it looks like a possible problem or does the hypercall continuation somehow take care of this lock?
>
> Sincerely,
>
> John

spin_trylock() will try to take the spinlock, but return failure rather
than spinning.

The body of the while loop is therefore strictly when the
vcpu_alloc_lock is not held, so the goto out is safe in context.

>
> ps. I tried subscribing to the Xen dev list 3 times but it never worked.

That is curious.  Any indication of an error?  You certainly havn't
successfully signed up as I had to approve this email through moderation.

~Andrew

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

* Re: Xen 4.4 Testing: Platform Op XENPF_microcode_update Leaves VCPU Lock Set?
  2014-04-24 14:10 ` Andrew Cooper
@ 2014-04-24 16:36   ` John McDermott
  0 siblings, 0 replies; 5+ messages in thread
From: John McDermott @ 2014-04-24 16:36 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: xen-devel


On Apr 24, 2014, at 10:10 AM, Andrew Cooper <andrew.cooper3@citrix.com> wrote:

>> 
>> ps. I tried subscribing to the Xen dev list 3 times but it never worked.
> 
> That is curious.  Any indication of an error?  You certainly havn't
> successfully signed up as I had to approve this email through moderation.
> 
> ~Andrew

Andrew,

I tried the web page 3 times and each time it just silently failed. No error messages and nothing showed up. Perhaps a problem with Apple Mail. I used to like it but now it seems less stable, but I am too busy to switch. But I did try to subscribe, so this thread would not be private chit chat.

Sincerely,

John

What is the formal meaning of the one-line program
#include "/dev/tty"

J.P. McDermott			building 12
Code 5542			john.mcdermott@nrl.navy.mil
Naval Research Laboratory	voice: +1 202.404.8301
Washington, DC 20375, US	fax:   +1 202.404.7942

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

* Re: Xen 4.4 Testing: Platform Op XENPF_microcode_update Leaves VCPU Lock Set?
  2014-04-24 14:10 ` Ian Campbell
@ 2014-04-24 16:39   ` John McDermott
  0 siblings, 0 replies; 5+ messages in thread
From: John McDermott @ 2014-04-24 16:39 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel


On Apr 24, 2014, at 10:10 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:

> Notice that the continuation is inside the !spin_trylock loop -- IOW it
> will only reach that point with the lock *not* held. If spin_trylock
> succeeds in taking the lock then we don't go into the loop body.
> 
> Ian.

Ian,

Yes; thanks for answering. I just sent a note about it because it looked odd to me as I was reading the code and I thought it would be bad citizenship to pass by and not ask about it. Sleep deprivation is an issue right now ...

Sincerely,

John

----


What is the formal meaning of the one-line program
#include "/dev/tty"

J.P. McDermott			building 12
Code 5542			john.mcdermott@nrl.navy.mil
Naval Research Laboratory	voice: +1 202.404.8301
Washington, DC 20375, US	fax:   +1 202.404.7942

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

end of thread, other threads:[~2014-04-24 16:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-24 13:35 Xen 4.4 Testing: Platform Op XENPF_microcode_update Leaves VCPU Lock Set? John McDermott
2014-04-24 14:10 ` Ian Campbell
2014-04-24 16:39   ` John McDermott
2014-04-24 14:10 ` Andrew Cooper
2014-04-24 16:36   ` John McDermott

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.