Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e991aa38 authored by Amit Pundir's avatar Amit Pundir
Browse files

ANDROID: arm64: fix undeclared 'init_thread_info' error



init_thread_info is deprecated in favour of THREAD_INFO_IN_TASK
related changes, see Change-Id: Ia4769ddcc6fc556e9eb6193d64fc99fe2d9e39ab
("UPSTREAM: arm64: thread_info remove stale items").

Use init_task.thread_info instead, to fix following build error:

arch/arm64/kernel/setup.c: In function 'setup_arch':
arch/arm64/kernel/setup.c:356:2: error: 'init_thread_info' undeclared (first use in this function)
  init_thread_info.ttbr0 = virt_to_phys(empty_zero_page);
  ^

Change-Id: I13bf03211f0d918d388d1436099d286c10a23e5d
Fixes: Change-Id: I85a49f70e13b153b9903851edf56f6531c14e6de
       ("BACKPORT: arm64: Disable TTBR0_EL1 during normal kernel execution")
Fixes: Change-Id: Ia4769ddcc6fc556e9eb6193d64fc99fe2d9e39ab
       ("UPSTREAM: arm64: thread_info remove stale items")
Signed-off-by: default avatarAmit Pundir <amit.pundir@linaro.org>
parent c932c1b7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -90,6 +90,8 @@ static inline struct thread_info *current_thread_info(void)

	return (struct thread_info *)sp_el0;
}

#define init_thread_info	(init_thread_union.thread_info)
#endif

#define init_stack		(init_thread_union.stack)
+6 −2
Original line number Diff line number Diff line
@@ -349,11 +349,15 @@ void __init setup_arch(char **cmdline_p)

#ifdef CONFIG_ARM64_SW_TTBR0_PAN
	/*
	 * Make sure init_thread_info.ttbr0 always generates translation
	 * Make sure thread_info.ttbr0 always generates translation
	 * faults in case uaccess_enable() is inadvertently called by the init
	 * thread.
	 */
	init_thread_info.ttbr0 = virt_to_phys(empty_zero_page);
#ifdef CONFIG_THREAD_INFO_IN_TASK
	init_task.thread_info.ttbr0 = virt_to_phys(empty_zero_page);
#else
	init_thread_info.ttbr0 = (init_thread_union.thread_info);
#endif
#endif

#ifdef CONFIG_VT