[PATCH] powerpc/powernv: remove dead npu-dma code

Michael Ellerman mpe at ellerman.id.au
Fri Nov 2 21:18:48 AEDT 2018


Alexey Kardashevskiy <aik at ozlabs.ru> 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 <hch at lst.de>
>> ---
...
>> 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


More information about the Linuxppc-dev mailing list