Re: [PATCH v4 7/7] ACPI / x86: introduce acpi_os_readable() support

From: Andy Lutomirski
Date: Mon Dec 14 2015 - 18:28:44 EST


On Wed, Dec 2, 2015 at 6:43 PM, Lv Zheng <lv.zheng@xxxxxxxxx> wrote:
> From: Chen Yu <yu.c.chen@xxxxxxxxx>
>
> This patch implements acpi_os_readable(). The function is used by ACPICA
> AML debugger to validate user specified pointers for dumping the memory as
> ACPICA descriptor objects.
>
> Signed-off-by: Chen Yu <yu.c.chen@xxxxxxxxx>
> Tested-by: Lv Zheng <lv.zheng@xxxxxxxxx>
> Signed-off-by: Lv Zheng <lv.zheng@xxxxxxxxx>
> ---
> arch/x86/Kconfig | 1 +
> arch/x86/include/asm/acenv.h | 1 +
> arch/x86/kernel/acpi/boot.c | 44 +++++++++++++++++++++++++++++++++++++
> drivers/acpi/Kconfig | 3 +++
> drivers/acpi/osl.c | 12 ++++++++++
> include/acpi/platform/aclinux.h | 1 -
> include/acpi/platform/aclinuxex.h | 5 -----
> 7 files changed, 61 insertions(+), 6 deletions(-)
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index db3622f..6593b6a 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -19,6 +19,7 @@ config X86
> def_bool y
> select ACPI_LEGACY_TABLES_LOOKUP if ACPI
> select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI
> + select ACPI_MEMORY_ACCESS_CHECK_SUPPORT if ACPI
> select ANON_INODES
> select ARCH_CLOCKSOURCE_DATA
> select ARCH_DISCARD_MEMBLOCK
> diff --git a/arch/x86/include/asm/acenv.h b/arch/x86/include/asm/acenv.h
> index 1b010a8..a2a2849 100644
> --- a/arch/x86/include/asm/acenv.h
> +++ b/arch/x86/include/asm/acenv.h
> @@ -20,6 +20,7 @@
>
> int __acpi_acquire_global_lock(unsigned int *lock);
> int __acpi_release_global_lock(unsigned int *lock);
> +bool __acpi_memory_readable(void *pointer, size_t length);
>
> #define ACPI_ACQUIRE_GLOBAL_LOCK(facs, Acq) \
> ((Acq) = __acpi_acquire_global_lock(&facs->global_lock))
> diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
> index e759076..4a5e22e 100644
> --- a/arch/x86/kernel/acpi/boot.c
> +++ b/arch/x86/kernel/acpi/boot.c
> @@ -1699,6 +1699,50 @@ int __acpi_release_global_lock(unsigned int *lock)
> return old & 0x1;
> }
>
> +bool __acpi_memory_readable(void *pointer, size_t length)
> +{
> + unsigned long obj_start, obj_end;
> + unsigned long start_pfn, end_pfn;

What does "readable" mean in this context?

--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/