• Re: Interrupts in OoO (was: Microarchitectural support for counting)

    From quadibloc@quadibloc@invalid.com (John Savard) to comp.arch on Fri Oct 23 23:57:04 2026
    From Newsgroup: comp.arch

    On Sat, 05 Oct 2024 17:57:12 GMT, anton@mips.complang.tuwien.ac.at
    (Anton Ertl) wrote:

    Ok, it's more efficient to insert an interrupt call into the
    instruction stream in the decoder: all the in-flight instructions will
    be completed instead of going to waste. However, the interrupt will
    usually be serviced later, and, as you point out, if the instruction
    stream is redirected for some other reason, you may have to replay the >interrupt.

    A _trap_ can be a problem on an out-of-order machine, since traps
    result from exceptions, and so they have to be tied to the instruction
    stream.
    An interrupt, on the other hand, just needs to get serviced. The
    process being interrupted just needs not to be disturbed by it.
    That leaves several alternatives.
    You could somehow make the machine act as if it has a second core just
    to serve interrupts. In fact, some early architectures anticipated SMT
    by having a second set of registers for privileged operation.
    Or, since interrupt routines _are_ at kernel level... when there's an interrupt, save the whole internal machine state, including the entire pipeline. After all, since interrupt routines are privileged, they can
    use a special return instruction that sets up the machine's internals
    instead of just restoring registers and branching somewhere.
    So, while interrupts _can_ be an issue for an OoO machine, they don't
    really have to be.

    John Savard
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Robert Finch@robfi680@gmail.com to comp.arch on Fri Oct 23 21:12:14 2026
    From Newsgroup: comp.arch

    On 2026-10-23 7:57 p.m., John Savard wrote:
    On Sat, 05 Oct 2024 17:57:12 GMT, anton@mips.complang.tuwien.ac.at
    (Anton Ertl) wrote:

    Ok, it's more efficient to insert an interrupt call into the
    instruction stream in the decoder: all the in-flight instructions will
    be completed instead of going to waste. However, the interrupt will
    usually be serviced later, and, as you point out, if the instruction
    stream is redirected for some other reason, you may have to replay the
    interrupt.

    For Q+ one build option is similar to this. A poll-for-interrupt
    instruction is periodically inserted into the instruction stream (approximately every 100 instructions) when micro-ops are translated and queued (could be the beginning of the decode stage). The poll operation
    is a special form of branch and then handled by the branch logic.

    The default Q+ build just has a hardware-interrupt flag on the pipeline registers, set at the fetch stage. When the pipeline reaches commit the
    flag is checked and interrupt processing takes place if the flag was
    set. Because it is a separate flag the processor knows to honor it even
    if the instructions are no longer valid.

    A _trap_ can be a problem on an out-of-order machine, since traps
    result from exceptions, and so they have to be tied to the instruction stream.
    An interrupt, on the other hand, just needs to get serviced. The
    process being interrupted just needs not to be disturbed by it.
    That leaves several alternatives.
    You could somehow make the machine act as if it has a second core just
    to serve interrupts. In fact, some early architectures anticipated SMT
    by having a second set of registers for privileged operation.
    Or, since interrupt routines _are_ at kernel level... when there's an interrupt, save the whole internal machine state, including the entire pipeline. After all, since interrupt routines are privileged, they can
    use a special return instruction that sets up the machine's internals
    instead of just restoring registers and branching somewhere.
    So, while interrupts _can_ be an issue for an OoO machine, they don't
    really have to be.

    John Savard

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From MitchAlsup@user5857@newsgrouper.org.invalid to comp.arch on Sat Oct 24 19:20:49 2026
    From Newsgroup: comp.arch

    quadibloc@invalid.com (John Savard) posted:

    On Sat, 05 Oct 2024 17:57:12 GMT, anton@mips.complang.tuwien.ac.at
    (Anton Ertl) wrote:

    Ok, it's more efficient to insert an interrupt call into the
    instruction stream in the decoder: all the in-flight instructions will
    be completed instead of going to waste. However, the interrupt will >usually be serviced later, and, as you point out, if the instruction
    stream is redirected for some other reason, you may have to replay the >interrupt.

    A _trap_ can be a problem on an out-of-order machine, since traps
    result from exceptions, and so they have to be tied to the instruction stream.

    We have {Traps, Exceptions, Interrupts}.

    A trap is synchronous to the executing code and we want IP pointing at the subsequent instruction. A trap may send a small amount of data to the service at the other end. Not all registers have to be preserved. Registers R0..R15
    are considered temporaries at the caller->callee boundary. Those registers either carry a result or are cleared <HW> at the callee->caller boundary::
    in My 66000 SBI.

    An Exception is synchronous to the executing code and we want IP pointing
    at the offending instruction. What kind of exception is the message to the service routine. All Thread-State has to be preserved. A Thread should
    be able to handle its own exceptions should it communicate same with
    Guest OS.

    An interrupt is asynchronous to the executing code and we can allow IP
    to point at any instruction so long as a) all instructions prior to
    *IP appear to have executed, and b) no instructions after *IP appear to
    have executed. All Thread-State has to be preserved.

    An interrupt, on the other hand, just needs to get serviced. The
    process being interrupted just needs not to be disturbed by it.

    Except via the time dimension...

    That leaves several alternatives.
    You could somehow make the machine act as if it has a second core just
    to serve interrupts. In fact, some early architectures anticipated SMT
    by having a second set of registers for privileged operation.

    Or, since interrupt routines _are_ at kernel level... when there's an interrupt, save the whole internal machine state, including the entire pipeline. After all, since interrupt routines are privileged, they can
    use a special return instruction that sets up the machine's internals
    instead of just restoring registers and branching somewhere.

    One now has to be careful, here. An interrupt can be taken in {HyperVisor,
    Host OS, Guest OS, or even Application} although most architectures disallow the Application to field its own interrupts or exceptions and most definitely its own SYSCALLs.

    Guest OS may receive a Page-Fault from Application and Guest OS has
    arranged that its ISR pages are "not paged" and thus it is not setup
    to deal with Guest OS Page-Faults in its own ISRs. Host OS can page
    Guest OS pages out at its whim, and take Guest OS Page-Faults without
    Guest OS ever knowing about those paging activities. So, virtualization
    has added monkey-wrenches into the verbology ...

    So, while interrupts _can_ be an issue for an OoO machine, they don't
    really have to be.

    Interrupts are easier than exceptions, mostly because one does not have to
    back up the execution window.

    John Savard
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From scott@scott@slp53.sl.home (Scott Lurndal) to comp.arch on Sun Oct 25 15:53:47 2026
    From Newsgroup: comp.arch

    MitchAlsup <user5857@newsgrouper.org.invalid> writes:
    quadibloc@invalid.com (John Savard) posted:

    On Sat, 05 Oct 2024 17:57:12 GMT, anton@mips.complang.tuwien.ac.at
    (Anton Ertl) wrote:

    Ok, it's more efficient to insert an interrupt call into the
    instruction stream in the decoder: all the in-flight instructions will
    be completed instead of going to waste. However, the interrupt will
    usually be serviced later, and, as you point out, if the instruction
    stream is redirected for some other reason, you may have to replay the
    interrupt.

    A _trap_ can be a problem on an out-of-order machine, since traps
    result from exceptions, and so they have to be tied to the instruction
    stream.

    We have {Traps, Exceptions, Interrupts}.

    A trap is synchronous to the executing code and we want IP pointing at the >subsequent instruction. A trap may send a small amount of data to the service >at the other end. Not all registers have to be preserved. Registers R0..R15 >are considered temporaries at the caller->callee boundary. Those registers >either carry a result or are cleared <HW> at the callee->caller boundary::
    in My 66000 SBI.

    An Exception is synchronous to the executing code and we want IP pointing
    at the offending instruction. What kind of exception is the message to the >service routine. All Thread-State has to be preserved. A Thread should
    be able to handle its own exceptions should it communicate same with
    Guest OS.

    Exceptions are not alway precise. For example, an exception
    on a posted store (that's spent time in a store buffer, for
    example), may have an exception asynchronously.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From EricP@ThatWouldBeTelling@thevillage.com to comp.arch on Mon Oct 26 11:06:16 2026
    From Newsgroup: comp.arch

    On 2026-Oct-25 11:53, Scott Lurndal wrote:
    MitchAlsup <user5857@newsgrouper.org.invalid> writes:
    quadibloc@invalid.com (John Savard) posted:

    On Sat, 05 Oct 2024 17:57:12 GMT, anton@mips.complang.tuwien.ac.at
    (Anton Ertl) wrote:

    Ok, it's more efficient to insert an interrupt call into the
    instruction stream in the decoder: all the in-flight instructions will >>>> be completed instead of going to waste. However, the interrupt will
    usually be serviced later, and, as you point out, if the instruction
    stream is redirected for some other reason, you may have to replay the >>>> interrupt.

    A _trap_ can be a problem on an out-of-order machine, since traps
    result from exceptions, and so they have to be tied to the instruction
    stream.

    We have {Traps, Exceptions, Interrupts}.

    A trap is synchronous to the executing code and we want IP pointing at the >> subsequent instruction. A trap may send a small amount of data to the service
    at the other end. Not all registers have to be preserved. Registers R0..R15 >> are considered temporaries at the caller->callee boundary. Those registers >> either carry a result or are cleared <HW> at the callee->caller boundary:: >> in My 66000 SBI.

    An Exception is synchronous to the executing code and we want IP pointing
    at the offending instruction. What kind of exception is the message to the >> service routine. All Thread-State has to be preserved. A Thread should
    be able to handle its own exceptions should it communicate same with
    Guest OS.

    Exceptions are not alway precise. For example, an exception
    on a posted store (that's spent time in a store buffer, for
    example), may have an exception asynchronously.

    This is a terminology problem that comes from processors putting
    all the "alert" notifications through the same delivery mechanism.
    People often use various the terms as interchangeable when really
    they are not.

    In my terminology I have Exceptions, Interrupts, and Errors.
    I take all the well defined stuff and put it in the Exception and
    Interrupt buckets, and take all the weird stuff and call it Errors.

    Exceptions are defined by the ISA, are precise, and synchronous
    to the excepting instruction. There are two kinds, Faults and Traps.
    Most exceptions notifications cannot be deferred or "masked".
    Floating point exceptions are potentially maskable however if
    they are then any auxiliary information about the precise source of
    the FP exceptions will be synchronous with instruction that unmasks
    a pending floating point exception.

    Interrupts are defined as precise and asynchronous.
    Their number and priority mechanisms is defined as model specific.
    Interrupts are potentially maskable and may be deferred.
    The only ISA defined part of interrupts are the master interrupt
    mask control instructions INTEN enable and INTDI disable.

    Exceptions and Interrupts are defined as precise and restartable.

    The mechanism for delivering Exception and Interrupt notifications
    is defined as model specific. In practice this just means that
    operating systems should modularize this layer of their software
    (sometimes called a HAL or Hardware Abstraction Layer).

    Errors are model and error specific, may be synchronous or asynchronous,
    may be precise (Faults or Traps) or imprecise (Aborts).
    Errors may or may not be deferred (maskable).
    Errors may not be restartable.
    The mechanism for delivering Error notifications is defined as
    model and error specific.

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Robert Finch@robfi680@gmail.com to comp.arch on Mon Oct 26 13:17:45 2026
    From Newsgroup: comp.arch

    On 2026-10-26 11:06 a.m., EricP wrote:
    On 2026-Oct-25 11:53, Scott Lurndal wrote:
    MitchAlsup <user5857@newsgrouper.org.invalid> writes:
    quadibloc@invalid.com (John Savard) posted:

    On Sat, 05 Oct 2024 17:57:12 GMT, anton@mips.complang.tuwien.ac.at
    (Anton Ertl) wrote:

    Ok, it's more efficient to insert an interrupt call into the
    instruction stream in the decoder: all the in-flight instructions will >>>>> be completed instead of going to waste.-a However, the interrupt will >>>>> usually be serviced later, and, as you point out, if the instruction >>>>> stream is redirected for some other reason, you may have to replay the >>>>> interrupt.

    A _trap_ can be a problem on an out-of-order machine, since traps
    result from exceptions, and so they have to be tied to the instruction >>>> stream.

    We have {Traps, Exceptions, Interrupts}.

    A trap is synchronous to the executing code and we want IP pointing
    at the
    subsequent instruction. A trap may send a small amount of data to the
    service
    at the other end. Not all registers have to be preserved. Registers
    R0..R15
    are considered temporaries at the caller->callee boundary. Those
    registers
    either carry a result or are cleared <HW> at the callee->caller
    boundary::
    in My 66000 SBI.

    An Exception is synchronous to the executing code and we want IP
    pointing
    at the offending instruction. What kind of exception is the message
    to the
    service routine. All Thread-State has to be preserved. A Thread should
    be able to handle its own exceptions should it communicate same with
    Guest OS.

    Exceptions are not alway precise.-a For example, an exception
    on a posted store (that's spent time in a store buffer, for
    example), may have an exception asynchronously.

    This is a terminology problem that comes from processors putting
    all the "alert" notifications through the same delivery mechanism.
    People often use various the terms as interchangeable when really
    they are not.

    In my terminology I have Exceptions, Interrupts, and Errors.
    I take all the well defined stuff and put it in the Exception and
    Interrupt buckets, and take all the weird stuff and call it Errors.

    Exceptions are defined by the ISA, are precise, and synchronous
    to the excepting instruction. There are two kinds, Faults and Traps.
    Most exceptions notifications cannot be deferred or "masked".
    Floating point exceptions are potentially maskable however if
    they are then any auxiliary information about the precise source of
    the FP exceptions will be synchronous with instruction that unmasks
    a pending floating point exception.

    Interrupts are defined as precise and asynchronous.
    Their number and priority mechanisms is defined as model specific.
    Interrupts are potentially maskable and may be deferred.
    The only ISA defined part of interrupts are the master interrupt
    mask control instructions INTEN enable and INTDI disable.

    Exceptions and Interrupts are defined as precise and restartable.

    The mechanism for delivering Exception and Interrupt notifications
    is defined as model specific. In practice this just means that
    operating systems should modularize this layer of their software
    (sometimes called a HAL or Hardware Abstraction Layer).

    Errors are model and error specific, may be synchronous or asynchronous,
    may be precise (Faults or Traps) or imprecise (Aborts).
    Errors may or may not be deferred (maskable).
    Errors may not be restartable.
    The mechanism for delivering Error notifications is defined as
    model and error specific.

    I have thought that interrupts, traps and others are subsets of
    exceptions, which I think is the way m68k docs describes them. So, I
    would have errors as a subset of exceptions.

    Interrupts, traps, errors and exceptions are all often handled by the
    same table which different vendors seem to give different names to.

    I think interrupts may only be precise to a point. An interrupt is asynchronous, so how precise is it? In q+ the hardware may defer it to a
    short time later.



    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.arch on Mon Oct 26 17:45:54 2026
    From Newsgroup: comp.arch

    quadibloc@invalid.com (John Savard) writes:
    On Sat, 05 Oct 2024 17:57:12 GMT, anton@mips.complang.tuwien.ac.at
    (Anton Ertl) wrote:

    Ok, it's more efficient to insert an interrupt call into the
    instruction stream in the decoder: all the in-flight instructions will
    be completed instead of going to waste. However, the interrupt will >>usually be serviced later, and, as you point out, if the instruction
    stream is redirected for some other reason, you may have to replay the >>interrupt.
    ...
    An interrupt, on the other hand, just needs to get serviced. The
    process being interrupted just needs not to be disturbed by it.
    That leaves several alternatives.
    You could somehow make the machine act as if it has a second core just
    to serve interrupts. In fact, some early architectures anticipated SMT
    by having a second set of registers for privileged operation.

    That's actually something that one can do relatively easily with cores
    capable of SMT: leave an SMT thread on one core (or n, if you want to
    be able to serve n interrupts at the same time) unallocated on an
    otherwise powered-up core, and have the interrupt controller direct
    the interrupt at one of these threads. The interrupt can be serviced
    right away, without throwing away work that has been done on the other
    core. If the interrupt thread gets priority on competetivelt
    allocated resources, that will minimize the interrupt latency.

    Or, since interrupt routines _are_ at kernel level... when there's an >interrupt, save the whole internal machine state, including the entire >pipeline. After all, since interrupt routines are privileged, they can
    use a special return instruction that sets up the machine's internals
    instead of just restoring registers and branching somewhere.

    This stack puke approach has been tried on various machines such as
    some (all?) 68000 family members, but all machines that did this have
    vanished from the general-purpose computing market. For OoO machines,
    the internal state is relatively large, and puking it on the stack and swallowing the puke back is something that would require additional
    data paths, and even once they are there, would require so many cycles
    that it is more efficient to throw away everything that's in flight,
    and then start from the architectural state on resuming from the
    interrupt.

    - anton
    --
    'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
    Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From EricP@ThatWouldBeTelling@thevillage.com to comp.arch on Mon Oct 26 17:03:23 2026
    From Newsgroup: comp.arch

    On 2026-Oct-26 13:17, Robert Finch wrote:
    On 2026-10-26 11:06 a.m., EricP wrote:
    On 2026-Oct-25 11:53, Scott Lurndal wrote:
    MitchAlsup <user5857@newsgrouper.org.invalid> writes:
    quadibloc@invalid.com (John Savard) posted:

    On Sat, 05 Oct 2024 17:57:12 GMT, anton@mips.complang.tuwien.ac.at
    (Anton Ertl) wrote:

    Ok, it's more efficient to insert an interrupt call into the
    instruction stream in the decoder: all the in-flight instructions will >>>>>> be completed instead of going to waste.-a However, the interrupt will >>>>>> usually be serviced later, and, as you point out, if the instruction >>>>>> stream is redirected for some other reason, you may have to replay the >>>>>> interrupt.

    A _trap_ can be a problem on an out-of-order machine, since traps
    result from exceptions, and so they have to be tied to the instruction >>>>> stream.

    We have {Traps, Exceptions, Interrupts}.

    A trap is synchronous to the executing code and we want IP pointing at the >>>> subsequent instruction. A trap may send a small amount of data to the service
    at the other end. Not all registers have to be preserved. Registers R0..R15
    are considered temporaries at the caller->callee boundary. Those registers >>>> either carry a result or are cleared <HW> at the callee->caller boundary:: >>>> in My 66000 SBI.

    An Exception is synchronous to the executing code and we want IP pointing >>>> at the offending instruction. What kind of exception is the message to the >>>> service routine. All Thread-State has to be preserved. A Thread should >>>> be able to handle its own exceptions should it communicate same with
    Guest OS.

    Exceptions are not alway precise.-a For example, an exception
    on a posted store (that's spent time in a store buffer, for
    example), may have an exception asynchronously.

    This is a terminology problem that comes from processors putting
    all the "alert" notifications through the same delivery mechanism.
    People often use various the terms as interchangeable when really
    they are not.

    In my terminology I have Exceptions, Interrupts, and Errors.
    I take all the well defined stuff and put it in the Exception and
    Interrupt buckets, and take all the weird stuff and call it Errors.

    Exceptions are defined by the ISA, are precise, and synchronous
    to the excepting instruction. There are two kinds, Faults and Traps.
    Most exceptions notifications cannot be deferred or "masked".
    Floating point exceptions are potentially maskable however if
    they are then any auxiliary information about the precise source of
    the FP exceptions will be synchronous with instruction that unmasks
    a pending floating point exception.

    Interrupts are defined as precise and asynchronous.
    Their number and priority mechanisms is defined as model specific.
    Interrupts are potentially maskable and may be deferred.
    The only ISA defined part of interrupts are the master interrupt
    mask control instructions INTEN enable and INTDI disable.

    Exceptions and Interrupts are defined as precise and restartable.

    The mechanism for delivering Exception and Interrupt notifications
    is defined as model specific. In practice this just means that
    operating systems should modularize this layer of their software
    (sometimes called a HAL or Hardware Abstraction Layer).

    Errors are model and error specific, may be synchronous or asynchronous,
    may be precise (Faults or Traps) or imprecise (Aborts).
    Errors may or may not be deferred (maskable).
    Errors may not be restartable.
    The mechanism for delivering Error notifications is defined as
    model and error specific.

    I have thought that interrupts, traps and others are subsets of exceptions, which I think is the way m68k docs describes them. So, I would have errors as a subset of exceptions.

    Interrupts, traps, errors and exceptions are all often handled by the same table which different vendors seem to give different names to.

    I think interrupts may only be precise to a point. An interrupt is asynchronous, so how precise is it? In q+ the hardware may defer it to a short time later.

    Precise means the processor state corresponds with a sequential model
    of program execution where one instruction completes before the next begin.

    Synchronous means that the saved state corresponds with the particular instruction that triggered the state or the instruction after it.
    For a Fault the state correspond to the triggering instruction.
    For a Trap the state corresponds to the instruction after the
    triggering instruction.
    All exceptions, whether faults or traps, are synchronous.

    Asynchronous means that the state does not correspond with any
    particular instruction. All Interrupts are asynchronous.

    For an asynchronous Interrupt or synchronous Exception to be
    restartable it must be precise.

    Each of Exceptions and Interrupts have well defined behaviour.
    Exceptions only have one delivery mechanism whereas Interrupts might
    have a variety of Interrupt controllers each with its own behavior.

    They can also be quite frequent and I didn't want to burden their
    dispatching mechanisms with the extra overhead of also dealing with
    potential errors that might infrequently occur.
    In both cases I would use a variation on branch-and-link to a hardware
    state save and generated RIP address so there are no memory references
    during the internal state change. This means no double- or triple-faults
    and potentially a 1 clock state change.

    The problem with errors is that their behaviour is all over the place.
    A store operation to memory or device marked as write-through would be synchronous with the ST instruction and any errors detected could be
    associated back to the ST instruction.
    A store operation to memory marked as write-back is asynchronous and
    can be performed long after the ST instruction has retired and
    been removed from the core.

    An ECC memory error can be detected and maybe corrected by the
    error scavenger sweep and not associated with any instruction at all.

    Some devices change state when read. For example a UART receive
    buffer can be FIFO queue and reading it consumes the first entry.
    If there was a bus parity error after a successful read of the
    FIFO then one may or may not want to retry the operation.

    By putting infrequent Errors off in their own bucket they can be
    dealt with on a case by case basis without burdening the frequent
    occurance delivery mechanisms for Exceptions and Interrupts.

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Chris M. Thomasson@chris.m.thomasson.1@gmail.com to comp.arch on Mon Oct 26 14:14:39 2026
    From Newsgroup: comp.arch

    On 10/26/2026 2:03 PM, EricP wrote:
    On 2026-Oct-26 13:17, Robert Finch wrote:
    On 2026-10-26 11:06 a.m., EricP wrote:
    On 2026-Oct-25 11:53, Scott Lurndal wrote:
    MitchAlsup <user5857@newsgrouper.org.invalid> writes:
    quadibloc@invalid.com (John Savard) posted:

    On Sat, 05 Oct 2024 17:57:12 GMT, anton@mips.complang.tuwien.ac.at >>>>>> (Anton Ertl) wrote:

    Ok, it's more efficient to insert an interrupt call into the
    instruction stream in the decoder: all the in-flight instructions >>>>>>> will
    be completed instead of going to waste.-a However, the interrupt will >>>>>>> usually be serviced later, and, as you point out, if the instruction >>>>>>> stream is redirected for some other reason, you may have to
    replay the
    interrupt.

    A _trap_ can be a problem on an out-of-order machine, since traps
    result from exceptions, and so they have to be tied to the
    instruction
    stream.

    We have {Traps, Exceptions, Interrupts}.

    A trap is synchronous to the executing code and we want IP pointing >>>>> at the
    subsequent instruction. A trap may send a small amount of data to
    the service
    at the other end. Not all registers have to be preserved. Registers >>>>> R0..R15
    are considered temporaries at the caller->callee boundary. Those
    registers
    either carry a result or are cleared <HW> at the callee->caller
    boundary::
    in My 66000 SBI.

    An Exception is synchronous to the executing code and we want IP
    pointing
    at the offending instruction. What kind of exception is the message >>>>> to the
    service routine. All Thread-State has to be preserved. A Thread should >>>>> be able to handle its own exceptions should it communicate same with >>>>> Guest OS.

    Exceptions are not alway precise.-a For example, an exception
    on a posted store (that's spent time in a store buffer, for
    example), may have an exception asynchronously.

    This is a terminology problem that comes from processors putting
    all the "alert" notifications through the same delivery mechanism.
    People often use various the terms as interchangeable when really
    they are not.

    In my terminology I have Exceptions, Interrupts, and Errors.
    I take all the well defined stuff and put it in the Exception and
    Interrupt buckets, and take all the weird stuff and call it Errors.

    Exceptions are defined by the ISA, are precise, and synchronous
    to the excepting instruction. There are two kinds, Faults and Traps.
    Most exceptions notifications cannot be deferred or "masked".
    Floating point exceptions are potentially maskable however if
    they are then any auxiliary information about the precise source of
    the FP exceptions will be synchronous with instruction that unmasks
    a pending floating point exception.

    Interrupts are defined as precise and asynchronous.
    Their number and priority mechanisms is defined as model specific.
    Interrupts are potentially maskable and may be deferred.
    The only ISA defined part of interrupts are the master interrupt
    mask control instructions INTEN enable and INTDI disable.

    Exceptions and Interrupts are defined as precise and restartable.

    The mechanism for delivering Exception and Interrupt notifications
    is defined as model specific. In practice this just means that
    operating systems should modularize this layer of their software
    (sometimes called a HAL or Hardware Abstraction Layer).

    Errors are model and error specific, may be synchronous or asynchronous, >>> may be precise (Faults or Traps) or imprecise (Aborts).
    Errors may or may not be deferred (maskable).
    Errors may not be restartable.
    The mechanism for delivering Error notifications is defined as
    model and error specific.

    I have thought that interrupts, traps and others are subsets of
    exceptions, which I think is the way m68k docs describes them. So, I
    would have errors as a subset of exceptions.

    Interrupts, traps, errors and exceptions are all often handled by the
    same table which different vendors seem to give different names to.

    I think interrupts may only be precise to a point. An interrupt is
    asynchronous, so how precise is it? In q+ the hardware may defer it to
    a short time later.

    Precise means the processor state corresponds with a sequential model
    of program execution where one instruction completes before the next begin.

    Synchronous means that the saved state corresponds with the particular instruction that triggered the state or the instruction after it.
    For a Fault the state correspond to the triggering instruction.
    For a Trap the state corresponds to the instruction after the
    triggering instruction.
    All exceptions, whether faults or traps, are synchronous.

    Asynchronous means that the state does not correspond with any
    particular instruction. All Interrupts are asynchronous.

    For an asynchronous Interrupt or synchronous Exception to be
    restartable it must be precise.

    Each of Exceptions and Interrupts have well defined behaviour.
    Exceptions only have one delivery mechanism whereas Interrupts might
    have a variety of Interrupt controllers each with its own behavior.

    They can also be quite frequent and I didn't want to burden their
    dispatching mechanisms with the extra overhead of also dealing with
    potential errors that might infrequently occur.
    In both cases I would use a variation on branch-and-link to a hardware
    state save and generated RIP address so there are no memory references
    during the internal state change. This means no double- or triple-faults
    and potentially a 1 clock state change.

    The problem with errors is that their behaviour is all over the place.
    A store operation to memory or device marked as write-through would be synchronous with the ST instruction and any errors detected could be associated back to the ST instruction.
    A store operation to memory marked as write-back is asynchronous and
    can be performed long after the ST instruction has retired and
    been removed from the core.

    An ECC memory error can be detected and maybe corrected by the
    error scavenger sweep and not associated with any instruction at all.

    Some devices change state when read. For example a UART receive
    buffer can be FIFO queue and reading it consumes the first entry.
    If there was a bus parity error after a successful read of the
    FIFO then one may or may not want to retry the operation.

    By putting infrequent Errors off in their own bucket they can be
    dealt with on a case by case basis without burdening the frequent
    occurance delivery mechanisms for Exceptions and Interrupts.


    Have you ever messed around with a Pthread async cancel?

    PTHREAD_CANCEL_ASYNCHRONOUS

    Iirc, a pthread emulation over on windows had to use a damn kernel
    driver to do it. I say, avoid at all costs!
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From MitchAlsup@user5857@newsgrouper.org.invalid to comp.arch on Tue Oct 27 16:35:08 2026
    From Newsgroup: comp.arch

    EricP <ThatWouldBeTelling@thevillage.com> posted:

    On 2026-Oct-25 11:53, Scott Lurndal wrote:
    MitchAlsup <user5857@newsgrouper.org.invalid> writes:
    quadibloc@invalid.com (John Savard) posted:

    On Sat, 05 Oct 2024 17:57:12 GMT, anton@mips.complang.tuwien.ac.at
    (Anton Ertl) wrote:

    Ok, it's more efficient to insert an interrupt call into the
    instruction stream in the decoder: all the in-flight instructions will >>>> be completed instead of going to waste. However, the interrupt will >>>> usually be serviced later, and, as you point out, if the instruction >>>> stream is redirected for some other reason, you may have to replay the >>>> interrupt.

    A _trap_ can be a problem on an out-of-order machine, since traps
    result from exceptions, and so they have to be tied to the instruction >>> stream.

    We have {Traps, Exceptions, Interrupts}.

    A trap is synchronous to the executing code and we want IP pointing at the >> subsequent instruction. A trap may send a small amount of data to the service
    at the other end. Not all registers have to be preserved. Registers R0..R15
    are considered temporaries at the caller->callee boundary. Those registers >> either carry a result or are cleared <HW> at the callee->caller boundary:: >> in My 66000 SBI.

    An Exception is synchronous to the executing code and we want IP pointing >> at the offending instruction. What kind of exception is the message to the >> service routine. All Thread-State has to be preserved. A Thread should
    be able to handle its own exceptions should it communicate same with
    Guest OS.

    Exceptions are not alway precise. For example, an exception
    on a posted store (that's spent time in a store buffer, for
    example), may have an exception asynchronously.

    This is a terminology problem that comes from processors putting
    all the "alert" notifications through the same delivery mechanism.
    People often use various the terms as interchangeable when really
    they are not.

    In my terminology I have Exceptions, Interrupts, and Errors.
    I take all the well defined stuff and put it in the Exception and
    Interrupt buckets, and take all the weird stuff and call it Errors.

    To a very large extent I agree with you. The things you call errors
    I call Checks. Checks are never supposed to happen {{like late store
    data ECC fails}}.

    Exceptions are defined by the ISA, are precise, and synchronous
    to the excepting instruction. There are two kinds, Faults and Traps.
    Most exceptions notifications cannot be deferred or "masked".
    Floating point exceptions are potentially maskable however if
    they are then any auxiliary information about the precise source of
    the FP exceptions will be synchronous with instruction that unmasks
    a pending floating point exception.

    Interrupts are defined as precise and asynchronous.
    Their number and priority mechanisms is defined as model specific.
    Interrupts are potentially maskable and may be deferred.
    The only ISA defined part of interrupts are the master interrupt
    mask control instructions INTEN enable and INTDI disable.

    Exceptions and Interrupts are defined as precise and restartable.

    The mechanism for delivering Exception and Interrupt notifications
    is defined as model specific. In practice this just means that
    operating systems should modularize this layer of their software
    (sometimes called a HAL or Hardware Abstraction Layer).

    Errors are model and error specific, may be synchronous or asynchronous,
    may be precise (Faults or Traps) or imprecise (Aborts).
    Errors may or may not be deferred (maskable).

    It is at this point I generally point out that Checks {errors} deliver
    control to the highest privilege level {HyperVisor} not the next higher privilege level {Guest OS when in User}.

    Errors may not be restartable.
    The mechanism for delivering Error notifications is defined as
    model and error specific.

    No, while the checks are model specific, the mechanism to deliver them
    to HV is specified.

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From MitchAlsup@user5857@newsgrouper.org.invalid to comp.arch on Tue Oct 27 16:39:26 2026
    From Newsgroup: comp.arch

    anton@mips.complang.tuwien.ac.at (Anton Ertl) posted:

    quadibloc@invalid.com (John Savard) writes:
    On Sat, 05 Oct 2024 17:57:12 GMT, anton@mips.complang.tuwien.ac.at
    (Anton Ertl) wrote:

    Ok, it's more efficient to insert an interrupt call into the
    instruction stream in the decoder: all the in-flight instructions will
    be completed instead of going to waste. However, the interrupt will >>usually be serviced later, and, as you point out, if the instruction >>stream is redirected for some other reason, you may have to replay the >>interrupt.
    ...
    An interrupt, on the other hand, just needs to get serviced. The
    process being interrupted just needs not to be disturbed by it.
    That leaves several alternatives.
    You could somehow make the machine act as if it has a second core just
    to serve interrupts. In fact, some early architectures anticipated SMT
    by having a second set of registers for privileged operation.

    That's actually something that one can do relatively easily with cores capable of SMT: leave an SMT thread on one core (or n, if you want to
    be able to serve n interrupts at the same time) unallocated on an
    otherwise powered-up core, and have the interrupt controller direct
    the interrupt at one of these threads. The interrupt can be serviced
    right away, without throwing away work that has been done on the other
    core. If the interrupt thread gets priority on competetivelt
    allocated resources, that will minimize the interrupt latency.

    Or, since interrupt routines _are_ at kernel level... when there's an >interrupt, save the whole internal machine state, including the entire >pipeline. After all, since interrupt routines are privileged, they can
    use a special return instruction that sets up the machine's internals >instead of just restoring registers and branching somewhere.

    This stack puke approach has been tried on various machines such as
    some (all?) 68000 family members, but all machines that did this have vanished from the general-purpose computing market.

    Agreed.

    For OoO machines,
    the internal state is relatively large, and puking it on the stack and swallowing the puke back is something that would require additional
    data paths,

    Also agreed.

    and even once they are there, would require so many cycles
    that it is more efficient to throw away everything that's in flight,

    Yes, Yes, Yes ...

    and then start from the architectural state on resuming from the
    interrupt.

    So, why not just make the transfer of control precise !

    - anton
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From MitchAlsup@user5857@newsgrouper.org.invalid to comp.arch on Tue Oct 27 16:48:45 2026
    From Newsgroup: comp.arch

    EricP <ThatWouldBeTelling@thevillage.com> posted:

    On 2026-Oct-26 13:17, Robert Finch wrote:
    On 2026-10-26 11:06 a.m., EricP wrote:
    On 2026-Oct-25 11:53, Scott Lurndal wrote:
    MitchAlsup <user5857@newsgrouper.org.invalid> writes:
    ----------snip-----------

    Precise means the processor state corresponds with a sequential model
    of program execution where one instruction completes before the next begin.

    Synchronous means that the saved state corresponds with the particular instruction that triggered the state or the instruction after it.
    For a Fault the state correspond to the triggering instruction.
    For a Trap the state corresponds to the instruction after the
    triggering instruction.
    All exceptions, whether faults or traps, are synchronous.

    Asynchronous means that the state does not correspond with any
    particular instruction. All Interrupts are asynchronous.

    For an asynchronous Interrupt or synchronous Exception to be
    restartable it must be precise.

    Some architectures defined "continue" model of returning from exceptions {68000} where enough state was saved so the ESR could finish the failed instruction and then continue onward with the next instruction.

    Both seem "workable" while precise has won overall.

    Each of Exceptions and Interrupts have well defined behaviour.
    Exceptions only have one delivery mechanism whereas Interrupts might
    have a variety of Interrupt controllers each with its own behavior.

    They can also be quite frequent and I didn't want to burden their
    dispatching mechanisms with the extra overhead of also dealing with
    potential errors that might infrequently occur.
    In both cases I would use a variation on branch-and-link to a hardware
    state save and generated RIP address so there are no memory references
    during the internal state change. This means no double- or triple-faults
    and potentially a 1 clock state change.

    The problem with errors is that their behaviour is all over the place.
    A store operation to memory or device marked as write-through would be synchronous with the ST instruction and any errors detected could be associated back to the ST instruction.
    A store operation to memory marked as write-back is asynchronous and
    can be performed long after the ST instruction has retired and
    been removed from the core.

    An ECC memory error can be detected and maybe corrected by the
    error scavenger sweep and not associated with any instruction at all.

    Some devices change state when read. For example a UART receive
    buffer can be FIFO queue and reading it consumes the first entry.
    If there was a bus parity error after a successful read of the
    FIFO then one may or may not want to retry the operation.

    By putting infrequent Errors off in their own bucket they can be
    dealt with on a case by case basis without burdening the frequent
    occurance delivery mechanisms for Exceptions and Interrupts.

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From scott@scott@slp53.sl.home (Scott Lurndal) to comp.arch on Tue Oct 27 18:33:32 2026
    From Newsgroup: comp.arch

    MitchAlsup <user5857@newsgrouper.org.invalid> writes:
    EricP <ThatWouldBeTelling@thevillage.com> posted:

    On 2026-Oct-25 11:53, Scott Lurndal wrote:
    MitchAlsup <user5857@newsgrouper.org.invalid> writes:
    quadibloc@invalid.com (John Savard) posted:

    On Sat, 05 Oct 2024 17:57:12 GMT, anton@mips.complang.tuwien.ac.at
    (Anton Ertl) wrote:

    Ok, it's more efficient to insert an interrupt call into the
    instruction stream in the decoder: all the in-flight instructions will >> >>>> be completed instead of going to waste. However, the interrupt will
    usually be serviced later, and, as you point out, if the instruction
    stream is redirected for some other reason, you may have to replay the >> >>>> interrupt.

    A _trap_ can be a problem on an out-of-order machine, since traps
    result from exceptions, and so they have to be tied to the instruction >> >>> stream.

    We have {Traps, Exceptions, Interrupts}.

    A trap is synchronous to the executing code and we want IP pointing at the
    subsequent instruction. A trap may send a small amount of data to the service
    at the other end. Not all registers have to be preserved. Registers R0..R15
    are considered temporaries at the caller->callee boundary. Those registers
    either carry a result or are cleared <HW> at the callee->caller boundary::
    in My 66000 SBI.

    An Exception is synchronous to the executing code and we want IP pointing >> >> at the offending instruction. What kind of exception is the message to the
    service routine. All Thread-State has to be preserved. A Thread should
    be able to handle its own exceptions should it communicate same with
    Guest OS.

    Exceptions are not alway precise. For example, an exception
    on a posted store (that's spent time in a store buffer, for
    example), may have an exception asynchronously.

    This is a terminology problem that comes from processors putting
    all the "alert" notifications through the same delivery mechanism.
    People often use various the terms as interchangeable when really
    they are not.

    In my terminology I have Exceptions, Interrupts, and Errors.
    I take all the well defined stuff and put it in the Exception and
    Interrupt buckets, and take all the weird stuff and call it Errors.

    To a very large extent I agree with you. The things you call errors
    I call Checks. Checks are never supposed to happen {{like late store
    data ECC fails}}.

    If it is "never supposed to happen", why bother to check at all...

    For RAS reasons, if nothing else, one must assume that anything
    may happen.


    <snip>

    Errors are model and error specific, may be synchronous or asynchronous,
    may be precise (Faults or Traps) or imprecise (Aborts).
    Errors may or may not be deferred (maskable).

    It is at this point I generally point out that Checks {errors} deliver >control to the highest privilege level {HyperVisor} not the next higher >privilege level {Guest OS when in User}.

    It's better if that is programmable, i.e. the highest privilege level
    (even higher than the hypervisor - i.e. the EL3 in ARM64, or SMM for
    intel/amd (or perhaps a BMC)). The higher privilege levels can delegate
    the asynchronous "check" exception handling to a lower level, if necessary.

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From MitchAlsup@user5857@newsgrouper.org.invalid to comp.arch on Tue Oct 27 21:07:51 2026
    From Newsgroup: comp.arch

    scott@slp53.sl.home (Scott Lurndal) posted:

    MitchAlsup <user5857@newsgrouper.org.invalid> writes:
    -----------------------------
    In my terminology I have Exceptions, Interrupts, and Errors.
    I take all the well defined stuff and put it in the Exception and
    Interrupt buckets, and take all the weird stuff and call it Errors.

    To a very large extent I agree with you. The things you call errors
    I call Checks. Checks are never supposed to happen {{like late store
    data ECC fails}}.

    If it is "never supposed to happen", why bother to check at all...

    Guest OS can run as if uncorrectable ECC can never happen. So, to
    Guest OS it is never supposed to happen, and Guest OS is not setup
    to deal with the problem if it does.

    HyperVisor cannot run banking applications with UC ECC, whereas some
    real-time control might be able to; so you punt it all the way up the
    privilege ladder.

    For RAS reasons, if nothing else, one must assume that anything
    may happen.

    But, still, Guest OS should not be burdened with those checks.


    <snip>

    Errors are model and error specific, may be synchronous or asynchronous, >> may be precise (Faults or Traps) or imprecise (Aborts).
    Errors may or may not be deferred (maskable).

    It is at this point I generally point out that Checks {errors} deliver >control to the highest privilege level {HyperVisor} not the next higher >privilege level {Guest OS when in User}.

    It's better if that is programmable, i.e. the highest privilege level
    (even higher than the hypervisor - i.e. the EL3 in ARM64, or SMM for intel/amd (or perhaps a BMC)). The higher privilege levels can delegate
    the asynchronous "check" exception handling to a lower level, if necessary.

    Or abort the lower level that suffered the check, possibly restarting it
    from the last checkpoint with new/diffent memory.

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From scott@scott@slp53.sl.home (Scott Lurndal) to comp.arch on Tue Oct 27 21:17:11 2026
    From Newsgroup: comp.arch

    MitchAlsup <user5857@newsgrouper.org.invalid> writes:
    scott@slp53.sl.home (Scott Lurndal) posted:

    MitchAlsup <user5857@newsgrouper.org.invalid> writes: >-----------------------------
    In my terminology I have Exceptions, Interrupts, and Errors.
    I take all the well defined stuff and put it in the Exception and
    Interrupt buckets, and take all the weird stuff and call it Errors.

    To a very large extent I agree with you. The things you call errors
    I call Checks. Checks are never supposed to happen {{like late store
    data ECC fails}}.

    If it is "never supposed to happen", why bother to check at all...

    Guest OS can run as if uncorrectable ECC can never happen. So, to
    Guest OS it is never supposed to happen, and Guest OS is not setup
    to deal with the problem if it does.

    HyperVisor cannot run banking applications with UC ECC, whereas some >real-time control might be able to; so you punt it all the way up the >privilege ladder.

    For RAS reasons, if nothing else, one must assume that anything
    may happen.

    But, still, Guest OS should not be burdened with those checks.

    Nor should the hypervisor. All of which are generally hardware
    agnostic (KVM, XEN, VMWare, et alia) for most everything except
    the virtualization mechanics (AMD's SVM or Intel's VM capabilities).
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From MitchAlsup@user5857@newsgrouper.org.invalid to comp.arch on Wed Oct 28 15:35:45 2026
    From Newsgroup: comp.arch

    scott@slp53.sl.home (Scott Lurndal) posted:

    MitchAlsup <user5857@newsgrouper.org.invalid> writes:
    scott@slp53.sl.home (Scott Lurndal) posted:

    MitchAlsup <user5857@newsgrouper.org.invalid> writes: >-----------------------------
    In my terminology I have Exceptions, Interrupts, and Errors.
    I take all the well defined stuff and put it in the Exception and
    Interrupt buckets, and take all the weird stuff and call it Errors.

    To a very large extent I agree with you. The things you call errors
    I call Checks. Checks are never supposed to happen {{like late store
    data ECC fails}}.

    If it is "never supposed to happen", why bother to check at all...

    Guest OS can run as if uncorrectable ECC can never happen. So, to
    Guest OS it is never supposed to happen, and Guest OS is not setup
    to deal with the problem if it does.

    HyperVisor cannot run banking applications with UC ECC, whereas some >real-time control might be able to; so you punt it all the way up the >privilege ladder.

    For RAS reasons, if nothing else, one must assume that anything
    may happen.

    But, still, Guest OS should not be burdened with those checks.

    Nor should the hypervisor. All of which are generally hardware
    agnostic (KVM, XEN, VMWare, et alia) for most everything except
    the virtualization mechanics (AMD's SVM or Intel's VM capabilities).

    So, it all one has is {user, Guest, Host, Hyper}: who SHOULD be burdened
    with creating responses to things that are not supposed to happen but do ??
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From EricP@ThatWouldBeTelling@thevillage.com to comp.arch on Wed Oct 28 14:19:56 2026
    From Newsgroup: comp.arch

    On 2026-Oct-27 12:35, MitchAlsup wrote:
    EricP <ThatWouldBeTelling@thevillage.com> posted:

    In my terminology I have Exceptions, Interrupts, and Errors.
    I take all the well defined stuff and put it in the Exception and
    Interrupt buckets, and take all the weird stuff and call it Errors.

    To a very large extent I agree with you. The things you call errors
    I call Checks. Checks are never supposed to happen {{like late store
    data ECC fails}}.

    Exceptions are defined by the ISA, are precise, and synchronous
    to the excepting instruction. There are two kinds, Faults and Traps.
    Most exceptions notifications cannot be deferred or "masked".
    Floating point exceptions are potentially maskable however if
    they are then any auxiliary information about the precise source of
    the FP exceptions will be synchronous with instruction that unmasks
    a pending floating point exception.

    Interrupts are defined as precise and asynchronous.
    Their number and priority mechanisms is defined as model specific.
    Interrupts are potentially maskable and may be deferred.
    The only ISA defined part of interrupts are the master interrupt
    mask control instructions INTEN enable and INTDI disable.

    Exceptions and Interrupts are defined as precise and restartable.

    The mechanism for delivering Exception and Interrupt notifications
    is defined as model specific. In practice this just means that
    operating systems should modularize this layer of their software
    (sometimes called a HAL or Hardware Abstraction Layer).

    Errors are model and error specific, may be synchronous or asynchronous,
    may be precise (Faults or Traps) or imprecise (Aborts).
    Errors may or may not be deferred (maskable).

    It is at this point I generally point out that Checks {errors} deliver control to the highest privilege level {HyperVisor} not the next higher privilege level {Guest OS when in User}.

    I didn't have separate privilege modes for HV and Errors-Checks,
    just Supervisor mode.

    There is a HV mode which triggers exceptions when guest OS attempt to
    access certain privileged control registers while guest is in Super mode.
    But that is enabled by privileged control flags.

    I'm not sure what an Error-Check mode could do that is different
    from faulting into Super mode and disabling the HV enable flag,
    and vectoring off to a privileged error handler routine.

    Errors may not be restartable.
    The mechanism for delivering Error notifications is defined as
    model and error specific.

    No, while the checks are model specific, the mechanism to deliver them
    to HV is specified.


    In my approach the ISA defines:
    - Exceptions type codes and auxiliary data, and their associated instructions. - That priority interrupts exist,
    that there is a master enable/disable flag controlled INTEN and INTDI instructions,
    that there is a REIC Return from Exception or Interrupt Conditional instruction
    to return from OS to prior execution context.
    - That Errors are possible.

    However the mechanism for communicating between the HW and SW handlers
    is defined as model specific. In the case of exceptions that mechanism is unlikely to change - there are some privileged control registers to set up,
    HW calculates a jump address using the exception code (no memory is accessed during state transition so no external errors can disrupt the context switch).

    However Interrupts and Errors (Checks) I see as external to the ISA
    and defined by the needs of the surrounding IO and other hardware.

    The interrupt controllers I see as plug-in HW and SW modules external to the ISA,
    and there would be multiple kinds interrupt controllers for different markets. Potentially there are different controllers for embedded, desktop, server-bare, and server-VM. Mobile and laptop are more like embedded where there are no
    new devices that plug into the interrupt system, than like desktop or server. Embedded, mobile and laptop probably want the lowest cost interfaces,
    whereas servers, particularly those running virtual machines want more features.

    These interfaces are specified, its just that they are documented for each model
    and any differences only affect privileged operating system software.



    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From George Neuner@gneuner2@comcast.net to comp.arch on Wed Oct 28 14:34:27 2026
    From Newsgroup: comp.arch

    On Wed, 28 Oct 2026 15:35:45 GMT, MitchAlsup
    <user5857@newsgrouper.org.invalid> wrote:

    scott@slp53.sl.home (Scott Lurndal) posted:

    MitchAlsup <user5857@newsgrouper.org.invalid> writes:
    scott@slp53.sl.home (Scott Lurndal) posted:

    MitchAlsup <user5857@newsgrouper.org.invalid> writes:
    -----------------------------
    In my terminology I have Exceptions, Interrupts, and Errors.
    I take all the well defined stuff and put it in the Exception and
    Interrupt buckets, and take all the weird stuff and call it Errors.

    To a very large extent I agree with you. The things you call errors
    I call Checks. Checks are never supposed to happen {{like late store
    data ECC fails}}.

    If it is "never supposed to happen", why bother to check at all...

    Guest OS can run as if uncorrectable ECC can never happen. So, to
    Guest OS it is never supposed to happen, and Guest OS is not setup
    to deal with the problem if it does.

    HyperVisor cannot run banking applications with UC ECC, whereas some
    real-time control might be able to; so you punt it all the way up the
    privilege ladder.

    For RAS reasons, if nothing else, one must assume that anything
    may happen.

    But, still, Guest OS should not be burdened with those checks.

    Nor should the hypervisor. All of which are generally hardware
    agnostic (KVM, XEN, VMWare, et alia) for most everything except
    the virtualization mechanics (AMD's SVM or Intel's VM capabilities).

    So, it all one has is {user, Guest, Host, Hyper}: who SHOULD be burdened
    with creating responses to things that are not supposed to happen but do ??

    There is another question along with who handles it ... what should be
    done? Uncorrected ECC error (check) means the data has to be
    considered corrupt [even if it really is valid] and unusable.

    Do you crash the program that can't handle it?
    Do you crash the guest OS that can't handle it?
    :

    How is the user going to feel about your system?
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From EricP@ThatWouldBeTelling@thevillage.com to comp.arch on Wed Oct 28 14:39:56 2026
    From Newsgroup: comp.arch

    On 2026-Oct-26 17:14, Chris M. Thomasson wrote:
    On 10/26/2026 2:03 PM, EricP wrote:


    Have you ever messed around with a Pthread async cancel?

    PTHREAD_CANCEL_ASYNCHRONOUS

    Iirc, a pthread emulation over on windows had to use a damn kernel driver to do it. I say, avoid at all costs!

    No, I have never used Pthreads and I have no idea
    how it is implemented on Windows.

    It sounds like it calls TerminateThread which does exactly that,
    without giving an application any chance to clean up nicely.
    But in the Unix manuals I also see warnings about the use of
    async cancel in general on any implementation.

    VMS got this one right - the ability to asynchronously force a
    process/thread to do a clean exit.
    A call to SYS$FORCEEX posts a user mode AST to the process/thread,
    which *interrupts* and raises a FORCE_EXIT exception in the process/thread, allowing stack exception catch handlers or thread exit rundown handlers
    a chance to clean up properly (release mutexes, finish a heap
    allocation without corrupting the heap, etc).

    WNT doesn't have asynchronous (interrupting) user mode APC's,
    just synchronous (polled) ones at alertable waits.
    So you can't always force another thread to do your bidding like stopping.
    (It is actually possible to do this using GetThreadContext and SetThreadContext.
    But as this would be non-standard the surrounding code for things like
    mutex holders and heap allocators would not expect it and would have no supporting exit handler code for it.
    Also Get/SetThreadContext requires debug privilege.)


    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From EricP@ThatWouldBeTelling@thevillage.com to comp.arch on Wed Oct 28 14:57:16 2026
    From Newsgroup: comp.arch

    On 2026-Oct-27 17:07, MitchAlsup wrote:
    scott@slp53.sl.home (Scott Lurndal) posted:

    MitchAlsup <user5857@newsgrouper.org.invalid> writes:
    -----------------------------
    In my terminology I have Exceptions, Interrupts, and Errors.
    I take all the well defined stuff and put it in the Exception and
    Interrupt buckets, and take all the weird stuff and call it Errors.

    To a very large extent I agree with you. The things you call errors
    I call Checks. Checks are never supposed to happen {{like late store
    data ECC fails}}.

    If it is "never supposed to happen", why bother to check at all...

    Guest OS can run as if uncorrectable ECC can never happen. So, to
    Guest OS it is never supposed to happen, and Guest OS is not setup
    to deal with the problem if it does.

    If a memory read error is uncorrectable then the entire hierarchy should be informed.
    If a guest OS chooses not to do anything in its handler then that's it business.
    HW notifies the HV, which does its thing and punts it to the guest OS,
    which can record it and punts it to the app, which dies with a fatal exception.


    HyperVisor cannot run banking applications with UC ECC, whereas some real-time control might be able to; so you punt it all the way up the privilege ladder.

    For RAS reasons, if nothing else, one must assume that anything
    may happen.

    But, still, Guest OS should not be burdened with those checks.


    <snip>

    Errors are model and error specific, may be synchronous or asynchronous, >>>> may be precise (Faults or Traps) or imprecise (Aborts).
    Errors may or may not be deferred (maskable).

    It is at this point I generally point out that Checks {errors} deliver
    control to the highest privilege level {HyperVisor} not the next higher
    privilege level {Guest OS when in User}.

    It's better if that is programmable, i.e. the highest privilege level
    (even higher than the hypervisor - i.e. the EL3 in ARM64, or SMM for
    intel/amd (or perhaps a BMC)). The higher privilege levels can delegate
    the asynchronous "check" exception handling to a lower level, if necessary.

    Or abort the lower level that suffered the check, possibly restarting it
    from the last checkpoint with new/diffent memory.


    I'm not clear on exactly what this "higher privilege level" does.
    Privileges typically give access to protected resources like control registers. But Super mode, or HV mode if in a VM, already has full access.


    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From MitchAlsup@user5857@newsgrouper.org.invalid to comp.arch on Wed Oct 28 19:02:55 2026
    From Newsgroup: comp.arch

    EricP <ThatWouldBeTelling@thevillage.com> posted:

    On 2026-Oct-27 12:35, MitchAlsup wrote:
    EricP <ThatWouldBeTelling@thevillage.com> posted:

    In my terminology I have Exceptions, Interrupts, and Errors.
    I take all the well defined stuff and put it in the Exception and
    Interrupt buckets, and take all the weird stuff and call it Errors.

    To a very large extent I agree with you. The things you call errors
    I call Checks. Checks are never supposed to happen {{like late store
    data ECC fails}}.

    Exceptions are defined by the ISA, are precise, and synchronous
    to the excepting instruction. There are two kinds, Faults and Traps.
    Most exceptions notifications cannot be deferred or "masked".
    Floating point exceptions are potentially maskable however if
    they are then any auxiliary information about the precise source of
    the FP exceptions will be synchronous with instruction that unmasks
    a pending floating point exception.

    Interrupts are defined as precise and asynchronous.
    Their number and priority mechanisms is defined as model specific.
    Interrupts are potentially maskable and may be deferred.
    The only ISA defined part of interrupts are the master interrupt
    mask control instructions INTEN enable and INTDI disable.

    Exceptions and Interrupts are defined as precise and restartable.

    The mechanism for delivering Exception and Interrupt notifications
    is defined as model specific. In practice this just means that
    operating systems should modularize this layer of their software
    (sometimes called a HAL or Hardware Abstraction Layer).

    Errors are model and error specific, may be synchronous or asynchronous, >> may be precise (Faults or Traps) or imprecise (Aborts).
    Errors may or may not be deferred (maskable).

    It is at this point I generally point out that Checks {errors} deliver control to the highest privilege level {HyperVisor} not the next higher privilege level {Guest OS when in User}.

    I didn't have separate privilege modes for HV and Errors-Checks,
    just Supervisor mode.

    There is a HV mode which triggers exceptions when guest OS attempt to
    access certain privileged control registers while guest is in Super mode.
    But that is enabled by privileged control flags.

    I'm not sure what an Error-Check mode could do that is different
    from faulting into Super mode and disabling the HV enable flag,
    and vectoring off to a privileged error handler routine.

    For example, HV takes a UC ECC fault from Guest OS. HV aborts that Guest
    OS and then spawns a new Guest OS and tells it to recover to its last
    saved checkpoint {because it wants Guest OS to use different memory
    pages to avoid future UC ECC faults.}

    I guess: if Guest OS is capable of rolling itself back to its latest
    saved checkpoint, and do something about the UC ECC page, the mechanism
    would not need to go all the way up to HV.

    Errors may not be restartable.
    The mechanism for delivering Error notifications is defined as
    model and error specific.

    No, while the checks are model specific, the mechanism to deliver them
    to HV is specified.


    In my approach the ISA defines:
    - Exceptions type codes and auxiliary data, and their associated instructions.

    I basically agree--and I define exception type code(s) to reside in R0 at control delivery, while auxiliary data is in R1-R4. This comprises the first 64-bits of the instruction, and up to 3 Operands to the instruction. Of course, IP points at instruction.

    - That priority interrupts exist,

    Both priority and privilege. Priority > Privilege. When a higher priority enabled interrupt is pending than core is currently running, interrupt
    control transfer is performed.

    that there is a master enable/disable flag controlled INTEN and INTDI instructions,
    that there is a REIC Return from Exception or Interrupt Conditional instruction
    to return from OS to prior execution context.

    I my model, control is delivered without disablement, so if while transfer- ring control a higher <still> interrupt becomes pending, the higher priority interrupt gets control before the lower priority interrupt can retire its first instruction. {{That is control is delivered with a re-entrant state in
    RF and Thread-Header.}}

    - That Errors are possible.

    However the mechanism for communicating between the HW and SW handlers
    is defined as model specific.

    I want unmodified OSs to remain upwards compatible across implementations.
    {and mostly downwards, too}

    In the case of exceptions that mechanism is unlikely to change - there are some privileged control registers to set up, HW calculates a jump address using the exception code (no memory is accessed during state transition so no external errors can disrupt the context switch).

    However Interrupts and Errors (Checks) I see as external to the ISA
    and defined by the needs of the surrounding IO and other hardware.

    Having an ID and IE instructions places interrupts IN the ISA. There are already plenty of places in the 'system' where individual {or groups of interrupts} can be disabled; without having ID and IE at the core. They
    are <generally> 'IN' the core due to non-re-entrant behavior at control transfer.

    The interrupt controllers I see as plug-in HW and SW modules external to the ISA,
    and there would be multiple kinds interrupt controllers for different markets.

    In my model, a core is a device and comes with a PCIe type-1 header. manufacture {My 66000} and device {core} tell Boot what kind of SW to
    load for that 'core'. The attached capabilities lists also help BOOT
    in loading appropriate SW for that/those cores.

    Potentially there are different controllers for embedded, desktop, server-bare,
    and server-VM.

    Yep, the chip may be the same, but manufacture and device point at different files to be loaded into the runnable image.

    Mobile and laptop are more like embedded where there are no new devices that plug into the interrupt system, than like desktop or server.

    You are still going to want plug-and-play. You are unlikely to want Disks, M2 to PaP; you will want discovered LAN WiFi, USB, CD-ROM, DVD.

    Embedded, mobile and laptop probably want the lowest cost interfaces,
    whereas servers, particularly those running virtual machines want more features.

    These interfaces are specified, its just that they are documented for each model
    and any differences only affect privileged operating system software.



    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From scott@scott@slp53.sl.home (Scott Lurndal) to comp.arch on Wed Oct 28 20:16:55 2026
    From Newsgroup: comp.arch

    George Neuner <gneuner2@comcast.net> writes:
    On Wed, 28 Oct 2026 15:35:45 GMT, MitchAlsup ><user5857@newsgrouper.org.invalid> wrote:

    scott@slp53.sl.home (Scott Lurndal) posted:

    MitchAlsup <user5857@newsgrouper.org.invalid> writes:
    scott@slp53.sl.home (Scott Lurndal) posted:

    MitchAlsup <user5857@newsgrouper.org.invalid> writes:
    -----------------------------
    In my terminology I have Exceptions, Interrupts, and Errors.
    I take all the well defined stuff and put it in the Exception and
    Interrupt buckets, and take all the weird stuff and call it Errors. >>> >> >
    To a very large extent I agree with you. The things you call errors
    I call Checks. Checks are never supposed to happen {{like late store >>> >> >data ECC fails}}.

    If it is "never supposed to happen", why bother to check at all...

    Guest OS can run as if uncorrectable ECC can never happen. So, to
    Guest OS it is never supposed to happen, and Guest OS is not setup
    to deal with the problem if it does.

    HyperVisor cannot run banking applications with UC ECC, whereas some
    real-time control might be able to; so you punt it all the way up the
    privilege ladder.

    For RAS reasons, if nothing else, one must assume that anything
    may happen.

    But, still, Guest OS should not be burdened with those checks.

    Nor should the hypervisor. All of which are generally hardware
    agnostic (KVM, XEN, VMWare, et alia) for most everything except
    the virtualization mechanics (AMD's SVM or Intel's VM capabilities).

    So, it all one has is {user, Guest, Host, Hyper}: who SHOULD be burdened >>with creating responses to things that are not supposed to happen but do ??

    There is another question along with who handles it ... what should be
    done? Uncorrected ECC error (check) means the data has to be
    considered corrupt [even if it really is valid] and unusable.

    On ARM64 systems, which supports industry standard interfaces implemented by both windows and linux, there are four exception levels, in order of
    increasing privilege:

    EL0 User code
    EL1 Kernel code (off the shelf, not platform specific)
    EL2 Hypervisor code (off the shelf, not platform specific)
    EL3 Secure monitor code

    Platform and processor specific code is encapsulated in EL3, so that
    the operating systems and hypervisors can off-the-shelf standard across
    all implementations of a given processor family.

    In addition, most non-consumer ARM64 systems will have a Baseboard
    Management Controller (BMC) and perhaps a CPLD which handle all the
    platform and processor specific RAS and management functionality,
    with a small shim in the EL3 code, if necessary, to interface
    with the BMC (usually over I2C/I3C and/or ethernet). This is
    all provided by the board manufacturer, with the appropriate
    security mechanisms and guarantees (e.g. encrypted communications
    over I3C or ethernet, etc.)

    Beyond that, most processors (intel/amd/arm) used in server-grade
    systems have on-SoC mini processors such as Cortex-M3 or M7 cores for handling boot (including loading firmware from SPI/eMMC controllers prior to
    releasing the primary core from reset). The boot rom is executed by
    the aux (e.g. m7) processor, not the main processor and is pretty
    small, but sufficient to support trusted boot.

    RAS notification and recovery is fairly well defined in the various
    related specifications for standard firmware interfaces (e.g. AcPI).

    Most of the platform-specific recovery is done by the secure firmware,
    BMC or the M7 core(s). The ACPI standard (used by intel/amd/arm) defines
    the standard mechanisms that windows and linux will use to interface
    with the proprietary hardware, including a notification mechanism
    to the hypervisor (which can then, if required, use the same mechanism
    to notify the kernel of an issue). Recovery is done by standard
    non-platform dependent code in the operating systems, if possible.


    Do you crash the program that can't handle it?
    Do you crash the guest OS that can't handle it?
    :

    How is the user going to feel about your system?

    Recovery from an uncorrectable hardware fault is HARD.

    Believe that the user experience is at the forefront of the
    designers of _all_ these systems; certainly at the high-end
    and for most custom designs.

    Worst case, if no recovery path exists for a hardware problem,
    the BMC will reset the board.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Chris M. Thomasson@chris.m.thomasson.1@gmail.com to comp.arch on Wed Oct 28 15:10:36 2026
    From Newsgroup: comp.arch

    On 10/28/2026 11:39 AM, EricP wrote:
    On 2026-Oct-26 17:14, Chris M. Thomasson wrote:
    On 10/26/2026 2:03 PM, EricP wrote:


    Have you ever messed around with a Pthread async cancel?

    PTHREAD_CANCEL_ASYNCHRONOUS

    Iirc, a pthread emulation over on windows had to use a damn kernel
    driver to do it. I say, avoid at all costs!

    No, I have never used Pthreads and I have no idea
    how it is implemented on Windows.

    Okay.


    It sounds like it calls TerminateThread which does exactly that,
    without giving an application any chance to clean up nicely.
    But in the Unix manuals I also see warnings about the use of
    async cancel in general on any implementation.

    Its odd. It needs an actual kernel driver to implement PTHREAD_CANCEL_ASYNCHRONOUS via, iirc, kernel mode APC.







    VMS got this one right - the ability to asynchronously force a
    process/thread to do a clean exit.
    A call to SYS$FORCEEX posts a user mode AST to the process/thread,
    which *interrupts* and raises a FORCE_EXIT exception in the process/thread, allowing stack exception catch handlers or thread exit rundown handlers
    a chance to clean up properly (release mutexes, finish a heap
    allocation without corrupting the heap, etc).

    WNT doesn't have asynchronous (interrupting) user mode APC's,
    just synchronous (polled) ones at alertable waits.
    So you can't always force another thread to do your bidding like stopping. (It is actually possible to do this using GetThreadContext and SetThreadContext.
    But as this would be non-standard the surrounding code for things like
    mutex holders and heap allocators would not expect it and would have no supporting exit handler code for it.
    Also Get/SetThreadContext requires debug privilege.)



    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From MitchAlsup@user5857@newsgrouper.org.invalid to comp.arch on Thu Oct 29 02:17:08 2026
    From Newsgroup: comp.arch

    George Neuner <gneuner2@comcast.net> posted:

    On Wed, 28 Oct 2026 15:35:45 GMT, MitchAlsup <user5857@newsgrouper.org.invalid> wrote:

    scott@slp53.sl.home (Scott Lurndal) posted:

    MitchAlsup <user5857@newsgrouper.org.invalid> writes:
    scott@slp53.sl.home (Scott Lurndal) posted:

    MitchAlsup <user5857@newsgrouper.org.invalid> writes:
    -----------------------------
    In my terminology I have Exceptions, Interrupts, and Errors.
    I take all the well defined stuff and put it in the Exception and
    Interrupt buckets, and take all the weird stuff and call it Errors. >> >> >
    To a very large extent I agree with you. The things you call errors
    I call Checks. Checks are never supposed to happen {{like late store >> >> >data ECC fails}}.

    If it is "never supposed to happen", why bother to check at all...

    Guest OS can run as if uncorrectable ECC can never happen. So, to
    Guest OS it is never supposed to happen, and Guest OS is not setup
    to deal with the problem if it does.

    HyperVisor cannot run banking applications with UC ECC, whereas some
    real-time control might be able to; so you punt it all the way up the
    privilege ladder.

    For RAS reasons, if nothing else, one must assume that anything
    may happen.

    But, still, Guest OS should not be burdened with those checks.

    Nor should the hypervisor. All of which are generally hardware
    agnostic (KVM, XEN, VMWare, et alia) for most everything except
    the virtualization mechanics (AMD's SVM or Intel's VM capabilities).

    So, it all one has is {user, Guest, Host, Hyper}: who SHOULD be burdened >with creating responses to things that are not supposed to happen but do ??

    There is another question along with who handles it ... what should be
    done? Uncorrected ECC error (check) means the data has to be
    considered corrupt [even if it really is valid] and unusable.

    Do you crash the program that can't handle it?

    Real Time control--just move along
    .....
    Banking--recover to checkpoint
    4,000 hour GB FP application--recover to checkpoint

    Do you crash the guest OS that can't handle it?

    PC--take a crash or restart Guest OS
    Server--backup to checkpoint and run forward until you catchup with real-time
    :
    How is the user going to feel about your system?

    Better than if the error was never detected...
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From MitchAlsup@user5857@newsgrouper.org.invalid to comp.arch on Thu Oct 29 02:27:41 2026
    From Newsgroup: comp.arch

    EricP <ThatWouldBeTelling@thevillage.com> posted:

    On 2026-Oct-27 17:07, MitchAlsup wrote:
    scott@slp53.sl.home (Scott Lurndal) posted:

    MitchAlsup <user5857@newsgrouper.org.invalid> writes:
    -----------------------------
    In my terminology I have Exceptions, Interrupts, and Errors.
    I take all the well defined stuff and put it in the Exception and
    Interrupt buckets, and take all the weird stuff and call it Errors.

    To a very large extent I agree with you. The things you call errors
    I call Checks. Checks are never supposed to happen {{like late store
    data ECC fails}}.

    If it is "never supposed to happen", why bother to check at all...

    Guest OS can run as if uncorrectable ECC can never happen. So, to
    Guest OS it is never supposed to happen, and Guest OS is not setup
    to deal with the problem if it does.

    If a memory read error is uncorrectable then the entire hierarchy should be informed.
    If a guest OS chooses not to do anything in its handler then that's it business.
    HW notifies the HV, which does its thing and punts it to the guest OS,
    which can record it and punts it to the app, which dies with a fatal exception.


    HyperVisor cannot run banking applications with UC ECC, whereas some real-time control might be able to; so you punt it all the way up the privilege ladder.

    For RAS reasons, if nothing else, one must assume that anything
    may happen.

    But, still, Guest OS should not be burdened with those checks.


    <snip>

    Errors are model and error specific, may be synchronous or asynchronous, >>>> may be precise (Faults or Traps) or imprecise (Aborts).
    Errors may or may not be deferred (maskable).

    It is at this point I generally point out that Checks {errors} deliver >>> control to the highest privilege level {HyperVisor} not the next higher >>> privilege level {Guest OS when in User}.

    It's better if that is programmable, i.e. the highest privilege level
    (even higher than the hypervisor - i.e. the EL3 in ARM64, or SMM for
    intel/amd (or perhaps a BMC)). The higher privilege levels can delegate >> the asynchronous "check" exception handling to a lower level, if necessary.

    Or abort the lower level that suffered the check, possibly restarting it from the last checkpoint with new/diffent memory.


    I'm not clear on exactly what this "higher privilege level" does.
    Privileges typically give access to protected resources like control registers.
    But Super mode, or HV mode if in a VM, already has full access.

    Not in my design:: each layer can see/access the layers under it,
    but not the layers above it. This is much easier to do when only
    1 instruction has any notion of privilege.

    Application has a few control registers it can see and access.

    Application cannot see/access Guest OS control registers,
    Guest OS can see/access Application control registers.
    Guest OS is protected from Application craziness.

    Guest OS cannot see/access Host OS control registers,
    Host OS can see/access Guest OS control registers.
    Host OS is protected from {Guest OS, Application} craziness.

    Host OS cannot see/access HyperVisor control registers,
    HyperVisor can see/access Host OS control registers.
    HyperVisor is protected from {Host OS Guest OS, Application} craziness.


    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Chris M. Thomasson@chris.m.thomasson.1@gmail.com to comp.arch on Wed Oct 28 21:21:20 2026
    From Newsgroup: comp.arch

    On 10/28/2026 7:17 PM, MitchAlsup wrote:
    George Neuner <gneuner2@comcast.net> posted:

    On Wed, 28 Oct 2026 15:35:45 GMT, MitchAlsup
    <user5857@newsgrouper.org.invalid> wrote:

    scott@slp53.sl.home (Scott Lurndal) posted:

    MitchAlsup <user5857@newsgrouper.org.invalid> writes:
    scott@slp53.sl.home (Scott Lurndal) posted:

    MitchAlsup <user5857@newsgrouper.org.invalid> writes:
    -----------------------------
    In my terminology I have Exceptions, Interrupts, and Errors.
    I take all the well defined stuff and put it in the Exception and >>>>>>>> Interrupt buckets, and take all the weird stuff and call it Errors. >>>>>>>
    To a very large extent I agree with you. The things you call errors >>>>>>> I call Checks. Checks are never supposed to happen {{like late store >>>>>>> data ECC fails}}.

    If it is "never supposed to happen", why bother to check at all...

    Guest OS can run as if uncorrectable ECC can never happen. So, to
    Guest OS it is never supposed to happen, and Guest OS is not setup
    to deal with the problem if it does.

    HyperVisor cannot run banking applications with UC ECC, whereas some >>>>> real-time control might be able to; so you punt it all the way up the >>>>> privilege ladder.

    For RAS reasons, if nothing else, one must assume that anything
    may happen.

    But, still, Guest OS should not be burdened with those checks.

    Nor should the hypervisor. All of which are generally hardware
    agnostic (KVM, XEN, VMWare, et alia) for most everything except
    the virtualization mechanics (AMD's SVM or Intel's VM capabilities).

    So, it all one has is {user, Guest, Host, Hyper}: who SHOULD be burdened >>> with creating responses to things that are not supposed to happen but do ?? >>
    There is another question along with who handles it ... what should be
    done? Uncorrected ECC error (check) means the data has to be
    considered corrupt [even if it really is valid] and unusable.

    Do you crash the program that can't handle it?

    Real Time control--just move along

    For some damn reason this made me think about some old Space Quest games.




    .....
    Banking--recover to checkpoint
    4,000 hour GB FP application--recover to checkpoint

    Do you crash the guest OS that can't handle it?

    PC--take a crash or restart Guest OS
    Server--backup to checkpoint and run forward until you catchup with real-time
    :
    How is the user going to feel about your system?

    Better than if the error was never detected...

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From EricP@ThatWouldBeTelling@thevillage.com to comp.arch on Thu Oct 29 14:50:11 2026
    From Newsgroup: comp.arch

    On 2026-Oct-28 18:10, Chris M. Thomasson wrote:
    On 10/28/2026 11:39 AM, EricP wrote:
    On 2026-Oct-26 17:14, Chris M. Thomasson wrote:
    On 10/26/2026 2:03 PM, EricP wrote:


    Have you ever messed around with a Pthread async cancel?

    PTHREAD_CANCEL_ASYNCHRONOUS

    Iirc, a pthread emulation over on windows had to use a damn kernel driver to do it. I say, avoid at all costs!

    No, I have never used Pthreads and I have no idea
    how it is implemented on Windows.

    Okay.


    It sounds like it calls TerminateThread which does exactly that,
    without giving an application any chance to clean up nicely.
    But in the Unix manuals I also see warnings about the use of
    async cancel in general on any implementation.

    Its odd. It needs an actual kernel driver to implement PTHREAD_CANCEL_ASYNCHRONOUS via, iirc, kernel mode APC.

    People often use drivers to work around functions requiring
    elevated privileges.


    VMS got this one right - the ability to asynchronously force a
    process/thread to do a clean exit.
    A call to SYS$FORCEEX posts a user mode AST to the process/thread,
    which *interrupts* and raises a FORCE_EXIT exception in the process/thread, >> allowing stack exception catch handlers or thread exit rundown handlers
    a chance to clean up properly (release mutexes, finish a heap
    allocation without corrupting the heap, etc).

    WNT doesn't have asynchronous (interrupting) user mode APC's,
    just synchronous (polled) ones at alertable waits.
    So you can't always force another thread to do your bidding like stopping. >> (It is actually possible to do this using GetThreadContext and SetThreadContext.
    But as this would be non-standard the surrounding code for things like
    mutex holders and heap allocators would not expect it and would have no
    supporting exit handler code for it.
    Also Get/SetThreadContext requires debug privilege.)




    It appears what I speculated is exactly what they did.

    https://sourceforge.net/projects/pthreads4w/files/

    This refers to them writing their own function QueueUserAPCEx
    to force a really asynchronous (interrupting) subroutine call
    onto a thread.

    I didn't want to download their files and search them but
    found some documentation elsewhere:

    https://locklessinc.com/articles/pthreads_on_windows/

    You can see below they are doing exactly what I said,
    using GetThreadContext and SetThreadContext to "edit" the thread
    and jam their own routine call into it.
    It sounds like they packaged this into a DLL and invoke it with a
    driver to get around the need for giving Debug privilege to everyone.

    This won't work for the reasons I said above:
    the software above it in the call stack must have been written
    *knowing* that this "force exit" can happen and have established
    exit handlers for the stack unwind. The OS must define this
    force-exit mechanism right from the start so all cleanup code uses it.
    VMS did that, WNT did not.

    static int pthread_cancel(pthread_t t)
    {
    if (t->p_state & PTHREAD_CANCEL_ASYNCHRONOUS)
    {
    /* Dangerous asynchronous cancelling */
    CONTEXT ctxt;

    /* Already done? */
    if (t->cancelled) return ESRCH;

    ctxt.ContextFlags = CONTEXT_CONTROL;

    SuspendThread(t->h);
    GetThreadContext(t->h, &ctxt);
    #ifdef _M_X64
    ctxt.Rip = (uintptr_t) _pthread_invoke_cancel;
    #else
    ctxt.Eip = (uintptr_t) _pthread_invoke_cancel;
    #endif
    SetThreadContext(t->h, &ctxt);

    /* Also try deferred Cancelling */
    t->cancelled = 1;

    /* Notify everyone to look */
    _InterlockedIncrement(&_pthread_cancelling);

    ResumeThread(t->h);
    }







    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From George Neuner@gneuner2@comcast.net to comp.arch on Thu Oct 29 21:49:36 2026
    From Newsgroup: comp.arch

    On Thu, 29 Oct 2026 02:17:08 GMT, MitchAlsup
    <user5857@newsgrouper.org.invalid> wrote:

    George Neuner <gneuner2@comcast.net> posted:

    There is another question along with who handles it ... what should be
    done? Uncorrected ECC error (check) means the data has to be
    considered corrupt [even if it really is valid] and unusable.

    Do you crash the program that can't handle it?

    Real Time control--just move along
    .....
    Banking--recover to checkpoint
    4,000 hour GB FP application--recover to checkpoint

    My MS degree was in DBMS, and I spent more than a decade in high
    availability HRT systems ... so that's an attitude to which I can
    relate. 8-)

    However, most software is not written either to transact or even just
    to checkpoint. A hardware error will just stop the program (for some definition of "stop") and badness ensues.


    Do you crash the guest OS that can't handle it?

    PC--take a crash or restart Guest OS
    Server--backup to checkpoint and run forward until you catchup with real-time
    :
    How is the user going to feel about your system?

    Better than if the error was never detected...

    Actually, the program cares only if /its/ data is corrupt ... if the
    problem really is the ECC check bits, the program would just soon
    continue normally.

    --- Synchronet 3.22a-Linux NewsLink 1.2