Re: MSI interrupts

Liste des GroupesRevenir à c arch 
Sujet : Re: MSI interrupts
De : mitchalsup (at) *nospam* aol.com (MitchAlsup1)
Groupes : comp.arch
Date : 13. Mar 2025, 21:46:30
Autres entêtes
Organisation : Rocksolid Light
Message-ID : <2543154ec4cab8f4bc791e3796492e76@www.novabbs.org>
References : 1 2 3 4 5
User-Agent : Rocksolid Light
On Thu, 13 Mar 2025 19:59:02 +0000, Robert Finch wrote:

On 2025-03-13 2:42 p.m., Scott Lurndal wrote:
Robert Finch <robfi680@gmail.com> writes:
On 2025-03-13 12:34 p.m., MitchAlsup1 wrote:
On Thu, 13 Mar 2025 4:50:47 +0000, Robert Finch wrote:
>
Planning on having the Q+ CPU respond directly to MSI interrupts. My
thought is to integrate an interrupt controller directly into the CPU
which will have several queues to prioritize interrupts. The controller
will take care of detecting the highest priority interrupt to process,
performing priority inversion occasionally, and detect stuck interrupts.
>
My 66000 went all the way to MSI-X interrupts as its base.
>
There are mapping methods to map INTx and INTk into MSI-X messages.
MSI->MSI-X mapping is "just zero extend the message".
>
MSI interrupts are the way to go when there are transistors available.
Just having discovered them not to long ago, I still think they are
great.
I have the luxury of not needing to support legacy interrupt systems
(yet), all the peripheral cores needing interrupts will have to support
MSI responses.
>
MSI has been deprecated for years.  MSI-X is preferred and used by
most modern devices (and supported by major operating software).
>
>
The Interrupt port lives in the memory controller and takes an
aperture of addresses and maps them to various interrupt tables.
>
I have read that MSI devices target particular I/O addresses to send the
messages to. Not sure what having a dedicated I/O addresses buys. In my
architecture, rather than target an I/O address a specific processing
core number is specified.
>
There are many reasons that MSI-X supports vector specific target
addresses.
  1) It is possible to target DRAM (so software can poll for the
interrupt)
>
This can be done using a dummy core in the system that echos interrupts
messages back to the DRAM. A current issue with the way interrupts in my
system are working, is they always spit out the interrupt on the
response bus, which means they cannot act like the master.
>
To drive messages onto the bus as requests instead of responses every
peripheral device would need to be able to be a bus master. It would add
a lot of logic to the system. Extra cross-bar ports etc.
>
>
  2) It is possible to support level-sensitive semantics by using two
vectors;
     one to assert the interrupt and the second to deassert it.  Each
needs
     to target a different interrupt controller register (address).
>
I think this can be handled with the cause code being returned as part
of the response.
>
  3) A system may have multiple interrupt controllers for different
     security states (e.g. monitor/secure vs. hypervisor vs. direct
virtual
     to a guest).
>
Is this just to get more target vectors for each interrupt? Could there
be one interrupt controller with multiple target vectors depending on
the security state?
Take a AHCI STAT drive, that has multiple GuestOSs and several
HyperVisors using various functions therein.
While ALL ISRs from this device can use the same code, they must
not be in a position where any state is shared across system-
states. It is often easier to not share the code, even though it
is exactly the same set of bit patterns because where the "other
state" resides is necessarily different in GuestOS as it is in
HyperVisor[k] as it is in Secure Monitor[j].

Q+ CPU always switches to machine mode to process interrupts. It can
then redirect to other operating modes. A security state code could be
added to the response so that different vector tables may be used.
Interrupts in My 66000 can be directed at any interrupt table, at
any privilege level, at any priority. So, in practice, one could
allow for a user to handle his own SATA interrupts without ever
taking an excursion through any GuestOS or Hypervisor code/state;
nor is it architecturally necessary to disable interrupts or
exceptions.

>
>
>
My architecture goes with a 3-bit priority field, and an 8-bit field to
help resolve the cause of the interrupt. The bus/device/function is also
part of the interrupt response.
>
That's what ARM64 GIC does, each interrupt is accompanied by a 20+ bit
'device id', which is composed of the segment, bus, dev/func values
for the sending device.   Since each PCIe controller can consume the
entire bus space potentially, the segment widens the device id space
to include a large number of devices.   The 'device id' is used to
select the in-memory table used to map the interrupt to the target
guest and the target guest vector number.
>
Seems like going out to memory tables to fetch the targets of an
interrupt would be costly, perhaps slow. In the SoC there are already a
half dozen devices fighting for access to the DRAM.
Cache it and pay the cost once (or once per context switch).
It is not like the ISR for the SATA drive for GuestOS[7]
changes very often !! And it is (I S) used often.

