From patchwork Sun Aug 30 09:12:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 7096881 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9CF57BEEC1 for ; Sun, 30 Aug 2015 09:13:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9439520710 for ; Sun, 30 Aug 2015 09:13:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A9A3D2070C for ; Sun, 30 Aug 2015 09:13:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753388AbbH3JNc (ORCPT ); Sun, 30 Aug 2015 05:13:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53074 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753199AbbH3JMx (ORCPT ); Sun, 30 Aug 2015 05:12:53 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 5BAF5ABBA6; Sun, 30 Aug 2015 09:12:53 +0000 (UTC) Received: from redhat.com (ovpn-116-40.ams2.redhat.com [10.36.116.40]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t7U9Coer032477; Sun, 30 Aug 2015 05:12:51 -0400 Date: Sun, 30 Aug 2015 12:12:50 +0300 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org Cc: kvm@vger.kernel.org, Paolo Bonzini Subject: [PATCH RFC 3/3] kvm: add KVM_CAP_IOEVENTFD_PF capability Message-ID: <1440925898-23440-4-git-send-email-mst@redhat.com> References: <1440925898-23440-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1440925898-23440-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Michael S. Tsirkin --- include/uapi/linux/kvm.h | 1 + arch/x86/kvm/x86.c | 1 + Documentation/virtual/kvm/api.txt | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 716ad4a..4509aa3 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -817,6 +817,7 @@ struct kvm_ppc_smmu_info { #define KVM_CAP_DISABLE_QUIRKS 116 #define KVM_CAP_X86_SMM 117 #define KVM_CAP_MULTI_ADDRESS_SPACE 118 +#define KVM_CAP_IOEVENTFD_PF 119 #ifdef KVM_CAP_IRQ_ROUTING diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index c8015fa..f989453 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -2629,6 +2629,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) case KVM_CAP_IRQ_INJECT_STATUS: case KVM_CAP_IOEVENTFD: case KVM_CAP_IOEVENTFD_NO_LENGTH: + case KVM_CAP_IOEVENTFD_PF: case KVM_CAP_PIT2: case KVM_CAP_PIT_STATE2: case KVM_CAP_SET_IDENTITY_MAP_ADDR: diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index a7926a9..85a76ad 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt @@ -1618,6 +1618,13 @@ The following flags are defined: 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. +If KVM_CAP_IOEVENTFD_NO_LENGTH is present, and when DATAMATCH flag +is clear, len can be set to 0 to match access of any length. + +If KVM_CAP_IOEVENTFD_PF is present, and when DATAMATCH flag +is clear and len is set to 0, the specified address can overlap +a read-only memory region (as opposed to an MMIO region). + For virtio-ccw devices, addr contains the subchannel id and datamatch the virtqueue index.