Paul Mackerras 7854f7545b KVM: PPC: Book3S: Rework TM save/restore code and make it C-callable
This adds a parameter to __kvmppc_save_tm and __kvmppc_restore_tm
which allows the caller to indicate whether it wants the nonvolatile
register state to be preserved across the call, as required by the C
calling conventions.  This parameter being non-zero also causes the
MSR bits that enable TM, FP, VMX and VSX to be preserved.  The
condition register and DSCR are now always preserved.

With this, kvmppc_save_tm_hv and kvmppc_restore_tm_hv can be called
from C code provided the 3rd parameter is non-zero.  So that these
functions can be called from modules, they now include code to set
the TOC pointer (r2) on entry, as they can call other built-in C
functions which will assume the TOC to have been set.

Also, the fake suspend code in kvmppc_save_tm_hv is modified here to
assume that treclaim in fake-suspend state does not modify any registers,
which is the case on POWER9.  This enables the code to be simplified
quite a bit.

_kvmppc_save_tm_pr and _kvmppc_restore_tm_pr become much simpler with
this change, since they now only need to save and restore TAR and pass
1 for the 3rd argument to __kvmppc_{save,restore}_tm.

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2018-10-09 16:04:27 +11:00
..
2018-08-17 11:32:50 -07:00
2015-05-28 15:31:53 +02:00
2015-01-12 05:04:13 -08:00
2015-02-03 18:47:18 +01:00
2016-03-04 23:50:27 -06:00
2018-06-03 20:32:02 +10:00
2018-06-07 10:23:33 -07:00
2018-08-17 11:32:50 -07:00
2016-03-01 19:27:20 +11:00
2018-05-07 07:15:41 +02:00
2017-11-16 12:47:46 -08:00
2017-11-16 12:47:46 -08:00
2016-06-14 13:58:26 +10:00
2016-06-14 13:58:26 +10:00
2018-08-19 10:38:36 -07:00
2018-05-25 12:04:43 +10:00
2018-06-03 21:19:40 +10:00
2018-01-15 09:35:26 +01:00
2018-06-23 21:43:21 +10:00
2018-06-03 20:43:34 +10:00
2018-07-30 22:48:21 +10:00
2016-06-14 13:58:26 +10:00
2018-06-23 21:43:21 +10:00
2017-11-12 09:03:10 +11:00
2015-05-05 13:35:39 -06:00