From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE72AC18E5B for ; Mon, 16 Mar 2020 12:49:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B7B5A20658 for ; Mon, 16 Mar 2020 12:49:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B7B5A20658 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 502006B0003; Mon, 16 Mar 2020 08:49:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4B23D6B0005; Mon, 16 Mar 2020 08:49:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3A0826B0007; Mon, 16 Mar 2020 08:49:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0107.hostedemail.com [216.40.44.107]) by kanga.kvack.org (Postfix) with ESMTP id 23F626B0003 for ; Mon, 16 Mar 2020 08:49:57 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id DC014181AEF1F for ; Mon, 16 Mar 2020 12:49:56 +0000 (UTC) X-FDA: 76601207592.20.wool54_90fe89926b046 X-HE-Tag: wool54_90fe89926b046 X-Filterd-Recvd-Size: 2459 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Mon, 16 Mar 2020 12:49:56 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id F22CC68CEC; Mon, 16 Mar 2020 13:49:53 +0100 (CET) Date: Mon, 16 Mar 2020 13:49:53 +0100 From: Christoph Hellwig To: Jason Gunthorpe Cc: Christoph Hellwig , Jerome Glisse , Ralph Campbell , Felix.Kuehling@amd.com, linux-mm@kvack.org, John Hubbard , dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Philip Yang Subject: Re: [PATCH hmm 8/8] mm/hmm: add missing call to hmm_pte_need_fault in HMM_PFN_SPECIAL handling Message-ID: <20200316124953.GC17386@lst.de> References: <20200311183506.3997-1-jgg@ziepe.ca> <20200311183506.3997-9-jgg@ziepe.ca> <20200316091347.GH12439@lst.de> <20200316121053.GP13183@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200316121053.GP13183@mellanox.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Mar 16, 2020 at 09:10:53AM -0300, Jason Gunthorpe wrote: > On Mon, Mar 16, 2020 at 10:13:47AM +0100, Christoph Hellwig wrote: > > On Wed, Mar 11, 2020 at 03:35:06PM -0300, Jason Gunthorpe wrote: > > > From: Jason Gunthorpe > > > > > > Currently if a special PTE is encountered hmm_range_fault() immediately > > > returns EFAULT and sets the HMM_PFN_SPECIAL error output (which nothing > > > uses). > > > > > > EFAULT should only be returned after testing with hmm_pte_need_fault(). > > > > > > Also pte_devmap() and pte_special() are exclusive, and there is no need to > > > check IS_ENABLED, pte_special() is stubbed out to return false on > > > unsupported architectures. > > > > I think the right fix is to just kill HMM_PFN_SPECIAL and treat any > > fault on special ptes that aren't the zero page as an error. > > I have another series that is doing that - this change is to make the > next series make sense and not introduce new control logic too. Ok. I had some cleanups like this based of older trees, but if you are active in this area I think I'll let you handle it. > Even when this is switched to ERROR it still needs to have the > hmm_range_fault() logic this patch introduces. True.