SDL-Hercules-390 / hyperion

The SDL Hercules 4.x Hyperion version of the System/370, ESA/390, and z/Architecture Emulator
Other
240 stars 90 forks source link

Instruction Trace: TRTE and TRTRE #501

Closed JamesWekel closed 2 years ago

JamesWekel commented 2 years ago

An instruction trace for both the TRTE and TRTRE instructions includes storage references for the second operand register. The second operand register is a only a destination register for the Function Code and is not a source/destination address register. Depending on the register contents, you can get "Translation exception 0005 (Addressing exception)" notices.

For example:

22:35:07 HHC02324I PSW=000800000000020A INST=B9BF0024     TRTE  2,4,0                  translate_and_test_extended
22:35:07 HHC02326I R:00010000:K:00=00000000 00000000 00000000 00000000  
22:35:07 HHC02326I R:00BBCCDD: Translation exception 0005 (Addressing exception)
22:35:07 HHC02269I GR00=00000000 GR01=00110000 GR02=00010000 GR03=00000001
22:35:07 HHC02269I GR04=AABBCCDD GR05=00000000 GR06=00000000 GR07=00000000
22:35:07 HHC02269I GR08=40000200 GR09=00000000 GR10=00000000 GR11=00000000
22:35:07 HHC02269I GR12=00000000 GR13=00000000 GR14=00000000 GR15=00000000

Only a reference for the first instruction operand register is valid and the second HHC02326I message should be removed.

I'm attaching two test scripts that demonstrate the issue and a log showing the problem. The Hercules configuration files used was the tests.conf configuration used for runtest.

I hope that I've sufficiently described the problem.

Jim

Fish-Git commented 2 years ago

This is normal Hercules behavior.

The logic that traces instructions does so according to the instruction's format, not its opcode.

The TRTE instruction function itself (that executes the TRTE instruction) is obviously smart enough to know the operand-2 register is not used to address storage, but the RRF format instruction tracing function isn't. All it knows is that the instruction it is tracing is an RRF format instruction and nothing more. It contains no special logic to allow it to determine whether operand-2 addresses storage or not, and therefore will always attempt to resolve it as such, leading to the Addressing Exception you are seeing.

~Closing as Invalid: working as designed.~ Closing as Won't Fix: working as designed.

Fish-Git commented 2 years ago

Removing improper "Invalid" label and relabeling as more proper "Won't Fix" instead: "The requested change was rejected or the described behavior is by design."