Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp1938821imd; Fri, 2 Nov 2018 03:19:29 -0700 (PDT) X-Google-Smtp-Source: AJdET5dbSJlfC4i8pc5rUmnUGl31GfuFV/ENX+PT9L4JmXJ40Zm3zGMT+RcT4E5++CQZ6/Um4Wf9 X-Received: by 2002:a63:7c13:: with SMTP id x19mr10354399pgc.45.1541153969028; Fri, 02 Nov 2018 03:19:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541153969; cv=none; d=google.com; s=arc-20160816; b=CPUvsFSvn2vpVPdog1vVZpXjzE/IeGlO0rkrL4qWDmsY42gfj54VI4+XbawEqcJRYb zJYhkbAUYPfJeEkQ3dTTZM5CXQWzujGA9ZytV6KTXDLt0UbsICkEbYZprsqZIxd1qXRN WHiM/LVcmCEfqTXBERN82bC8OBlUVBsWlUT3L0TKB/IT18l14poGSn6s4cFWaGXOHg7p jrViHp1ltaTV7x81LFPFGq3pQuhKQ59Z+gEC0H909KZN1CTdhoxsORLiSn/Bp8wKnMPa SElLqjpIF9OqTUTtapnApPaM4SN4SK5dek5nuxhEHO/4wwXbFKZJVm65ZPYV3/YlqYeS NJWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=o8q7Pv4iJTjYC3C+tXpDynQVvKlO7ncKuU7vavic+Ic=; b=xcmwVXlFcT3kJaUGZ10U8cEfy1QM1m9NHoC4ajzr2GPvPgsgpM8QelRnAC8422NKUy +HH+fZlf40gOtwZp2HsvnK8u0M65x7O9V3w0O47DuZ7nbyxDsAbLxAMwjDCnYkltVt6Q ZDFG4mZfforAI4ryn0CrUVsNn3HsrDkbxC0jn9dtBqLlztAhd5gK+m9qlt9vnHV6lrTH Bs8X1yAe4HnkuMtjtllymv22m0F1BQNiZFjyC9YUalcPcXzIsMRF9Iu7hBjM2jvNv6or uUUJE8Yysp/lUkqju6aoeUXzYkdbCGxX9patrSzGuDeJQiTLIrS0UA58X3FhN5B6vjzf h3nA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v141-v6si21905045pfc.193.2018.11.02.03.19.11; Fri, 02 Nov 2018 03:19:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726116AbeKBTZ3 (ORCPT + 99 others); Fri, 2 Nov 2018 15:25:29 -0400 Received: from ozlabs.org ([203.11.71.1]:33231 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725990AbeKBTZ3 (ORCPT ); Fri, 2 Nov 2018 15:25:29 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 42mdMX5smPzB4VP; Fri, 2 Nov 2018 21:18:48 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au From: Michael Ellerman To: Alexey Kardashevskiy , Christoph Hellwig , Benjamin Herrenschmidt , Paul Mackerras Cc: James Bottomley , "Paul E. McKenney" , Andrew Morton , Linus Torvalds , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] powerpc/powernv: remove dead npu-dma code In-Reply-To: <2c87f9d2-3beb-6c7e-71a4-db8a905f57b1@ozlabs.ru> References: <20181030133122.GA31102@lst.de> <2c87f9d2-3beb-6c7e-71a4-db8a905f57b1@ozlabs.ru> Date: Fri, 02 Nov 2018 21:18:48 +1100 Message-ID: <877ehveq9j.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Alexey Kardashevskiy writes: > On 31/10/2018 00:31, Christoph Hellwig wrote: >> This code has never been unused in the kernel since it was merged, and >> there has been no attempt that I could find to even submit users for >> it. Besides the general policy of not keep 1000+ lines of dead >> code, it helps cleaning up the DMA code and making powerpc user common >> infrastructure. >> >> This effectively reverts commit 5d2aa710 ("powerpc/powernv: Add support >> for Nvlink NPUs"). >> >> Signed-off-by: Christoph Hellwig >> --- ... >> diff --git a/arch/powerpc/platforms/powernv/npu-dma.c b/arch/powerpc/platforms/powernv/npu-dma.c >> deleted file mode 100644 >> index 6f60e0931922..000000000000 >> --- a/arch/powerpc/platforms/powernv/npu-dma.c >> +++ /dev/null >> @@ -1,989 +0,0 @@ ... >> -int pnv_npu2_init(struct pnv_phb *phb) >> -{ >> - unsigned int i; >> - u64 mmio_atsd; >> - struct device_node *dn; >> - struct pci_dev *gpdev; >> - static int npu_index; >> - uint64_t rc = 0; >> - >> - phb->npu.nmmu_flush = >> - of_property_read_bool(phb->hose->dn, "ibm,nmmu-flush"); >> - for_each_child_of_node(phb->hose->dn, dn) { >> - gpdev = pnv_pci_get_gpu_dev(get_pci_dev(dn)); >> - if (gpdev) { >> - rc = opal_npu_map_lpar(phb->opal_id, >> - PCI_DEVID(gpdev->bus->number, gpdev->devfn), >> - 0, 0); > > I heavily hacked on these (draft): > https://patchwork.ozlabs.org/project/kvm-ppc/list/?series=70791 > > and the result is going to be used for VFIO purposes (draft too): > https://patchwork.ozlabs.org/project/kvm-ppc/list/?series=70793 > > Other bits can go away from npu-dma but I still need some to make > KVM+VFIO work for GPUs, this is without any vendor driver on the host > side whatsoever. OK, so to be clear we will need at least some of this code so that a KVM host can pass through a GPU to a guest, and that requires no binary driver on the host. I don't think anyone's arguing that we should prevent passing through devices that might need a binary driver in a guest? Christoph I think that establishes that this is not all dead code, and so I'm nacking this patch in its current form. If you have other objections to this code please raise them specifically. I'll merge Alistair's patch to remove the NPU dma_ops, because they're not really necessary and might legitimately be getting in the way of dma_ops cleanups. https://patchwork.ozlabs.org/patch/990721/ cheers