Skip to contentSkip to conversation

tools/libs/evtchn: Drop assert()s referencing MiniOS's main_thread

PATCH In review Andrew Cooper 3 participants 6 messages Nov 11, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/libs/evtchn: Drop assert()s referencing MiniOS's main_thread

This breaks the build with debug active, as main_thread is not an exposed symbol.

This is a minimal version of commit bc4fe94a69d4 ("tools/libs/evtchn: replace assert()s in stubdom with proper locking"). It leaves MiniOS no worse off with respect to thread safety.

---
CC: Jan Beulich <[email protected]>
CC: Juergen Gross <[email protected]>

Speculative fix. Gitlab is a little busy right now:

https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1536597753

---
 tools/libs/evtchn/minios.c | 3 ---
 1 file changed, 3 deletions(-)
tools/libs/evtchn/minios.c +0 -3
index 28743cb05575..e33ddec7e7f0 100644
@@ -195,7 +195,6 @@ xenevtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce,
     int ret;
     evtchn_port_t port;
 
-    assert(get_current() == main_thread);
     port_info = port_alloc(xce);
     if ( port_info == NULL )
         return -1;
@@ -226,7 +225,6 @@ xenevtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce,
     evtchn_port_t local_port;
     int ret;
 
-    assert(get_current() == main_thread);
     port_info = port_alloc(xce);
     if ( port_info == NULL )
         return -1;
@@ -279,7 +277,6 @@ xenevtchn_port_or_error_t xenevtchn_bind_virq(xenevtchn_handle *xce,
     struct port_info *port_info;
     evtchn_port_t port;
 
-    assert(get_current() == main_thread);
     port_info = port_alloc(xce);
     if ( port_info == NULL )
         return -1;

base-commit: 2b18f341cb5c66bbc3260a8e0dd9f42b2f58d78c
prerequisite-patch-id: 39749d67636f2c0377cd95d938cf0ae5da72403b
prerequisite-patch-id: 75378607486a1a3909481c243f3dfd163ae433dc

Signature · 1 line
2.39.5
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Andrew Cooper

This breaks the build with debug active, as main_thread is not an exposed symbol.

This is a minimal version of commit bc4fe94a69d4 ("tools/libs/evtchn: replace assert()s in stubdom with proper locking"). It leaves MiniOS no worse off with respect to thread safety.

Quoted 8 lines

---
CC: Jan Beulich <[email protected]>
CC: Juergen Gross <[email protected]>

Speculative fix. Gitlab is a little busy right now:

https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1536597753

Assuming it helps:

Considering that 4.18 pre-dates the export restrictions, I'm a little puzzled though. And indeed a400dd51706867565ed1382b23d3475bb30668c2 is a 4.19 commit; the update of the main tree branch (3c81457aa338) should have used ff13dabd3099687921145a5e3e960ba8337e7488 instead, if I'm not mistaken.

Jan

#2 lore raw
Quoted 13 lines · Jan Beulich
Quoted 12 lines · Andrew Cooper

This breaks the build with debug active, as main_thread is not an exposed symbol.

This is a minimal version of commit bc4fe94a69d4 ("tools/libs/evtchn: replace assert()s in stubdom with proper locking"). It leaves MiniOS no worse off with respect to thread safety.

---
CC: Jan Beulich <[email protected]>
CC: Juergen Gross <[email protected]>

Quoted 5 lines
Quoted 3 lines

Speculative fix. Gitlab is a little busy right now:

https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1536597753

Assuming it helps:

Testing is still going, but various ones have passed where previously they failed, so yes, it is helping.

Quoted 4 lines

Considering that 4.18 pre-dates the export restrictions, I'm a little puzzled though. And indeed a400dd51706867565ed1382b23d3475bb30668c2 is a 4.19 commit; the update of the main tree branch (3c81457aa338) should have used ff13dabd3099687921145a5e3e960ba8337e7488 instead, if I'm not mistaken.

Oh yes.  I've messed that up.

I'll try again with the correct revision.

~Andrew

#3 lore raw
Quoted 22 lines · Andrew Cooper
Quoted 13 lines · Jan Beulich
Quoted 12 lines · Andrew Cooper

This breaks the build with debug active, as main_thread is not an exposed symbol.

This is a minimal version of commit bc4fe94a69d4 ("tools/libs/evtchn: replace assert()s in stubdom with proper locking"). It leaves MiniOS no worse off with respect to thread safety.

---
CC: Jan Beulich <[email protected]>
CC: Juergen Gross <[email protected]>

Quoted 5 lines
Quoted 3 lines

Speculative fix. Gitlab is a little busy right now:

https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1536597753

Assuming it helps:

Testing is still going, but various ones have passed where previously they failed, so yes, it is helping.

Quoted 7 lines
Quoted 4 lines

Considering that 4.18 pre-dates the export restrictions, I'm a little puzzled though. And indeed a400dd51706867565ed1382b23d3475bb30668c2 is a 4.19 commit; the update of the main tree branch (3c81457aa338) should have used ff13dabd3099687921145a5e3e960ba8337e7488 instead, if I'm not mistaken.

Oh yes.  I've messed that up.

I'll try again with the correct revision.

With the revision fixed:

https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1536629643

(Still busy though.)

~Andrew

#4 lore raw
Quoted 27 lines · Andrew Cooper
Quoted 26 lines · Andrew Cooper
Quoted 13 lines · Jan Beulich
Quoted 12 lines · Andrew Cooper

This breaks the build with debug active, as main_thread is not an exposed symbol.

This is a minimal version of commit bc4fe94a69d4 ("tools/libs/evtchn: replace assert()s in stubdom with proper locking"). It leaves MiniOS no worse off with respect to thread safety.

---
CC: Jan Beulich <[email protected]>
CC: Juergen Gross <[email protected]>

Quoted 5 lines
Quoted 3 lines

Speculative fix. Gitlab is a little busy right now:

https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1536597753

Assuming it helps:

Testing is still going, but various ones have passed where previously they failed, so yes, it is helping.

Quoted 4 lines

Considering that 4.18 pre-dates the export restrictions, I'm a little puzzled though. And indeed a400dd51706867565ed1382b23d3475bb30668c2 is a 4.19 commit; the update of the main tree branch (3c81457aa338) should have used ff13dabd3099687921145a5e3e960ba8337e7488 instead, if I'm not mistaken.

Quoted 6 lines
Quoted 3 lines

Oh yes.  I've messed that up.

I'll try again with the correct revision.

With the revision fixed:

https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1536629643

Yes, having the correct MiniOS revision does work too.  I'll fix that up.

~Andrew

#5 lore raw
In reply to Jan Beulich
Quoted 17 lines · Jan Beulich
Quoted 7 lines · Andrew Cooper

This breaks the build with debug active, as main_thread is not an exposed symbol.

This is a minimal version of commit bc4fe94a69d4 ("tools/libs/evtchn: replace assert()s in stubdom with proper locking"). It leaves MiniOS no worse off with respect to thread safety.

Quoted 8 lines

---
CC: Jan Beulich <[email protected]>
CC: Juergen Gross <[email protected]>

Speculative fix. Gitlab is a little busy right now:

   https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1536597753
Quoted 7 lines

Assuming it helps:

Considering that 4.18 pre-dates the export restrictions, I'm a little puzzled though. And indeed a400dd51706867565ed1382b23d3475bb30668c2 is a 4.19 commit; the update of the main tree branch (3c81457aa338) should have used ff13dabd3099687921145a5e3e960ba8337e7488 instead, if I'm not mistaken.

I agree with that.

Juergen