From: Igor Munkin via Tarantool-patches <tarantool-patches@dev.tarantool.org> To: Sergey Kaplun <skaplun@tarantool.org>, Kirill Yukhin <kyukhin@tarantool.org> Cc: tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH luajit] ARM64: Fix exit stub patching. Date: Wed, 18 Aug 2021 23:51:26 +0300 [thread overview] Message-ID: <20210818205126.GJ5743@tarantool.org> (raw) In-Reply-To: <3c9433a3166bcc2396efb01e89261dea370bd5c1.1629315033.git.imun@tarantool.org> Found several typos after sending the patch. Fixed and force-pushed the changes to the branch. On 18.08.21, Igor Munkin wrote: > From: Mike Pall <mike> > > 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 <lj_asm_patchexit> 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 <lj_vm_exit_handler> 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 Typo fixed: s/Additionaly/Additionally/. > 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 Typo fixed: s/Resoves/Resolves/. > Part of tarantool/tarantool#5629 > > Signed-off-by: Igor Munkin <imun@tarantool.org> > --- > > 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 > <snipped> > diff --git a/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua b/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua > new file mode 100644 > index 00000000..05e8904c > --- /dev/null > +++ b/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua > @@ -0,0 +1,129 @@ <snipped> > +for i = 1, FUNCS do > + -- XXX: FNEW is NYI, hence loop recording fails at this point. > + -- The recording is aborted on purpose: we are going to record > + -- <FUNCS> number of traces for functions in <recfuncs>. > + -- Otherwise, loop recording might lead to a very long trace > + -- error (via return to a lower frame), or a trace with lots of > + -- side traces. We need neither of this, but just bunch of > + -- traces filling the avaiable mcode area. ================================================================================ diff --git a/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua b/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua index 05e8904c..4dcf3e22 100644 --- a/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua +++ b/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua @@ -82,7 +82,7 @@ for i = 1, FUNCS do -- Otherwise, loop recording might lead to a very long trace -- error (via return to a lower frame), or a trace with lots of -- side traces. We need neither of this, but just bunch of - -- traces filling the avaiable mcode area. + -- traces filling the available mcode area. local function tnew(p) return { a = p + 1, f = p + 6, k = p + 11, p = p + 16, u = p + 21, z = p + 26, ================================================================================ > + local function tnew(p) <snipped> > -- > 2.25.0 > -- Best regards, IM
next prev parent reply other threads:[~2021-08-18 21:16 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-08-18 19:51 Igor Munkin via Tarantool-patches 2021-08-18 20:51 ` Igor Munkin via Tarantool-patches [this message] 2021-08-19 6:01 ` Sergey Kaplun via Tarantool-patches 2021-08-19 6:07 ` Igor Munkin via Tarantool-patches 2021-08-19 7:33 ` Kirill Yukhin via Tarantool-patches 2021-08-19 7:15 ` Igor Munkin via Tarantool-patches 2021-08-19 8:24 ` Igor Munkin via Tarantool-patches
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210818205126.GJ5743@tarantool.org \ --to=tarantool-patches@dev.tarantool.org \ --cc=imun@tarantool.org \ --cc=kyukhin@tarantool.org \ --cc=skaplun@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH luajit] ARM64: Fix exit stub patching.' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox