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.7 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 679FC1F8C8 for ; Mon, 20 Sep 2021 17:10:43 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5E321385841C for ; Mon, 20 Sep 2021 17:10:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5E321385841C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1632157842; bh=E+svQgSMUYT7hM0la+6ZIYCLyj9KqSzhAqoYgsu3j84=; h=To:Subject:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=SB9nWif1BpeWducVy+K/zS/CIOaftu0piYuye8axgAE4P2jYA52gvfk6v0AeQ5wOK CdrEYKaKwAAFHudJeEHkM+QxHACrL+8Q8tReTeQjayRsZQC5OsFHwbRG22YkkWBTRU cbxJl/2UTmv+jtUz+1wEzsLiYhUlMJOs/XWNMtjk= 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) To: DJ Delorie via Libc-alpha 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-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: , From: Florian Weimer via Libc-alpha Reply-To: Florian Weimer Cc: Vincent Chen Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" * 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