[PATCH for-4.18] tools/libs/evtchn: Drop assert()s referencing MiniOS's main_thread

Andrew Cooper posted 1 patch 11 months, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20241111143101.996733-1-andrew.cooper3@citrix.com
tools/libs/evtchn/minios.c | 3 ---
1 file changed, 3 deletions(-)
[PATCH for-4.18] tools/libs/evtchn: Drop assert()s referencing MiniOS's main_thread
Posted by Andrew Cooper 11 months, 3 weeks ago
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.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Juergen Gross <jgross@suse.com>

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(-)

diff --git a/tools/libs/evtchn/minios.c b/tools/libs/evtchn/minios.c
index 28743cb05575..e33ddec7e7f0 100644
--- a/tools/libs/evtchn/minios.c
+++ b/tools/libs/evtchn/minios.c
@@ -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
-- 
2.39.5
Re: [PATCH for-4.18] tools/libs/evtchn: Drop assert()s referencing MiniOS's main_thread
Posted by Jan Beulich 11 months, 3 weeks ago
On 11.11.2024 15:31, Andrew Cooper wrote:
> 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.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Juergen Gross <jgross@suse.com>
> 
> Speculative fix.  Gitlab is a little busy right now:
> 
>   https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1536597753

Assuming it helps:
Acked-by: Jan Beulich <jbeulich@suse.com>

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
Re: [PATCH for-4.18] tools/libs/evtchn: Drop assert()s referencing MiniOS's main_thread
Posted by Jürgen Groß 11 months, 3 weeks ago
On 11.11.24 15:41, Jan Beulich wrote:
> On 11.11.2024 15:31, Andrew Cooper wrote:
>> 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.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>> CC: Jan Beulich <JBeulich@suse.com>
>> CC: Juergen Gross <jgross@suse.com>
>>
>> Speculative fix.  Gitlab is a little busy right now:
>>
>>    https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1536597753
> 
> Assuming it helps:
> Acked-by: Jan Beulich <jbeulich@suse.com>
> 
> 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
Re: [PATCH for-4.18] tools/libs/evtchn: Drop assert()s referencing MiniOS's main_thread
Posted by Andrew Cooper 11 months, 3 weeks ago
On 11/11/2024 2:41 pm, Jan Beulich wrote:
> On 11.11.2024 15:31, Andrew Cooper wrote:
>> 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.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>> CC: Jan Beulich <JBeulich@suse.com>
>> CC: Juergen Gross <jgross@suse.com>
>>
>> Speculative fix.  Gitlab is a little busy right now:
>>
>>   https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1536597753
> Assuming it helps:
> Acked-by: Jan Beulich <jbeulich@suse.com>

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

> 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

Re: [PATCH for-4.18] tools/libs/evtchn: Drop assert()s referencing MiniOS's main_thread
Posted by Andrew Cooper 11 months, 3 weeks ago
On 11/11/2024 2:47 pm, Andrew Cooper wrote:
> On 11/11/2024 2:41 pm, Jan Beulich wrote:
>> On 11.11.2024 15:31, Andrew Cooper wrote:
>>> 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.
>>>
>>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>> ---
>>> CC: Jan Beulich <JBeulich@suse.com>
>>> CC: Juergen Gross <jgross@suse.com>
>>>
>>> Speculative fix.  Gitlab is a little busy right now:
>>>
>>>   https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1536597753
>> Assuming it helps:
>> Acked-by: Jan Beulich <jbeulich@suse.com>
> Testing is still going, but various ones have passed where previously
> they failed, so yes, it is helping.
>
>> 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

Re: [PATCH for-4.18] tools/libs/evtchn: Drop assert()s referencing MiniOS's main_thread
Posted by Andrew Cooper 11 months, 3 weeks ago
On 11/11/2024 2:53 pm, Andrew Cooper wrote:
> On 11/11/2024 2:47 pm, Andrew Cooper wrote:
>> On 11/11/2024 2:41 pm, Jan Beulich wrote:
>>> On 11.11.2024 15:31, Andrew Cooper wrote:
>>>> 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.
>>>>
>>>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>>> ---
>>>> CC: Jan Beulich <JBeulich@suse.com>
>>>> CC: Juergen Gross <jgross@suse.com>
>>>>
>>>> Speculative fix.  Gitlab is a little busy right now:
>>>>
>>>>   https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1536597753
>>> Assuming it helps:
>>> Acked-by: Jan Beulich <jbeulich@suse.com>
>> Testing is still going, but various ones have passed where previously
>> they failed, so yes, it is helping.
>>
>>> 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

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

~Andrew