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.
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
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
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.
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.
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.
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.
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.
On 2026-10-26 11:06 a.m., EricP wrote:
On 2026-Oct-25 11:53, Scott Lurndal wrote: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.
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.
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.
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:I have thought that interrupts, traps and others are subsets of
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.
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.
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.
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--- Synchronet 3.22a-Linux NewsLink 1.2
On 2026-Oct-26 13:17, Robert Finch wrote:----------snip-----------
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:
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.
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}}.
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}.
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...
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.
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.
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).
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}.
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.
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 ??
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!
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.
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.
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.To a very large extent I agree with you. The things you call 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. >>> >> >
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?
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.)
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.To a very large extent I agree with you. The things you call 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. >> >> >
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?
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.
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:There is another question along with who handles it ... what should be
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.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}}.
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. >>>>>>>
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 ?? >>
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...
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.)
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
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...
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 76 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 54:49:17 |
| Calls: | 1,265 |
| Calls today: | 1 |
| Files: | 1,362 |
| D/L today: |
3 files (2,684K bytes) |
| Messages: | 285,582 |