From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 4B3B86EC40; Thu, 19 Aug 2021 11:49:14 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4B3B86EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1629362954; bh=/+VSVvyTvaNHRNGi4lUfemi1ld7uEXu/iNpiRAhp13w=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=WhazEUkBM+UVDPejhoZjiptg3IPlXKRsYOLr06k6wmnt+PoAZrcvyhxW/HbKHBAO1 GKSD9kVJgmyZ4zp20r/vYNrvG9/dDKknL3WNU6+H05gSQ9TmytTMIxdGQ4nkibyQA3 ihLWYuQJ3nq88R4GHu7jGT19Yo/vvsuwbNApNgaE= Received: from smtpng2.i.mail.ru (smtpng2.i.mail.ru [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 0C9666EC40 for ; Thu, 19 Aug 2021 11:49:13 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0C9666EC40 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1mGdjb-0005iH-Kc; Thu, 19 Aug 2021 11:49:12 +0300 Date: Thu, 19 Aug 2021 11:24:01 +0300 To: Sergey Kaplun , Kirill Yukhin Cc: tarantool-patches@dev.tarantool.org Message-ID: <20210819082401.GP5743@tarantool.org> References: <3c9433a3166bcc2396efb01e89261dea370bd5c1.1629315033.git.imun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <3c9433a3166bcc2396efb01e89261dea370bd5c1.1629315033.git.imun@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.10.1 (2018-07-13) X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD9ECFD080E047A606F6525B29142351271182A05F538085040BBAF26AE90D4C2C08892E938B7E59E73592E0F555EAE464DC2678398A87965D6 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE78C6616F30072131EEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063707C4856229E8E7E48638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8D5619E4F3FA89D94867888EC22E29716117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCAA867293B0326636D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8BF1175FABE1C0F9B6A471835C12D1D977C4224003CC8364762BB6847A3DEAEFB0F43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7C2C2559B29ED8195043847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A51CB5E00CFEA5B8E2E935E3B3EC87B54DAC61B454D1F913FED59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA758B25CD4253D1D611410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34C6EC1BD9807109D24461F970F3C71073AAB343D5BB59DCAE658F3AD5A6F687858F3F25C1187166D61D7E09C32AA3244CAED04E60A33724BE152E21591CB5D11EA8CE788DE6831205927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojGSxK+6r6oBG1Px5DwrjaLw== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5DAC3E64BE97C4581C9B8956C1B9BE8231A7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] ARM64: Fix exit stub patching. X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" I've checked the patch into tarantool branch in tarantool/luajit and bumped a new version in master. On 18.08.21, Igor Munkin wrote: > From: Mike Pall > > Contributed by Javier Guerra Giraldez. > > (cherry picked from commit 9da06535092d6d9dec442641a26c64bce5574322) > > When the side trace is assembled, it is linked to its parent trace. For > this purpose, JIT runs through the parent trace mcode and updates jump > instruction targeted to the corresponding exitno. Prior to this patch, > these instructions were patched unconditionally, that leads to errors if > the jump target address is out of the value ranges specified in ARM64 > references[1][2][3][4][5][6]. > > As a result of the patch considers value ranges of > the jump targets and updates directly only those instructions fitting > the particular jump range. Moreover, the corresponding jump in the pad > leading to is also patched, so those instructions, > that are not updated before, targets to the linked side trace too. > > Additionaly, there is some refactoring of jump targets assembling in > scope of this patch. > > Igor Munkin: > * added the description and the test for the problem > > [1]: https://developer.arm.com/documentation/dui0801/g/A64-General-Instructions/B > [2]: https://developer.arm.com/documentation/dui0801/g/A64-General-Instructions/B-cond > [3]: https://developer.arm.com/documentation/dui0801/g/A64-General-Instructions/CBZ > [4]: https://developer.arm.com/documentation/dui0801/g/A64-General-Instructions/CBNZ > [5]: https://developer.arm.com/documentation/dui0801/g/A64-General-Instructions/TBZ > [6]: https://developer.arm.com/documentation/dui0801/g/A64-General-Instructions/TBNZ > > Resoves tarantool/tarantool#6098 > Part of tarantool/tarantool#5629 > > Signed-off-by: Igor Munkin > --- > > Issue: https://github.com/tarantool/tarantool/issues/6098 > Branch: https://github.com/tarantool/luajit/tree/imun/gh-6098-fix-luajit-tests-suite-failures > CI: https://github.com/tarantool/tarantool/commit/67f92d2 > Related PR in LuaJIT repo: https://github.com/LuaJIT/LuaJIT/pull/429 > > src/lj_asm_arm64.h | 64 +++++---- > src/lj_emit_arm64.h | 18 +-- > src/lj_target_arm64.h | 7 +- > test/tarantool-tests/CMakeLists.txt | 1 + > ...8-fix-side-exit-patching-on-arm64.test.lua | 129 ++++++++++++++++++ > .../CMakeLists.txt | 1 + > .../libproxy.c | 23 ++++ > 7 files changed, 205 insertions(+), 38 deletions(-) > create mode 100644 test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua > create mode 100644 test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64/CMakeLists.txt > create mode 100644 test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64/libproxy.c > > -- > 2.25.0 > -- Best regards, IM