From: Avi Kivity <avi@qumranet.com>
To: Ben-Ami Yassour <benami@il.ibm.com>
Cc: Amit Shah <amit.shah@qumranet.com>,
kvm@vger.kernel.org, Muli Ben-Yehuda <muli@il.ibm.com>,
weidong.han@intel.com, anthony@codemonkey.ws
Subject: Re: [PATCH 3/5] KVM: pci device assignment
Date: Tue, 29 Jul 2008 17:02:26 +0300 [thread overview]
Message-ID: <488F22F2.7030709@qumranet.com> (raw)
In-Reply-To: <1217324307.24756.5.camel@cluwyn.haifa.ibm.com>
Ben-Ami Yassour wrote:
> On Tue, 2008-07-29 at 14:49 +0530, Amit Shah wrote:
>
>> * On Monday 28 Jul 2008 21:56:26 Ben-Ami Yassour wrote:
>>
>>
>>> +static int kvm_vm_ioctl_assign_device(struct kvm *kvm,
>>> + struct kvm_assigned_pci_dev *assigned_dev)
>>> +{
>>>
>>
>>> + if (pci_enable_device(dev)) {
>>> + printk(KERN_INFO "%s: Could not enable PCI device\n", __func__);
>>> + r = -EBUSY;
>>> + goto out_put;
>>> + }
>>> + r = pci_request_regions(dev, "kvm_assigned_device");
>>> + if (r) {
>>> + printk(KERN_INFO "%s: Could not get access to device regions\n",
>>> + __func__);
>>> + goto out_disable;
>>>
>> Shouldn't disable here unconditionally (see my comment earlier to the previous
>> patch).
>>
> Why? the device should not be used by the host at the same time.
> What is the condition that you were thinking of?
>
>
pci_enable_device() can succeed even if the device was already enabled,
so Amit was probably wishing to avoid an assignment failure disabling a
device under a driver's feet. But I see that pci_disable_device() will
pair with pci_enable_device() correctly (doing reference counts), so I
think the code is correct as is.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2008-07-29 14:02 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-28 16:26 Device assignemnt: updated patches Ben-Ami Yassour
2008-07-28 16:26 ` [PATCH 1/5] KVM: PCIPT: direct mmio pfn check Ben-Ami Yassour
2008-07-28 16:26 ` [PATCH 2/5] KVM: Add irq ack notifier list Ben-Ami Yassour
2008-07-28 16:26 ` [PATCH 3/5] KVM: pci device assignment Ben-Ami Yassour
2008-07-28 16:26 ` [PATCH 4/5] VT-d: changes to support KVM Ben-Ami Yassour
2008-07-28 16:26 ` [PATCH 5/5] This patch extends the VT-d driver " Ben-Ami Yassour
2008-07-28 16:32 ` Device assignment - userspace part Ben-Ami Yassour
2008-07-28 16:32 ` [PATCH 1/1] KVM/userspace: Support for assigning PCI devices to guest Ben-Ami Yassour
2008-08-01 3:09 ` Han, Weidong
2008-08-05 9:41 ` Ben-Ami Yassour
2008-07-29 7:28 ` [PATCH 5/5] This patch extends the VT-d driver to support KVM Yang, Sheng
2008-08-05 6:01 ` Yang, Sheng
2008-08-05 9:32 ` Ben-Ami Yassour
2008-08-05 14:46 ` Han, Weidong
2008-08-06 5:50 ` Ben-Ami Yassour
2008-08-06 6:18 ` Han, Weidong
2008-08-06 8:56 ` Ben-Ami Yassour
2008-08-06 9:12 ` Han, Weidong
2008-08-06 9:42 ` Ben-Ami Yassour
2008-08-07 1:21 ` Han, Weidong
2008-08-07 10:35 ` Ben-Ami Yassour
2008-08-12 3:29 ` Han, Weidong
2008-07-29 9:19 ` [PATCH 3/5] KVM: pci device assignment Amit Shah
2008-07-29 9:38 ` Ben-Ami Yassour
2008-07-29 14:02 ` Avi Kivity [this message]
2008-07-30 6:00 ` Amit Shah
2008-07-30 6:03 ` Amit Shah
2008-07-30 11:58 ` Ben-Ami Yassour
2008-08-01 11:24 ` Amit Shah
2008-07-29 12:27 ` Ben-Ami Yassour
2008-07-29 7:14 ` [PATCH 2/5] KVM: Add irq ack notifier list Yang, Sheng
2008-07-29 9:34 ` Amit Shah
2008-07-29 9:56 ` Yang, Sheng
2008-07-30 5:54 ` Amit Shah
2008-07-31 8:55 ` Avi Kivity
2008-07-30 15:21 ` Device assignemnt: updated patches Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=488F22F2.7030709@qumranet.com \
--to=avi@qumranet.com \
--cc=amit.shah@qumranet.com \
--cc=anthony@codemonkey.ws \
--cc=benami@il.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=muli@il.ibm.com \
--cc=weidong.han@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.