1. 07 5月, 2014 4 次提交
    • L
      ACPICA: Tables: Add new mechanism to skip NULL entries in RSDT and XSDT. · 0f929fbf
      Lv Zheng 提交于
      It is reported that there are buggy BIOSes in the world: AMI uses an XSDT
      compiler for early BIOSes, this compiler will generate XSDT with a NULL
      entry.  The affected BIOS versions are "AMI BIOS F2-F4".
      
      Original solution on Linux is to use an alternative heathy root table
      instead of the ill one.  This commit is:
        Commit: 671cc68d
        Subject: ACPICA: Back port and refine validation of the XSDT root table.
      
      This is an example of such XSDT dumped from B85-HD3 (AMI F3 BIOS):
      [000h 0000   4]                    Signature : "XSDT"    [Extended System Description Table]
      [004h 0004   4]                 Table Length : 00000074
      [008h 0008   1]                     Revision : 01
      [009h 0009   1]                     Checksum : 18
      [00Ah 0010   6]                       Oem ID : "ALASKA"
      [010h 0016   8]                 Oem Table ID : "A M I"
      [018h 0024   4]                 Oem Revision : 01072009
      [01Ch 0028   4]              Asl Compiler ID : "AMI "
      [020h 0032   4]        Asl Compiler Revision : 00010013
      
      [024h 0036   8]       ACPI Table Address   0 : 00000000BA5F8180
      [02Ch 0044   8]       ACPI Table Address   1 : 00000000BA5F8290
      [034h 0052   8]       ACPI Table Address   2 : 00000000BA5F8308
      [03Ch 0060   8]       ACPI Table Address   3 : 00000000BA5F8848
      [044h 0068   8]       ACPI Table Address   4 : 00000000BA5F9320
      [04Ch 0076   8]       ACPI Table Address   5 : 00000000BA5F9360
      [054h 0084   8]       ACPI Table Address   6 : 00000000BA5F9398
      [05Ch 0092   8]       ACPI Table Address   7 : 00000000BA5F9708
      [064h d100   8]       ACPI Table Address   8 : 00000000BA5FC9A8
      [06Ch 0108   8]       ACPI Table Address   9 : 0000000000000000
      
      But according to the bug report, the XSDT in fact is not broken. In the
      above XSDT, ACPI Table Address 1-8 contains the same value as RSDT.  The
      differences can only be seen on the following 2 entries:
      1. The first entry points to a FADT whose Revision is 5 while the first
         entry in RSDT points to a FADT whose Revision is 2.
         The FADT dumped from the address indicated by the first entry of XSDT:
          FACP @ 0x00000000BA5F8180
            0000: 46 41 43 50 0C 01 00 00<05>4B 41 4C 41 53 4B 41  FACP.....KALASKA
            ...
         The FADT dumped from the address indicated by the first entry of RSDT:
          FACP @ 0x00000000BA5ED0F0
            0000: 46 41 43 50 84 00 00 00<02>A7 41 4C 41 53 4B 41  FACP......ALASKA
            ...
      2. The last entry is a NULL terminator.
      According to the test result, the Revision 5 FADT is accessible.  Thus the
      original solution turns out to be a work around that is preventing the
      higher revision tables to be used for such platforms (they are all x86-64
      platforms, and should use XSDT and higher revision FADT).
      
      This patch offers a new solution, where a sanity check is performed before
      installing a table address from XSDT. If the entry is NULL, it is simply
      discarded.
      
      Note that, this patch doesn't remove the original solution, so for Linux
      kernel, this commit is actually a no-op, but it allows acpidump to be
      working on such platforms. By doing so, we allow another easy revertable
      commit to enable this feature so that when that commit is reverted, the
      useful sanity check will not be affected. Lv Zheng.
      
      References: https://bugzilla.kernel.org/show_bug.cgi?id=73911
      References: https://bugs.archlinux.org/task/39811Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Reported-and-tested-by: NBruce Chiarelli <mano155@gmail.com>
      Reported-and-tested-by: NSpyros Stathopoulos <spystath@gmail.com>
      Signed-off-by: NBob Moore <robert.moore@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0f929fbf
    • L
      ACPICA: acpidump: Add support to force using RSDT. · c7932267
      Lv Zheng 提交于
      This patch adds "-x" and "-x -x" options to disable XSDT for acpidump.
      
      The single "-x" can be used to stop using XSDT, RSDT will be forced to find
      static tables, note that XSDT will still be dumped. The double "-x" can
      stop dumping XSDT, which is useful when the XSDT address reported by RSDP
      is pointing to an invalid address.
      
      It is reported there are platforms having broken XSDT shipped, acpidump
      will stop working while accessing such XSDT. This patch adds new option so
      that users can force acpidump to dump tables listed in the RSDT. Lv Zheng.
      
      Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=73911
      Buglink: https://bugs.archlinux.org/task/39811Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Reported-and-tested-by: NBruce Chiarelli <mano155@gmail.com>
      Reported-and-tested-by: NSpyros Stathopoulos <spystath@gmail.com>
      Signed-off-by: NBob Moore <robert.moore@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      c7932267
    • L
      ACPICA: acpidump: Fix truncated RSDP signature validation. · d63f3790
      Lv Zheng 提交于
      This patch enforces a rule to always use ACPI_VALIDATE_RSDP_SIG for RSDP
      signatures passed from table header or ACPI_SIG_RSDP so that truncated
      string comparison can be avoided.  This could help to fix the issue that
      "RSD " matches but "RSD PTR " doesn't match.  Lv Zheng.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NBob Moore <robert.moore@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d63f3790
    • L
      ACPICA: acpidump: Fix code issue in invoking fread in the loop. · d87a2b75
      Lv Zheng 提交于
      This patch fixes an issue that the while loop is not needed as fread()
      should return exact the bytes of expected.
      
      The patch is tested by runing diff against the output of "-c" mode and
      the normal mode, and only finds the following differences:
      1. table addresses: the "-c" mode will always fill 0x0000000000000000 for
                          the address.
      2. RSDP/RSDT/XSDT: there is no generation of such tables for "-c" mode.
      So the test result shows the fix is valid.  Lv Zheng.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NBob Moore <robert.moore@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d87a2b75
  2. 30 4月, 2014 7 次提交
  3. 23 4月, 2014 4 次提交
  4. 22 4月, 2014 1 次提交
  5. 21 4月, 2014 5 次提交
  6. 20 4月, 2014 3 次提交
  7. 17 4月, 2014 1 次提交
  8. 15 4月, 2014 2 次提交
  9. 14 4月, 2014 12 次提交
  10. 08 4月, 2014 1 次提交
    • K
      tools/vm/page-types.c: page-cache sniffing feature · 65a6a410
      Konstantin Khlebnikov 提交于
      After this patch 'page-types' can walk over a file's mappings and
      analyze populated page cache pages mostly without disturbing its state.
      
      It maps chunk of file, marks VMA as MADV_RANDOM to turn off readahead,
      pokes VMA via mincore() to determine cached pages, triggers page-fault
      only for them, and finally gathers information via pagemap/kpageflags.
      Before unmap it marks VMA as MADV_SEQUENTIAL for ignoring reference
      bits.
      
      usage: page-types -f <path>
      
      If <path> is directory it will analyse all files in all subdirectories.
      
      Symlinks are not followed as well as mount points.  Hardlinks aren't
      handled, they'll be dumped as many times as they are found.  Recursive
      walk brings all dentries into dcache and populates page cache of
      block-devices aka 'Buffers'.
      
      Probably it's worth to add ioctl for dumping file page cache as array of
      PFNs as a replacement for this hackish juggling with
      mmap/madvise/mincore/pagemap.  Also recursive walk could be replaced
      with dumping cached inodes via some ioctl or debugfs interface followed
      by openning them via open_by_handle_at, this would fix hardlinks
      handling and unneeded population of dcache and buffers.  This interface
      might be used as data source for constructing readahead plans and for
      background optimizations of actively used files.
      
      collateral changes:
      + fix 64-bit LFS: define _FILE_OFFSET_BITS instead of _LARGEFILE64_SOURCE
      + replace lseek + read with single pread
      + make show_page_range() reusable after flush
      
      usage example:
      
        ~/src/linux/tools/vm$ sudo ./page-types -L -f page-types
        foffset offset    flags
        page-types       Inode: 2229277       Size: 89065 (22 pages)
        Modify: Tue Feb 25 12:00:59 2014 (162 seconds ago)
        Access: Tue Feb 25 12:01:00 2014 (161 seconds ago)
        0       3cbf3b     __RU_lA____M________________________
        1       38946a     __RU_lA____M________________________
        2       1a3cec     __RU_lA____M________________________
        3       1a8321     __RU_lA____M________________________
        4       3af7cc     __RU_lA____M________________________
        5       1ed532     __RU_lA_____________________________
        6       2e436a     __RU_lA_____________________________
        7       29a35e     ___U_lA_____________________________
        8       2de86e     ___U_lA_____________________________
        9       3bdfb4     ___U_lA_____________________________
        10      3cd8a3     ___U_lA_____________________________
        11      2afa50     ___U_lA_____________________________
        12      2534c2     ___U_lA_____________________________
        13      1b7a40     ___U_lA_____________________________
        14      17b0be     ___U_lA_____________________________
        15      392b0c     ___U_lA_____________________________
        16      3ba46a     __RU_lA_____________________________
        17      397dc8     ___U_lA_____________________________
        18      1f2a36     ___U_lA_____________________________
        19      21fd30     __RU_lA_____________________________
        20      2c35ba     __RU_l______________________________
        21      20f181     __RU_l______________________________
      
                     flags page-count   MB  symbolic-flags                        long-symbolic-flags
        0x000000000000002c          2    0  __RU_l______________________________  referenced,uptodate,lru
        0x0000000000000068         11    0  ___U_lA_____________________________  uptodate,lru,active
        0x000000000000006c          4    0  __RU_lA_____________________________  referenced,uptodate,lru,active
        0x000000000000086c          5    0  __RU_lA____M________________________  referenced,uptodate,lru,active,mmap
                     total         22    0
      
        ~/src/linux/tools/vm$ sudo ./page-types -f /
                     flags page-count     MB  symbolic-flags                        long-symbolic-flags
        0x0000000000000028      21761     85  ___U_l______________________________  uptodate,lru
        0x000000000000002c     127279    497  __RU_l______________________________  referenced,uptodate,lru
        0x0000000000000068      74160    289  ___U_lA_____________________________  uptodate,lru,active
        0x000000000000006c      84469    329  __RU_lA_____________________________  referenced,uptodate,lru,active
        0x000000000000007c          1      0  __RUDlA_____________________________  referenced,uptodate,dirty,lru,active
        0x0000000000000228        370      1  ___U_l___I__________________________  uptodate,lru,reclaim
        0x0000000000000828         49      0  ___U_l_____M________________________  uptodate,lru,mmap
        0x000000000000082c        126      0  __RU_l_____M________________________  referenced,uptodate,lru,mmap
        0x0000000000000868        137      0  ___U_lA____M________________________  uptodate,lru,active,mmap
        0x000000000000086c      12890     50  __RU_lA____M________________________  referenced,uptodate,lru,active,mmap
                     total     321242   1254
      Signed-off-by: NKonstantin Khlebnikov <koct9i@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Fengguang Wu <fengguang.wu@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      65a6a410