Re: [PATCH v6 04/11] swiotlb: Map the buffer if it was unmapped by XPFO

2017-09-08 Thread Christoph Hellwig
On Thu, Sep 07, 2017 at 12:44:14PM -0600, Tycho Andersen wrote: > On Thu, Sep 07, 2017 at 11:10:15AM -0700, Christoph Hellwig wrote: > > > - if (PageHighMem(pfn_to_page(pfn))) { > > > + if (PageHighMem(page) || xpfo_page_is_unmapped(page)) { > > > > Please don't sprinkle xpfo details over various

Re: [PATCH v6 04/11] swiotlb: Map the buffer if it was unmapped by XPFO

2017-09-07 Thread Tycho Andersen
On Thu, Sep 07, 2017 at 11:10:15AM -0700, Christoph Hellwig wrote: > > - if (PageHighMem(pfn_to_page(pfn))) { > > + if (PageHighMem(page) || xpfo_page_is_unmapped(page)) { > > Please don't sprinkle xpfo details over various bits of code. > > Just add a helper with a descriptive name, e.g. >

Re: [PATCH v6 04/11] swiotlb: Map the buffer if it was unmapped by XPFO

2017-09-07 Thread Christoph Hellwig
> - if (PageHighMem(pfn_to_page(pfn))) { > + if (PageHighMem(page) || xpfo_page_is_unmapped(page)) { Please don't sprinkle xpfo details over various bits of code. Just add a helper with a descriptive name, e.g. page_is_unmapped() that also includes the highmem case, as that will easily

[PATCH v6 04/11] swiotlb: Map the buffer if it was unmapped by XPFO

2017-09-07 Thread Tycho Andersen
From: Juerg Haefliger v6: * guard against lookup_xpfo() returning NULL CC: Konrad Rzeszutek Wilk Signed-off-by: Juerg Haefliger Signed-off-by: Tycho Andersen --- include/linux/xpfo.h | 4 lib/swiotlb.c| 3 ++- mm/xpfo.c| 15 +++ 3 files changed, 21 inse