All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark McLoughlin <markmc@redhat.com>
To: "Han, Weidong" <weidong.han@intel.com>
Cc: "'Avi Kivity'" <avi@redhat.com>,
	"'kvm@vger.kernel.org'" <kvm@vger.kernel.org>
Subject: Re: [PATCH 5/6] kvm: qemu: deassign device from guest
Date: Fri, 13 Feb 2009 08:14:45 +0000	[thread overview]
Message-ID: <1234512885.3644.1.camel@blaa> (raw)
In-Reply-To: <715D42877B251141A38726ABF5CABF2C01959AFDD7@pdsmsx503.ccr.corp.intel.com>

On Fri, 2009-02-13 at 14:58 +0800, Han, Weidong wrote:
> +static void deassign_device(AssignedDevInfo *adev)
> +{
> +    struct kvm_assigned_pci_dev assigned_dev_data;
> +    AssignedDevice *dev = adev->assigned_dev;
> +    int r;
> +
> +    memset(&assigned_dev_data, 0, sizeof(assigned_dev_data));
> +    assigned_dev_data.assigned_dev_id  =
> +       calc_assigned_dev_id(dev->h_busnr, dev->h_devfn);

>From here:

> +    assigned_dev_data.busnr = dev->h_busnr;
> +    assigned_dev_data.devfn = dev->h_devfn;
> +
> +#ifdef KVM_CAP_IOMMU
> +    /* We always enable the IOMMU if present
> +     * (or when not disabled on the command line)
> +     */
> +    r = kvm_check_extension(kvm_context, KVM_CAP_IOMMU);
> +    if (r && !adev->disable_iommu)
> +       assigned_dev_data.flags |= KVM_DEV_ASSIGN_ENABLE_IOMMU;
> +#endif

to here.

As, I said, these lines should not be needed and the ioctl should be
fixed like so:

-       if (assigned_dev->flags & KVM_DEV_ASSIGN_ENABLE_IOMMU)
+       if (match->flags & KVM_DEV_ASSIGN_ENABLE_IOMMU)
                kvm_deassign_device(kvm, match);

Cheers,
Mark.


  reply	other threads:[~2009-02-13  8:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-13  6:58 [PATCH 5/6] kvm: qemu: deassign device from guest Han, Weidong
2009-02-13  8:14 ` Mark McLoughlin [this message]
2009-02-13  9:20   ` Han, Weidong

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=1234512885.3644.1.camel@blaa \
    --to=markmc@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --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.