1. 21 12月, 2016 1 次提交
    • L
      ACPICA: Tables: Back port acpi_get_table_with_size() and... · 174cc718
      Lv Zheng 提交于
      ACPICA: Tables: Back port acpi_get_table_with_size() and early_acpi_os_unmap_memory() from Linux kernel
      
      ACPICA commit cac6790954d4d752a083e6122220b8a22febcd07
      
      This patch back ports Linux acpi_get_table_with_size() and
      early_acpi_os_unmap_memory() into ACPICA upstream to reduce divergences.
      
      The 2 APIs are used by Linux as table management APIs for long time, it
      contains a hidden logic that during the early stage, the mapped tables
      should be unmapped before the early stage ends.
      
      During the early stage, tables are handled by the following sequence:
       acpi_get_table_with_size();
       parse the table
       early_acpi_os_unmap_memory();
      During the late stage, tables are handled by the following sequence:
       acpi_get_table();
       parse the table
      Linux uses acpi_gbl_permanent_mmap to distinguish the early stage and the
      late stage.
      
      The reasoning of introducing acpi_get_table_with_size() is: ACPICA will
      remember the early mapped pointer in acpi_get_table() and Linux isn't able to
      prevent ACPICA from using the wrong early mapped pointer during the late
      stage as there is no API provided from ACPICA to be an inverse of
      acpi_get_table() to forget the early mapped pointer.
      
      But how ACPICA can work with the early/late stage requirement? Inside of
      ACPICA, tables are ensured to be remained in "INSTALLED" state during the
      early stage, and they are carefully not transitioned to "VALIDATED" state
      until the late stage. So the same logic is in fact implemented inside of
      ACPICA in a different way. The gap is only that the feature is not provided
      to the OSPMs in an accessible external API style.
      
      It then is possible to fix the gap by providing an inverse of
      acpi_get_table() from ACPICA, so that the two Linux sequences can be
      combined:
       acpi_get_table();
       parse the table
       acpi_put_table();
      In order to work easier with the current Linux code, acpi_get_table() and
      acpi_put_table() is implemented in a usage counting based style:
       1. When the usage count of the table is increased from 0 to 1, table is
          mapped and .Pointer is set with the mapping address (VALIDATED);
       2. When the usage count of the table is decreased from 1 to 0, .Pointer
          is unset and the mapping address is unmapped (INVALIDATED).
      So that we can deploy the new APIs to Linux with minimal effort by just
      invoking acpi_get_table() in acpi_get_table_with_size() and invoking
      acpi_put_table() in early_acpi_os_unmap_memory(). Lv Zheng.
      
      Link: https://github.com/acpica/acpica/commit/cac67909Signed-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>
      174cc718
  2. 01 12月, 2016 1 次提交
  3. 13 8月, 2016 1 次提交
  4. 05 5月, 2016 1 次提交
  5. 16 1月, 2016 1 次提交
  6. 02 7月, 2015 1 次提交
  7. 23 6月, 2015 1 次提交
  8. 05 2月, 2015 1 次提交
  9. 26 1月, 2015 1 次提交
  10. 22 1月, 2015 1 次提交
  11. 21 4月, 2014 4 次提交
    • B
      ACPICA: Table Manager: Misc cleanup and renames, no functional change. · ed6f1d44
      Bob Moore 提交于
      Some various cleanups and renames.
      Signed-off-by: NBob Moore <robert.moore@intel.com>
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      ed6f1d44
    • L
      ACPICA: Tables: Cleanup ACPI_TABLE_ORIGIN_xxx flags. · 8a216d7f
      Lv Zheng 提交于
      This patch refines ACPI_TABLE_ORIGIN_xxx flags.  No functional changes.
      
      The previous commits have introduced the following internal APIs:
      1. acpi_tb_acquire_table: Acquire struct acpi_table_header according to
                             ACPI_TABLE_ORIGIN_xxx flags.
      2. acpi_tb_release_table: Release struct acpi_table_header according to
                             ACPI_TABLE_ORIGIN_xxx flags.
      3. acpi_tb_install_table: Make struct acpi_table_desc.Address not NULL according to
                             ACPI_TABLE_ORIGIN_xxx flags.
      4. acpi_tb_uninstall_table: Make struct acpi_table_desc.Address NULL according to
                               ACPI_TABLE_ORIGIN_xxx flags.
      5. acpi_tb_validate_table: Make struct acpi_table_desc.Pointer not NULL according to
                              ACPI_TABLE_ORIGIN_xxx flags.
      6. acpi_tb_invalidate_table: Make struct acpi_table_desc.Pointer NULL according to
                                ACPI_TABLE_ORIGIN_xxx flags.
      It thus detects that the ACPI_TABLE_ORIGIN_UNKNOWN is redundant to
      ACPI_TABLE_ORIGIN_OVERRIDE.
      
      The ACPI_TABLE_ORIGIN_xxTERN_VIRTUAL flags are named as VIRTUAL in order
      not to confuse with x86 logical address, this patch also renames all
      "logical override" into "virtual override".
      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>
      8a216d7f
    • L
      ACPICA: Tables: Clean up split INSTALLED/VALIDATED table state logics. · 7f9fc99c
      Lv Zheng 提交于
      This patch is mainly a naming cleanup to clarify hidden logics, no
      functional changes.
      
      acpi_initialize_tables() is used by Linux to install table addresses for
      early boot steps.  During this stage, table addresses are mapped by
      early_ioremap() mechanism which is different from the runtime IO mappings.
      Thus it is not safe for ACPICA to keep mapped pointers in struct acpi_table_desc
      structure during this stage.
      
      In order to support this in ACPICA, table states are divided into
      1. "INSTALLED" (where struct acpi_table_desc.Pointer is always NULL) and
      2. "VALIDATED" (where struct acpi_table_desc.Pointer is always not NULL).
      During acpi_initialize_tables(), table state are ensured to be "INSTALLED"
      but not "VALIDATED".  This logic is ensured by the original code in very
      ambigious way.  For example, currently acpi_tb_delete_table() is invoked in
      some place to perform an uninstallation while it is invoked in other place
      to perform an invalidation.  They happen to work just because no one enters
      the penalty where the 2 behaviours are not equivalent.
      
      The naming cleanups are made in this patch:
      A. For installation and validation:
         There is code setting struct acpi_table_desc.Pointer first and delete it
         immediately to keep the descriptor's state as "INSTALLED" during the
         installation.  This patch implements this in more direct way.  After
         applying it, struct acpi_table_desc.Pointer will never be set in
         acpi_tb_install_table() and acpi_tb_override_table() as they are the only
         functions invoked during acpi_initialize_tables(). This is achieved by:
      1. Rename acpi_tb_verify_table() to acpi_tb_validate_table() to clarify this
         change.
      2. Rename acpi_tb_table_override() to acpi_tb_override_table() to keep nameing
         consistencies as other APIs (verb. Table).
      3. Stops setting struct acpi_table_desc.Pointer in acpi_tb_install_table() and
         acpi_tb_table_override().
      4. Introduce acpi_tb_acquire_table() to acquire the table pointer that is not
         maintained in the struct acpi_table_desc of the global root table list and
         rewrite acpi_tb_validate_table() using this new function to reduce
         redundancies.
      5. Replace the table pointer using the overridden table pointer in
         acpi_tb_add_table(). As acpi_tb_add_table() is not invoked during early boot
         stage, tables returned from this functions should be "VALIDATED".  As
         acpi_tb_override_table() is modified by this patch to return a "INSTALLED"
         but not "VALIDATED" descriptor, to keep acpi_tb_add_table() unchanged,
         struct acpi_table_desc.Pointer is filled in acpi_tb_add_table().
      B. For invalidation and uninstallation:
         The original code invalidate table by invoking acpi_tb_delete_table() here
         and there, but actually this function should only be used to uninstall
         tables.  This can work just because its invocations are equivalent to
         invalidation in some cases.
         This patch splits acpi_tb_delete_table() into acpi_tb_invalidate_table() and
         acpi_tb_uninstall_table() and cleans up the hidden logic using the new
         APIs.  This is achieved by:
      1. Rename acpi_tb_delete_table() to acpi_tb_uninstall_table() as it is mainly
         called before resetting struct acpi_table_desc.Address.  Thus the table
         descriptor is in "not INSTALLED" state.  This patch enforces this by
         setting struct acpi_table_desc.Address to NULL in this function.
      2. Introduce acpi_tb_invalidate_table() to be the reversal of
         acpi_tb_validate_table() and invoke it in acpi_tb_uninstall_table().
      3. Introduce acpi_tb_release_table() to release the table pointer that is not
         maintained in acpi_gbl_root_table_list and rewrite acpi_tb_invalidate_table()
         using this new function to reduce redundancies.
      
      After cleaning up, the maintainability of the internal APIs are also
      improved:
      1. acpi_tb_acquire_table: Acquire struct acpi_table_header according to
                             ACPI_TABLE_ORIGIN_xxx flags.
      2. acpi_tb_release_table: Release struct acpi_table_header according to
                             ACPI_TABLE_ORIGIN_xxx flags.
      3. acpi_tb_install_table: Make struct acpi_table_desc.Address not NULL according to
                             ACPI_TABLE_ORIGIN_xxx flags.
      4. acpi_tb_uninstall_table: Make struct acpi_table_desc.Address NULL according to
                               ACPI_TABLE_ORIGIN_xxx flags.
      5. acpi_tb_validate_table: Make struct acpi_table_desc.Pointer not NULL according to
                              ACPI_TABLE_ORIGIN_xxx flags.
      6. acpi_tb_invalidate_table: Make struct acpi_table_desc.Pointer NULL according to
                                ACPI_TABLE_ORIGIN_xxx flags.
      7. acpi_tb_override_table: Replace struct acpi_table_desc.Address and
                              struct acpi_table_desc.Flags.  It only happens in
                              "INSTALLED" state.
      
      The patch has been unit tested in acpi_exec by:
      1. Initializing;
      2. Executing exc_tbl ASLTS tests;
      3. Executing "Load" command.
      So that all original acpi_tb_install_table() and acpi_tb_override_table()
      invocations are covered.
      
      Known Issues:
      1. Cleanup acpi_tb_add_table() to Kill Code Redundancies
         Current implementation in acpi_tb_add_table() is not very clean, further
         patch can rewrite acpi_tb_add_table() with ordered acpi_tb_install_table(),
         acpi_tb_override_table() and acpi_tb_validate_table(). It is not done in this
         patch so that it is easy for the reviewers to understand the changes in
         this patch.
      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>
      7f9fc99c
    • L
      ACPICA: Remove indent divergences to reduce maintenance overhead. · 5582982d
      Lv Zheng 提交于
      The divergences in the ACPICA files makes it difficult to maintain linuxize
      ACPICA table commits.  This patch reduces such divergences before applying
      table manager commits so that human interventions of patch rebasing can be
      reduced.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      [rjw: Subject]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      5582982d
  12. 11 2月, 2014 1 次提交
  13. 31 10月, 2013 4 次提交
  14. 12 4月, 2013 1 次提交
  15. 25 1月, 2013 1 次提交
  16. 11 1月, 2013 1 次提交
  17. 10 1月, 2013 1 次提交
    • L
      ACPICA: Cleanup source to reduce differences between Linux and ACPICA. · 739dcbb9
      Lv Zheng 提交于
      This is a cosmetic patch only. Comparison of the resulting binary showed
      only line number differences.
      
      This patch does not affect the generation of the Linux binary.
      This patch decreases 389 lines of 20121018 divergence.diff.
      
      This patch reduces source code diff caused by the simple code maintenance
      work:
      1. Deletion of the unused include files.
      2. Deletion of the deprecated codes blocks.
      3. Repositioning of the code blocks.
      4. Replacing the values with the well defined macros.
      5. Replacing the types with the equivalent types.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      739dcbb9
  18. 15 11月, 2012 1 次提交
  19. 21 9月, 2012 1 次提交
  20. 20 8月, 2012 1 次提交
  21. 17 7月, 2012 3 次提交
  22. 17 1月, 2012 1 次提交
  23. 01 11月, 2011 1 次提交
  24. 19 1月, 2011 1 次提交
  25. 06 5月, 2010 1 次提交
  26. 20 4月, 2010 4 次提交
  27. 23 1月, 2010 1 次提交
  28. 27 3月, 2009 2 次提交