Thread View: comp.arch
28 messages
28 total messages
Started by John Savard
Fri, 23 Oct 2026 23:57
Re: Interrupts in OoO (was: Microarchitectural support for counting)
Author: John Savard
Date: Fri, 23 Oct 2026 23:57
Date: Fri, 23 Oct 2026 23:57
28 lines
2791 bytes
2791 bytes
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
Re: Interrupts in OoO
Author: Robert Finch
Date: Sat, 24 Oct 2026 01:12
Date: Sat, 24 Oct 2026 01:12
42 lines
3763 bytes
3763 bytes
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
Re: Interrupts in OoO (was: Microarchitectural support for counting)
Author: MitchAlsup
Date: Sat, 24 Oct 2026 19:20
Date: Sat, 24 Oct 2026 19:20
71 lines
4507 bytes
4507 bytes
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
Re: Interrupts in OoO (was: Microarchitectural support for counting)
Author: Scott Lurndal
Date: Sun, 25 Oct 2026 15:53
Date: Sun, 25 Oct 2026 15:53
35 lines
2845 bytes
2845 bytes
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.
Re: Interrupts in OoO
Author: EricP
Date: Mon, 26 Oct 2026 15:06
Date: Mon, 26 Oct 2026 15:06
74 lines
4787 bytes
4787 bytes
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.
Re: Interrupts in OoO
Author: Robert Finch
Date: Mon, 26 Oct 2026 17:17
Date: Mon, 26 Oct 2026 17:17
95 lines
5900 bytes
5900 bytes
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. 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.
>
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.
Re: Interrupts in OoO (was: Microarchitectural support for counting)
Author: Anton Ertl
Date: Mon, 26 Oct 2026 17:45
Date: Mon, 26 Oct 2026 17:45
47 lines
3960 bytes
3960 bytes
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>
Re: Interrupts in OoO
Author: EricP
Date: Mon, 26 Oct 2026 21:03
Date: Mon, 26 Oct 2026 21:03
130 lines
7988 bytes
7988 bytes
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. 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.
>>
> 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.
Re: Interrupts in OoO
Author: Chris M. Thomasson
Date: Mon, 26 Oct 2026 21:14
Date: Mon, 26 Oct 2026 21:14
153 lines
8955 bytes
8955 bytes
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. 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.
>>>
>> 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!
Re: Interrupts in OoO
Author: MitchAlsup
Date: Tue, 27 Oct 2026 16:35
Date: Tue, 27 Oct 2026 16:35
88 lines
5433 bytes
5433 bytes
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.
>
Re: Interrupts in OoO (was: Microarchitectural support for counting)
Author: MitchAlsup
Date: Tue, 27 Oct 2026 16:39
Date: Tue, 27 Oct 2026 16:39
59 lines
3893 bytes
3893 bytes
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
Re: Interrupts in OoO
Author: MitchAlsup
Date: Tue, 27 Oct 2026 16:48
Date: Tue, 27 Oct 2026 16:48
62 lines
4298 bytes
4298 bytes
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.
>
Re: Interrupts in OoO
Author: Scott Lurndal
Date: Tue, 27 Oct 2026 18:33
Date: Tue, 27 Oct 2026 18:33
74 lines
4658 bytes
4658 bytes
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.
Re: Interrupts in OoO
Author: MitchAlsup
Date: Tue, 27 Oct 2026 21:07
Date: Tue, 27 Oct 2026 21:07
46 lines
3187 bytes
3187 bytes
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.
Re: Interrupts in OoO
Author: Scott Lurndal
Date: Tue, 27 Oct 2026 21:17
Date: Tue, 27 Oct 2026 21:17
31 lines
2604 bytes
2604 bytes
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).
Re: Interrupts in OoO
Author: MitchAlsup
Date: Wed, 28 Oct 2026 15:35
Date: Wed, 28 Oct 2026 15:35
36 lines
2916 bytes
2916 bytes
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 ??
Re: Interrupts in OoO
Author: EricP
Date: Wed, 28 Oct 2026 18:19
Date: Wed, 28 Oct 2026 18:19
89 lines
5630 bytes
5630 bytes
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.
Re: Interrupts in OoO
Author: George Neuner
Date: Wed, 28 Oct 2026 18:34
Date: Wed, 28 Oct 2026 18:34
49 lines
3717 bytes
3717 bytes
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?
Re: Interrupts in OoO
Author: EricP
Date: Wed, 28 Oct 2026 18:39
Date: Wed, 28 Oct 2026 18:39
36 lines
2915 bytes
2915 bytes
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.)
Re: Interrupts in OoO
Author: EricP
Date: Wed, 28 Oct 2026 18:57
Date: Wed, 28 Oct 2026 18:57
59 lines
3920 bytes
3920 bytes
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.
Re: Interrupts in OoO
Author: MitchAlsup
Date: Wed, 28 Oct 2026 19:02
Date: Wed, 28 Oct 2026 19:02
144 lines
8095 bytes
8095 bytes
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.
>
>
>
Re: Interrupts in OoO
Author: Scott Lurndal
Date: Wed, 28 Oct 2026 20:16
Date: Wed, 28 Oct 2026 20:16
100 lines
5810 bytes
5810 bytes
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.
Re: Interrupts in OoO
Author: Chris M. Thomasson
Date: Wed, 28 Oct 2026 22:10
Date: Wed, 28 Oct 2026 22:10
52 lines
3608 bytes
3608 bytes
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.) > >
Re: Interrupts in OoO
Author: MitchAlsup
Date: Thu, 29 Oct 2026 02:17
Date: Thu, 29 Oct 2026 02:17
61 lines
3841 bytes
3841 bytes
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...
Re: Interrupts in OoO
Author: MitchAlsup
Date: Thu, 29 Oct 2026 02:27
Date: Thu, 29 Oct 2026 02:27
79 lines
4863 bytes
4863 bytes
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.
>
Re: Interrupts in OoO
Author: Chris M. Thomasson
Date: Thu, 29 Oct 2026 04:21
Date: Thu, 29 Oct 2026 04:21
69 lines
4487 bytes
4487 bytes
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...
Re: Interrupts in OoO
Author: EricP
Date: Thu, 29 Oct 2026 18:50
Date: Thu, 29 Oct 2026 18:50
111 lines
5125 bytes
5125 bytes
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);
}
Re: Interrupts in OoO
Author: George Neuner
Date: Fri, 30 Oct 2026 01:49
Date: Fri, 30 Oct 2026 01:49
38 lines
2925 bytes
2925 bytes
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.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads