Gabe Black has submitted this change and it was merged. ( https://gem5-review.googlesource.com/3500 )

Change subject: x86: sim: Make 32 bit x86 processes work again.
......................................................................

x86: sim: Make 32 bit x86 processes work again.

When the LiveProcess class was renamed to be just Process, the CL author
also changed the syscall function from a virtual function into a regular
one. Unfortunately, the I386Process class overrode the syscall function
to adjust the return address so that control would return to the right
place. Without that adjustment, 32 bit x86 process would segfault and die
immediately after their first system call.

This change reinstates the virtual specifier on the base syscall function,
and adds an override keyword on the I386Process's version so that it won't
be orphaned again in the future. It also fixes some small style issues the
style checker script complained about.

Change-Id: I0d1178ea0eda6676050c8fc043820a2bb4d99c0d
Reviewed-on: https://gem5-review.googlesource.com/3500
Reviewed-by: Jason Lowe-Power <[email protected]>
Reviewed-by: Brandon Potter <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
---
M src/arch/x86/process.hh
M src/sim/process.hh
2 files changed, 6 insertions(+), 4 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  Brandon Potter: Looks good to me, approved



diff --git a/src/arch/x86/process.hh b/src/arch/x86/process.hh
index 4240ee6..fe31348 100644
--- a/src/arch/x86/process.hh
+++ b/src/arch/x86/process.hh
@@ -43,9 +43,9 @@
 #include <string>
 #include <vector>

+#include "mem/multi_level_page_table.hh"
 #include "sim/aux_vector.hh"
 #include "sim/process.hh"
-#include "mem/multi_level_page_table.hh"

 class SyscallDesc;

@@ -175,7 +175,8 @@
         void argsInit(int pageSize);
         void initState();

-        void syscall(int64_t callnum, ThreadContext *tc, Fault *fault);
+        void syscall(int64_t callnum, ThreadContext *tc,
+                     Fault *fault) override;
         X86ISA::IntReg getSyscallArg(ThreadContext *tc, int &i);
         X86ISA::IntReg getSyscallArg(ThreadContext *tc, int &i, int width);
         void setSyscallArg(ThreadContext *tc, int i, X86ISA::IntReg val);
@@ -186,7 +187,8 @@
     /**
      * Declaration of architectural page table for x86.
      *
- * These page tables are stored in system memory and respect x86 specification.
+     * These page tables are stored in system memory and respect x86
+     * specification.
      */
     typedef MultiLevelPageTable<PageTableOps> ArchPageTable;

diff --git a/src/sim/process.hh b/src/sim/process.hh
index add3eb3..5da30a4 100644
--- a/src/sim/process.hh
+++ b/src/sim/process.hh
@@ -71,7 +71,7 @@
     void initState() override;
     DrainState drain() override;

-    void syscall(int64_t callnum, ThreadContext *tc, Fault *fault);
+    virtual void syscall(int64_t callnum, ThreadContext *tc, Fault *fault);
     virtual TheISA::IntReg getSyscallArg(ThreadContext *tc, int &i) = 0;
virtual TheISA::IntReg getSyscallArg(ThreadContext *tc, int &i, int width);
     virtual void setSyscallArg(ThreadContext *tc, int i,

--
To view, visit https://gem5-review.googlesource.com/3500
To unsubscribe, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I0d1178ea0eda6676050c8fc043820a2bb4d99c0d
Gerrit-Change-Number: 3500
Gerrit-PatchSet: 2
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Brandon Potter <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-CC: Andreas Sandberg <[email protected]>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to