lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191023091037.GB21910@lst.de>
Date:   Wed, 23 Oct 2019 11:10:37 +0200
From:   "hch@....de" <hch@....de>
To:     Wei Hu <weh@...rosoft.com>
Cc:     "b.zolnierkie@...sung.com" <b.zolnierkie@...sung.com>,
        KY Srinivasan <kys@...rosoft.com>,
        Haiyang Zhang <haiyangz@...rosoft.com>,
        Stephen Hemminger <sthemmin@...rosoft.com>,
        "sashal@...nel.org" <sashal@...nel.org>, "hch@....de" <hch@....de>,
        "m.szyprowski@...sung.com" <m.szyprowski@...sung.com>,
        "robin.murphy@....com" <robin.murphy@....com>,
        "mchehab+samsung@...nel.org" <mchehab+samsung@...nel.org>,
        "sam@...nborg.org" <sam@...nborg.org>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "alexandre.belloni@...tlin.com" <alexandre.belloni@...tlin.com>,
        "info@...ux.net" <info@...ux.net>, "arnd@...db.de" <arnd@...db.de>,
        "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
        "linux-fbdev@...r.kernel.org" <linux-fbdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
        "iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
        "dcui@...rosoft.com" <dcui@...rosoft.com>,
        Michael Kelley <mikelley@...rosoft.com>
Subject: Re: [PATCH] video: hyperv: hyperv_fb: Use physical memory for fb
 on HyperV Gen 1 VMs.

> +	select DMA_CMA

Thіs needs to be

	select DMA_CMA if HAVE_DMA_CONTIGUOUS

> +#include <linux/dma-contiguous.h>

> +	/* Allocate from CMA */
> +	// request_pages = (request_size >> PAGE_SHIFT) + 1;
> +	request_pages = (round_up(request_size, PAGE_SIZE) >> PAGE_SHIFT);
> +	page = dma_alloc_from_contiguous(NULL, request_pages, 0, false);

dma_alloc_from_contiguous is an internal helper, you must use it
through dma_alloc_coherent and pass a struct device to that function.

> +	if (!gen2vm) {
> +		pdev = pci_get_device(PCI_VENDOR_ID_MICROSOFT,
> +			PCI_DEVICE_ID_HYPERV_VIDEO, NULL);
> +		if (!pdev) {
> +			pr_err("Unable to find PCI Hyper-V video\n");
> +			return -ENODEV;
> +		}
> +	}

Please actually implement a pci_driver instead of hacks like this.

> +			par->need_docopy = false;
> +			goto getmem1;
> +		} else {

No need for an else after a goto.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