From patchwork Mon May 6 07:21:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 241575 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id EE0F02C0605 for ; Mon, 6 May 2013 17:24:04 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753161Ab3EFHYC (ORCPT ); Mon, 6 May 2013 03:24:02 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:56656 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753269Ab3EFHWf (ORCPT ); Mon, 6 May 2013 03:22:35 -0400 Received: by mail-pa0-f50.google.com with SMTP id fb10so1900763pad.37 for ; Mon, 06 May 2013 00:22:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=HTaP683CmIUr+2wC8kPuvFKIZuiy4Gh8eytoKsKNgoU=; b=F6mz0fo5dwqxCzBe556jona+D0FKIv2AHyr9eVndQMXH5UqHON8+iu1ZEvv0cdGxxR /NV2txO48a4XuylpS/IvSZttg95+319X65vG1n5uXiQBthQQFYh06yVGHo6KExKo/l6M AOlZrbPU20wVw2Mr1puOMviL2TSlOFzplPCRYpBIp8c9Vif4FzkqwxLsvAqvdpvPkzIv GYoZE4BmtGZALb+HMM/2I3AzwEpcyxnjzb83RyOhPjsYdMuggjhUmPnteDAqvKF6AM+a ibl6689Q+PUZOt9o4+RIKpDmE0MwMatLZ5FWukTiLrP1agvOKMSf/AR3bLe+o7Wd6saV Lnrw== X-Received: by 10.68.177.33 with SMTP id cn1mr24534316pbc.189.1367824954732; Mon, 06 May 2013 00:22:34 -0700 (PDT) Received: from ka1.ozlabs.ibm.com (ibmaus65.lnk.telstra.net. [165.228.126.9]) by mx.google.com with ESMTPSA id az5sm20593976pbc.18.2013.05.06.00.22.27 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 06 May 2013 00:22:30 -0700 (PDT) From: aik@ozlabs.ru To: linuxppc-dev@lists.ozlabs.org Cc: Alexey Kardashevskiy , David Gibson , Benjamin Herrenschmidt , Alex Williamson , Paul Mackerras , Alexander Graf , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH 2/5] KVM: PPC: iommu: Add missing kvm_iommu_map_pages/kvm_iommu_unmap_pages Date: Mon, 6 May 2013 17:21:58 +1000 Message-Id: <51875a36.25ac440a.50d9.ffffe90d@mx.google.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1367824921-27151-1-git-send-email-y> References: <1367824921-27151-1-git-send-email-y> X-Gm-Message-State: ALoCoQlULtFmEGV4g9y7g+sagX3PV9uDtzgC0d4hZz+s1O7L8H0Faxm3cTFwzRn0qznpBYyFIJ5r Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org From: Alexey Kardashevskiy The IOMMU API implements groups creating/deletion, device binding and IOMMU map/unmap operations. The PowerPC implementation uses most of the API except map/unmap operations, which are implemented on POWER using hypercalls. However, in order to link a kernel with the CONFIG_IOMMU_API enabled, the empty kvm_iommu_map_pages/kvm_iommu_unmap_pages have to be defined, so this defines them. Signed-off-by: Alexey Kardashevskiy Cc: David Gibson Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/kvm_host.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h index b6a047e..c025d91 100644 --- a/arch/powerpc/include/asm/kvm_host.h +++ b/arch/powerpc/include/asm/kvm_host.h @@ -603,4 +603,18 @@ struct kvm_vcpu_arch { #define __KVM_HAVE_ARCH_WQP +#ifdef CONFIG_IOMMU_API +/* POWERPC does not use IOMMU API for mapping/unmapping */ +static inline int kvm_iommu_map_pages(struct kvm *kvm, + struct kvm_memory_slot *slot) +{ + return 0; +} + +static inline void kvm_iommu_unmap_pages(struct kvm *kvm, + struct kvm_memory_slot *slot) +{ +} +#endif /* CONFIG_IOMMU_API */ + #endif /* __POWERPC_KVM_HOST_H__ */