From patchwork Sat May 28 11:12:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 826072 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4SBFSEB008711 for ; Sat, 28 May 2011 11:15:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752522Ab1E1LNe (ORCPT ); Sat, 28 May 2011 07:13:34 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:55018 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751358Ab1E1LNd (ORCPT ); Sat, 28 May 2011 07:13:33 -0400 Received: by wya21 with SMTP id 21so1751900wya.19 for ; Sat, 28 May 2011 04:13:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer; bh=JJFQew8XVQb5kbh6XAZdgI/CMDtv4oR9JEAGvshYcoM=; b=I0wdwsaWTShyLO2iLZXQ+pPb2NfVXAkXMQPLamt8srcv6E1E5O3AwWjaBNlnjKD+GQ ZRcUSP3zhDpInkVT7HGm34vgNOOkrbovYIKoZAp0JYWUsbDHyuNKkch/ZNm34I5vh1qG WA/32EdKDBFyeBr1MWmKqnn0fICPiCN5HLH44= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=kzBv3/5evwg8d8h7npXEDotiLohgcI37lzooz+C1DvzWJC1+Tp7/XSDnC6DM4zoCBf UMD46puET34Nvm3ILO+5D1YqElrP+zS7NMGP1tTMnPdlpKo0hULji44Szm+E+xvJ0uNy 1qiZ8W+3a62EiftOVU6+rMamhweO6BlDR4gYc= Received: by 10.217.7.9 with SMTP id z9mr615744wes.103.1306581212107; Sat, 28 May 2011 04:13:32 -0700 (PDT) Received: from localhost.localdomain (bzq-79-176-208-154.red.bezeqint.net [79.176.208.154]) by mx.google.com with ESMTPS id o75sm1445826weq.16.2011.05.28.04.13.30 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 28 May 2011 04:13:31 -0700 (PDT) From: Sasha Levin To: kvm@vger.kernel.org Cc: Sasha Levin , Avi Kivity , Marcelo Tosatti Subject: [PATCH] kvm: Document KVM_IOEVENTFD Date: Sat, 28 May 2011 14:12:30 +0300 Message-Id: <1306581150-23155-1-git-send-email-levinsasha928@gmail.com> X-Mailer: git-send-email 1.7.5.rc3 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sat, 28 May 2011 11:15:29 +0000 (UTC) Document KVM_IOEVENTFD that can be used to receive notifications of PIO/MMIO events without triggering an exit. Cc: Avi Kivity Cc: Marcelo Tosatti Signed-off-by: Sasha Levin --- Documentation/virtual/kvm/api.txt | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index 42542eb..80c5fcd 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt @@ -1291,6 +1291,36 @@ Returns the tsc frequency of the guest. The unit of the return value is KHz. If the host has unstable tsc this ioctl returns -EIO instead as an error. +4.56 KVM_IOEVENTFD + +Capability: KVM_CAP_IOEVENTFD +Architectures: all +Type: vm ioctl +Parameters: struct kvm_ioeventfd (in) +Returns: 0 on success, !0 on error + +This ioctl attaches or deattaches an ioeventfd to a legal pio/mmio address +within the guest. A guest write in the registered address will signal the +provided event instead of triggering an exit. + +struct kvm_ioeventfd { + __u64 datamatch; + __u64 addr; /* legal pio/mmio address */ + __u32 len; /* 1, 2, 4, or 8 bytes */ + __s32 fd; + __u32 flags; + __u8 pad[36]; +}; + +The following flags are defined: + +#define KVM_IOEVENTFD_FLAG_DATAMATCH (1 << kvm_ioeventfd_flag_nr_datamatch) +#define KVM_IOEVENTFD_FLAG_PIO (1 << kvm_ioeventfd_flag_nr_pio) +#define KVM_IOEVENTFD_FLAG_DEASSIGN (1 << kvm_ioeventfd_flag_nr_deassign) + +If datamatch flag is set, the event will be signaled only if the written value +to the registered address is equal to datamatch in struct kvm_ioeventfd. + 5. The kvm_run structure Application code obtains a pointer to the kvm_run structure by