From patchwork Fri Jun 7 10:37:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 2686201 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 036FB40077 for ; Fri, 7 Jun 2013 10:37:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754722Ab3FGKhN (ORCPT ); Fri, 7 Jun 2013 06:37:13 -0400 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:49044 "EHLO e06smtp15.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752118Ab3FGKhL (ORCPT ); Fri, 7 Jun 2013 06:37:11 -0400 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 7 Jun 2013 11:33:02 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 7 Jun 2013 11:32:59 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 1973C2190069; Fri, 7 Jun 2013 11:40:21 +0100 (BST) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps4075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r57AatM851380290; Fri, 7 Jun 2013 10:36:55 GMT Received: from d06av08.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r57Ab5Xc009871; Fri, 7 Jun 2013 04:37:06 -0600 Received: from gondolin.boeblingen.de.ibm.com (dyn-9-152-224-40.boeblingen.de.ibm.com [9.152.224.40]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id r57Ab4Vw009838; Fri, 7 Jun 2013 04:37:05 -0600 From: Cornelia Huck To: KVM , linux-s390 , qemu-devel , virtualization@lists.linux-foundation.org Subject: [PATCH RFC] virtio-ccw: Document adapter interrupts. Date: Fri, 7 Jun 2013 12:37:04 +0200 Message-Id: <1370601424-23412-2-git-send-email-cornelia.huck@de.ibm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1370601424-23412-1-git-send-email-cornelia.huck@de.ibm.com> References: <1370601424-23412-1-git-send-email-cornelia.huck@de.ibm.com> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13060710-0342-0000-0000-00000540C86D Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.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 6e188d0..697351e 100644 --- a/virtio-spec.lyx +++ b/virtio-spec.lyx @@ -10701,11 +10701,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 @@ -11045,11 +11052,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 @@ -11064,7 +11196,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 @@ -11073,6 +11205,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