From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: [PATCH 0/2] kvm: iommu cleanup Date: Thu, 29 Mar 2012 14:10:31 -0600 Message-ID: <20120329200701.16338.19994.stgit@bling.home> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: alex.williamson@redhat.com, avi@redhat.com, jan.kiszka@siemens.com To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:9700 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754311Ab2C2UKg (ORCPT ); Thu, 29 Mar 2012 16:10:36 -0400 Sender: kvm-owner@vger.kernel.org List-ID: When using device assignment, new page mappings are added to the iommu, but never removed. Fix it. We're also lazy about tearing down the iommu and unpinning the guest when we have no assigned devices attached. Instead of waiting for the vm to be destroyed, do these cleanups when we deassign the last assigned device. Thanks, Alex --- Alex Williamson (2): kvm: unpin guest and free iommu domain after deassign last device kvm: unmap pages from the iommu when slots are removed include/linux/kvm_host.h | 6 ++++++ virt/kvm/assigned-dev.c | 3 +++ virt/kvm/iommu.c | 8 +++++++- virt/kvm/kvm_main.c | 5 +++-- 4 files changed, 19 insertions(+), 3 deletions(-)