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: <ZJspBy/imk1qH+s2@smile.fi.intel.com>
Date:   Tue, 27 Jun 2023 21:23:03 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Xu Yilun <yilun.xu@...el.com>
Cc:     Peter Colberg <peter.colberg@...el.com>, hao.wu@...el.com,
        gregkh@...uxfoundation.org, linux-fpga@...r.kernel.org,
        linux-kernel@...r.kernel.org, aaron.j.grier@...el.com,
        tianfei.zhang@...el.com, russell.h.weight@...el.com,
        matthew.gerlach@...ux.intel.com, marpagan@...hat.com,
        lgoncalv@...hat.com
Subject: Re: [PATCH v2] fpga: dfl: afu: use PFN_DOWN() and PFN_PHYS() helper
 macros

On Tue, Jun 27, 2023 at 02:26:27PM +0800, Xu Yilun wrote:
> On 2023-06-19 at 15:56:34 -0400, Peter Colberg wrote:

...

> > -	int npages = region->length >> PAGE_SHIFT;
> > +	int npages = PFN_DOWN(region->length);
> 
> I don't much prefer this change, it is not doing the phy addr to pfn
> convertion. The macro name doesn't match what is doing here.

This macro converts length to pages. And it's not about phy addr.

...

> > -	long npages = region->length >> PAGE_SHIFT;
> > +	long npages = PFN_DOWN(region->length);
> 
> ditto

Ditto.

...

> > -	int npages = region->length >> PAGE_SHIFT;
> > +	int npages = PFN_DOWN(region->length);
> 
> ditto

Ditto.

...

> > -	offset = vma->vm_pgoff << PAGE_SHIFT;
> > +	offset = PFN_PHYS(vma->vm_pgoff);
> 
> ditto. The variables are offsets within file, not phys addr & pfn.

Here I probably can agree.

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