OASIS Virtual I/O Device (VIRTIO) TC

 View Only
Expand all | Collapse all

[OASIS Issue Tracker] Created: (VIRTIO-43) ccw: Support for adapter interrupts.

  • 1.  [OASIS Issue Tracker] Created: (VIRTIO-43) ccw: Support for adapter interrupts.

    Posted 10-09-2013 13:36
    ccw: Support for adapter interrupts. ------------------------------------ Key: VIRTIO-43 URL: http://tools.oasis-open.org/issues/browse/VIRTIO-43 Project: OASIS Virtual I/O Device (VIRTIO) TC Issue Type: New Feature Reporter: Cornelia Huck We want to be able to use adapter interrupts instead of classic I/O interrupts for virtio-ccw for several reasons: - Less exits, since we don't need TEST SUBCHANNEL for every interrupt and can coalesce interrupts for different devices - Common guest code with zPCI - Ability to make use of irqfds For this, we need a new channel command to set up two-stage indicator bits. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tools.oasis-open.org/issues/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira


  • 2.  [PATCH] virtio-ccw: add adapter interrupt support

    Posted 10-09-2013 13:40
    Specify a new channel command to set up two-stage indicators as needed
    for adapter interrupts and describe how adapter interrupts are used
    for notifications.

    VIRTIO-43

    Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
    ---
    virtio-v1.0-wd01-part1-specification.txt | 100 ++++++++++++++++++++++++++++--
    1 file changed, 96 insertions(+), 4 deletions(-)

    diff --git a/virtio-v1.0-wd01-part1-specification.txt b/virtio-v1.0-wd01-part1-specification.txt
    index 3ba7f52..ae646db 100644
    --- a/virtio-v1.0-wd01-part1-specification.txt
    +++ b/virtio-v1.0-wd01-part1-specification.txt
    @@ -1545,6 +1545,7 @@ virtio:
    #define CCW_CMD_VDEV_RESET 0x33
    #define CCW_CMD_SET_IND 0x43
    #define CCW_CMD_SET_CONF_IND 0x53
    +#define CCW_CMD_SET_IND_ADAPTER 0x73
    #define CCW_CMD_READ_FEAT 0x12
    #define CCW_CMD_WRITE_FEAT 0x11
    #define CCW_CMD_READ_CONF 0x22
    @@ -1724,15 +1725,74 @@ In both cases, the complete configuration space is transmitted.
    2.3.3.2.6. Setting Up Indicators
    --------------------------------

    +In order to set up the indicator bits for host->guest notification,
    +the driver uses different channel commands depending on whether it
    +wishes to use traditional I/O interrupts tied to a subchannel or
    +adapter I/O interrupts. For any given device, the two mechanisms
    +are mutually exclusive.
    +
    +For the configuration change indicators, the same mechanism is used
    +in both cases.
    +
    +2.3.3.2.6.1. Setting Up Classic Queue Indicators
    +------------------------------------------------
    +
    +Indicators for notification via classic I/O interrupts are contained
    +in a 64 bit value per virtio-ccw proxy device.
    +
    To communicate the location of the indicator bits for host->guest
    notification, the guest uses the CCW_CMD_SET_IND command,
    pointing to a location containing the guest address of the
    indicators in a 64 bit value.

    -For the indicator bits used in the configuration change
    -host->guest notification, the CCW_CMD_SET_CONF_IND command is
    -used analogously.
    +If the driver has already set up two-staged queue indicators via the
    +CCW_CMD_SET_IND_ADAPTER command, the device MUST post a unit check
    +with command reject to any subsequent CCW_CMD_SET_IND command.
    +
    +2.3.3.2.6.2. Setting Up Configuration Change Indicators
    +-------------------------------------------------------
    +
    +Indicators for configuration change host->guest notification are
    +contained in a 64 bit value per virtio-ccw proxy device.
    +
    +To communicate the location of the indicator bits used in the
    +configuration change host->guest notification, the driver issues the
    +CCW_CMD_SET_CONF_IND command, pointing to a location containing the
    +guest address of the indicators in a 64 bit value.
    +
    +2.3.3.2.6.3. Setting Up Two-Stage Queue Indicators
    +--------------------------------------------------
    +
    +Indicators for notification via adapter I/O interrupts consist of
    +two stages:
    +- a summary indicator byte covering the virtqueues for one or more
    + virtio-ccw proxy devices
    +- a set of contigous indicator bits for the virtqueues for a
    + virtio-ccw proxy device
    +
    +To communicate the location of the summary and queue indicator bits,
    +the driver uses the CCW_CMD_SET_IND_ADAPTER command with the following
    +payload:
    +
    +struct virtio_thinint_area {
    + __u64 summary_indicator;
    + __u64 indicator;
    + __u64 bit_nr;
    + __u8 isc;
    +};
    +
    +summary_indicator contains the guest address of the 8 bit summary
    +indicator.
    +indicator contains the guest address of an area wherin the indicators
    +for the devices are contained, starting at bit_nr, one bit per
    +virtqueue of the device. Bit numbers start at the left.
    +isc contains the I/O interruption subclass to be used for the adapter
    +I/O interrupt. It may be different from the isc used by the proxy
    +virtio-ccw device's subchannel.

    +If the driver has already set up classic queue indicators via the
    +CCW_CMD_SET_IND command, the device MUST post a unit check with
    +command reject to any subsequent CCW_CMD_SET_IND_ADAPTER command.

    2.3.3.3. Device Operation
    -------------------------
    @@ -1740,6 +1800,21 @@ used analogously.
    2.3.3.3.1. Host->Guest Notification
    -----------------------------------

    +There are two modes of operation regarding host->guest notifcation,
    +classic I/O interrupts and adapter I/O interrupts. The mode to be
    +used is determined by the driver by using CCW_CMD_SET_IND respectively
    +CCW_CMD_SET_IND_ADAPTER to set up queue indicators.
    +
    +For configuration changes, the driver will always use classic I/O
    +interrupts.
    +
    +2.3.3.3.1.1. Notification via Classic I/O Interrupts
    +----------------------------------------------------
    +
    +If the driver used the CCW_CMD_SET_IND command to set up queue
    +indicators, the device will use classic I/O interrupts for
    +host->guest notification about virtqueue activity.
    +
    For notifying the guest of virtqueue buffers, the host sets the
    corresponding bit in the guest-provided indicators. If an
    interrupt is not already pending for the subchannel, the host
    @@ -1747,7 +1822,24 @@ generates an unsolicited I/O interrupt.

    If the host wants to notify the guest about configuration
    changes, it sets bit 0 in the configuration indicators and
    -generates an unsolicited I/O interrupt, if needed.
    +generates an unsolicited I/O interrupt, if needed. This also
    +applies if adapter I/O interrupts are used for queue notifications.
    +
    +2.3.3.3.1.2. Notification via Adapter I/O Interrupts
    +----------------------------------------------------
    +
    +If the driver used the CCW_CMD_SET_IND_ADAPTER command to set up
    +queue indicators, the device will use adapter I/O interrupts for
    +host->guest notification about virtqueue activity.
    +
    +For notifying the guest of virtqueue buffers, the host sets the
    +bit in the guest-provided indicator area at the corresponding offset.
    +The guest-provided summary indicator is also set. An adapter I/O
    +interrupt for the corresponding interruption subclass is generated.
    +The device SHOULD only generate an adapter I/O interrupt if the
    +summary indicator had not been set prior to notification. The driver
    +MUST clear the summary indicator after receiving an adapter I/O
    +interrupt before it processes the queue indicators.

    2.3.3.3.2. Guest->Host Notification
    -----------------------------------
    --
    1.7.9.5




  • 3.  [PATCH] virtio-ccw: add adapter interrupt support

    Posted 10-09-2013 13:41
    Specify a new channel command to set up two-stage indicators as needed for adapter interrupts and describe how adapter interrupts are used for notifications. VIRTIO-43 Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> --- virtio-v1.0-wd01-part1-specification.txt 100 ++++++++++++++++++++++++++++-- 1 file changed, 96 insertions(+), 4 deletions(-) diff --git a/virtio-v1.0-wd01-part1-specification.txt b/virtio-v1.0-wd01-part1-specification.txt index 3ba7f52..ae646db 100644 --- a/virtio-v1.0-wd01-part1-specification.txt +++ b/virtio-v1.0-wd01-part1-specification.txt @@ -1545,6 +1545,7 @@ virtio: #define CCW_CMD_VDEV_RESET 0x33 #define CCW_CMD_SET_IND 0x43 #define CCW_CMD_SET_CONF_IND 0x53 +#define CCW_CMD_SET_IND_ADAPTER 0x73 #define CCW_CMD_READ_FEAT 0x12 #define CCW_CMD_WRITE_FEAT 0x11 #define CCW_CMD_READ_CONF 0x22 @@ -1724,15 +1725,74 @@ In both cases, the complete configuration space is transmitted. 2.3.3.2.6. Setting Up Indicators -------------------------------- +In order to set up the indicator bits for host->guest notification, +the driver uses different channel commands depending on whether it +wishes to use traditional I/O interrupts tied to a subchannel or +adapter I/O interrupts. For any given device, the two mechanisms +are mutually exclusive. + +For the configuration change indicators, the same mechanism is used +in both cases. + +2.3.3.2.6.1. Setting Up Classic Queue Indicators +------------------------------------------------ + +Indicators for notification via classic I/O interrupts are contained +in a 64 bit value per virtio-ccw proxy device. + To communicate the location of the indicator bits for host->guest notification, the guest uses the CCW_CMD_SET_IND command, pointing to a location containing the guest address of the indicators in a 64 bit value. -For the indicator bits used in the configuration change -host->guest notification, the CCW_CMD_SET_CONF_IND command is -used analogously. +If the driver has already set up two-staged queue indicators via the +CCW_CMD_SET_IND_ADAPTER command, the device MUST post a unit check +with command reject to any subsequent CCW_CMD_SET_IND command. + +2.3.3.2.6.2. Setting Up Configuration Change Indicators +------------------------------------------------------- + +Indicators for configuration change host->guest notification are +contained in a 64 bit value per virtio-ccw proxy device. + +To communicate the location of the indicator bits used in the +configuration change host->guest notification, the driver issues the +CCW_CMD_SET_CONF_IND command, pointing to a location containing the +guest address of the indicators in a 64 bit value. + +2.3.3.2.6.3. Setting Up Two-Stage Queue Indicators +-------------------------------------------------- + +Indicators for notification via adapter I/O interrupts consist of +two stages: +- a summary indicator byte covering the virtqueues for one or more + virtio-ccw proxy devices +- a set of contigous indicator bits for the virtqueues for a + virtio-ccw proxy device + +To communicate the location of the summary and queue indicator bits, +the driver uses the CCW_CMD_SET_IND_ADAPTER command with the following +payload: + +struct virtio_thinint_area { + __u64 summary_indicator; + __u64 indicator; + __u64 bit_nr; + __u8 isc; +}; + +summary_indicator contains the guest address of the 8 bit summary +indicator. +indicator contains the guest address of an area wherin the indicators +for the devices are contained, starting at bit_nr, one bit per +virtqueue of the device. Bit numbers start at the left. +isc contains the I/O interruption subclass to be used for the adapter +I/O interrupt. It may be different from the isc used by the proxy +virtio-ccw device's subchannel. +If the driver has already set up classic queue indicators via the +CCW_CMD_SET_IND command, the device MUST post a unit check with +command reject to any subsequent CCW_CMD_SET_IND_ADAPTER command. 2.3.3.3. Device Operation ------------------------- @@ -1740,6 +1800,21 @@ used analogously. 2.3.3.3.1. Host->Guest Notification ----------------------------------- +There are two modes of operation regarding host->guest notifcation, +classic I/O interrupts and adapter I/O interrupts. The mode to be +used is determined by the driver by using CCW_CMD_SET_IND respectively +CCW_CMD_SET_IND_ADAPTER to set up queue indicators. + +For configuration changes, the driver will always use classic I/O +interrupts. + +2.3.3.3.1.1. Notification via Classic I/O Interrupts +---------------------------------------------------- + +If the driver used the CCW_CMD_SET_IND command to set up queue +indicators, the device will use classic I/O interrupts for +host->guest notification about virtqueue activity. + For notifying the guest of virtqueue buffers, the host sets the corresponding bit in the guest-provided indicators. If an interrupt is not already pending for the subchannel, the host @@ -1747,7 +1822,24 @@ generates an unsolicited I/O interrupt. If the host wants to notify the guest about configuration changes, it sets bit 0 in the configuration indicators and -generates an unsolicited I/O interrupt, if needed. +generates an unsolicited I/O interrupt, if needed. This also +applies if adapter I/O interrupts are used for queue notifications. + +2.3.3.3.1.2. Notification via Adapter I/O Interrupts +---------------------------------------------------- + +If the driver used the CCW_CMD_SET_IND_ADAPTER command to set up +queue indicators, the device will use adapter I/O interrupts for +host->guest notification about virtqueue activity. + +For notifying the guest of virtqueue buffers, the host sets the +bit in the guest-provided indicator area at the corresponding offset. +The guest-provided summary indicator is also set. An adapter I/O +interrupt for the corresponding interruption subclass is generated. +The device SHOULD only generate an adapter I/O interrupt if the +summary indicator had not been set prior to notification. The driver +MUST clear the summary indicator after receiving an adapter I/O +interrupt before it processes the queue indicators. 2.3.3.3.2. Guest->Host Notification ----------------------------------- -- 1.7.9.5


  • 4.  Re: [virtio] [PATCH] virtio-ccw: add adapter interrupt support

    Posted 10-15-2013 03:44
    Cornelia Huck <cornelia.huck@de.ibm.com> writes:
    > Specify a new channel command to set up two-stage indicators as needed
    > for adapter interrupts and describe how adapter interrupts are used
    > for notifications.

    Since this presumably isn't in the current implementation, should there
    be a legacy section talking about what happens if it's not supported?
    Or is that implied and I missed it?

    Nice to see that CCW is getting some benefit from the pain of v1.0 :)

    > VIRTIO-43
    >
    > Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
    > ---
    > virtio-v1.0-wd01-part1-specification.txt | 100 ++++++++++++++++++++++++++++--
    > 1 file changed, 96 insertions(+), 4 deletions(-)
    >
    > diff --git a/virtio-v1.0-wd01-part1-specification.txt b/virtio-v1.0-wd01-part1-specification.txt
    > index 3ba7f52..ae646db 100644
    > --- a/virtio-v1.0-wd01-part1-specification.txt
    > +++ b/virtio-v1.0-wd01-part1-specification.txt
    > @@ -1545,6 +1545,7 @@ virtio:
    > #define CCW_CMD_VDEV_RESET 0x33
    > #define CCW_CMD_SET_IND 0x43
    > #define CCW_CMD_SET_CONF_IND 0x53
    > +#define CCW_CMD_SET_IND_ADAPTER 0x73
    > #define CCW_CMD_READ_FEAT 0x12
    > #define CCW_CMD_WRITE_FEAT 0x11
    > #define CCW_CMD_READ_CONF 0x22
    > @@ -1724,15 +1725,74 @@ In both cases, the complete configuration space is transmitted.
    > 2.3.3.2.6. Setting Up Indicators
    > --------------------------------
    >
    > +In order to set up the indicator bits for host->guest notification,
    > +the driver uses different channel commands depending on whether it
    > +wishes to use traditional I/O interrupts tied to a subchannel or
    > +adapter I/O interrupts. For any given device, the two mechanisms
    > +are mutually exclusive.
    > +
    > +For the configuration change indicators, the same mechanism is used
    > +in both cases.
    > +
    > +2.3.3.2.6.1. Setting Up Classic Queue Indicators
    > +------------------------------------------------
    > +
    > +Indicators for notification via classic I/O interrupts are contained
    > +in a 64 bit value per virtio-ccw proxy device.
    > +
    > To communicate the location of the indicator bits for host->guest
    > notification, the guest uses the CCW_CMD_SET_IND command,
    > pointing to a location containing the guest address of the
    > indicators in a 64 bit value.
    >
    > -For the indicator bits used in the configuration change
    > -host->guest notification, the CCW_CMD_SET_CONF_IND command is
    > -used analogously.
    > +If the driver has already set up two-staged queue indicators via the
    > +CCW_CMD_SET_IND_ADAPTER command, the device MUST post a unit check
    > +with command reject to any subsequent CCW_CMD_SET_IND command.
    > +
    > +2.3.3.2.6.2. Setting Up Configuration Change Indicators
    > +-------------------------------------------------------
    > +
    > +Indicators for configuration change host->guest notification are
    > +contained in a 64 bit value per virtio-ccw proxy device.
    > +
    > +To communicate the location of the indicator bits used in the
    > +configuration change host->guest notification, the driver issues the
    > +CCW_CMD_SET_CONF_IND command, pointing to a location containing the
    > +guest address of the indicators in a 64 bit value.
    > +
    > +2.3.3.2.6.3. Setting Up Two-Stage Queue Indicators
    > +--------------------------------------------------
    > +
    > +Indicators for notification via adapter I/O interrupts consist of
    > +two stages:
    > +- a summary indicator byte covering the virtqueues for one or more
    > + virtio-ccw proxy devices
    > +- a set of contigous indicator bits for the virtqueues for a
    > + virtio-ccw proxy device
    > +
    > +To communicate the location of the summary and queue indicator bits,
    > +the driver uses the CCW_CMD_SET_IND_ADAPTER command with the following
    > +payload:
    > +
    > +struct virtio_thinint_area {
    > + __u64 summary_indicator;
    > + __u64 indicator;
    > + __u64 bit_nr;
    > + __u8 isc;
    > +};

    Hmm... you __attribute__((packed)) the other structures; I assume
    that's wanted here too?

    Cheers,
    Rusty.




  • 5.  Re: [virtio] [PATCH] virtio-ccw: add adapter interrupt support

    Posted 10-15-2013 06:12
    Cornelia Huck <cornelia.huck@de.ibm.com> writes: > Specify a new channel command to set up two-stage indicators as needed > for adapter interrupts and describe how adapter interrupts are used > for notifications. Since this presumably isn't in the current implementation, should there be a legacy section talking about what happens if it's not supported? Or is that implied and I missed it? Nice to see that CCW is getting some benefit from the pain of v1.0 :) > VIRTIO-43 > > Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> > --- > virtio-v1.0-wd01-part1-specification.txt 100 ++++++++++++++++++++++++++++-- > 1 file changed, 96 insertions(+), 4 deletions(-) > > diff --git a/virtio-v1.0-wd01-part1-specification.txt b/virtio-v1.0-wd01-part1-specification.txt > index 3ba7f52..ae646db 100644 > --- a/virtio-v1.0-wd01-part1-specification.txt > +++ b/virtio-v1.0-wd01-part1-specification.txt > @@ -1545,6 +1545,7 @@ virtio: > #define CCW_CMD_VDEV_RESET 0x33 > #define CCW_CMD_SET_IND 0x43 > #define CCW_CMD_SET_CONF_IND 0x53 > +#define CCW_CMD_SET_IND_ADAPTER 0x73 > #define CCW_CMD_READ_FEAT 0x12 > #define CCW_CMD_WRITE_FEAT 0x11 > #define CCW_CMD_READ_CONF 0x22 > @@ -1724,15 +1725,74 @@ In both cases, the complete configuration space is transmitted. > 2.3.3.2.6. Setting Up Indicators > -------------------------------- > > +In order to set up the indicator bits for host->guest notification, > +the driver uses different channel commands depending on whether it > +wishes to use traditional I/O interrupts tied to a subchannel or > +adapter I/O interrupts. For any given device, the two mechanisms > +are mutually exclusive. > + > +For the configuration change indicators, the same mechanism is used > +in both cases. > + > +2.3.3.2.6.1. Setting Up Classic Queue Indicators > +------------------------------------------------ > + > +Indicators for notification via classic I/O interrupts are contained > +in a 64 bit value per virtio-ccw proxy device. > + > To communicate the location of the indicator bits for host->guest > notification, the guest uses the CCW_CMD_SET_IND command, > pointing to a location containing the guest address of the > indicators in a 64 bit value. > > -For the indicator bits used in the configuration change > -host->guest notification, the CCW_CMD_SET_CONF_IND command is > -used analogously. > +If the driver has already set up two-staged queue indicators via the > +CCW_CMD_SET_IND_ADAPTER command, the device MUST post a unit check > +with command reject to any subsequent CCW_CMD_SET_IND command. > + > +2.3.3.2.6.2. Setting Up Configuration Change Indicators > +------------------------------------------------------- > + > +Indicators for configuration change host->guest notification are > +contained in a 64 bit value per virtio-ccw proxy device. > + > +To communicate the location of the indicator bits used in the > +configuration change host->guest notification, the driver issues the > +CCW_CMD_SET_CONF_IND command, pointing to a location containing the > +guest address of the indicators in a 64 bit value. > + > +2.3.3.2.6.3. Setting Up Two-Stage Queue Indicators > +-------------------------------------------------- > + > +Indicators for notification via adapter I/O interrupts consist of > +two stages: > +- a summary indicator byte covering the virtqueues for one or more > + virtio-ccw proxy devices > +- a set of contigous indicator bits for the virtqueues for a > + virtio-ccw proxy device > + > +To communicate the location of the summary and queue indicator bits, > +the driver uses the CCW_CMD_SET_IND_ADAPTER command with the following > +payload: > + > +struct virtio_thinint_area { > + __u64 summary_indicator; > + __u64 indicator; > + __u64 bit_nr; > + __u8 isc; > +}; Hmm... you __attribute__((packed)) the other structures; I assume that's wanted here too? Cheers, Rusty.


  • 6.  Re: [virtio] [PATCH] virtio-ccw: add adapter interrupt support

    Posted 10-15-2013 10:51
    On Tue, 15 Oct 2013 14:13:58 +1030
    Rusty Russell <rusty@au1.ibm.com> wrote:

    > Cornelia Huck <cornelia.huck@de.ibm.com> writes:
    > > Specify a new channel command to set up two-stage indicators as needed
    > > for adapter interrupts and describe how adapter interrupts are used
    > > for notifications.
    >
    > Since this presumably isn't in the current implementation, should there
    > be a legacy section talking about what happens if it's not supported?
    > Or is that implied and I missed it?

    As a device will reject any channel command it doesn't know, we should
    be fine. I'll add a legacy section though; a transitional driver should
    just fall back to classic indicators.

    >
    > Nice to see that CCW is getting some benefit from the pain of v1.0 :)
    >
    > > VIRTIO-43
    > >
    > > Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
    > > ---
    > > virtio-v1.0-wd01-part1-specification.txt | 100 ++++++++++++++++++++++++++++--
    > > 1 file changed, 96 insertions(+), 4 deletions(-)
    > >
    > > diff --git a/virtio-v1.0-wd01-part1-specification.txt b/virtio-v1.0-wd01-part1-specification.txt
    > > index 3ba7f52..ae646db 100644
    > > --- a/virtio-v1.0-wd01-part1-specification.txt
    > > +++ b/virtio-v1.0-wd01-part1-specification.txt
    > > @@ -1545,6 +1545,7 @@ virtio:
    > > #define CCW_CMD_VDEV_RESET 0x33
    > > #define CCW_CMD_SET_IND 0x43
    > > #define CCW_CMD_SET_CONF_IND 0x53
    > > +#define CCW_CMD_SET_IND_ADAPTER 0x73
    > > #define CCW_CMD_READ_FEAT 0x12
    > > #define CCW_CMD_WRITE_FEAT 0x11
    > > #define CCW_CMD_READ_CONF 0x22
    > > @@ -1724,15 +1725,74 @@ In both cases, the complete configuration space is transmitted.
    > > 2.3.3.2.6. Setting Up Indicators
    > > --------------------------------
    > >
    > > +In order to set up the indicator bits for host->guest notification,
    > > +the driver uses different channel commands depending on whether it
    > > +wishes to use traditional I/O interrupts tied to a subchannel or
    > > +adapter I/O interrupts. For any given device, the two mechanisms
    > > +are mutually exclusive.
    > > +
    > > +For the configuration change indicators, the same mechanism is used
    > > +in both cases.
    > > +
    > > +2.3.3.2.6.1. Setting Up Classic Queue Indicators
    > > +------------------------------------------------
    > > +
    > > +Indicators for notification via classic I/O interrupts are contained
    > > +in a 64 bit value per virtio-ccw proxy device.
    > > +
    > > To communicate the location of the indicator bits for host->guest
    > > notification, the guest uses the CCW_CMD_SET_IND command,
    > > pointing to a location containing the guest address of the
    > > indicators in a 64 bit value.
    > >
    > > -For the indicator bits used in the configuration change
    > > -host->guest notification, the CCW_CMD_SET_CONF_IND command is
    > > -used analogously.
    > > +If the driver has already set up two-staged queue indicators via the
    > > +CCW_CMD_SET_IND_ADAPTER command, the device MUST post a unit check
    > > +with command reject to any subsequent CCW_CMD_SET_IND command.
    > > +
    > > +2.3.3.2.6.2. Setting Up Configuration Change Indicators
    > > +-------------------------------------------------------
    > > +
    > > +Indicators for configuration change host->guest notification are
    > > +contained in a 64 bit value per virtio-ccw proxy device.
    > > +
    > > +To communicate the location of the indicator bits used in the
    > > +configuration change host->guest notification, the driver issues the
    > > +CCW_CMD_SET_CONF_IND command, pointing to a location containing the
    > > +guest address of the indicators in a 64 bit value.
    > > +
    > > +2.3.3.2.6.3. Setting Up Two-Stage Queue Indicators
    > > +--------------------------------------------------
    > > +
    > > +Indicators for notification via adapter I/O interrupts consist of
    > > +two stages:
    > > +- a summary indicator byte covering the virtqueues for one or more
    > > + virtio-ccw proxy devices
    > > +- a set of contigous indicator bits for the virtqueues for a
    > > + virtio-ccw proxy device
    > > +
    > > +To communicate the location of the summary and queue indicator bits,
    > > +the driver uses the CCW_CMD_SET_IND_ADAPTER command with the following
    > > +payload:
    > > +
    > > +struct virtio_thinint_area {
    > > + __u64 summary_indicator;
    > > + __u64 indicator;
    > > + __u64 bit_nr;
    > > + __u8 isc;
    > > +};
    >
    > Hmm... you __attribute__((packed)) the other structures; I assume
    > that's wanted here too?

    I'll add it.

    >
    > Cheers,
    > Rusty.




  • 7.  Re: [virtio] [PATCH] virtio-ccw: add adapter interrupt support

    Posted 10-15-2013 10:51
    On Tue, 15 Oct 2013 14:13:58 +1030 Rusty Russell <rusty@au1.ibm.com> wrote: > Cornelia Huck <cornelia.huck@de.ibm.com> writes: > > Specify a new channel command to set up two-stage indicators as needed > > for adapter interrupts and describe how adapter interrupts are used > > for notifications. > > Since this presumably isn't in the current implementation, should there > be a legacy section talking about what happens if it's not supported? > Or is that implied and I missed it? As a device will reject any channel command it doesn't know, we should be fine. I'll add a legacy section though; a transitional driver should just fall back to classic indicators. > > Nice to see that CCW is getting some benefit from the pain of v1.0 :) > > > VIRTIO-43 > > > > Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> > > --- > > virtio-v1.0-wd01-part1-specification.txt 100 ++++++++++++++++++++++++++++-- > > 1 file changed, 96 insertions(+), 4 deletions(-) > > > > diff --git a/virtio-v1.0-wd01-part1-specification.txt b/virtio-v1.0-wd01-part1-specification.txt > > index 3ba7f52..ae646db 100644 > > --- a/virtio-v1.0-wd01-part1-specification.txt > > +++ b/virtio-v1.0-wd01-part1-specification.txt > > @@ -1545,6 +1545,7 @@ virtio: > > #define CCW_CMD_VDEV_RESET 0x33 > > #define CCW_CMD_SET_IND 0x43 > > #define CCW_CMD_SET_CONF_IND 0x53 > > +#define CCW_CMD_SET_IND_ADAPTER 0x73 > > #define CCW_CMD_READ_FEAT 0x12 > > #define CCW_CMD_WRITE_FEAT 0x11 > > #define CCW_CMD_READ_CONF 0x22 > > @@ -1724,15 +1725,74 @@ In both cases, the complete configuration space is transmitted. > > 2.3.3.2.6. Setting Up Indicators > > -------------------------------- > > > > +In order to set up the indicator bits for host->guest notification, > > +the driver uses different channel commands depending on whether it > > +wishes to use traditional I/O interrupts tied to a subchannel or > > +adapter I/O interrupts. For any given device, the two mechanisms > > +are mutually exclusive. > > + > > +For the configuration change indicators, the same mechanism is used > > +in both cases. > > + > > +2.3.3.2.6.1. Setting Up Classic Queue Indicators > > +------------------------------------------------ > > + > > +Indicators for notification via classic I/O interrupts are contained > > +in a 64 bit value per virtio-ccw proxy device. > > + > > To communicate the location of the indicator bits for host->guest > > notification, the guest uses the CCW_CMD_SET_IND command, > > pointing to a location containing the guest address of the > > indicators in a 64 bit value. > > > > -For the indicator bits used in the configuration change > > -host->guest notification, the CCW_CMD_SET_CONF_IND command is > > -used analogously. > > +If the driver has already set up two-staged queue indicators via the > > +CCW_CMD_SET_IND_ADAPTER command, the device MUST post a unit check > > +with command reject to any subsequent CCW_CMD_SET_IND command. > > + > > +2.3.3.2.6.2. Setting Up Configuration Change Indicators > > +------------------------------------------------------- > > + > > +Indicators for configuration change host->guest notification are > > +contained in a 64 bit value per virtio-ccw proxy device. > > + > > +To communicate the location of the indicator bits used in the > > +configuration change host->guest notification, the driver issues the > > +CCW_CMD_SET_CONF_IND command, pointing to a location containing the > > +guest address of the indicators in a 64 bit value. > > + > > +2.3.3.2.6.3. Setting Up Two-Stage Queue Indicators > > +-------------------------------------------------- > > + > > +Indicators for notification via adapter I/O interrupts consist of > > +two stages: > > +- a summary indicator byte covering the virtqueues for one or more > > + virtio-ccw proxy devices > > +- a set of contigous indicator bits for the virtqueues for a > > + virtio-ccw proxy device > > + > > +To communicate the location of the summary and queue indicator bits, > > +the driver uses the CCW_CMD_SET_IND_ADAPTER command with the following > > +payload: > > + > > +struct virtio_thinint_area { > > + __u64 summary_indicator; > > + __u64 indicator; > > + __u64 bit_nr; > > + __u8 isc; > > +}; > > Hmm... you __attribute__((packed)) the other structures; I assume > that's wanted here too? I'll add it. > > Cheers, > Rusty.


  • 8.  Re: [virtio] [PATCH] virtio-ccw: add adapter interrupt support

    Posted 10-16-2013 00:15
    Cornelia Huck <cornelia.huck@de.ibm.com> writes:
    > On Tue, 15 Oct 2013 14:13:58 +1030
    > Rusty Russell <rusty@au1.ibm.com> wrote:
    >
    >> Cornelia Huck <cornelia.huck@de.ibm.com> writes:
    >> > Specify a new channel command to set up two-stage indicators as needed
    >> > for adapter interrupts and describe how adapter interrupts are used
    >> > for notifications.
    >>
    >> Since this presumably isn't in the current implementation, should there
    >> be a legacy section talking about what happens if it's not supported?
    >> Or is that implied and I missed it?
    >
    > As a device will reject any channel command it doesn't know, we should
    > be fine. I'll add a legacy section though; a transitional driver should
    > just fall back to classic indicators.

    To make sure I understand correctly: a non-legacy device MUST support
    this, right? So a non-transitional driver can count on it? (I guess
    the command might fail for other reasons, so it's still nice for the
    driver to fall back, but not compulsory).

    Cheers,
    Rusty.




  • 9.  Re: [virtio] [PATCH] virtio-ccw: add adapter interrupt support

    Posted 10-16-2013 22:50
    Cornelia Huck <cornelia.huck@de.ibm.com> writes: > On Tue, 15 Oct 2013 14:13:58 +1030 > Rusty Russell <rusty@au1.ibm.com> wrote: > >> Cornelia Huck <cornelia.huck@de.ibm.com> writes: >> > Specify a new channel command to set up two-stage indicators as needed >> > for adapter interrupts and describe how adapter interrupts are used >> > for notifications. >> >> Since this presumably isn't in the current implementation, should there >> be a legacy section talking about what happens if it's not supported? >> Or is that implied and I missed it? > > As a device will reject any channel command it doesn't know, we should > be fine. I'll add a legacy section though; a transitional driver should > just fall back to classic indicators. To make sure I understand correctly: a non-legacy device MUST support this, right? So a non-transitional driver can count on it? (I guess the command might fail for other reasons, so it's still nice for the driver to fall back, but not compulsory). Cheers, Rusty.


  • 10.  Re: [virtio] [PATCH] virtio-ccw: add adapter interrupt support

    Posted 10-17-2013 17:14
    On Wed, 16 Oct 2013 10:45:22 +1030
    Rusty Russell <rusty@au1.ibm.com> wrote:

    > Cornelia Huck <cornelia.huck@de.ibm.com> writes:
    > > On Tue, 15 Oct 2013 14:13:58 +1030
    > > Rusty Russell <rusty@au1.ibm.com> wrote:
    > >
    > >> Cornelia Huck <cornelia.huck@de.ibm.com> writes:
    > >> > Specify a new channel command to set up two-stage indicators as needed
    > >> > for adapter interrupts and describe how adapter interrupts are used
    > >> > for notifications.
    > >>
    > >> Since this presumably isn't in the current implementation, should there
    > >> be a legacy section talking about what happens if it's not supported?
    > >> Or is that implied and I missed it?
    > >
    > > As a device will reject any channel command it doesn't know, we should
    > > be fine. I'll add a legacy section though; a transitional driver should
    > > just fall back to classic indicators.
    >
    > To make sure I understand correctly: a non-legacy device MUST support
    > this, right? So a non-transitional driver can count on it? (I guess
    > the command might fail for other reasons, so it's still nice for the
    > driver to fall back, but not compulsory).

    I don't think we win anything if a device stops implementing classic
    indicators. Configuration-change indicators still use the same
    mechanism, after all.

    >
    > Cheers,
    > Rusty.




  • 11.  Re: [virtio] [PATCH] virtio-ccw: add adapter interrupt support

    Posted 10-17-2013 17:15
    On Wed, 16 Oct 2013 10:45:22 +1030 Rusty Russell <rusty@au1.ibm.com> wrote: > Cornelia Huck <cornelia.huck@de.ibm.com> writes: > > On Tue, 15 Oct 2013 14:13:58 +1030 > > Rusty Russell <rusty@au1.ibm.com> wrote: > > > >> Cornelia Huck <cornelia.huck@de.ibm.com> writes: > >> > Specify a new channel command to set up two-stage indicators as needed > >> > for adapter interrupts and describe how adapter interrupts are used > >> > for notifications. > >> > >> Since this presumably isn't in the current implementation, should there > >> be a legacy section talking about what happens if it's not supported? > >> Or is that implied and I missed it? > > > > As a device will reject any channel command it doesn't know, we should > > be fine. I'll add a legacy section though; a transitional driver should > > just fall back to classic indicators. > > To make sure I understand correctly: a non-legacy device MUST support > this, right? So a non-transitional driver can count on it? (I guess > the command might fail for other reasons, so it's still nice for the > driver to fall back, but not compulsory). I don't think we win anything if a device stops implementing classic indicators. Configuration-change indicators still use the same mechanism, after all. > > Cheers, > Rusty.