|
|
8de16c |
commit c2894790640da2c0761924ff1b06efddbdfa031e
|
|
|
8de16c |
Author: Segher Boessenkool <segher@kernel.crashing.org>
|
|
|
8de16c |
Date: Fri Aug 30 16:15:39 2019 +0200
|
|
|
8de16c |
|
|
|
8de16c |
backport: re PR target/91481 (POWER9 "DARN" RNG intrinsic produces repeated output (CVE-2019-15847))
|
|
|
8de16c |
|
|
|
8de16c |
Backport from trunk
|
|
|
8de16c |
2019-08-22 Segher Boessenkool <segher@kernel.crashing.org>
|
|
|
8de16c |
|
|
|
8de16c |
PR target/91481
|
|
|
8de16c |
* config/rs6000/rs6000.md (unspec): Delete UNSPEC_DARN, UNSPEC_DARN_32,
|
|
|
8de16c |
and UNSPEC_DARN_RAW.
|
|
|
8de16c |
(unspecv): New enumerator values UNSPECV_DARN, UNSPECV_DARN_32, and
|
|
|
8de16c |
UNSPECV_DARN_RAW.
|
|
|
8de16c |
(darn_32): Use an unspec_volatile, and UNSPECV_DARN_32.
|
|
|
8de16c |
(darn_raw): Use an unspec_volatile, and UNSPECV_DARN_RAW.
|
|
|
8de16c |
(darn): Use an unspec_volatile, and UNSPECV_DARN.
|
|
|
8de16c |
|
|
|
8de16c |
From-SVN: r275181
|
|
|
8de16c |
|
|
|
8de16c |
--- gcc/config/rs6000/rs6000.md
|
|
|
8de16c |
+++ gcc/config/rs6000/rs6000.md
|
|
|
8de16c |
@@ -136,9 +136,6 @@
|
|
|
8de16c |
UNSPEC_LSQ
|
|
|
8de16c |
UNSPEC_FUSION_GPR
|
|
|
8de16c |
UNSPEC_STACK_CHECK
|
|
|
8de16c |
- UNSPEC_DARN
|
|
|
8de16c |
- UNSPEC_DARN_32
|
|
|
8de16c |
- UNSPEC_DARN_RAW
|
|
|
8de16c |
UNSPEC_CMPRB
|
|
|
8de16c |
UNSPEC_CMPRB2
|
|
|
8de16c |
UNSPEC_CMPEQB
|
|
|
8de16c |
@@ -168,6 +165,9 @@
|
|
|
8de16c |
UNSPECV_EH_RR ; eh_reg_restore
|
|
|
8de16c |
UNSPECV_ISYNC ; isync instruction
|
|
|
8de16c |
UNSPECV_MFTB ; move from time base
|
|
|
8de16c |
+ UNSPECV_DARN ; darn 1 (deliver a random number)
|
|
|
8de16c |
+ UNSPECV_DARN_32 ; darn 2
|
|
|
8de16c |
+ UNSPECV_DARN_RAW ; darn 0
|
|
|
8de16c |
UNSPECV_NLGR ; non-local goto receiver
|
|
|
8de16c |
UNSPECV_MFFS ; Move from FPSCR
|
|
|
8de16c |
UNSPECV_MTFSF ; Move to FPSCR Fields
|
|
|
8de16c |
@@ -14611,21 +14611,21 @@
|
|
|
8de16c |
|
|
|
8de16c |
(define_insn "darn_32"
|
|
|
8de16c |
[(set (match_operand:SI 0 "register_operand" "=r")
|
|
|
8de16c |
- (unspec:SI [(const_int 0)] UNSPEC_DARN_32))]
|
|
|
8de16c |
+ (unspec_volatile:SI [(const_int 0)] UNSPECV_DARN_32))]
|
|
|
8de16c |
"TARGET_P9_MISC"
|
|
|
8de16c |
"darn %0,0"
|
|
|
8de16c |
[(set_attr "type" "integer")])
|
|
|
8de16c |
|
|
|
8de16c |
(define_insn "darn_raw"
|
|
|
8de16c |
[(set (match_operand:DI 0 "register_operand" "=r")
|
|
|
8de16c |
- (unspec:DI [(const_int 0)] UNSPEC_DARN_RAW))]
|
|
|
8de16c |
+ (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN_RAW))]
|
|
|
8de16c |
"TARGET_P9_MISC && TARGET_64BIT"
|
|
|
8de16c |
"darn %0,2"
|
|
|
8de16c |
[(set_attr "type" "integer")])
|
|
|
8de16c |
|
|
|
8de16c |
(define_insn "darn"
|
|
|
8de16c |
[(set (match_operand:DI 0 "register_operand" "=r")
|
|
|
8de16c |
- (unspec:DI [(const_int 0)] UNSPEC_DARN))]
|
|
|
8de16c |
+ (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN))]
|
|
|
8de16c |
"TARGET_P9_MISC && TARGET_64BIT"
|
|
|
8de16c |
"darn %0,1"
|
|
|
8de16c |
[(set_attr "type" "integer")])
|