This is an archive of the discontinued LLVM Phabricator instance.

Intel(R) Memory Protection Extensions (Intel(R) MPX) support.
ClosedPublic

Authored by valentinagiusti on Sep 2 2016, 6:20 AM.

Details

Summary

The test for this fix is included in the test for the coming
patch with the support for Intel(R) Memory Protection
Extensions (Intel(R) MPX).

Signed-off-by: Valentina Giusti <valentina.giusti@intel.com>

Support for Intel(R) Memory Protection Extensions for Linux (x86_64/i386).

The Intel(R) Memory Protection Extensions (Intel(R) MPX) associates pointers
to bounds, against which the software can check memory references to
prevent out of bound memory access.

This patch allows accessing the MPX registers:

  • bnd0-3: 128-bit registers to hold the bound values,
  • bndcfgu, bndstatus: 64-bit configuration registers,

Signed-off-by: Valentina Giusti <valentina.giusti@intel.com>

Move register command tests into subdirectory.

Signed-off-by: Valentina Giusti <valentina.giusti@intel.com>

MPX register test.

This patch adds read/write tests for the MPX registers in the register
command tests and adds a new subdirectory for MPX specific tests.

Signed-off-by: Valentina Giusti <valentina.giusti@intel.com>

Diff Detail

Repository
rL LLVM

Event Timeline

valentinagiusti retitled this revision from to Enable eFormatVectorOfUInt64 formatting for registers..
valentinagiusti updated this object.
valentinagiusti added a project: Restricted Project.
valentinagiusti added a reviewer: lldb-commits.
valentinagiusti set the repository for this revision to rL LLVM.
valentinagiusti removed rL LLVM as the repository for this revision.Sep 2 2016, 6:55 AM
valentinagiusti removed a project: Restricted Project.
valentinagiusti retitled this revision from Enable eFormatVectorOfUInt64 formatting for registers. to Intel(R) Memory Protection Extensions (Intel(R) MPX) support..Sep 2 2016, 7:02 AM
clayborg accepted this revision.Sep 2 2016, 10:50 AM
clayborg edited edge metadata.
This revision is now accepted and ready to land.Sep 2 2016, 10:50 AM
labath edited edge metadata.Sep 5 2016, 2:17 AM

Thanks for the patch. The changes seem pretty straight-forward. I'd just like to sort out some issues in the new test first.

packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py
27 ↗(On Diff #70152)

Do we really need the ios simulator decorator here?

29 ↗(On Diff #70152)

I presume this is XFAIL because the compiler does not have the required features. If that is true then a "skip" result would be more appropriate.

30 ↗(On Diff #70152)

It shouldn't be necessary to specify amd64 here. I know some old code does that, but now we have code in lldbtest.py which automatically remaps it to x86_64.

43 ↗(On Diff #70152)

Why is this necessary? (Also it looks like your cleanup function is the same as the setup)

50 ↗(On Diff #70152)

So, this test will fail if run on hardware which does not have the registers you are testing now (as far as I can tell, that's pretty much all of it). We should detect that situation (the inferior already has code for that, apparently), and skip the test. Something like:

if inferior_exited_with_minus_1:
  self.skipTest("blah blah")
This revision was automatically updated to reflect the committed changes.

Thanks for the review! You can find my replies inline.

packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py
27 ↗(On Diff #70152)

Is this naturally skipped if all OSs are skipped except for linux?

29 ↗(On Diff #70152)

True, here a skip would be better.

30 ↗(On Diff #70152)

ok, I'll remove it then!

43 ↗(On Diff #70152)

Sorry this is something I should have cleaned up.

50 ↗(On Diff #70152)

Good point! I will add this

labath added a comment.Sep 7 2016, 5:41 AM

Thank you for addressing the comments. let's continue this in the other thread.

packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py
27 ↗(On Diff #70152)

I am pretty sure it is, I have never needed to use the decorator, although it still exists in some legacy tests.

lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp