[lkml]   [2015]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[PATCH 08/31] ACPICA: Utilities: split IO address types from data type models.
    ACPICA commit aacf863cfffd46338e268b7415f7435cae93b451

    It is reported that on a physically 64-bit addressed machine, 32-bit kernel
    can trigger crashes in accessing the memory regions that are beyond the
    32-bit boundary. The region field's start address should still be 32-bit
    compliant, but after a calculation (adding some offsets), it may exceed the
    32-bit boundary. This case is rare and buggy, but there are real BIOSes
    leaked with such issues (see References below).

    This patch fixes this gap by always defining IO addresses as 64-bit, and
    allows OSPMs to optimize it for a real 32-bit machine to reduce the size of
    the internal objects.

    Internal acpi_physical_address usages in the structures that can be fixed
    by this change include:
    1. struct acpi_object_region:
    acpi_physical_address address;
    2. struct acpi_address_range:
    acpi_physical_address start_address;
    acpi_physical_address end_address;
    3. struct acpi_mem_space_context;
    acpi_physical_address address;
    4. struct acpi_table_desc
    acpi_physical_address address;
    See known issues 1 for other usages.

    Note that acpi_io_address which is used for ACPI_PROCESSOR may also suffer
    from same problem, so this patch changes it accordingly.

    For iasl, it will enforce acpi_physical_address as 32-bit to generate
    32-bit OSPM compatible tables on 32-bit platforms, we need to define
    ACPI_32BIT_PHYSICAL_ADDRESS for it in acenv.h.

    Known issues:
    1. Cleanup of mapped virtual address
    In struct acpi_mem_space_context, acpi_physical_address is used as a virtual
    acpi_physical_address mapped_physical_address;
    It is better to introduce acpi_virtual_address or use acpi_size instead.
    This patch doesn't make such a change. Because this should be done along
    with a change to acpi_os_map_memory()/acpi_os_unmap_memory().
    There should be no functional problem to leave this unchanged except
    that only this structure is enlarged unexpectedly.

    Reported-and-tested-by: Paul Menzel <>
    Reported-and-tested-by: Sial Nije <>
    Signed-off-by: Lv Zheng <>
    Signed-off-by: Bob Moore <>
    Cc: <>
    include/acpi/actypes.h | 20 ++++++++++++++++++++
    include/acpi/platform/acenv.h | 1 +
    2 files changed, 21 insertions(+)

    diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
    index b034f10..658c42e 100644
    --- a/include/acpi/actypes.h
    +++ b/include/acpi/actypes.h
    @@ -199,9 +199,29 @@ typedef int s32;
    typedef s32 acpi_native_int;

    typedef u32 acpi_size;
    + * OSPMs can define this to shrink the size of the structures for 32-bit
    + * none PAE environment. ASL compiler may always define this to generate
    + * 32-bit OSPM compliant tables.
    + */
    typedef u32 acpi_io_address;
    typedef u32 acpi_physical_address;

    +#else /* ACPI_32BIT_PHYSICAL_ADDRESS */
    + * It is reported that, after some calculations, the physical addresses can
    + * wrap over the 32-bit boundary on 32-bit PAE environment.
    + *
    + */
    +typedef u64 acpi_io_address;
    +typedef u64 acpi_physical_address;
    +#endif /* ACPI_32BIT_PHYSICAL_ADDRESS */

    diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
    index ad74dc5..ecdf940 100644
    --- a/include/acpi/platform/acenv.h
    +++ b/include/acpi/platform/acenv.h
    @@ -76,6 +76,7 @@

    /* acpi_exec configuration. Multithreaded with full AML debugger */

     \ /
      Last update: 2015-04-13 06:21    [W:2.281 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site