From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A0B5B285CB3 for ; Mon, 15 Sep 2025 17:22:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=63.228.1.57 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757956970; cv=none; b=BF4hL3sIjwbD2RjWzS3OBs9aehRos9V3/csu7Aj9Xh6Br9N1PUYMy0d1laohYREbJ3sD61JrFByMOv3TG9q8Vcr/NXoJPpwvlfHnK5/eyyt8SB+GFVPajeWx3ScO8bLIDwd5x/baXPp/8EZV/CK5Rm9B/8qiojZnRDN4qDCZRtI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757956970; c=relaxed/simple; bh=mi4GXlDoGS0imwX6AZihiZmnS37OCUBHcNg9TUFd+4Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uBarcmy14gOxsvOf44HCGHfULrM1dTCsncn3X3OU2Gp4ZX2GfqNSOavYCtn54rvWn9mdGgpGYb/hRhK4HyglNwwpPMHCsqC6cEtRcCB+2UeRJnNhUoNRlSLrSHm4DF7HEKQGeC1SNN52+NOIfKjWpSzyZp8ZKN4rW3RXorQybqM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org; spf=pass smtp.mailfrom=kernel.crashing.org; arc=none smtp.client-ip=63.228.1.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost [127.0.0.1]) by gate.crashing.org (8.18.1/8.18.1/Debian-2) with ESMTP id 58FHMCAx209792; Mon, 15 Sep 2025 12:22:12 -0500 Received: (from segher@localhost) by gate.crashing.org (8.18.1/8.18.1/Submit) id 58FHMB67209791; Mon, 15 Sep 2025 12:22:11 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Mon, 15 Sep 2025 12:22:11 -0500 From: Segher Boessenkool To: Steven Rostedt Cc: Indu Bhagat , Jan Beulich , Rainer Orth , "linux-toolchains@vger.kernel.org" , Jens Remus , Sterling Augustine , Pavel Labath , Andrii Nakryiko , Josh Poimboeuf , Serhei Makarov , Binutils Subject: Re: Unaligned access trade-offs for SFrame FRE layout Message-ID: References: <9d104c46-855c-4b36-8226-1f59b59e455c@suse.com> <26895e7a-5d54-4c89-aeb4-bcd094ba081d@suse.com> <1308e9fa-90c8-4c52-b53d-afd24542b4c8@suse.com> <76b8c89e-5d80-48da-aff1-580d539d1b87@oracle.com> <20250915120742.7ff2f781@gandalf.local.home> Precedence: bulk X-Mailing-List: linux-toolchains@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250915120742.7ff2f781@gandalf.local.home> On Mon, Sep 15, 2025 at 12:07:42PM -0400, Steven Rostedt wrote: > On Sun, 14 Sep 2025 22:42:46 -0700 > Indu Bhagat wrote: > > > In such cases, the routines reading the SFrame data under consideration > > here (SFrame FRE start addr, and SFrame FRE stack offsets) from memory > > will need to use a memcpy to copy out the data to an aligned location. > > > > In GNU Binutils libsframe (used by ld), we do the above. Such a "SFrame > > FRE decoding" routine could be provided in a arch-specific manner in > > SFrame stack tracers. > > I'm perfectly fine with making it a requirement for the reader of the > SFrame section having to use memcpy into an aligned structure for reading > if the architecture requires it. Let only the architectures that have > issues with unaligned access take the performance hit. Constructing the bigger value from a whole bunch of byte reads should be pretty optimal, too. Just don't force misaligned bigger reads, not even on platforms where that *does* work (not all!), it might well be really, really slow. Segher