delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2025/06/27/13:46:15

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 55RHkEpZ1527018
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 55RHkEpZ1527018
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=UphIrq8G
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E0C9E3854A8D
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1751046372;
bh=w/0DTvfeC/+KrJLi/DX8iQuBccXRVK2ak1Hm1w5hxqA=;
h=Date:To:cc:Subject:In-Reply-To:References:List-Id:
List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:
From:Reply-To:From;
b=UphIrq8GxOcFfHgnxwVxw6dtauV3Ip/MkfBWKXBx0WivsYyX83KcGx4pARtjnFg/3
NLiES5lpg5xWjhXTDPEI+7IXsyXRZ5gtIC7+PqIrHebseCQDfdPx96xwTH5MYWnJD7
zvIlG9QocueSOD+HuE6uTFTR1+xhQa5EGCVGWxi0=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8A2C738560BC
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8A2C738560BC
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1751046316; cv=none;
b=jsOeLbXPvhdQEAodEo0BC/g01f0eL5fEAaE7IGIctz3g7qWXDz02LQTkFq5n7GOsat4CcEm5z/TJMyYzv+XBAQXl34SczhSDhhoTTmS87ny/sBYeDMCJPIS4Wpxx/0wtgEARUghpoa2cDAi/INncLCxDo3BomVx5JVxGNhNmPoQ=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1751046316; c=relaxed/simple;
bh=gyKlfJB/vSUuiykvi0utEfB7ImI+48FRzc3C6T5qcCg=;
h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version;
b=T5Z4Pqu5q8Ek4uT8AZ9GTfpzzW1dLT28Xb2Q4ic9s6p7AeYgUt+EzO+Y5KifDphMMnOK5CagRoZCKgrtTZ9eWy/XwIG+rWFQHCwuU2XZ2mRUZOjlHNP8uuSf2F8aBRSqcWxKWwxUqwIbMCJu+fMWPGhYMleMCe9RLUkXCLP1Vh4=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8A2C738560BC
Date: Fri, 27 Jun 2025 10:45:16 -0700 (PDT)
X-X-Sender: jeremyd AT resin DOT csoft DOT net
To: Corinna Vinschen via Cygwin <cygwin AT cygwin DOT com>
cc: Pip Cet <pipcet AT protonmail DOT com>
Subject: Re: XSAVE-related segfaults observed under wine
In-Reply-To: <aF60VympSWbCeu2n@calimero.vinschen.de>
Message-ID: <abda5210-ba7f-a4a0-5c0c-880367fec254@jdrake.com>
References: <87bjq9457k DOT fsf AT protonmail DOT com>
<aF60VympSWbCeu2n AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Jeremy Drake via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Jeremy Drake <cygwin AT jdrake DOT com>
Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>

On Fri, 27 Jun 2025, Corinna Vinschen via Cygwin wrote:

> 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

If aligning via andq, does the 0x18 "for alignment" still need to be
included?

> >  	subq	%rbx,%rsp
>
>   +     andq    \$-64, %rsp
>

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019