vdso.c (c9f289701540baeef9ac7c9977d67a7259f404db) vdso.c (0a7601b6ffddec11d7cc0bc3264daf0159f5e1a6)
1// SPDX-License-Identifier: GPL-2.0-or-later
2
3/*
4 * Copyright (C) 2004 Benjamin Herrenschmidt, IBM Corp.
5 * <benh@kernel.crashing.org>
6 */
7
8#include <linux/errno.h>

--- 377 unchanged lines hidden (view full) ---

386{
387 Elf64_Sym *sym = find_symbol64(lib, symname);
388
389 if (sym == NULL) {
390 printk(KERN_WARNING "vDSO64: function %s not found !\n",
391 symname);
392 return 0;
393 }
1// SPDX-License-Identifier: GPL-2.0-or-later
2
3/*
4 * Copyright (C) 2004 Benjamin Herrenschmidt, IBM Corp.
5 * <benh@kernel.crashing.org>
6 */
7
8#include <linux/errno.h>

--- 377 unchanged lines hidden (view full) ---

386{
387 Elf64_Sym *sym = find_symbol64(lib, symname);
388
389 if (sym == NULL) {
390 printk(KERN_WARNING "vDSO64: function %s not found !\n",
391 symname);
392 return 0;
393 }
394#ifdef VDS64_HAS_DESCRIPTORS
395 return *((u64 *)(vdso64_kbase + sym->st_value - VDSO64_LBASE)) -
396 VDSO64_LBASE;
397#else
398 return sym->st_value - VDSO64_LBASE;
394 return sym->st_value - VDSO64_LBASE;
399#endif
400}
401
402static int __init vdso_do_func_patch64(struct lib32_elfinfo *v32,
403 struct lib64_elfinfo *v64,
404 const char *orig, const char *fix)
405{
406 Elf64_Sym *sym64_gen, *sym64_fix;
407

--- 243 unchanged lines hidden (view full) ---

651 extern unsigned long sys_ni_syscall;
652
653
654 for (i = 0; i < NR_syscalls; i++) {
655#ifdef CONFIG_PPC64
656 if (sys_call_table[i] != sys_ni_syscall)
657 vdso_data->syscall_map_64[i >> 5] |=
658 0x80000000UL >> (i & 0x1f);
395}
396
397static int __init vdso_do_func_patch64(struct lib32_elfinfo *v32,
398 struct lib64_elfinfo *v64,
399 const char *orig, const char *fix)
400{
401 Elf64_Sym *sym64_gen, *sym64_fix;
402

--- 243 unchanged lines hidden (view full) ---

646 extern unsigned long sys_ni_syscall;
647
648
649 for (i = 0; i < NR_syscalls; i++) {
650#ifdef CONFIG_PPC64
651 if (sys_call_table[i] != sys_ni_syscall)
652 vdso_data->syscall_map_64[i >> 5] |=
653 0x80000000UL >> (i & 0x1f);
659 if (compat_sys_call_table[i] != sys_ni_syscall)
654 if (IS_ENABLED(CONFIG_COMPAT) &&
655 compat_sys_call_table[i] != sys_ni_syscall)
660 vdso_data->syscall_map_32[i >> 5] |=
661 0x80000000UL >> (i & 0x1f);
662#else /* CONFIG_PPC64 */
663 if (sys_call_table[i] != sys_ni_syscall)
664 vdso_data->syscall_map_32[i >> 5] |=
665 0x80000000UL >> (i & 0x1f);
666#endif /* CONFIG_PPC64 */
667 }

--- 130 unchanged lines hidden ---
656 vdso_data->syscall_map_32[i >> 5] |=
657 0x80000000UL >> (i & 0x1f);
658#else /* CONFIG_PPC64 */
659 if (sys_call_table[i] != sys_ni_syscall)
660 vdso_data->syscall_map_32[i >> 5] |=
661 0x80000000UL >> (i & 0x1f);
662#endif /* CONFIG_PPC64 */
663 }

--- 130 unchanged lines hidden ---