Commit 92bb8d5d authored by Jisheng Zhang's avatar Jisheng Zhang Committed by Russell King

ARM: 8597/1: VDSO: put RO and RO after init objects into proper sections

vdso_data_mapping is never modified, so mark it as const.

vdso_total_pages, vdso_data_page, vdso_text_mapping and cntvct_ok are
initialized by vdso_init(), thereafter are read only.

The fact that they are read only after init makes them candidates for
__ro_after_init declarations.
Signed-off-by: default avatarJisheng Zhang <jszhang@marvell.com>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Acked-by: default avatarNathan Lynch <nathan_lynch@mentor.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent bcd3006f
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <linux/cache.h>
#include <linux/elf.h> #include <linux/elf.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -39,7 +40,7 @@ ...@@ -39,7 +40,7 @@
static struct page **vdso_text_pagelist; static struct page **vdso_text_pagelist;
/* Total number of pages needed for the data and text portions of the VDSO. */ /* Total number of pages needed for the data and text portions of the VDSO. */
unsigned int vdso_total_pages __read_mostly; unsigned int vdso_total_pages __ro_after_init;
/* /*
* The VDSO data page. * The VDSO data page.
...@@ -47,13 +48,13 @@ unsigned int vdso_total_pages __read_mostly; ...@@ -47,13 +48,13 @@ unsigned int vdso_total_pages __read_mostly;
static union vdso_data_store vdso_data_store __page_aligned_data; static union vdso_data_store vdso_data_store __page_aligned_data;
static struct vdso_data *vdso_data = &vdso_data_store.data; static struct vdso_data *vdso_data = &vdso_data_store.data;
static struct page *vdso_data_page; static struct page *vdso_data_page __ro_after_init;
static struct vm_special_mapping vdso_data_mapping = { static const struct vm_special_mapping vdso_data_mapping = {
.name = "[vvar]", .name = "[vvar]",
.pages = &vdso_data_page, .pages = &vdso_data_page,
}; };
static struct vm_special_mapping vdso_text_mapping = { static struct vm_special_mapping vdso_text_mapping __ro_after_init = {
.name = "[vdso]", .name = "[vdso]",
}; };
...@@ -67,7 +68,7 @@ struct elfinfo { ...@@ -67,7 +68,7 @@ struct elfinfo {
/* Cached result of boot-time check for whether the arch timer exists, /* Cached result of boot-time check for whether the arch timer exists,
* and if so, whether the virtual counter is useable. * and if so, whether the virtual counter is useable.
*/ */
static bool cntvct_ok __read_mostly; static bool cntvct_ok __ro_after_init;
static bool __init cntvct_functional(void) static bool __init cntvct_functional(void)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment