Files
android_kernel_xiaomi_sm8450/arch/mips/include/asm
Paul Burton 08eeb44b24 MIPS: Use read-write output operand in __write_64bit_c0_split()
Commit c22c804310 ("MIPS: Fix input modify in
__write_64bit_c0_split()") modified __write_64bit_c0_split() constraints
such that we have both an input & an output which we hope to assign to
the same registers, and modify the output rather than incorrectly
clobbering an input.

The way in which we use both an output & an input parameter with the
input constrained to share the output registers is a little convoluted &
also problematic for clang, which complains if the input & output values
have different widths. For example:

  In file included from kernel/fork.c:98:
  ./arch/mips/include/asm/mmu_context.h:149:19: error: unsupported
    inline asm: input with type 'unsigned long' matching output with
    type 'unsigned long long'
          write_c0_entryhi(cpu_asid(cpu, next));
          ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
  ./arch/mips/include/asm/mmu_context.h:93:2: note: expanded from macro
    'cpu_asid'
          (cpu_context((cpu), (mm)) & cpu_asid_mask(&cpu_data[cpu]))
          ^
  ./arch/mips/include/asm/mipsregs.h:1617:65: note: expanded from macro
    'write_c0_entryhi'
  #define write_c0_entryhi(val)   __write_ulong_c0_register($10, 0, val)
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
  ./arch/mips/include/asm/mipsregs.h:1430:39: note: expanded from macro
    '__write_ulong_c0_register'
                  __write_64bit_c0_register(reg, sel, val);               \
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
  ./arch/mips/include/asm/mipsregs.h:1400:41: note: expanded from macro
    '__write_64bit_c0_register'
                  __write_64bit_c0_split(register, sel, value);           \
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
  ./arch/mips/include/asm/mipsregs.h:1498:13: note: expanded from macro
    '__write_64bit_c0_split'
                          : "r,0" (val));                                 \
                                   ^~~

We can both fix this build failure & simplify the code somewhat by
assigning the __tmp variable with the input value in C prior to our
inline assembly, and then using a single read-write output operand (ie.
a constraint beginning with +) to provide this value to our assembly.

Signed-off-by: Paul Burton <paul.burton@mips.com>
2018-08-07 10:33:35 -07:00
..
2018-06-24 09:26:04 -07:00
2017-11-03 09:02:30 -07:00
2016-04-03 12:32:09 +02:00
2017-09-06 11:01:52 +02:00
2018-01-24 11:17:20 +00:00
2017-08-29 15:21:51 +02:00
2018-07-27 15:19:59 -07:00
2017-11-03 09:02:30 -07:00
2014-08-26 02:18:56 +02:00
2016-05-28 12:35:06 +02:00
2018-07-24 10:02:24 -07:00
2017-11-03 09:02:30 -07:00
2017-11-03 09:02:30 -07:00
2017-11-03 09:02:30 -07:00
2017-11-03 09:02:30 -07:00
2017-11-03 09:02:30 -07:00
2018-05-07 07:15:41 +02:00
2017-06-08 14:51:58 +02:00
2017-11-15 18:21:03 -08:00
2017-11-03 09:02:30 -07:00
2017-03-28 16:43:25 -04:00
2014-08-02 00:06:38 +02:00
2016-04-03 12:32:09 +02:00
2018-08-01 13:20:15 -07:00
2017-11-03 09:02:30 -07:00
2017-06-28 12:22:39 +02:00
2017-05-27 15:38:02 -04:00
2016-05-09 12:00:02 +02:00
2017-11-03 09:02:30 -07:00