From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 1/4] KVM: support VT-d device hotplug Date: Mon, 17 Nov 2008 16:05:49 +0200 Message-ID: <49217A3D.709@redhat.com> References: <715D42877B251141A38726ABF5CABF2C018BE64962@pdsmsx503.ccr.corp.intel.com> <491FD45A.9070309@redhat.com> <715D42877B251141A38726ABF5CABF2C018BE64D26@pdsmsx503.ccr.corp.intel.com> <4921475B.5010403@redhat.com> <715D42877B251141A38726ABF5CABF2C018BE64D7E@pdsmsx503.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "'kvm@vger.kernel.org'" , "Kay, Allen M" , "Yang, Sheng" To: "Han, Weidong" Return-path: Received: from mx2.redhat.com ([66.187.237.31]:39214 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752180AbYKQOF6 (ORCPT ); Mon, 17 Nov 2008 09:05:58 -0500 In-Reply-To: <715D42877B251141A38726ABF5CABF2C018BE64D7E@pdsmsx503.ccr.corp.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: Han, Weidong wrote: > Avi Kivity wrote: > >> Han, Weidong wrote: >> >>>> Need a KVM_CAP_ to indicate this is available. >>>> >>>> >>>> >>> KVM_ASSIGN_PCI_DEVICE and KVM_ASSIGN_IRQ don't need a KVM_CAP_xxx. >>> Why do you need it for KVM_DEASSIGN_PCI_DEVICE? >>> >>> >>> >> #define KVM_CAP_DEVICE_ASSIGNMENT 17 >> > > Do you mean add it like that: > > #ifdef KVM_CAP_DEVICE_ASSIGNMENT > #define KVM_ASSIGN_PCI_DEVICE _IOR(KVMIO, 0x69, \ > struct kvm_assigned_pci_dev) > #define KVM_ASSIGN_IRQ _IOR(KVMIO, 0x70, \ > struct kvm_assigned_irq) > #define KVM_DEASSIGN_PCI_DEVICE _IOR(KVMIO, 0x71, \ > struct kvm_assigned_pci_dev) > #endif > No, sorry for being unclear. KVM_CAP_DEVICE_ASSIGNMENT already exists in kvm.h This is how KVM_CAP_ works: - kvm.h defines KVM_CAP_DEVICE_ASSIGNMENT - userspace compiles device assignment code only if it sees KVM_CAP_DEVICE_ASSIGNMENT in kvm.h - kvm.ko returns nonzero to ioctl(KVM_CHECK_EXTENSION, KVM_CAP_DEVICE_ASSIGNMENT) if it supports device assignment (recent enough module, iommu found) - userspace runs device assignment code only if above ioctl passes We need something similar to deassignment, since it didn't arrive at the same time as assignment. -- error compiling committee.c: too many arguments to function