All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: "Han, Weidong" <weidong.han@intel.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"Kay, Allen M" <allen.m.kay@intel.com>,
	"Yang, Sheng" <sheng.yang@intel.com>
Subject: Re: [PATCH 1/4] KVM: support VT-d device hotplug
Date: Sun, 16 Nov 2008 10:05:46 +0200	[thread overview]
Message-ID: <491FD45A.9070309@redhat.com> (raw)
In-Reply-To: <715D42877B251141A38726ABF5CABF2C018BE64962@pdsmsx503.ccr.corp.intel.com>

Han, Weidong wrote:
> From bba614bf2acf22f765995fb2364de04cec039226 Mon Sep 17 00:00:00 2001
> From: Weidong Han <weidong.han@intel.com>
> Date: Fri, 14 Nov 2008 16:53:10 +0800
> Subject: [PATCH] support VT-d device hotplug
>
> wrap kvm_assign_device() and kvm_deassign_device() to support assign/deassign a device to a guest
>   

> --- a/include/linux/kvm.h
> +++ b/include/linux/kvm.h
> @@ -425,6 +425,8 @@ struct kvm_trace_rec {
>  				   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)
>  
>   

Need a KVM_CAP_ to indicate this is available.

>  
>  static inline void kvm_guest_enter(void)
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 4f43abe..689d615 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -293,7 +293,11 @@ static int kvm_vm_ioctl_assign_device(struct kvm *kvm,
>  	list_add(&match->list, &kvm->arch.assigned_dev_head);
>  
>  	if (assigned_dev->flags & KVM_DEV_ASSIGN_ENABLE_IOMMU) {
> -		r = kvm_iommu_map_guest(kvm, match);
> +		if (kvm->arch.intel_iommu_domain)
> +			r = kvm_assign_device(kvm, match);
> +		else
> +			r = kvm_iommu_map_guest(kvm, match);
> +
>   

Shouldn't kvm_assign_device() be called unconditionally?  Perhaps some 
code needs to be removed from kvm_iommu_map_guest().


-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2008-11-16  8:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-14  9:23 [PATCH 1/4] KVM: support VT-d device hotplug Han, Weidong
2008-11-16  8:05 ` Avi Kivity [this message]
2008-11-17  9:16   ` Han, Weidong
2008-11-17 10:28     ` Avi Kivity
2008-11-17 13:31       ` Han, Weidong
2008-11-17 14:05         ` Avi Kivity
2008-11-17 14:21           ` Han, Weidong
2008-11-17 14:48             ` Avi Kivity
2008-11-18  3:31               ` Han, Weidong
2008-11-18 12:40                 ` 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=491FD45A.9070309@redhat.com \
    --to=avi@redhat.com \
    --cc=allen.m.kay@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=sheng.yang@intel.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.