From 5c63aad7c299d27cf5ba6d63b005ee0a71c8fe86 Mon Sep 17 00:00:00 2001 From: Ajay Nandakumar Date: Tue, 6 Feb 2018 17:54:03 +0530 Subject: [PATCH] platform: nvadsp: do not export da to va mappings nvadsp_da_to_va_mappings API provides the ability to get the virtual address from the physical address. This API does not need to be exposed as there are no other modules using it and prevent prevent speculative load related leak. Bug 200381256 Change-Id: Ic94497ca40402101e4246b914f00e030551b0c4c Signed-off-by: Ajay Nandakumar Reviewed-on: https://git-master.nvidia.com/r/1652771 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/platform/tegra/nvadsp/dev.c | 4 ++-- drivers/platform/tegra/nvadsp/os.c | 5 ++--- drivers/platform/tegra/nvadsp/os.h | 5 +++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/platform/tegra/nvadsp/dev.c b/drivers/platform/tegra/nvadsp/dev.c index 03cb86d4..6560297b 100644 --- a/drivers/platform/tegra/nvadsp/dev.c +++ b/drivers/platform/tegra/nvadsp/dev.c @@ -3,7 +3,7 @@ * * A device driver for ADSP and APE * - * Copyright (C) 2014-2017, NVIDIA Corporation. All rights reserved. + * Copyright (C) 2014-2018, NVIDIA Corporation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -282,7 +282,7 @@ static int __init nvadsp_probe(struct platform_device *pdev) goto out; } drv_data->base_regs[iter] = base; - adsp_add_load_mappings(res->start, base, + nvadsp_add_load_mappings(res->start, base, resource_size(res)); } diff --git a/drivers/platform/tegra/nvadsp/os.c b/drivers/platform/tegra/nvadsp/os.c index 1df4d194..7befb63b 100644 --- a/drivers/platform/tegra/nvadsp/os.c +++ b/drivers/platform/tegra/nvadsp/os.c @@ -309,7 +309,7 @@ bool is_adsp_dram_addr(u64 addr) return false; } -int adsp_add_load_mappings(phys_addr_t pa, void *mapping, int len) +int nvadsp_add_load_mappings(phys_addr_t pa, void *mapping, int len) { if (map_idx >= NM_LOAD_MAPPINGS) return -EINVAL; @@ -342,7 +342,6 @@ void *nvadsp_da_to_va_mappings(u64 da, int len) } return ptr; } -EXPORT_SYMBOL(nvadsp_da_to_va_mappings); void *nvadsp_alloc_coherent(size_t size, dma_addr_t *da, gfp_t flags) { @@ -623,7 +622,7 @@ static int allocate_memory_for_adsp_os(void) goto end; } #endif - adsp_add_load_mappings(addr, dram_va, size); + nvadsp_add_load_mappings(addr, dram_va, size); end: return ret; } diff --git a/drivers/platform/tegra/nvadsp/os.h b/drivers/platform/tegra/nvadsp/os.h index 624b94c9..e89503c7 100644 --- a/drivers/platform/tegra/nvadsp/os.h +++ b/drivers/platform/tegra/nvadsp/os.h @@ -3,7 +3,7 @@ * * A header file containing data structures shared with ADSP OS * - * Copyright (C) 2014-2017 NVIDIA Corporation. All rights reserved. + * Copyright (C) 2014-2018 NVIDIA Corporation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -160,7 +160,8 @@ static inline int nvadsp_os_init(struct platform_device *pdev) int nvadsp_os_probe(struct platform_device *); int nvadsp_app_module_probe(struct platform_device *); -int adsp_add_load_mappings(phys_addr_t, void *, int); +void *nvadsp_da_to_va_mappings(u64 da, int len); +int nvadsp_add_load_mappings(phys_addr_t pa, void *mapping, int len); struct elf32_shdr *nvadsp_get_section(const struct firmware *, char *); struct global_sym_info *find_global_symbol(const char *); void update_nvadsp_app_shared_ptr(void *);