ia64: Rename 'ip' to 'addr' in 'struct fdesc'
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Tue, 15 Feb 2022 12:41:01 +0000 (13:41 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 16 Feb 2022 12:25:11 +0000 (23:25 +1100)
There are three architectures with function descriptors, try to
have common names for the address they contain in order to
refactor some functions into generic functions later.

powerpc has 'entry'
ia64 has 'ip'
parisc has 'addr'

Vote for 'addr' and update 'struct fdesc' accordingly.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/65b73ac614e4c002c5819d40b42f6f426d2ee52b.1644928018.git.christophe.leroy@csgroup.eu
arch/ia64/include/asm/elf.h
arch/ia64/include/asm/sections.h
arch/ia64/kernel/module.c

index 6629301a26205ef384d57485ca1375c644ae8ea0..2ef5f9966ad18fe620054f0e34a98c41de588c91 100644 (file)
@@ -226,7 +226,7 @@ struct got_entry {
  * Layout of the Function Descriptor
  */
 struct fdesc {
-       uint64_t ip;
+       uint64_t addr;
        uint64_t gp;
 };
 
index 3a033d2008b3c5d87e7741c667b84d13769d1790..35f24e52149a63aa54f6824aae759a1b6b377398 100644 (file)
@@ -35,7 +35,7 @@ static inline void *dereference_function_descriptor(void *ptr)
        struct fdesc *desc = ptr;
        void *p;
 
-       if (!get_kernel_nofault(p, (void *)&desc->ip))
+       if (!get_kernel_nofault(p, (void *)&desc->addr))
                ptr = p;
        return ptr;
 }
index 360f36b0eb3ff59e5be17f44d86fca1eb0f98ba1..8f62cf97f691aea5e491f635d81edffdb89ab510 100644 (file)
@@ -602,15 +602,15 @@ get_fdesc (struct module *mod, uint64_t value, int *okp)
                return value;
 
        /* Look for existing function descriptor. */
-       while (fdesc->ip) {
-               if (fdesc->ip == value)
+       while (fdesc->addr) {
+               if (fdesc->addr == value)
                        return (uint64_t)fdesc;
                if ((uint64_t) ++fdesc >= mod->arch.opd->sh_addr + mod->arch.opd->sh_size)
                        BUG();
        }
 
        /* Create new one */
-       fdesc->ip = value;
+       fdesc->addr = value;
        fdesc->gp = mod->arch.gp;
        return (uint64_t) fdesc;
 }