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: 219534 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 F12DD2C030F for ; Mon, 11 Feb 2013 16:09:36 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750721Ab3BKFJT (ORCPT ); Mon, 11 Feb 2013 00:09:19 -0500 Received: from mail-pa0-f53.google.com ([209.85.220.53]:37954 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750708Ab3BKFJS (ORCPT ); Mon, 11 Feb 2013 00:09:18 -0500 Received: by mail-pa0-f53.google.com with SMTP id bg4so2879728pad.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=BFZegD/3gr3yMuLjQqE4Lb7lJArI/kMK20ifVA7z3+io64KlThOeiiZzrZVGEIOScA JnPO+nxahmv75JKNkPoxUAq760fW22zuWSjA7ALSw7GH9mbIuHz4di5DPCmpw9YpqU73 WssiN0t6b/E7h1aF8OYUA4/0mM8bRWGCOGf1QLMLsN6hHdqiaVyAbKfwqIxUUDbyGQwV o/FcbqhGt6lVBt1bGuNX0r6xSTtuzQGkeWMS2V+2Qih34tLD5hCpi0yWOr3JXWPYwQE5 VXn/nfaI+jn4fcscz/STg6KfDG+Ffj2lbz+3fckflqpXVfHBv2eIy8VXhVblmGbE7+KY UccQ== 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 Cc: Alexey Kardashevskiy , Paul Mackerras , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, David Gibson , kvm-ppc@vger.kernel.org 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: ALoCoQlN2EEd5Y41LXKz1bvEnxFFpEm5csDCD0PqWQHDVmldrqGzrFmpAGaYiXKSRj/S7sq3UjKv Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org 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 */