From patchwork Tue Jul 9 11:33:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 257702 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 841892C0084 for ; Tue, 9 Jul 2013 21:34:29 +1000 (EST) Received: from localhost ([::1]:57819 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwWBf-00055C-3V for incoming@patchwork.ozlabs.org; Tue, 09 Jul 2013 07:34:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwWBE-000520-Vw for qemu-devel@nongnu.org; Tue, 09 Jul 2013 07:34:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UwWBD-0001Lu-Eu for qemu-devel@nongnu.org; Tue, 09 Jul 2013 07:34:00 -0400 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:49534) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwWBD-0001LD-6O for qemu-devel@nongnu.org; Tue, 09 Jul 2013 07:33:59 -0400 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 9 Jul 2013 12:28:18 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 9 Jul 2013 12:28:16 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 707512190023 for ; Tue, 9 Jul 2013 12:37:45 +0100 (BST) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps4074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r69BXgt643843628 for ; Tue, 9 Jul 2013 11:33:42 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r69BXqeo032223 for ; Tue, 9 Jul 2013 05:33:53 -0600 Received: from gondolin.boeblingen.de.ibm.com (dyn-9-152-224-218.boeblingen.de.ibm.com [9.152.224.218]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id r69BXqlM032190; Tue, 9 Jul 2013 05:33:52 -0600 From: Cornelia Huck To: KVM , linux-s390 , qemu-devel , virtualization@lists.linux-foundation.org Date: Tue, 9 Jul 2013 13:33:51 +0200 Message-Id: <1373369631-3148-2-git-send-email-cornelia.huck@de.ibm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1373369631-3148-1-git-send-email-cornelia.huck@de.ibm.com> References: <1373369631-3148-1-git-send-email-cornelia.huck@de.ibm.com> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13070911-5024-0000-0000-00000689C177 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 195.75.94.107 Subject: [Qemu-devel] [RFC PATCH v2] virtio-ccw: Document adapter interrupts. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Cornelia Huck --- virtio-spec.lyx | 147 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 144 insertions(+), 3 deletions(-) diff --git a/virtio-spec.lyx b/virtio-spec.lyx index c920155..4729766 100644 --- a/virtio-spec.lyx +++ b/virtio-spec.lyx @@ -10721,11 +10721,18 @@ status open \begin_layout LyX-Code -\change_inserted -385801441 1343732726 +\change_inserted -385801441 1369814105 #define CCW_CMD_READ_VQ_CONF 0x32 \end_layout +\begin_layout LyX-Code + +\change_inserted -385801441 1369814140 + +#define CCW_CMD_SET_IND_ADAPTER 0x63 +\end_layout + \end_inset @@ -11065,11 +11072,136 @@ To communicate the location of the indicator bits for host->guest notification, \begin_layout Standard -\change_inserted -385801441 1347015749 +\change_inserted -385801441 1369814376 For the indicator bits used in the configuration change host->guest notification , the CCW_CMD_SET_CONF_IND command is used analogously. \end_layout +\begin_layout Subsubsection* + +\change_inserted -385801441 1369814399 +Setting Up Indicators For Adapter Interrupts +\end_layout + +\begin_layout Standard + +\change_inserted -385801441 1369815013 +If the guest wishes to use adapter interrupts for host->guest notification, + it may use the CCW_CMD_SET_IND_ADAPTER command instead of CCW_CMD_SET_IND. + Note that usage of those two mechanisms is mutually exclusive. +\end_layout + +\begin_layout Standard + +\change_inserted -385801441 1369815065 +CCW_CMD_SET_IND_ADAPTER uses the following communication block: +\end_layout + +\begin_layout LyX-Code + +\change_inserted -385801441 1369815367 +\begin_inset listings +inline false +status open + +\begin_layout LyX-Code + +\change_inserted -385801441 1369815367 + +struct thinint_area { +\end_layout + +\begin_layout LyX-Code + +\change_inserted -385801441 1369815367 + + unsigned long summary_indicator; +\end_layout + +\begin_layout LyX-Code + +\change_inserted -385801441 1369815367 + + unsigned long indicator; +\end_layout + +\begin_layout LyX-Code + +\change_inserted -385801441 1369815367 + + u16 shift; +\end_layout + +\begin_layout LyX-Code + +\change_inserted -385801441 1369815367 + + u8 isc; +\end_layout + +\begin_layout LyX-Code + +\change_inserted -385801441 1369815367 + +} __packed; +\change_unchanged + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard + +\change_inserted -385801441 1370345028 + +\family typewriter +summary_indicator +\family default + contains the guest address of a byte value to be used as a summary indicator + which is set to != 0 every time the host wants to signal the guest for + any of the indictors and unset by the guest to signify that it received + the notification. + +\family typewriter +isc +\family default + is the interruption subclass to be used for the adapter interrupt. + Note that an isc/summary indicator pair must match for any subsequent requests + to set up adapter interrupts . +\end_layout + +\begin_layout Standard + +\change_inserted -385801441 1369816401 + +\family typewriter +indicator +\family default + contains the guest address of the 64 bit indicators to be used; +\family typewriter +shift +\family default + contains the offset of the queue indicators for the device in this value. + All queue indicators for a device must fit into the same 64 bit value. +\end_layout + +\begin_layout Standard + +\change_inserted -385801441 1369814707 +Hosts not supporting adapter interrupts for virtio-ccw may fail this command + with a command reject. +\end_layout + +\begin_layout Standard + +\change_inserted -385801441 1369814766 +Configuration change host->guest notification is always setup using CCW_CMD_SET_ +CONF_IND. +\end_layout + \begin_layout Subsection* \change_inserted -385801441 1343732726 @@ -11084,7 +11216,7 @@ Host->Guest Notification \begin_layout Standard -\change_inserted -385801441 1347015762 +\change_inserted -385801441 1369814838 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 generates @@ -11093,6 +11225,15 @@ For notifying the guest of virtqueue buffers, the host sets the corresponding \begin_layout Standard +\change_inserted -385801441 1369815397 +Alternatively, if the guest enabled adapter interrupts for a device, notificatio +n happens via setting the bit in the guest-provided indicators, setting + the summary indicator and generating an adapter interrupt for the registered + interruption subclass. +\end_layout + +\begin_layout Standard + \change_inserted -385801441 1347015847 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