This is an archive of the discontinued LLVM Phabricator instance.

[Compiler-rt][Sanitizer][MSan][MIPS] Adding support for MIPS32
Changes PlannedPublic

Authored by mohit.bhakkad on Oct 8 2014, 6:52 AM.

Details

Summary

Most of the changes are specific to MIPS32 architecture to support Memory Sanitizer.

Diff Detail

Event Timeline

mohit.bhakkad retitled this revision from to [Compiler-rt][Sanitizer][MSan][MIPS] Adding support for MIPS32.
mohit.bhakkad updated this object.
mohit.bhakkad edited the test plan for this revision. (Show Details)
mohit.bhakkad set the repository for this revision to rL LLVM.
mohit.bhakkad added subscribers: Unknown Object (MLST), farazs, sdkie, slthakur.
samsonov edited edge metadata.Oct 8 2014, 2:08 PM

Deferring this to Evgeniy. Just a couple of drive-by comments.

lib/msan/msan.cc
29

Can you #define those things where they are actually used for the first time?

513

#if should start from the beginning of the line:

#if defined(__mips__)
  char *ptr;
  // more code
#else
  // more code
#endif
eugenis added inline comments.Oct 9 2014, 2:21 AM
lib/msan/CMakeLists.txt
37

Cool. You don't need this if() now.

lib/msan/msan.cc
510–511

This is only used in MSanDR (DynamoRio helper tool) which does not support MIPS. Better not change it, or disable it with #ifdef.

lib/msan/msan.h
29

This gives you only 512Mb usable application memory in [0x60000000, 0x80000000),
and requires that all application code is mapped in that region. The latter depends on the kernel. Just FYI.

lib/msan/msan_allocator.cc
44

No point in 3Tb allocation limit, you have only 512Mb application memory.

mohit.bhakkad edited edge metadata.
mohit.bhakkad set the repository for this revision to rL LLVM.

Changed indentation and done suggested changes.

eugenis edited edge metadata.Oct 13 2014, 9:18 AM

What's the overall status of this work? Proper support of a new platform (and a new bitness) would require a lot more changes than this. If you have a larger patch, please upload it here for a general discussion.

In D5672#10, @eugenis wrote:

What's the overall status of this work? Proper support of a new platform (and a new bitness) would require a lot more changes than this. If you have a larger patch, please upload it here for a general discussion.

I have tried to change every architecture specific code as per my understanding, please suggest on anything we missed out.
Below are the test results on mips32 board:

19 test cases are failing out of 88:

  • 3 are x86_64 specific
  • 2 are working after changing addresses in program(64--->32)
  • 9 are failing because of minor differences with expected o/p
  • I am working on remaining 5 failing tests.

I am going to submit a separate patch for testing related changes.

mohit.bhakkad planned changes to this revision.Apr 17 2015, 4:11 AM

This patch (when synced with ToT) functions properly with mips32, but it is kept on waiting for i386 support.
I have tried to provide i386 support for MSan in D6433, but it is stuck with
some issue in lit framework, please see if we can have green flag for this patch.

I am changing the status of patch to "Plan Changes" i.e. to be synced with current ToT.

dsanders resigned from this revision.Jul 12 2019, 4:15 PM