From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-3.4 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RDNS_DYNAMIC,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id B54D31F8C6 for ; Mon, 13 Sep 2021 13:53:25 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E119F385AC19 for ; Mon, 13 Sep 2021 13:53:24 +0000 (GMT) Received: from brightrain.aerifal.cx (brightrain.aerifal.cx [216.12.86.13]) by sourceware.org (Postfix) with ESMTPS id B1F313857427 for ; Mon, 13 Sep 2021 13:52:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B1F313857427 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=libc.org Authentication-Results: sourceware.org; spf=none smtp.mailfrom=libc.org Date: Mon, 13 Sep 2021 09:52:48 -0400 From: Rich Felker To: Florian Weimer Subject: Re: [RFC patch 2/5] RISC-V: Reserve about 5K space in mcontext_t to support future ISA expansion. Message-ID: <20210913135247.GL13220@brightrain.aerifal.cx> References: <1631497278-29829-1-git-send-email-vincent.chen@sifive.com> <1631497278-29829-3-git-send-email-vincent.chen@sifive.com> <871r5sd1zq.fsf@oldenburg.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <871r5sd1zq.fsf@oldenburg.str.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vincent Chen , libc-alpha@sourceware.org, andrew@sifive.com Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On Mon, Sep 13, 2021 at 03:44:09PM +0200, Florian Weimer via Libc-alpha wrote: > * Vincent Chen: > > > Following the changes of struct sigcontext in Linux to reserve about 5K space > > to support future ISA expansion. > > --- > > sysdeps/unix/sysv/linux/riscv/sys/ucontext.h | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/sysdeps/unix/sysv/linux/riscv/sys/ucontext.h b/sysdeps/unix/sysv/linux/riscv/sys/ucontext.h > > index cfafa44..80caf07 100644 > > --- a/sysdeps/unix/sysv/linux/riscv/sys/ucontext.h > > +++ b/sysdeps/unix/sysv/linux/riscv/sys/ucontext.h > > @@ -82,6 +82,8 @@ typedef struct mcontext_t > > { > > __riscv_mc_gp_state __gregs; > > union __riscv_mc_fp_state __fpregs; > > + /* 5K + 256 reserved for vector state and future expansion. */ > > + unsigned char __reserved[5376] __attribute__ ((__aligned__ (16))); > > } mcontext_t; > > This changes the size of struct ucontext_t, which is an ABI break > (getcontext callers are supposed to provide their own object). > > This shouldn't be necessary if the additional vector registers are > caller-saved. Indeed, that was my first thought when I saw this too. Any late additions to the register file must be call-clobbered or else they are a new ABI. And mcontext_t does not need to represent any call-clobbered state. Rich