From patchwork Wed May 26 03:37:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zachary Amsden X-Patchwork-Id: 102332 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4Q3bFHr020678 for ; Wed, 26 May 2010 03:37:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759202Ab0EZDhM (ORCPT ); Tue, 25 May 2010 23:37:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36980 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759184Ab0EZDhL (ORCPT ); Tue, 25 May 2010 23:37:11 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4Q3bBg0002969 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 25 May 2010 23:37:11 -0400 Received: from [10.11.10.106] (vpn-10-106.rdu.redhat.com [10.11.10.106]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4Q3b9n0024485; Tue, 25 May 2010 23:37:10 -0400 Message-ID: <4BFC9765.6070200@redhat.com> Date: Tue, 25 May 2010 17:37:09 -1000 From: Zachary Amsden User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Thunderbird/3.0.4 MIME-Version: 1.0 To: kvm , Jan Kiszka , Avi Kivity , Gleb Natapov Subject: Re: [PATCH 4/4] Hack around IOMMU changes References: <4BFC974D.8010206@redhat.com> In-Reply-To: <4BFC974D.8010206@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 26 May 2010 03:37:15 +0000 (UTC) diff --git a/external-module-compat-comm.h b/external-module-compat-comm.h index c5284e5..708019e 100644 --- a/external-module-compat-comm.h +++ b/external-module-compat-comm.h @@ -1128,3 +1128,15 @@ perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *cbs) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) #define lockdep_is_held(m) (1) #endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34) +/* This is a dirty, nasty trick */ +#define iommu_map(domain, iova, paddr, gfp_order, prot) \ +({ \ + int _r = iommu_map_range(domain, iova, paddr, PAGE_SIZE, prot); \ + page_size = PAGE_SIZE; \ + _r; \ +}) +#define iommu_unmap(domain, iova, gfp_order) \ + (iommu_unmap_range(domain, iova, PAGE_SIZE),1) +#endif