[gem5-dev] Change in public/gem5[master]: cpu-o3: Prevent cpu from suspending if it is already draining

2017-11-21 Thread Nikos Nikoleris (Gerrit)
Nikos Nikoleris has submitted this change and it was merged. (  
https://gem5-review.googlesource.com/5881 )


Change subject: cpu-o3: Prevent cpu from suspending if it is already  
draining

..

cpu-o3: Prevent cpu from suspending if it is already draining

Suspending the current thread context while draining due to a quiesce
pseudo instruction (for example a wfi instruction) could deadlock the
cpu and prevent it from successfully draining. This change ensures
that the cpu is not draining before suspending the thread context.

Change-Id: I7c019847f5a870d4bc9ce2b19936bc3dc45e5fd7
Reviewed-by: Andreas Sandberg 
Reviewed-on: https://gem5-review.googlesource.com/5881
Reviewed-by: Jason Lowe-Power 
Maintainer: Andreas Sandberg 
---
M src/cpu/o3/thread_context_impl.hh
1 file changed, 6 insertions(+), 1 deletion(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Andreas Sandberg: Looks good to me, approved; Looks good to me, approved



diff --git a/src/cpu/o3/thread_context_impl.hh  
b/src/cpu/o3/thread_context_impl.hh

index fdaa351..d9f84fb 100755
--- a/src/cpu/o3/thread_context_impl.hh
+++ b/src/cpu/o3/thread_context_impl.hh
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2012, 2016 ARM Limited
+ * Copyright (c) 2010-2012, 2016-2017 ARM Limited
  * Copyright (c) 2013 Advanced Micro Devices, Inc.
  * All rights reserved
  *
@@ -109,6 +109,11 @@
 if (thread->status() == ThreadContext::Suspended)
 return;

+if (cpu->isDraining()) {
+DPRINTF(O3CPU, "Ignoring suspend on TC due to pending drain\n");
+return;
+}
+
 thread->lastActivate = curTick();
 thread->lastSuspend = curTick();


--
To view, visit https://gem5-review.googlesource.com/5881
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I7c019847f5a870d4bc9ce2b19936bc3dc45e5fd7
Gerrit-Change-Number: 5881
Gerrit-PatchSet: 2
Gerrit-Owner: Nikos Nikoleris 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Nikos Nikoleris 
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in public/gem5[master]: cpu-o3: Prevent cpu from suspending if it is already draining

2017-11-20 Thread Nikos Nikoleris (Gerrit)

Hello Andreas Sandberg,

I'd like you to do a code review. Please visit

https://gem5-review.googlesource.com/5881

to review the following change.


Change subject: cpu-o3: Prevent cpu from suspending if it is already  
draining

..

cpu-o3: Prevent cpu from suspending if it is already draining

Suspending the current thread context while draining due to a quiesce
pseudo instruction (for example a wfi instruction) could deadlock the
cpu and prevent it from successfully draining. This change ensures
that the cpu is not draining before suspending the thread context.

Change-Id: I7c019847f5a870d4bc9ce2b19936bc3dc45e5fd7
Reviewed-by: Andreas Sandberg 
---
M src/cpu/o3/thread_context_impl.hh
1 file changed, 6 insertions(+), 1 deletion(-)



diff --git a/src/cpu/o3/thread_context_impl.hh  
b/src/cpu/o3/thread_context_impl.hh

index fdaa351..d9f84fb 100755
--- a/src/cpu/o3/thread_context_impl.hh
+++ b/src/cpu/o3/thread_context_impl.hh
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2012, 2016 ARM Limited
+ * Copyright (c) 2010-2012, 2016-2017 ARM Limited
  * Copyright (c) 2013 Advanced Micro Devices, Inc.
  * All rights reserved
  *
@@ -109,6 +109,11 @@
 if (thread->status() == ThreadContext::Suspended)
 return;

+if (cpu->isDraining()) {
+DPRINTF(O3CPU, "Ignoring suspend on TC due to pending drain\n");
+return;
+}
+
 thread->lastActivate = curTick();
 thread->lastSuspend = curTick();


--
To view, visit https://gem5-review.googlesource.com/5881
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c019847f5a870d4bc9ce2b19936bc3dc45e5fd7
Gerrit-Change-Number: 5881
Gerrit-PatchSet: 1
Gerrit-Owner: Nikos Nikoleris 
Gerrit-Reviewer: Andreas Sandberg 
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev