diff mbox series

[09/11] pdp11 - example of a port not needing a speculation barrier

Message ID 1532684275-13041-10-git-send-email-Richard.Earnshaw@arm.com
State New
Headers show
Series (v2) Mitigation against unsafe data speculation (CVE-2017-5753) | expand

Commit Message

Richard Earnshaw (lists) July 27, 2018, 9:37 a.m. UTC
This patch is intended as an example of all that is needed if the
target system doesn't support CPUs that have speculative execution.
I've chosen the pdp11 port on the basis that it's old enough that this
is likely to be true for all existing implementations and that there
is also little chance of that changing in future!

	* config/pdp11/pdp11.c (TARGET_HAVE_SPECULATION_SAFE_VALUE): Redefine
	to speculation_safe_value_not_needed.
---
 gcc/config/pdp11/pdp11.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Paul Koning July 27, 2018, 1:27 p.m. UTC | #1
> On Jul 27, 2018, at 5:37 AM, Richard Earnshaw <Richard.Earnshaw@arm.com> wrote:

> 

> 

> This patch is intended as an example of all that is needed if the

> target system doesn't support CPUs that have speculative execution.

> I've chosen the pdp11 port on the basis that it's old enough that this

> is likely to be true for all existing implementations and that there

> is also little chance of that changing in future!

> 

> 	* config/pdp11/pdp11.c (TARGET_HAVE_SPECULATION_SAFE_VALUE): Redefine

> 	to speculation_safe_value_not_needed.

> ---

> gcc/config/pdp11/pdp11.c | 3 +++

> 1 file changed, 3 insertions(+)

> 

> <0009-pdp11-example-of-a-port-not-needing-a-speculation-ba.patch>


Correct, no speculative instruction now, and I don't think any of the people constructing PDP11s (yes there are some) are going to be adding it.

Thanks Richard.

	paul
Richard Biener July 27, 2018, 3:19 p.m. UTC | #2
On July 27, 2018 3:27:49 PM GMT+02:00, Paul Koning <paulkoning@comcast.net> wrote:
>

>

>> On Jul 27, 2018, at 5:37 AM, Richard Earnshaw

><Richard.Earnshaw@arm.com> wrote:

>> 

>> 

>> This patch is intended as an example of all that is needed if the

>> target system doesn't support CPUs that have speculative execution.

>> I've chosen the pdp11 port on the basis that it's old enough that

>this

>> is likely to be true for all existing implementations and that there

>> is also little chance of that changing in future!

>> 

>> 	* config/pdp11/pdp11.c (TARGET_HAVE_SPECULATION_SAFE_VALUE):

>Redefine

>> 	to speculation_safe_value_not_needed.

>> ---

>> gcc/config/pdp11/pdp11.c | 3 +++

>> 1 file changed, 3 insertions(+)

>> 

>> <0009-pdp11-example-of-a-port-not-needing-a-speculation-ba.patch>

>

>Correct, no speculative instruction now, and I don't think any of the

>people constructing PDP11s (yes there are some) are going to be adding

>it.


It's not really about speculative instructions but about things like having a branch predictor and ways to recover from badly predicted ones and thus from wrongly speculatively executed regular instructions. 

Probably every pipelined CPU implementation nowadays has speculative execution. 

Richard. 

>Thanks Richard.

>

>	paul
diff mbox series

Patch

diff --git a/gcc/config/pdp11/pdp11.c b/gcc/config/pdp11/pdp11.c
index 1bcdaed..62c653f 100644
--- a/gcc/config/pdp11/pdp11.c
+++ b/gcc/config/pdp11/pdp11.c
@@ -291,6 +291,9 @@  static bool pdp11_scalar_mode_supported_p (scalar_mode);
 
 #undef TARGET_INVALID_WITHIN_DOLOOP
 #define TARGET_INVALID_WITHIN_DOLOOP hook_constcharptr_const_rtx_insn_null
+
+#undef TARGET_HAVE_SPECULATION_SAFE_VALUE
+#define TARGET_HAVE_SPECULATION_SAFE_VALUE speculation_safe_value_not_needed
 
 /* A helper function to determine if REGNO should be saved in the
    current function's stack frame.  */