Skip to content

Commit 2a44859

Browse files
committed
Fix minor instruction count bug in SIE:
Add same 'run_cpu' code that was missing from 'run_sie'. [skip travis]
1 parent d8a549c commit 2a44859

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

sie.c

+16
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,9 @@ static int ARCH_DEP( run_sie )( REGS* regs )
894894

895895
PTT_SIE( "run_sie setjmp", 0, 0, 0 );
896896

897+
/* Establish longjmp destination for program check or
898+
RETURN_INTCHECK, or SIE_INTERCEPT, or longjmp, etc.
899+
*/
897900
if (!(icode = setjmp( GUESTREGS->progjmp )))
898901
{
899902
PTT_SIE( "run_sie run...", 0, 0, 0 );
@@ -1154,6 +1157,19 @@ endloop: ; // (nop to make compiler happy)
11541157
&& !SIE_INTERRUPT_PENDING ( GUESTREGS )
11551158
));
11561159
}
1160+
else
1161+
{
1162+
/* Our above instruction execution loop didn't finish due
1163+
to a longjmp(progjmp) having been done, bringing us to
1164+
here, thereby causing the instruction counter to not be
1165+
properly updated. Thus, we must update it here instead.
1166+
*/
1167+
regs->instcount += MAX_CPU_LOOPS/2;
1168+
UPDATE_SYSBLK_INSTCOUNT( MAX_CPU_LOOPS/2 );
1169+
1170+
/* Perform automatic instruction tracing if it's enabled */
1171+
do_automatic_tracing();
1172+
}
11571173

11581174
PTT_SIE( "run_sie !run", icode, 0, 0 );
11591175

0 commit comments

Comments
 (0)