Skip to content
Snippets Groups Projects
  1. Apr 17, 2014
  2. Apr 16, 2014
    • Mitchel Humpherys's avatar
      lrdp-v2: add hexdump functions · 97cff249
      Mitchel Humpherys authored
      It's useful to be able to dump regions of memory a la `xxd'. Add some
      machinery to parser_util and RamDump to do this.
      
      Example:
      
          $ ramparse.py -a . -o parsed --shell
          >>> dump.hexdump(0, 100, virtual=False)
          00000000: fffe ffde 0200 0000 ffff b7bf adf5 a5ff  ................
          00000010: e7bf edfe c6fe edf6 fefa fffe befa fefe  ................
          00000020: bfbe ffef aebd a5ef ffff 7f7e fefe 5afb  ...........~..Z.
          00000030: 1b00 2000 3300 4300 1c00 2100 3400 4800  .. .3.C...!.4.H.
          00000040: ffff ff7f fafe ffdb effd a5af adf5 a5bf  ................
          00000050: 4444 4444 4444 4444 4444 4444 4444 4444  DDDDDDDDDDDDDDDD
          00000060: 5fff ffff                                _...
          >>> dump.hexdump(0xc0000000, 100, virtual=True)
          c0000000: fffe ffde 0200 0000 ffff b7bf adf5 a5ff  ................
          c0000010: e7bf edfe c6fe edf6 fefa fffe befa fefe  ................
          c0000020: bfbe ffef aebd a5ef ffff 7f7e fefe 5afb  ...........~..Z.
          c0000030: 1b00 2000 3300 4300 1c00 2100 3400 4800  .. .3.C...!.4.H.
          c0000040: ffff ff7f fafe ffdb effd a5af adf5 a5bf  ................
          c0000050: 4444 4444 4444 4444 4444 4444 4444 4444  DDDDDDDDDDDDDDDD
          c0000060: 5fff ffff                                _...
          >>> dump.hexdump(dump.addr_lookup('linux_banner'), 144, virtual=True)
          c0b0006a: 4c69 6e75 7820 7665 7273 696f 6e20 332e  Linux version 3.
          c0b0007a: 3130 2e32 382d 6765 3232 3362 6632 3830  10.28-ge223bf280
          c0b0008a: 662d 6469 7274 7920 286d 6974 6368 656c  f-dirty (mitchel
          c0b0009a: 6840 6d69 7463 6865 6c68 2d6c 696e 7578  h@mitchelh-linux
          c0b000aa: 2920 2867 6363 2076 6572 7369 6f6e 2034  ) (gcc version 4
          c0b000ba: 2e37 2028 4743 4329 2029 2023 3720 534d  .7 (GCC) ) #7 SM
          c0b000ca: 5020 5052 4545 4d50 5420 5475 6520 4170  P PREEMPT Tue Ap
          c0b000da: 7220 3820 3134 3a32 303a 3132 2050 4454  r 8 14:20:12 PDT
          c0b000ea: 2032 3031 340a 007c 2f2d 5c00 0000 0000   2014..|/-\.....
      
      Change-Id: Iecaf80f72845f052085a60eadedd2bb24743224c
      97cff249
    • Mitchel Humpherys's avatar
      lrdp-v2: refactor Armv7LPAEMMU code · 4f8207f7
      Mitchel Humpherys authored
      The LPAE MMU code can be re-used for other modules that need page table
      parsing (like the LPAE IOMMU page tables). Refactor the code a bit so
      that it can be easily re-used later.
      
      Change-Id: I0deb80a69f2fca83c3ddcc78867fa2e5f5d18bb2
      4f8207f7
    • Mitchel Humpherys's avatar
      lrdp-v2: refactor Iommu domain parsing code · 29d3f2ed
      Mitchel Humpherys authored
      The Iommu domain parsing code is common across different Iommu page
      table types (normal vs LPAE). Pull this code out so that it can be
      easily re-used later when LPAE page table support is added.
      
      Change-Id: Ifc39c12428a9c090f8197d997ddd293e0ae1f0b1
      29d3f2ed
    • Mitchel Humpherys's avatar
      lrdp-v2: set up register.py for doctest · 87538b00
      Mitchel Humpherys authored
      register.py is almost ready to handle doctest testing. Fix up one typo
      and add the necessary call in if __name__ == "__main__".
      
      Change-Id: I0a79060bb3bb58e807e7699ec0c21ef0eddb062d
      87538b00
    • Mitchel Humpherys's avatar
      lrdp-v2: register: handle None values more gracefully · b69a4c8a
      Mitchel Humpherys authored
      If a Register is created with a None value, it currently blows up. Fix
      this.
      
      Change-Id: Ic652620e367c64e0a8444ef4b3e5ea7d77edcd82
      b69a4c8a
    • Mitchel Humpherys's avatar
      lrdp-v2: add missing `self' reference to Armv7LPAEMMU · 1bbe85f2
      Mitchel Humpherys authored
      do_fl_sl_level_lookup is a class method, so it needs to be called on a
      class object. Add some missing `self' class objects.
      
      Change-Id: I8b9932ec2bd2eb7c2296355afff4783612171c7d
      1bbe85f2
    • Mitchel Humpherys's avatar
      lrdp-v2: Add docstring to MMU.virt_to_phys · 75b79aa7
      Mitchel Humpherys authored
      MMU.virt_to_phys currently lacks a docstring. They're useful, so add
      one.
      
      Change-Id: I95b0a7a8f97912f178157eb4b68c453585e547bd
      75b79aa7
    • Mitchel Humpherys's avatar
      lrdp-v2: add container_of and sibling_field_addr convenience functions · e0e640fd
      Mitchel Humpherys authored
      Some common operations include getting the parent structure of some
      embedded field as well as getting "sibling" fields within the parent
      structure. Add some convenience methods to the gdbmi module (as well as
      wrappers in the RamDump class) for this.
      
      Change-Id: Ic65d7e60b930af8c73384a30b6b0dd84fb55f09c
      e0e640fd
    • Mitchel Humpherys's avatar
      lrdp-v2: iommu: use sizes module · e8e68cb9
      Mitchel Humpherys authored
      Move to the new sizes module to avoid repetition.
      
      Change-Id: I5b18837bb47c0077976e84bcc3af59a30ce42614
      e8e68cb9
    • Mitchel Humpherys's avatar
      lrdp-v2: add sizes module · 4b07323c
      Mitchel Humpherys authored
      Add a convenience module with definitions for common sizes, conversions
      to strings, functions for working with orders, etc.
      
      Change-Id: I922d6daa0c021a0d189b53aac76ed211e8864923
      4b07323c
    • Mitchel Humpherys's avatar
      lrdp-v2: iommu: remove unused variable · ffd1e0d7
      Mitchel Humpherys authored
      out_dir is not used anymore. Remove it.
      
      Change-Id: I082e0642a352e91b232ce02fe40e20a200de9fc8
      ffd1e0d7
    • Mitchel Humpherys's avatar
      lrdp-v2: create output directory if it doesn't exist · c36143c0
      Mitchel Humpherys authored
      Currently we error out and ask the user to create the output directory
      if it doesn't exist. As a convenience, just create the directory for
      them.
      
      Change-Id: I0e9caa8294d644621bd166a06e2a70c8ca5715fc
      c36143c0
    • Linux Build Service Account's avatar
    • Linux Build Service Account's avatar
  3. Apr 12, 2014
  4. Apr 07, 2014
    • Mitchel Humpherys's avatar
      lrdp-v2: look for vmlinux in autodump dir when missing · b70d9718
      Mitchel Humpherys authored
      It's not uncommon for the vmlinux file to live in the same directory as
      the actual RAM dumps. If the users doesn't explicitly specify a vmlinux
      image to use, look for it in the autodump dir. If we still can't find it
      there, error out as usual.
      
      Change-Id: I702c5584477e26912e0857dbd03b02491bd33c6c
      b70d9718
    • Mitchel Humpherys's avatar
      lrdp-v2: better error message for bad local_settings.py · 7b181bfb
      Mitchel Humpherys authored
      When local_settings.py is missing variables we just error out when
      trying to access those attributes. Improve the error message by
      mentioning local_settings.py and pointing the user to README.txt.
      
      Change-Id: Iaa2a1ab96ca889d75972bbfa1d4e127a8bf5bec1
      7b181bfb
    • Mitchel Humpherys's avatar
      lrdp-v2: automatically lookup addresses when needed · 8d02f6cf
      Mitchel Humpherys authored
      Add support to RamDump.virt_to_phys for automatically looking up
      addresses of symbols when a string is passed in. This will simplify code
      that uses the RamDump.read_* routines.
      
      Old way:
      
          mydata_addr = ramdump.addr_lookup('data_var')
          mydata2_addr = ramdump.addr_lookup('data2_var')
      
          mydata = ramdump.read_word(mydata_addr)
          mydata2 = ramdump.read_word(mydata2_addr)
      
      New way:
      
          mydata = ramdump.read_word('data_var')
          mydata2 = ramdump.read_word('data2_var')
      
      Of course, the "Old way" will still work.
      
      Change-Id: I0c006f5135b48f8385d2107d9b9d2fe767a266b0
      8d02f6cf
  5. Apr 05, 2014
  6. Apr 04, 2014
    • Mitchel Humpherys's avatar
      lrdp-v2: add interactive shell · c52de5a0
      Mitchel Humpherys authored
      During development, it's quite convenient to load up an interactive
      python interpreter with a RamDump instance loaded. Add some command line
      switches to launch an interactive shell with the RamDump instance that
      gets created as a result of whatever other command line options are
      passed.
      
      If IPython is installed, an IPython interpreter will be launched,
      otherwise a classic Python interpreter will be launched. The classic
      interface can also be forced with --classic-shell.
      
      Change-Id: Id59acb97a830055212de9db3eaf05f18358f757f
      c52de5a0
  7. Mar 28, 2014
  8. Mar 15, 2014
  9. Mar 14, 2014
  10. Mar 13, 2014
    • Laura Abbott's avatar
      linux-ramdump-parser-v2: Skip bad rodata headers · 1bc0a672
      Laura Abbott authored
      When checking for rodata differences, we scan the ELF headers of
      the vmlinux. Newer vmlinux files seem to have extra ELF headers
      with addresses outside the valid mapped range. If we encounter
      one of those headers and read an invalid address, skip it.
      
      Change-Id: I2a8af784df7216bf9d890be42eec8599fbaa7f72
      1bc0a672
    • Laura Abbott's avatar
      linux-ramdump-parser-v2: Conditionally add phys offset for socinfo · 9e570006
      Laura Abbott authored
      Commit 3d6a90bd
      (linux-ramdump-parser-v2: Don't use ram start address in socinfo)
      corrected the case for --auto-dump detection but broke the case of
      specifying ram files manually with addresses. When specifying the
      addresses manually, the addresses given are correct so the ram start
      does need to be added. Correct the code to add the offset by default
      but not add when doing autodetection.
      
      Change-Id: I50d54a932210afeace49a898dd819dc46c3e3aa1
      9e570006
Loading