Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755533AbdIGSKS (ORCPT ); Thu, 7 Sep 2017 14:10:18 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:38869 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751639AbdIGSKR (ORCPT ); Thu, 7 Sep 2017 14:10:17 -0400 Date: Thu, 7 Sep 2017 11:10:15 -0700 From: Christoph Hellwig To: Tycho Andersen Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel-hardening@lists.openwall.com, Marco Benatto , Juerg Haefliger , Konrad Rzeszutek Wilk Subject: Re: [PATCH v6 04/11] swiotlb: Map the buffer if it was unmapped by XPFO Message-ID: <20170907181015.GA9557@infradead.org> References: <20170907173609.22696-1-tycho@docker.com> <20170907173609.22696-5-tycho@docker.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170907173609.22696-5-tycho@docker.com> User-Agent: Mutt/1.8.3 (2017-05-23) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 326 Lines: 11 > - 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 document what this check is doing.