DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 55RFEoOB1481603 Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 55RFEoOB1481603 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=m2aTJ+Ka X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3226F3856260 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1751037289; bh=dSIQ15nvUY1p1XuBQzq4Rrr1eBEi2dMAf+V6aiUdooQ=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=m2aTJ+KapsOJZsGQLTKUZptFkHb4Khz0/pBFixbSS3sgA2iJkU02vMikuOMBFTaWC fAQx9hHy3Od496+iZWo5khN35CoIsgHTp7IdpOamr2HjK4Ga4bHFyiWEMViAkx9o31 jgAxTIstsS0RC1B+vyVeL9UVr7b79jfobaAprB0U= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EAD36385B517 Date: Fri, 27 Jun 2025 17:10:15 +0200 To: Pip Cet Subject: Re: XSAVE-related segfaults observed under wine Message-ID: Mail-Followup-To: Pip Cet , cygwin AT cygwin DOT com References: <87bjq9457k DOT fsf AT protonmail DOT com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87bjq9457k.fsf@protonmail.com> X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Corinna Vinschen via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Corinna Vinschen , cygwin AT cygwin DOT com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Hi Pip, On Jun 27 14:41, Pip Cet via Cygwin wrote: > My suggested fix is to align the value in %rbx to the next 64-byte > multiple after the "cpuid" instruction is executed, by performing the > assembler equivalent of $rbx += 63; $rbx &= -64; I tried this: > > diff --git a/winsup/cygwin/scripts/gendef b/winsup/cygwin/scripts/gendef > index 861a2405b..d681fde3f 100755 > --- a/winsup/cygwin/scripts/gendef > +++ b/winsup/cygwin/scripts/gendef > @@ -232,6 +232,8 @@ sigdelayed: > movl \$0x0d,%eax > xorl %ecx,%ecx > cpuid # get necessary space for xsave > + addq \$63, %rbx > + andq \$-64, %rbx # align to next 64-byte multiple what about a oneliner instead by just aligning rsp? As in > movq %rbx,%rcx > addq \$0x48,%rbx # 0x18 for alignment, 0x30 for additional space > subq %rbx,%rsp + andq \$-64, %rsp Would you mind to create a git send-email compatible patch with a nice commit message basically duplicating your great description of the problem and matching "Fixes:" and "Signed-off-by:" lines? You can send it here or to the cygwin-patches mailing list. Thanks, Corinna -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple