<div dir="ltr">The policy and mechanism for Clang to support experimental/unratified extensions in RISCV has already been established, see <a href="https://reviews.llvm.org/D73891">https://reviews.llvm.org/D73891</a> (as well as <a href="https://reviews.llvm.org/D69987">https://reviews.llvm.org/D69987</a> <a href="https://reviews.llvm.org/D81188">https://reviews.llvm.org/D81188</a> implementing the experimental V extension). As long as you follow the same model for the experimental "J" extension, there should be no issue with this.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 20, 2020 at 2:09 AM Anatoly Parshintsev via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p style="color:rgb(14,16,26);background:transparent;margin-top:0pt;margin-bottom:0pt"><span style="background:transparent;margin-top:0pt;margin-bottom:0pt">Hello there,</span></p><p style="color:rgb(14,16,26);background:transparent;margin-top:0pt;margin-bottom:0pt"><br></p><p style="color:rgb(14,16,26);background:transparent;margin-top:0pt;margin-bottom:0pt"><span style="background:transparent;margin-top:0pt;margin-bottom:0pt">We want to publish the port of HWASAN implementation for RISCV to llvm. And I'd like to understand the prerequisites for this functionality to be adopted by llvm</span></p><p style="color:rgb(14,16,26);background:transparent;margin-top:0pt;margin-bottom:0pt"><br></p><p style="color:rgb(14,16,26);background:transparent;margin-top:0pt;margin-bottom:0pt"><span style="background:transparent;margin-top:0pt;margin-bottom:0pt">The implementation is dependent on the </span><a style="background:transparent;margin-top:0pt;margin-bottom:0pt;color:rgb(74,110,224)" href="https://github.com/riscv/riscv-j-extension" target="_blank"><span style="background:transparent;margin-top:0pt;margin-bottom:0pt">J-extension</span></a><span style="background:transparent;margin-top:0pt;margin-bottom:0pt"> (aka "Pointer Masking") to be available. At the present moment, the extension is not an official one, but the core concepts which are relevant to llvm are not expected to be changed. </span><span style="background-color:transparent">Currently, we are pushing the implementation of this extension to qemu. There is a set of patches on <a href="https://lists.nongnu.org/archive/html/qemu-riscv/2020-10/msg00173.html" target="_blank">review</a>.</span></p><p style="color:rgb(14,16,26);background:transparent;margin-top:0pt;margin-bottom:0pt"><br></p><p style="color:rgb(14,16,26);background:transparent;margin-top:0pt;margin-bottom:0pt"><span style="background:transparent;margin-top:0pt;margin-bottom:0pt">We already have an initial prototype of the HWASAN port for RISC-V based on this extension. And we'd like to push it to llvm mainline. I'd like to understand the prerequisites of such functionality to be adopted.</span></p><p style="color:rgb(14,16,26);background:transparent;margin-top:0pt;margin-bottom:0pt"><br></p><p style="color:rgb(14,16,26);background:transparent;margin-top:0pt;margin-bottom:0pt"><span style="background:transparent;margin-top:0pt;margin-bottom:0pt">1. Is the availability of J-extension in qemu enough?</span></p><p style="color:rgb(14,16,26);background:transparent;margin-top:0pt;margin-bottom:0pt"><span style="background:transparent;margin-top:0pt;margin-bottom:0pt">2. As is - the extension can be used in bare-metal applications right away. However, Linux may require some patches: for example, implementation of syscalls to enable Pointer Masking for the calling process (by the way - we have the initial implementation for that too).</span></p><p style="color:rgb(14,16,26);background:transparent;margin-top:0pt;margin-bottom:0pt"><br></p><p style="color:rgb(14,16,26);background:transparent;margin-top:0pt;margin-bottom:0pt"><span style="background:transparent;margin-top:0pt;margin-bottom:0pt">Could someone advise if we can begin to roll-out the relevant patches for such an experimental functionality? Or should we wait for, say, an "official" Linux support?</span></p><p style="color:rgb(14,16,26);background:transparent;margin-top:0pt;margin-bottom:0pt"><br></p><p style="color:rgb(14,16,26);background:transparent;margin-top:0pt;margin-bottom:0pt"><span style="background:transparent;margin-top:0pt;margin-bottom:0pt">Any suggestions and recommendations are very welcome. </span></p></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>