I think you really want an interrupt controller as an intermediary
between the device and the CPU interrupt signal, allows a great deal
of implementation flexibility (e.g. changing the target CPU in the
Wrong abstraction::
You want an interrupt service device that services interrupts
(logs them into tables) even when no core (Virtual Machine or
Virtual Machine Monitor) knows anything about said interrupt
table. That is an interrupt to a table is serviced even when
there is no recipient at this instant in time. This prevents
loss of interrupts the table is supposed to accumulate.
Only when at least 1 core is processing VM[k] or VMM[j]
associated with that interrupt table are cores running
VM[k] or VMM[j] concerned with any random interrupt from
that table.
----------------
Connecting the missing dots can be done several ways, My
66000 does::
My 66000 has a service port (in the memory controller) which
services the MMI/O requests to the interrupt aperture. I (currently)
call this the interrupt service port (rather than interrupt
controller) because it just services messages to the interrupt
aperture with almost no regard to any consumer. Said consumer
regard is via a broadcast MMI/O message using the DRAM address
of the interrupt table with a 64-bit message of raised interrupts.
Should the Interrupt table CR match broadcast address, core
captures the raised vector...and decided to deal with interrupt
or not.
A core can IPI a VM or VMM by performing a MMI/O write using
the same bit patterns the I/O device would have used. Since
all interrupts carry privilege (SW stack index) and priority
along with 8-bit ISR and 32-bit message, SW has a "big Enough"
interrupt name-space to do anything it likes.
Finally, there is interrupt negotiation where a service port
on the core sees the interrupt table broadcast and decides
to try-to process said interrupt.
Thus, the Interrupt Service Philosophy
a) is not close to any core
b) cores are notified by MMI/O broadcast
c) cores continue to run code while negotiating for interrupts
d) HW prefetches thread state and RF before interrupt acceptance
e) anybody with VAS access can perform IPIs via MMU-PTEs
Thus, the local Pic is a 6-rail-road-track state machine,
with a single DW of state (&interrupt_table).

Absolutely. Be crazy not to. There is an irq controller component
separate from the CPU. (I decided to move the controller outside of the
CPU).
You need 2 concepts:
a) the deposition of interrupts in the table
b) the delivery of interrupts to consuming (cores)
(a) must happen even when no core is looking at the table.
(b) can happen by having SW perform read requests to interrupt
    aperture or by the normal HW broadcast mechanism.

interrupt controller tables rather than requiring the device driver
to change the msix-vector address field).
The MSI-X address is (nominally) set once just after GuestOS device
discovery. And becomes a virtual constant pointer afterwards.

Updating I/O is faster than updating DRAM tables.
Expand:: is this the distinction between flip-flops and a RAM
buried inside a pre-defined pin-boundary ??

