All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/HAP: avoid using bogus/misleading locking
@ 2017-05-29 12:37 Jan Beulich
  2017-05-29 13:55 ` Andrew Cooper
  2017-06-06 15:50 ` Ping: " Jan Beulich
  0 siblings, 2 replies; 5+ messages in thread
From: Jan Beulich @ 2017-05-29 12:37 UTC (permalink / raw)
  To: xen-devel; +Cc: George Dunlap, Andrew Cooper, Julien Grall, Tim Deegan

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

hap_teardown() unconditionally releases the paging lock and is always
being called without the lock held: Lock acquire should then be
unconditional too.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
While this is only a cosmetic change afaict I would still like to
explore whether to include this in 4.9.

--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -576,8 +576,7 @@ void hap_teardown(struct domain *d, bool
     ASSERT(d->is_dying);
     ASSERT(d != current->domain);
 
-    if ( !paging_locked_by_me(d) )
-        paging_lock(d); /* Keep various asserts happy */
+    paging_lock(d); /* Keep various asserts happy */
 
     if ( paging_mode_enabled(d) )
     {




[-- Attachment #2: x86-HAP-teardown-locking.patch --]
[-- Type: text/plain, Size: 762 bytes --]

x86/HAP: avoid using bogus/misleading locking

hap_teardown() unconditionally releases the paging lock and is always
being called without the lock held: Lock acquire should then be
unconditional too.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
While this is only a cosmetic change afaict I would still like to
explore whether to include this in 4.9.

--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -576,8 +576,7 @@ void hap_teardown(struct domain *d, bool
     ASSERT(d->is_dying);
     ASSERT(d != current->domain);
 
-    if ( !paging_locked_by_me(d) )
-        paging_lock(d); /* Keep various asserts happy */
+    paging_lock(d); /* Keep various asserts happy */
 
     if ( paging_mode_enabled(d) )
     {

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

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

end of thread, other threads:[~2017-06-06 15:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-29 12:37 [PATCH] x86/HAP: avoid using bogus/misleading locking Jan Beulich
2017-05-29 13:55 ` Andrew Cooper
2017-05-31  9:03   ` Julien Grall
2017-05-31  9:12     ` Jan Beulich
2017-06-06 15:50 ` Ping: " Jan Beulich

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.