From patchwork Mon Feb 11 05:09:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 219535 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 88DC62C035C for ; Mon, 11 Feb 2013 16:09:53 +1100 (EST) Received: from mail-da0-f53.google.com (mail-da0-f53.google.com [209.85.210.53]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id ECD852C02AD for ; Mon, 11 Feb 2013 16:09:20 +1100 (EST) Received: by mail-da0-f53.google.com with SMTP id w3so304243dad.40 for ; Sun, 10 Feb 2013 21:09:18 -0800 (PST) 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 :x-gm-message-state; bh=s934zuol1Lj8jPr0vbx6xZ+fcn5KtOgQX8ZeGBP2Rlo=; b=WMJZsn7WvutgZwBU9dZquRupuDFxNu3SfDgBBU6GE0MkoaqkLOSggg6ia8xefSNgyB cZqnCfUwK8F8xPGpECZOnLpANKTeGZittQk83w6hBX9gwkKyoQXzyNoRM8wLcFQ3alMA Om7n3fDEJEuodBtQ6WGSgDsw7rbKnF9itbxD9fabNoF5S4LFRP5ZM16053Qlwl8maLhI i0U+OTd+izGJaXfJOpAZylcuOVh0hcgatPyZpBXH3Dtt9IIJnEHLzjgrML4Th7qXFDXi jeizM9Xa/aimPnfHIGMCMXPvx+Lw9T+zbJY38jMk+9nTNsD5wrbAlFASl0icXwdrOhM3 JFIQ== X-Received: by 10.68.131.67 with SMTP id ok3mr15785211pbb.33.1360559358109; Sun, 10 Feb 2013 21:09:18 -0800 (PST) Received: from ka1.ozlabs.ibm.com (ibmaus65.lnk.telstra.net. [165.228.126.9]) by mx.google.com with ESMTPS id rk5sm6454904pbb.21.2013.02.10.21.09.14 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 10 Feb 2013 21:09:16 -0800 (PST) From: Alexey Kardashevskiy To: Benjamin Herrenschmidt Subject: [PATCH] iommu: adding missing kvm_iommu_map_pages/kvm_iommu_unmap_pages Date: Mon, 11 Feb 2013 16:09:02 +1100 Message-Id: <1360559342-21423-1-git-send-email-aik@ozlabs.ru> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQmUO9mGTVstil0/4MP2S08FKSRUCJWLJnBnG0AAX7zfj6X/f/k8pH51x0opxUU30DVqLZ+W Cc: Alexey Kardashevskiy , linux-kernel@vger.kernel.org, kvm-ppc@vger.kernel.org, Paul Mackerras , linuxppc-dev@lists.ozlabs.org, David Gibson X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 POWERPC 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 does the patch. Signed-off-by: Alexey Kardashevskiy Cc: David Gibson --- arch/powerpc/kernel/iommu.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index 31c4fdc..7c309fe 100644 --- a/arch/powerpc/kernel/iommu.c +++ b/arch/powerpc/kernel/iommu.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -860,3 +861,19 @@ void iommu_free_coherent(struct iommu_table *tbl, size_t size, free_pages((unsigned long)vaddr, get_order(size)); } } + +#ifdef CONFIG_IOMMU_API +/* + * SPAPR TCE API + */ + +/* POWERPC does not use IOMMU API for mapping/unmapping */ +int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot) +{ + return 0; +} +void kvm_iommu_unmap_pages(struct kvm *kvm, struct kvm_memory_slot *slot) +{ +} + +#endif /* CONFIG_IOMMU_API */