gem5-dev@gem5.org

The gem5 Developer List

View all threads

Change in gem5/gem5[develop]: arch-x86: Fix a bug in the protected mode IRET.

GB
Gabe Black (Gerrit)
Mon, Mar 14, 2022 9:54 AM

Gabe Black has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/55887 )

(

10 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the
submitted one.
)Change subject: arch-x86: Fix a bug in the protected mode IRET.
......................................................................

arch-x86: Fix a bug in the protected mode IRET.

Fix the direction of the comparison which makes sure the new RIP will
fit within the new CS limit.

Change-Id: I3f3e66c185d0e1fbc430b0ae594d63cdd62b9dfd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55887
Reviewed-by: Matt Sinclair <mattdsinclair(a)gmail.com>
Maintainer: Gabe Black <gabe.black(a)gmail.com>
Tested-by: kokoro <noreply+kokoro(a)google.com>

M
src/arch/x86/isa/insts/general_purpose/control_transfer/interrupts_and_exceptions.py
1 file changed, 17 insertions(+), 1 deletion(-)

Approvals:
Matt Sinclair: Looks good to me, approved
Gabe Black: Looks good to me, approved
kokoro: Regressions pass

diff --git
a/src/arch/x86/isa/insts/general_purpose/control_transfer/interrupts_and_exceptions.py
b/src/arch/x86/isa/insts/general_purpose/control_transfer/interrupts_and_exceptions.py
index 525279c..60d0086 100644

a/src/arch/x86/isa/insts/general_purpose/control_transfer/interrupts_and_exceptions.py
+++
b/src/arch/x86/isa/insts/general_purpose/control_transfer/interrupts_and_exceptions.py
@@ -156,7 +156,7 @@
# appropriate/other RIP checks.
# if temp_RIP > CS.limit throw #GP(0)
rdlimit t6, cs, dataSize=8

  • sub t0, t1, t6, flags=(ECF,)
  • sub t0, t6, t1, flags=(ECF,)
    fault "std::make_shared<GeneralProtection>(0)", flags=(CECF,)

    #(temp_CPL!=CPL)

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

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I3f3e66c185d0e1fbc430b0ae594d63cdd62b9dfd
Gerrit-Change-Number: 55887
Gerrit-PatchSet: 12
Gerrit-Owner: Gabe Black <gabe.black(a)gmail.com>
Gerrit-Reviewer: Bradford Beckmann <bradford.beckmann(a)gmail.com>
Gerrit-Reviewer: Gabe Black <gabe.black(a)gmail.com>
Gerrit-Reviewer: Matt Sinclair <mattdsinclair(a)gmail.com>
Gerrit-Reviewer: Matthew Poremba <matthew.poremba(a)amd.com>
Gerrit-Reviewer: kokoro <noreply+kokoro(a)google.com>
Gerrit-MessageType: merged

Gabe Black has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/55887 ) ( 10 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: arch-x86: Fix a bug in the protected mode IRET. ...................................................................... arch-x86: Fix a bug in the protected mode IRET. Fix the direction of the comparison which makes sure the new RIP will fit within the new CS limit. Change-Id: I3f3e66c185d0e1fbc430b0ae594d63cdd62b9dfd Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55887 Reviewed-by: Matt Sinclair <mattdsinclair(a)gmail.com> Maintainer: Gabe Black <gabe.black(a)gmail.com> Tested-by: kokoro <noreply+kokoro(a)google.com> --- M src/arch/x86/isa/insts/general_purpose/control_transfer/interrupts_and_exceptions.py 1 file changed, 17 insertions(+), 1 deletion(-) Approvals: Matt Sinclair: Looks good to me, approved Gabe Black: Looks good to me, approved kokoro: Regressions pass diff --git a/src/arch/x86/isa/insts/general_purpose/control_transfer/interrupts_and_exceptions.py b/src/arch/x86/isa/insts/general_purpose/control_transfer/interrupts_and_exceptions.py index 525279c..60d0086 100644 --- a/src/arch/x86/isa/insts/general_purpose/control_transfer/interrupts_and_exceptions.py +++ b/src/arch/x86/isa/insts/general_purpose/control_transfer/interrupts_and_exceptions.py @@ -156,7 +156,7 @@ # appropriate/other RIP checks. # if temp_RIP > CS.limit throw #GP(0) rdlimit t6, cs, dataSize=8 - sub t0, t1, t6, flags=(ECF,) + sub t0, t6, t1, flags=(ECF,) fault "std::make_shared<GeneralProtection>(0)", flags=(CECF,) #(temp_CPL!=CPL) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/55887 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I3f3e66c185d0e1fbc430b0ae594d63cdd62b9dfd Gerrit-Change-Number: 55887 Gerrit-PatchSet: 12 Gerrit-Owner: Gabe Black <gabe.black(a)gmail.com> Gerrit-Reviewer: Bradford Beckmann <bradford.beckmann(a)gmail.com> Gerrit-Reviewer: Gabe Black <gabe.black(a)gmail.com> Gerrit-Reviewer: Matt Sinclair <mattdsinclair(a)gmail.com> Gerrit-Reviewer: Matthew Poremba <matthew.poremba(a)amd.com> Gerrit-Reviewer: kokoro <noreply+kokoro(a)google.com> Gerrit-MessageType: merged