Changes between Initial Version and Version 1 of Ticket #228


Ignore:
Timestamp:
06/22/2021 12:10:41 PM (5 years ago)
Author:
Gary Dixon
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #228 – Description

    initial v1  
    2323}}}
    2424
    25 Beginning at line 3900, the read_clock macro reads the system's calendar clock into the AQ register as a signed fixed bin(71) integer.  It saves this clock reading into tc_data|last_time to record when the scheduler last ran on any processor.  It then subtracts from this time stamp the value prds$last_recorded_time (which is the time at which the scheduler last ran on this processor).  This gives a delta_t value, the microseconds of quanta that can be added to tc_data|governing_bank_credit, which is also a signed fixed bin(71) integer value.  [See lines 3902-3903 above.]
     25Beginning at line 3900, the read_clock macro reads the system's calendar clock into the AQ register as a signed fixed bin(71) integer.  It saves this clock reading into tc_data|last_time to record when the scheduler last ran on any processor.  It then subtracts from this time stamp the value prds$last_recorded_time: the time at which the scheduler last ran on this processor.  This gives a delta_t value: the microseconds of quanta that can be added to tc_data|governing_bank_credit, which is also a signed fixed bin(71) integer value.  [See lines 3902-3903 above.]
    2626
    2727The problem occurs in the ASQ instruction on line 3904.  That instruction uses signed arithmetic to add two single-word integers together:  C(Q) + C(Y)  ->  C(Y).  In this case, Y is the address of tc_data|governing_credit_bank, a fixed bin(35) signed value.  Q contains the right word of a double-word fixed bin(71) value; it is effectively an unsigned fixed bin(36) integer.  But the ASQ instruction treats Q as a signed fixed bin(35) value, with the left-most bit in this word being the sign bit. 
    2828
    29 In situations where that sign bit is negative, the ASQ can add a negative value to the previous tc_data|governing_credit_bank, causing it to become negative.  Code which assigns those credits (see pxss.alm line 2963++) ignore assignments of credits if the bank value is negative.  Thus the negative tc_data|govern_credit_bank value remains negative when scheduling ends on that CPU.
     29In situations where that sign bit is negative, the ASQ instruction adds a negative value to the previous tc_data|governing_credit_bank, often causing it to become negative.  Code which assigns those credits (see pxss.alm line 2963++) ignores assignment of credits if the bank value is negative.  Thus the negative tc_data|govern_credit_bank value remains negative when scheduling ends on that CPU.
    3030
    31 The next time the schedules runs on that CPU, if the delta_t value has a right-word storage that again looks like a negative integer, that negative value again gets added to the still-negative tc_data|governing_credit_bank value.  This process can continue until the ASQ instruction overflows the negative range of the fixed bin(35) signed storage space.  ASQ then turns on the Overflow indicator bit. And if the Overflow Mask indicator bit is off, then an Overflow Fault is triggered.  That scenario (or some variant), and Overflow Fault while running in ring-0,  is what caused the GHM system to crash.
     31The next time the scheduler runs on that CPU, if the delta_t value has a right-word storage that again looks like a negative integer, that negative value again gets added to the still-negative tc_data|governing_credit_bank value.  This process can continue until the ASQ instruction overflows the negative range of the fixed bin(35) signed storage space.  ASQ then turns on the Overflow indicator bit. And if the Overflow Mask indicator bit is off, an Overflow Fault is also triggered. 
    3232
     33That scenario (or some variant) caused an Overflow Fault while running in ring-0,  producing the GHM system to crash.
     34