[{"id":1773948,"web_url":"http://patchwork.ozlabs.org/comment/1773948/","msgid":"<10f7c0bb-1e28-8f15-8bea-db207f3efbbd@suse.de>","list_archive_url":null,"date":"2017-09-23T00:48:52","subject":"Re: [U-Boot] [PATCH v3 3/6] arm: provide a PCS-compliant setjmp\n\timplementation","submitter":{"id":1212,"url":"http://patchwork.ozlabs.org/api/people/1212/","name":"Alexander Graf","email":"agraf@suse.de"},"content":"On 21.09.17 10:19, Philipp Tomsich wrote:\n> The previous setjmp-implementation (as a static inline function that\n> contained an 'asm volatile' sequence) was extremely fragile: (some\n> versions of) GCC optimised the set of registers.  One critical example\n> was the removal of 'r9' from the clobber list, if -ffixed-reg9 was\n> supplied.\n\nI wouldn't call that fragile, but \"works as intended\". Gcc only saves \nthe registers it really needs to save - and if r9 is fixed it can safely \nassume that between setjmp/longjmp it did not change.\n\nDid you encounter other cases where it did something wrong?\n\n> To increase robustness and ensure PCS-compliant behaviour, the setjmp\n> and longjmp implementation are now in assembly and closely match what\n> one would expect to find in a libc implementation.\n\nI'm personally quite indifferent on which version we take, but I \npersonally found the inline asm version more readable. At least it was \nhalf-way self-documenting and struct offset independent ;).\n\nBut again, I really don't have strong feelings. I only wrote the inline \nasm version because we didn't have any implementation at all. If you opt \nto maintain yours, be my guest :).\n\n\nAlex","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xzWv710NHz9s4s\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 23 Sep 2017 10:49:05 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 78953C21F83; Sat, 23 Sep 2017 00:49:00 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 5DA5EC21C39;\n\tSat, 23 Sep 2017 00:48:58 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid DCEBAC21C39; Sat, 23 Sep 2017 00:48:56 +0000 (UTC)","from mx1.suse.de (mx2.suse.de [195.135.220.15])\n\tby lists.denx.de (Postfix) with ESMTPS id 88DFCC21C26\n\tfor <u-boot@lists.denx.de>; Sat, 23 Sep 2017 00:48:56 +0000 (UTC)","from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254])\n\tby mx1.suse.de (Postfix) with ESMTP id 90EECAC82;\n\tSat, 23 Sep 2017 00:48:55 +0000 (UTC)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED\n\tautolearn=unavailable autolearn_force=no version=3.4.0","X-Virus-Scanned":"by amavisd-new at test-mx.suse.de","To":"Philipp Tomsich <philipp.tomsich@theobroma-systems.com>,\n\tu-boot@lists.denx.de","References":"<1505981969-49480-1-git-send-email-philipp.tomsich@theobroma-systems.com>\n\t<1505981969-49480-4-git-send-email-philipp.tomsich@theobroma-systems.com>","From":"Alexander Graf <agraf@suse.de>","Message-ID":"<10f7c0bb-1e28-8f15-8bea-db207f3efbbd@suse.de>","Date":"Sat, 23 Sep 2017 02:48:52 +0200","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0)\n\tGecko/20100101 Thunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<1505981969-49480-4-git-send-email-philipp.tomsich@theobroma-systems.com>","Content-Language":"en-US","Cc":"Andre Przywara <andre.przywara@arm.com>,\n\tKlaus Goger <klaus.goger@theobroma-systems.com>,\n\tAndy Yan <andy.yan@rock-chips.com>, Stefan Roese <sr@denx.de>,\n\tJagan Teki <jagan@openedev.com>","Subject":"Re: [U-Boot] [PATCH v3 3/6] arm: provide a PCS-compliant setjmp\n\timplementation","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"; Format=\"flowed\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}}]