x86: Implementation of Int3 and Int_Ib in long mode
Review Request #1939 - Created June 28, 2013 and submitted
| Information | |
|---|---|
| Christian Menard | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
This is an implementation of the x86 int3 and int immediate instructions for long mode according to 'AMD64 Programmers Manual Volume 3'. I did not do any heavy testing, but it works fine with the Fiasco.OC micro kernel (http://os.inf.tu-dresden.de/fiasco/). I'm not sure if the changes to the decoder (one_byte_opcodes.isa) break the way Linux-syscalls are currently treated. So please have a look at it.
Test runs with Fiasco.OC micro kernel (http://os.inf.tu-dresden.de/fiasco/)
Posted (Aug. 27, 2013, 8:59 a.m.)
I do not like that form WarnUnimpl being repeated all over the place. Can you try if something else works?
Review request changed
Updated (Oct. 21, 2013, 3:18 a.m.)
Change Summary:
After my question on the mailing list I updated this patch. The instructions now just check if the CPU runs in long or in legacy mode and jumps to the corresponding rom labels. The Decoder was changed as well. Now should be able to handle linux syscalls (int 80) in SE mode as well as soft interrupts in FS mode.
Diff: |
Revision 3 (+33 -2) |
|---|
Posted (Oct. 21, 2013, 5:20 a.m.)
It seems like the diff doesn't apply cleanly in RB. It happens from time to time, it's kinda crap.
I think you probably don't want to add the 'default: Inst::INT(Ib);' to the SE-mode case, just using 'Inst::INT(Ib)' as the default when FullSystemInt != 0 should suffice. I'd be very surprised if taking an interrupt in SE mode is going to do anything sensible.
I think you should be able to do 'limm t1, imm, dataSize=8' instead of clearing t1 first.
Also, are you sure the long mode test is correct? Isn't it supposed to be something like this:
andi t0, t5, 0x1, flags=(EZF,)
br rom_label("longModeSoftInterrupt"), flags=(nCEZF,)
IIRC, the least significant bit of the handy m5 reg is 0 for long mode and 1 for the the legacy modes.
Review request changed
Updated (Oct. 22, 2013, 1:37 a.m.)
Review request changed
Updated (Oct. 22, 2013, 9:52 a.m.)
Change Summary:
Changed the isa description of INT(Ib) and INT3 as suggested by Andreas. Thanks for your help and support.
Diff: |
Revision 5 (+33 -2) |
|---|
Looks good! Thanks!
