From patchwork Wed Aug 28 08:49:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 270410 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 E57FD2C0292 for ; Wed, 28 Aug 2013 18:50:46 +1000 (EST) Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com [209.85.192.178]) (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 4D36F2C00B6 for ; Wed, 28 Aug 2013 18:50:12 +1000 (EST) Received: by mail-pd0-f178.google.com with SMTP id w10so6031252pde.37 for ; Wed, 28 Aug 2013 01:50:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+XOAdJanzgiywDNUOVELCfoOBSs9Fu0a85QDyEK4Drs=; b=JuNnM1Dys04RG0Zbv83BMDpdSIr0X3icUALAD2F42dVnZkTTkWnY50TtkP2ZmXt/dE 0Hhgf1zoLAK6T73ULCxuthj5x+hn0g5SWM6F39ljodd595fPlyPVSI6s1ebd4euORkvV RsvIjPu9O4sX4ytODuUxBQmghi7dBEziClbRw73jlwXylHfbRiZ8KSNSuN3quA1f4JMP ENLxwu6due+g+FY7IokL2b68X5XVVPOjrn01BcryJv6vI9164QLadW1tDqC8At8hvYoF 2+f2yGt/hsNX/svQX7Om0awyZyQB0Wg2wPuxeSZn2gVtSZlbWmgKM+PFJ6CvRsk8yhmq bHMQ== X-Gm-Message-State: ALoCoQnEGLPcPNkZvN90DrRAtY732kQwTKGxM96qKzVewzOmif4H4SDoiVCBZMs2V2J1N6jjjfou X-Received: by 10.68.110.98 with SMTP id hz2mr26287649pbb.94.1377679810805; Wed, 28 Aug 2013 01:50:10 -0700 (PDT) Received: from ka1.ozlabs.ibm.com (ibmaus65.lnk.telstra.net. [165.228.126.9]) by mx.google.com with ESMTPSA id ht5sm29868159pbb.29.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Aug 2013 01:50:09 -0700 (PDT) From: Alexey Kardashevskiy To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH v9 10/13] KVM: PPC: remove warning from kvmppc_core_destroy_vm Date: Wed, 28 Aug 2013 18:49:57 +1000 Message-Id: <1377679797-3744-1-git-send-email-aik@ozlabs.ru> X-Mailer: git-send-email 1.8.4.rc4 In-Reply-To: <1377679070-3515-1-git-send-email-aik@ozlabs.ru> References: <1377679070-3515-1-git-send-email-aik@ozlabs.ru> Cc: kvm@vger.kernel.org, Gleb Natapov , Alexey Kardashevskiy , Alexander Graf , kvm-ppc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Paul Mackerras , Paolo Bonzini , David Gibson X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.16rc2 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" Book3S KVM implements in-kernel TCE tables via kvmppc_spapr_tce_table structs list (created per KVM). Entries in the list are per LIOBN (logical bus number) and have a TCE table so DMA hypercalls (such as H_PUT_TCE) can convert LIOBN to a TCE table. The entry in the list is created via KVM_CREATE_SPAPR_TCE ioctl which returns an anonymous fd. This fd is used to map the TCE table to the user space and it also defines the lifetime of the TCE table in the kernel. Every list item also hold the link to KVM so when KVM is about to be destroyed, all kvmppc_spapr_tce_table objects are expected to be released and removed from the global list. And this is what the warning verifies. The upcoming support of VFIO IOMMU will extend kvmppc_spapr_tce_table use. Unlike emulated devices, it will create kvmppc_spapr_tce_table structs via new KVM device API which opens an anonymous fd (as KVM_CREATE_SPAPR_TCE) but the release callback does not call KVM Device's destroy callback immediately. Instead, KVM devices destruction is postponed this till KVM destruction but this happens after arch-specific KVM destroy function so the warning does a false alarm. This removes the warning as it never happens in real life and there is no any obvious place to put it. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/kvm/book3s_hv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 9e823ad..5f15ff7 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c @@ -1974,7 +1974,6 @@ void kvmppc_core_destroy_vm(struct kvm *kvm) kvmppc_rtas_tokens_free(kvm); kvmppc_free_hpt(kvm); - WARN_ON(!list_empty(&kvm->arch.spapr_tce_tables)); } /* These are stubs for now */