From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id D7A0D3858D3C for ; Mon, 20 Sep 2021 17:10:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D7A0D3858D3C Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-174-HZhRo-jjNlSICYoesYDWYw-1; Mon, 20 Sep 2021 13:10:22 -0400 X-MC-Unique: HZhRo-jjNlSICYoesYDWYw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7EC49800FF3; Mon, 20 Sep 2021 17:10:21 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.176]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AC4E85C3DF; Mon, 20 Sep 2021 17:10:20 +0000 (UTC) From: Florian Weimer To: DJ Delorie via Libc-alpha Cc: Vincent Chen , DJ Delorie Subject: Re: [RFC patch 2/5] RISC-V: Reserve about 5K space in mcontext_t to support future ISA expansion. References: Date: Mon, 20 Sep 2021 19:10:19 +0200 In-Reply-To: (DJ Delorie via Libc-alpha's message of "Mon, 20 Sep 2021 12:41:53 -0400") Message-ID: <87o88nyxz8.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Mon, 20 Sep 2021 17:10:24 -0000 * DJ Delorie via Libc-alpha: > Vincent Chen writes: >> I am not familiar with the mechanism of LD_AUDIT, so I actually do not >> know if this modification may have any effect on LD_AUDIT. If >> possible, could you briefly introduce the issues for me? Thank you >> very much. > > In general, when function foo() calls DSO function bar(), and bar() is > in an object that needs to be loaded from disk, the loader needs to save > foo()'s context, do a bunch of work, restore the context, and call > bar(). > > The LD_AUDIT feature adds a lot more "do a bunch of work" both on the > foo->bar call, and on the bar->foo return, typically calling some third > party functions to process the audit messages. > > However, if the "do a bunch of work" changes registers that aren't saved > in the context, and aren't agreed on as "call clobbered" and thus > changeable, problems happen. If foo() expects a register to be > preserved across the call to bar(), and the loader and audit functions > don't know that and clobber it, foo() breaks. One point of clarification: The issue is with register usage for passing argument and return values. It's more or less unrelated to whether registers are callee-saved or caller-saved. So you need special LD_AUDIT support as soon it's possible to pass vector arguments and return values in registers (as opposed to memory). Thanks, Florian