Re: finding fast_cwd_pointer on ARM64

2024-11-27 Thread Jeremy Drake via Cygwin-patches
> > > On Tue, 26 Nov 2024, Corinna Vinschen wrote: > > > > > > > Btw... > > > > > > > > We're doing this because nobody being able to debug ARM64 assembler came > > > > up with a piece of code checking the ntdll assembler code to find the > > > > address of the fast_cwd_pointer on ARM64. > > > > >

[PATCH v3 2/2] Cygwin: uname: add host machine tag to sysname.

2024-11-27 Thread Jeremy Drake via Cygwin-patches
From: Jeremy Drake If the Cygwin dll's architecture is different from the host system's architecture, append an additional tag that indicates the host system architecture (the Cygwin dll's architecture is already indicated in machine). Signed-off-by: Jeremy Drake --- v2: get rid of hardcoded st

[PATCH v3 1/2] Cygwin: cache IsWow64Process2 host arch in wincap.

2024-11-27 Thread Jeremy Drake via Cygwin-patches
From: Jeremy Drake This was already used in the FAST_CWD check, and could be used in a couple other places. I found the "emulated"/process value returned from the function largely useless, so I did not cache it. It is useless because, as the docs say, it is set to IMAGE_FILE_MACHINE_UNKNOWN (0)

[PATCH] Cygwin: nice: align return value and errno with POSIX and Linux

2024-11-27 Thread Christian Franke
No "Fixes:" in comment because the current behavior emulates old Linux behavior which is possibly not a bug. SUS 1997 to POSIX 2024 require to return the new nice value. https://pubs.opengroup.org/onlinepubs/007908799/xsh/nice.html https://pubs.opengroup.org/onlinepubs/9799919799/functions/nice.

Re: [PATCH v2 2/2] Cygwin: uname: add host machine tag to sysname.

2024-11-27 Thread Corinna Vinschen
On Nov 27 08:47, Jeremy Drake via Cygwin-patches wrote: > On Wed, 27 Nov 2024, Corinna Vinschen wrote: > > > I'm not opposed to a switch statement consisting of an > > IMAGE_FILE_MACHINE_ARM64 case and a default case adding "-???" or > > something. Chances are so extremly slim that we'll ever see

Re: [PATCH] Cygwin: sched_setscheduler: allow changes of the priority

2024-11-27 Thread Corinna Vinschen
On Nov 27 16:44, Christian Franke wrote: > Corinna Vinschen wrote: > > And I think your patch here should go in as is, just with the release > > message in release/3.5.5 so we can cherry-pick it to the 3.5 branch. > > Attached. Message moved to 3.5.5 and "Fixes:" changed as suggested. > > From 8

Re: [PATCH v2 0/7] Fix issues when too many signals arrive rapidly

2024-11-27 Thread Corinna Vinschen
On Nov 27 18:01, Corinna Vinschen wrote: > On Nov 26 17:54, Takashi Yano wrote: > > Takashi Yano (7): > > Cygwin: signal: Fix deadlock between main thread and sig thread > > Cygwin: signal: Handle queued signal without explicit __SIGFLUSH > > Cygwin: signal: Cleanup signal queue after process

Re: [PATCH 8/8] Cygwin: signal: Fix another deadlock between main and sig thread

2024-11-27 Thread Corinna Vinschen
On Nov 27 20:22, Takashi Yano wrote: > In _cygtls::handle_SIGCONT(), the sig thread waits for the main thread > processing the signal without unlocking tls area. This causes a deadlock > if the main thread tries to acquire a lock for the tls area meanwhile. > With this patch, unlock tls before call

Re: [PATCH v2 0/7] Fix issues when too many signals arrive rapidly

2024-11-27 Thread Corinna Vinschen
On Nov 26 17:54, Takashi Yano wrote: > Takashi Yano (7): > Cygwin: signal: Fix deadlock between main thread and sig thread > Cygwin: signal: Handle queued signal without explicit __SIGFLUSH > Cygwin: signal: Cleanup signal queue after processing it > Cygwin: signal: Optimize the priority of

Re: [PATCH v2 6/7] Cygwin: cygtls: Prompt system to switch tasks explicitly in lock()

2024-11-27 Thread Corinna Vinschen
On Nov 26 17:55, Takashi Yano wrote: > This patch calls Sleep() in lock() in order to increase the chance > of being unlocked in other threads. The lock(), unlock() and locked() > are moved from sigfe.s to cygtls.h so that allows inline expansion. When doing the locking in C++, we should really ma

Re: [PATCH v2 4/7] Cygwin: signal: Optimize the priority of the sig thread

2024-11-27 Thread Corinna Vinschen
On Nov 26 17:55, Takashi Yano wrote: > Previously, the sig thread ran in THREAD_PRIORITY_HIGHEST priority. > This causes a critical delay in the signal handling in the main thread > if too many signals are received rapidly and the CPU is very busy. > In this case, most of the CPU time is allocated

Re: [PATCH v2 2/2] Cygwin: uname: add host machine tag to sysname.

2024-11-27 Thread Jeremy Drake via Cygwin-patches
On Wed, 27 Nov 2024, Corinna Vinschen wrote: > I'm not opposed to a switch statement consisting of an > IMAGE_FILE_MACHINE_ARM64 case and a default case adding "-???" or > something. Chances are so extremly slim that we'll ever see another > CPU emulated on x86_64, we can always add a case for th

Re: [PATCH v2 3/7] Cygwin: signal: Cleanup signal queue after processing it

2024-11-27 Thread Corinna Vinschen
Hi Takashi, On Nov 26 17:55, Takashi Yano wrote: > The queue is once cleaned up, however, sigpacket::process() may set > si_signo in the queue to 0 by calling sig_clear(). This patch adds > another loop for cleanup after calling sigpacket::process(). > > Addresses: https://cygwin.com/pipermail/cy

Re: [PATCH] Cygwin: sched_setscheduler: allow changes of the priority

2024-11-27 Thread Christian Franke
Corinna Vinschen wrote: On Nov 27 10:14, Christian Franke wrote: Corinna Vinschen wrote: On Nov 25 21:20, Christian Franke wrote: Corinna Vinschen wrote: - Isn't returning SCHED_FIFO sched_getscheduler() just as wrong? Definitly. SCHED_FIFO is a non-preemptive(!) real-time policy. Windows do

Re: [PATCH] Cygwin: setpriority, sched_setparam: fail if Windows sets a lower priority

2024-11-27 Thread Corinna Vinschen
On Nov 27 10:39, Christian Franke wrote: > A minor improvement of POSIX emulation. > > -- > Regards, > Christian > > From 7d089e109f32fe44f331ca142e8dc8747f0e9db3 Mon Sep 17 00:00:00 2001 > From: Christian Franke > Date: Wed, 27 Nov 2024 10:26:38 +0100 > Subject: [PATCH] Cygwin: setpriority, s

Re: [PATCH] Cygwin: sched_getscheduler: fix error handling

2024-11-27 Thread Corinna Vinschen
On Nov 25 15:06, Christian Franke wrote: > Christian Franke wrote: > > Long standing (2001) minor issue. > > > > v2 with "Fixes:" in log message. > Pushed. Thanks, Corinna

Re: [PATCH v2 2/2] Cygwin: uname: add host machine tag to sysname.

2024-11-27 Thread Corinna Vinschen
On Nov 26 14:27, Jeremy Drake via Cygwin-patches wrote: > On Tue, 26 Nov 2024, Corinna Vinschen wrote: > > > On Nov 25 11:24, Jeremy Drake via Cygwin-patches wrote: > > > + switch (wincap.host_machine ()) > > > + { > > > + case IMAGE_FILE_MACHINE_AMD64: > > > + n = stpcpy (buf, "-x64")

Re: finding fast_cwd_pointer on ARM64

2024-11-27 Thread Corinna Vinschen
On Nov 26 17:25, Jeremy Drake via Cygwin-patches wrote: > On Tue, 26 Nov 2024, Jeremy Drake via Cygwin-patches wrote: > > > On Tue, 26 Nov 2024, Corinna Vinschen wrote: > > > > > Btw... > > > > > > We're doing this because nobody being able to debug ARM64 assembler came > > > up with a piece of co

Re: [PATCH v2 1/2] Cygwin: cache IsWow64Process2 host arch in wincap.

2024-11-27 Thread Corinna Vinschen
On Nov 26 10:16, Jeremy Drake via Cygwin-patches wrote: > On Tue, 26 Nov 2024, Corinna Vinschen wrote: > > > On Nov 25 11:21, Jeremy Drake via Cygwin-patches wrote: > > > +extern const IMAGE_DOS_HEADER > > > +dosheader __asm__ ("__image_base__"); > > > > On second thought, shouldn't we just use Ge

Re: [PATCH] Cygwin: sched_setscheduler: allow changes of the priority

2024-11-27 Thread Corinna Vinschen
On Nov 27 10:14, Christian Franke wrote: > Corinna Vinschen wrote: > > On Nov 25 21:20, Christian Franke wrote: > > > Corinna Vinschen wrote: > > > > - Isn't returning SCHED_FIFO sched_getscheduler() just as wrong? > > > Definitly. SCHED_FIFO is a non-preemptive(!) real-time policy. Windows > > >

[PATCH 8/8] Cygwin: signal: Fix another deadlock between main and sig thread

2024-11-27 Thread Takashi Yano
In _cygtls::handle_SIGCONT(), the sig thread waits for the main thread processing the signal without unlocking tls area. This causes a deadlock if the main thread tries to acquire a lock for the tls area meanwhile. With this patch, unlock tls before calling yield() in handle_SIGCONT(). Addresses:

[PATCH] Cygwin: setpriority, sched_setparam: fail if Windows sets a lower priority

2024-11-27 Thread Christian Franke
A minor improvement of POSIX emulation. -- Regards, Christian From 7d089e109f32fe44f331ca142e8dc8747f0e9db3 Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Wed, 27 Nov 2024 10:26:38 +0100 Subject: [PATCH] Cygwin: setpriority, sched_setparam: fail if Windows sets a lower priority Windows

Re: [PATCH] Cygwin: sched_setscheduler: allow changes of the priority

2024-11-27 Thread Christian Franke
Corinna Vinschen wrote: On Nov 25 21:20, Christian Franke wrote: Hi Corinna, Corinna Vinschen wrote: Hi Christian, On Nov 25 15:00, Christian Franke wrote: Corinna Vinschen wrote: Fixes: ...? ... the very first commit (cgf 2001) of sched.cc :-) New patch attached. From e95fc1aceb5287f9