Date Sujet#  Auteur
13 Mar 25 * MSI interrupts163Robert Finch
13 Mar 25 `* Re: MSI interrupts162MitchAlsup1
13 Mar 25  +* Re: MSI interrupts5Robert Finch
13 Mar 25  i+- Re: MSI interrupts1MitchAlsup1
13 Mar 25  i`* Re: MSI interrupts3Robert Finch
13 Mar 25  i +- Re: MSI interrupts1MitchAlsup1
13 Mar 25  i `- Re: MSI interrupts1Stefan Monnier
13 Mar 25  `* Re: MSI interrupts156MitchAlsup1
13 Mar 25   `* Re: MSI interrupts155MitchAlsup1
14 Mar 25    `* Re: MSI interrupts154MitchAlsup1
14 Mar 25     `* Re: MSI interrupts153MitchAlsup1
14 Mar 25      `* Re: MSI interrupts152MitchAlsup1
15 Mar 25       `* Re: MSI interrupts151Robert Finch
15 Mar 25        `* Re: MSI interrupts150MitchAlsup1
15 Mar 25         `* Re: MSI interrupts149Robert Finch
15 Mar 25          `* Re: MSI interrupts148MitchAlsup1
16 Mar 25           `* Re: MSI interrupts147Robert Finch
16 Mar 25            +- Re: MSI interrupts1MitchAlsup1
17 Mar 25            +* Re: MSI interrupts142Michael S
17 Mar 25            i+- Re: MSI interrupts1Robert Finch
17 Mar 25            i+* Re: MSI interrupts133Robert Finch
18 Mar 25            ii+* Re: MSI interrupts127Robert Finch
19 Mar 25            iii+* Re: MSI interrupts124MitchAlsup1
19 Mar 25            iiii+* Re: MSI interrupts121Dan Cross
19 Mar 25            iiiii+* Re: MSI interrupts112MitchAlsup1
20 Mar 25            iiiiii`* Re: MSI interrupts111Dan Cross
20 Mar 25            iiiiii `* Re: MSI interrupts110MitchAlsup1
20 Mar 25            iiiiii  `* Re: MSI interrupts109Dan Cross
20 Mar 25            iiiiii   +* Re: MSI interrupts31MitchAlsup1
24 Mar 25            iiiiii   i`* Re: MSI interrupts30Dan Cross
24 Mar 25            iiiiii   i +* Re: MSI interrupts20MitchAlsup1
24 Mar 25            iiiiii   i i+* Re: MSI interrupts18Stefan Monnier
24 Mar 25            iiiiii   i ii`* Re: MSI interrupts17MitchAlsup1
24 Mar 25            iiiiii   i ii `* Re: MSI interrupts16Dan Cross
24 Mar 25            iiiiii   i ii  +* Re: MSI interrupts8MitchAlsup1
25 Mar 25            iiiiii   i ii  i`* Re: MSI interrupts7Dan Cross
25 Mar 25            iiiiii   i ii  i `* Re: MSI interrupts6Dan Cross
25 Mar 25            iiiiii   i ii  i  `* Re: MSI interrupts5Stefan Monnier
25 Mar 25            iiiiii   i ii  i   +- Re: MSI interrupts1Stefan Monnier
25 Mar 25            iiiiii   i ii  i   +- Re: MSI interrupts1Dan Cross
27 Mar 25            iiiiii   i ii  i   `* Re: MSI interrupts2Terje Mathisen
27 Mar 25            iiiiii   i ii  i    `- Re: MSI interrupts1MitchAlsup1
25 Mar 25            iiiiii   i ii  `* Re: MSI interrupts7Chris M. Thomasson
25 Mar 25            iiiiii   i ii   `* Re: MSI interrupts6Dan Cross
25 Mar 25            iiiiii   i ii    `* Re: MSI interrupts5Chris M. Thomasson
25 Mar 25            iiiiii   i ii     `* Re: MSI interrupts4Dan Cross
26 Mar 25            iiiiii   i ii      `* Re: MSI interrupts3Chris M. Thomasson
26 Mar 25            iiiiii   i ii       `* Re: MSI interrupts2Dan Cross
26 Mar 25            iiiiii   i ii        `- Re: MSI interrupts1Chris M. Thomasson
24 Mar 25            iiiiii   i i`- Re: MSI interrupts1Dan Cross
24 Mar 25            iiiiii   i +- Re: MSI interrupts1MitchAlsup1
24 Mar 25            iiiiii   i `* Re: MSI interrupts8Dan Cross
24 Mar 25            iiiiii   i  `* Re: MSI interrupts7Chris M. Thomasson
24 Mar 25            iiiiii   i   `* Re: MSI interrupts6Dan Cross
25 Mar 25            iiiiii   i    `* Re: MSI interrupts5Chris M. Thomasson
25 Mar 25            iiiiii   i     +* Re: MSI interrupts2Chris M. Thomasson
25 Mar 25            iiiiii   i     i`- Re: MSI interrupts1Dan Cross
25 Mar 25            iiiiii   i     `* Re: MSI interrupts2Dan Cross
25 Mar 25            iiiiii   i      `- Re: MSI interrupts1Chris M. Thomasson
24 Mar 25            iiiiii   +- Re: MSI interrupts1Chris M. Thomasson
24 Mar 25            iiiiii   `* Re: MSI interrupts76Dan Cross
24 Mar 25            iiiiii    +* Re: MSI interrupts57MitchAlsup1
25 Mar 25            iiiiii    i`* Re: MSI interrupts56Dan Cross
25 Mar 25            iiiiii    i `* Re: MSI interrupts55MitchAlsup1
25 Mar 25            iiiiii    i  +* Re: MSI interrupts2Stefan Monnier
25 Mar 25            iiiiii    i  i`- Re: MSI interrupts1Chris M. Thomasson
25 Mar 25            iiiiii    i  +- Re: MSI interrupts1Dan Cross
25 Mar 25            iiiiii    i  `* Re: MSI interrupts51MitchAlsup1
25 Mar 25            iiiiii    i   `* Re: MSI interrupts50Dan Cross
25 Mar 25            iiiiii    i    `* Re: MSI interrupts49MitchAlsup1
25 Mar 25            iiiiii    i     `* Re: MSI interrupts48Dan Cross
25 Mar 25            iiiiii    i      `* Re: MSI interrupts47MitchAlsup1
25 Mar 25            iiiiii    i       `* Re: MSI interrupts46Dan Cross
25 Mar 25            iiiiii    i        +* Re: MSI interrupts8Stefan Monnier
26 Mar 25            iiiiii    i        i+* Re: MSI interrupts5Dan Cross
26 Mar 25            iiiiii    i        ii`* Re: MSI interrupts4Stefan Monnier
26 Mar 25            iiiiii    i        ii +- Re: MSI interrupts1Dan Cross
26 Mar 25            iiiiii    i        ii `* Re: MSI interrupts2MitchAlsup1
27 Mar 25            iiiiii    i        ii  `- Re: MSI interrupts1Stefan Monnier
26 Mar 25            iiiiii    i        i+- Re: MSI interrupts1Chris M. Thomasson
26 Mar 25            iiiiii    i        i`- Re: MSI interrupts1MitchAlsup1
26 Mar 25            iiiiii    i        `* Re: MSI interrupts37MitchAlsup1
26 Mar 25            iiiiii    i         `* Re: MSI interrupts36Dan Cross
26 Mar 25            iiiiii    i          +* Re: MSI interrupts4Stefan Monnier
26 Mar 25            iiiiii    i          i`* Re: MSI interrupts3Dan Cross
26 Mar 25            iiiiii    i          i `* Re: MSI interrupts2Chris M. Thomasson
4 Apr 25            iiiiii    i          i  `- Re: MSI interrupts1Chris M. Thomasson
26 Mar 25            iiiiii    i          `* Re: MSI interrupts31MitchAlsup1
26 Mar 25            iiiiii    i           +- Re: MSI interrupts1Stefan Monnier
26 Mar 25            iiiiii    i           +* Re: MSI interrupts2Stefan Monnier
27 Mar 25            iiiiii    i           i`- Re: MSI interrupts1MitchAlsup1
27 Mar 25            iiiiii    i           +* Re: MSI interrupts3MitchAlsup1
27 Mar 25            iiiiii    i           i`* Re: MSI interrupts2MitchAlsup1
27 Mar 25            iiiiii    i           i `- Re: MSI interrupts1Dan Cross
27 Mar 25            iiiiii    i           `* Re: MSI interrupts24Dan Cross
27 Mar 25            iiiiii    i            +* Re: MSI interrupts2Stefan Monnier
27 Mar 25            iiiiii    i            i`- Re: MSI interrupts1Dan Cross
27 Mar 25            iiiiii    i            +* Re: MSI interrupts12MitchAlsup1
28 Mar 25            iiiiii    i            i`* Re: MSI interrupts11Dan Cross
28 Mar 25            iiiiii    i            i +- Re: MSI interrupts1MitchAlsup1
28 Mar 25            iiiiii    i            i +* Re: MSI interrupts5MitchAlsup1
28 Mar 25            iiiiii    i            i +* Re: MSI interrupts2Stefan Monnier
28 Mar 25            iiiiii    i            i `* Re: MSI interrupts2Chris M. Thomasson
27 Mar 25            iiiiii    i            `* Re: MSI interrupts9MitchAlsup1
25 Mar 25            iiiiii    `* Re: MSI interrupts18Dan Cross
20 Mar 25            iiiii`* Re: MSI interrupts8MitchAlsup1
19 Mar 25            iiii`* Re: MSI interrupts2MitchAlsup1
19 Mar 25            iii`* Re: MSI interrupts2Robert Finch
18 Mar 25            ii`* Re: MSI interrupts5MitchAlsup1
17 Mar 25            i`* Re: MSI interrupts7MitchAlsup1
17 Mar 25            `* Re: MSI interrupts3Robert Finch

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal