SDL-Hercules-390 / hyperion

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

Problem if ENGINES lists fewer than MAXCPU engines #626

Closed Peter-J-Jansen closed 6 months ago

Peter-J-Jansen commented 6 months ago

My Hercules configuration file contains :

MAXCPU   16
ENGINES  2*CP,2*IP,2*CP,4*IP

This used to be no problem as the default was CP for all non-specified CPU's. When IPL-ing z/VM this causes a crash HIP006. The Hercules log shows why :

14:01:37 HHC01603I *ENGINES  2*CP,2*IP,2*CP,4*IP
14:01:37 HHC00827I Processor CP00: engine 00 type 0 set: CP
14:01:37 HHC00827I Processor CP01: engine 01 type 0 set: CP
14:01:37 HHC00827I Processor IP02: engine 02 type 5 set: IP
14:01:37 HHC00827I Processor IP03: engine 03 type 5 set: IP
14:01:37 HHC00827I Processor CP04: engine 04 type 0 set: CP
14:01:37 HHC00827I Processor CP05: engine 05 type 0 set: CP
14:01:37 HHC00827I Processor IP06: engine 06 type 5 set: IP
14:01:37 HHC00827I Processor IP07: engine 07 type 5 set: IP
14:01:37 HHC00827I Processor IP08: engine 08 type 5 set: IP
14:01:37 HHC00827I Processor IP09: engine 09 type 5 set: IP
14:01:37 HHC00827I Processor ??0A: engine 0A type 229 set: ??
14:01:37 HHC00827I Processor ??0B: engine 0B type 19 set: ??
14:01:37 HHC00827I Processor ??0C: engine 0C type 228 set: ??
14:01:37 HHC00827I Processor ??0D: engine 0D type 127 set: ??
14:01:37 HHC00827I Processor CP0E: engine 0E type 0 set: CP
14:01:37 HHC00827I Processor CP0F: engine 0F type 0 set: CP
14:01:37 HHC02204I ENGINES        set to 2*CP,2*IP,2*CP,4*IP

The non-specified CPU types are not properly initialized. This can easily be circumvented by always specifying enough ENGINES. The previous behavior of defaulting non-specified CPU types to CP can be restored with the following source correction :

--- hsccmd_79a14889.c   2024-02-14 15:16:53.199495405 +0100
+++ hsccmd.c       2024-02-16 16:14:00.673789422 +0100
@@ -3285,7 +3285,8 @@
     {
         BYTE   c;
         BYTE   type;                    /* Processor engine type     */
-        BYTE   ptyp[ MAX_CPU_ENGS ];    /* SCCB ptyp for each engine */
+        BYTE   ptyp[ MAX_CPU_ENGS ]     /* SCCB ptyp for each engine */
+               = { short2ptyp( "CP" ) };/*       defaulting to "CP"  */
         char*  styp;                    /* -> Engine type string     */
         char*  strtok_str = NULL;       /* strtok_r work variable    */
         char*  arg1 = strdup( argv[1] );/* (save before modifying)   */

I have tested the above successfully. Shall I make the commit please ?

Thanks,

Peter

Fish-Git commented 6 months ago

Fixed by commit ec4102bb67f957a0fd303aa72ac48bec8426f492.

Closing.

THANK YOU, Peter, for catching/reporting this!