angler-fishThe Vulnerability History Project

s390: remove all code using the access register mode

      The vdso code for the getcpu() and the clock_gettime() call use the access
register mode to access the per-CPU vdso data page with the current code.

An alternative to the complicated AR mode is to use the secondary space
mode. This makes the vdso faster and quite a bit simpler. The downside is
that the uaccess code has to be changed quite a bit.

Which instructions are used depends on the machine and what kind of uaccess
operation is requested. The instruction dictates which ASCE value needs
to be loaded into %cr1 and %cr7.

The different cases:

* User copy with MVCOS for z10 and newer machines
  The MVCOS instruction can copy between the primary space (aka user) and
  the home space (aka kernel) directly. For set_fs(KERNEL_DS) the kernel
  ASCE is loaded into %cr1. For set_fs(USER_DS) the user space is already
  loaded in %cr1.

* User copy with MVCP/MVCS for older machines
  To be able to execute the MVCP/MVCS instructions the ke
    
commit 0aaba41b58bc5f3074c0c0a6136b9500b5e29e19
+6 -3
+14 -19
+16 -20
+1 -3
+9 -20
+1 -1
+21 -5
+1 -1
+4 -40
+2 -14
+4 -15
+2 -13
+80 -10
+65 -43
+1
+1 -3
expand_less