Changes between Initial Version and Version 1 of Ticket #228
- Timestamp:
- 06/22/2021 12:10:41 PM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #228 – Description
initial v1 23 23 }}} 24 24 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.]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: 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.] 26 26 27 27 The 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. 28 28 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 assignmentsof credits if the bank value is negative. Thus the negative tc_data|govern_credit_bank value remains negative when scheduling ends on that CPU.29 In 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. 30 30 31 The next time the schedule s 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.31 The 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. 32 32 33 That scenario (or some variant) caused an Overflow Fault while running in ring-0, producing the GHM system to crash. 34
