{"version": "https://jsonfeed.org/version/1", "title": "/dev/posts/ - Tag index - x86_64", "home_page_url": "https://www.gabriel.urdhr.fr", "feed_url": "/tags/x86_64/feed.json", "items": [{"id": "http://www.gabriel.urdhr.fr/2014/11/03/not-cleaning-the-stack/", "title": "Avoiding to clean the stack", "url": "https://www.gabriel.urdhr.fr/2014/11/03/not-cleaning-the-stack/", "date_published": "2014-11-03T00:00:00+01:00", "date_modified": "2014-11-03T00:00:00+01:00", "tags": ["computer", "simgrid", "compilation", "assembly", "x86_64"], "content_html": "<p>In two previous posts, I looked into cleaning the stack frame of a\nfunction before using it by adding assembly at the beginning of each\nfunction. This was done either by modifying LLVM with a <a href=\"https://www.gabriel.urdhr.fr/2014/10/06/cleaning-the-stack-in-a-llvm-pass/\">custom\ncodegen pass</a> or by\n<a href=\"https://www.gabriel.urdhr.fr/2014/10/06/cleaning-the-stack-by-filtering-the-assembly/\">rewriting the\nassembly</a>\nbetween the compiler and the assembler. The current implementation\nadds a loop at the beginning of every function. We look at the impact\nof this modification on the performance on the application.</p>\n"}, {"id": "http://www.gabriel.urdhr.fr/2014/10/06/cleaning-the-stack-by-filtering-the-assembly/", "title": "Cleaning the stack by filtering the assembly", "url": "https://www.gabriel.urdhr.fr/2014/10/06/cleaning-the-stack-by-filtering-the-assembly/", "date_published": "2014-10-06T12:40:02+02:00", "date_modified": "2014-10-06T12:40:02+02:00", "tags": ["computer", "simgrid", "unix", "compilation", "assembly", "x86_64"], "content_html": "<p>In order to help the SimGridMC state comparison code, I wrote a\nproof-of-concept <a href=\"https://www.gabriel.urdhr.fr/2014/10/06/cleaning-the-stack-in-a-llvm-pass/\">LLVM pass which cleans each stack\nframe</a> before using\nit. However, SimGridMC currently does not work properly when compiled\nwith clang/LLVM. We can do the same thing by pre-processing the\nassembly generated by the compiler before passing it to the linker:\nthis is done by inserting a script between the compiler and the\nassembler. This script will rewrite the generated assembly by\nprepending stack-cleaning code at the beginning of each function.</p>\n"}, {"id": "http://www.gabriel.urdhr.fr/2014/10/06/cleaning-the-stack-in-a-llvm-pass/", "title": "Cleaning the stack in a LLVM pass", "url": "https://www.gabriel.urdhr.fr/2014/10/06/cleaning-the-stack-in-a-llvm-pass/", "date_published": "2014-10-06T10:00:02+02:00", "date_modified": "2014-10-06T10:00:02+02:00", "tags": ["computer", "simgrid", "llvm", "compilation", "assembly", "x86_64"], "content_html": "<p>In the previous episode, we implemented a <a href=\"https://www.gabriel.urdhr.fr/2014/09/26/adding-a-llvm-pass/\">LLVM pass which does\nnothing</a>. Now we are trying to modify\nthis to create a (proof-of-concept) LLVM pass which fills the current\nstack frame with zero before using it.</p>\n"}, {"id": "http://www.gabriel.urdhr.fr/2014/09/26/adding-a-llvm-pass/", "title": "Adding a basic LLVM pass", "url": "https://www.gabriel.urdhr.fr/2014/09/26/adding-a-llvm-pass/", "date_published": "2014-09-26T00:00:00+02:00", "date_modified": "2014-09-26T00:00:00+02:00", "tags": ["computer", "simgrid", "llvm", "compilation", "assembly", "x86_64"], "content_html": "<p>The SimGrid model checker uses memory introspection (of the heap,\nstack and global variables) in order to detect the equality of the\nstate of a distributed application at the different nodes of its\nexecution graph. One difficulty is to deal with uninitialised\nvariables. The uninitialised global variables are usually not a big\nproblem as their initial value is 0. The heap variables are dealt with\nby <code>memset</code>ing to 0 the content of the buffers returned by <code>malloc</code>\nand friends. The case of uninitialised stack variables is more\nproblematic as their value is whatever was at this place on the stack\nbefore. In order to evaluate the impact of those uninitialised\nvariables, we would like to clean each stack frame before using\nthem. This could be done with a LLVM plugin. Here is my first attempt\nto write a LLVM pass to modify the code of a function.</p>\n"}]}