• Y
    LoongArch: extable: Add a dedicated uaccess handler · 7e828480
    Youling Tang 提交于
    mainline inclusion
    from mainline-v6.2-rc1
    commit 672999cf
    category: feature
    bugzilla: https://gitee.com/openeuler/kernel/issues/I6BWFP
    CVE: NA
    
    --------------------------------
    
    Inspired by commit 2e77a62c("arm64: extable: add a dedicated uaccess
    handler"), do similar to LoongArch to add a dedicated uaccess exception
    handler to update registers in exception context and subsequently return
    back into the function which faulted, so we remove the need for fixups
    specialized to each faulting instruction.
    
    Add gpr-num.h here because we need to map the same GPR names to integer
    constants, so that we can use this to build meta-data for the exception
    fixups.
    
    The compiler treats gpr 0 as zero rather than $r0, so set it separately
    to .L__gpr_num_zero, otherwise the following assembly error will occurs:
    
    {standard input}: Assembler messages:
    {standard input}:1074: Error: invalid operands (*UND* and *ABS* sections) for `<<'
    {standard input}:1160: Error: invalid operands (*UND* and *ABS* sections) for `<<'
    make[1]: *** [scripts/Makefile.build:249: fs/fcntl.o] Error 1
    Signed-off-by: NYouling Tang <tangyouling@loongson.cn>
    Signed-off-by: NHuacai Chen <chenhuacai@loongson.cn>
    Change-Id: Ifda81e961c8147c6f652891802dc6b5354bb5491
    7e828480
extable.c 1.4 KB