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: 2523121 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 03A993FE80 for ; Mon, 6 May 2013 07:24:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753329Ab3EFHWi (ORCPT ); Mon, 6 May 2013 03:22:38 -0400 Received: from mail-pb0-f50.google.com ([209.85.160.50]:56437 "EHLO mail-pb0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753327Ab3EFHWf (ORCPT ); Mon, 6 May 2013 03:22:35 -0400 Received: by mail-pb0-f50.google.com with SMTP id um15so1842193pbc.9 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=ElwxvYPf9Du0eqRT8tpcV8BKa/tqr6HRbUkmj2AcpZh5t6Yd9W3MicqtFaBOKTLMEt XQCJoD0rcixwBILaiylzDXvYw2O7eriyNx1j35N+6QO81aAKrjEfyKjbZXe0bGlnX0HK PG/i8D2QioEXZVmCXkvrQLdlK1n2yuIqDWdXyqUroGvjkZOoKVJ9dPNLoYA9MK1WccZJ 1i6YOESBzHrQH2AsjFmQkMU9pKgaop79zUDHCZtVb1DkSAJKHPa+fMxGGZHtyh1yGvL7 5xyLTnkVCbuSMuWAnW2+qB5p+v30S8zuwMdJjfuIVKK0FTvQy88acH9ezhXRdbkyZQm0 R5Xg== 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: ALoCoQnpbwbPB+5Zq1UkeriPXJpouMczggazLXHFrw8Xv50AjOZGnovzNOTcby3lfMPlTBOh30CL Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@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__ */