Received: by 2002:a05:6520:4211:b029:f4:110d:56bc with SMTP id o17csp1620521lkv; Wed, 19 May 2021 14:14:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjWHETaKj0XWrSGSR6l92FHQR+6YqLyVYKwUjgnHVfsbEaWGFfQL2VlZfXZonlGvpDdBpg X-Received: by 2002:a5e:c744:: with SMTP id g4mr1775432iop.26.1621458863391; Wed, 19 May 2021 14:14:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621458863; cv=none; d=google.com; s=arc-20160816; b=i4yMPfEC37eH1UPN6XfVyJUQvq5WL9W0GCA+K7djMHmAdue47L5q+eKkYIlbJE9/Cb vFFOPZH9QRlQ/SxicMIEK4MVK0gLBegidwFL+p4LV+bK35w/wh1r47eGWPRzFXSoT+WK 2aZ6us/oQEGI6Q3REAHdJnWQ5acqcGXNVBj81s3Z7M3Djrmrt8pVsZmay9Yqwfo9JvUI AB51zBpyJMz6rgh0k1Mp/4giYPnIoHvJMdAa0DFdsVNNwSaDUGIRW53Ygy72EsUag1mU 2lr4nvIXRDzClo+LQbvKktL0nhvaFqFrjwXRlYGfN+fJsmyVCBGr2jID9522nOPIys8l BzWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=AK0X9IKcvdwGbpZ1Wqb9b+L8nBaYk+GeMCJ8xJZRdgE=; b=AHShLgP7OV/l+kLwbu2qD0oI42sGLHQi0PGdiUbqgNZHKmKQdEhJi2noOnT61/G2Vk EglS2TINox6+1mbqdR5Y7nLwxr+InGEFzcF0jBOnH3v4JGWAqhMvJQfYjnK6Fzo27dwq JFRMXHDuYSXdqNVpcAqyM6J2wT/ACzMuyJIMt88UmklyGvYYPKmeDssJJO2M2qzzc9T6 8E2EpelRVET5r03ApIZnCVPDvkCTtKNIQB3mB3AXHhgMWdBhsyLi9Bs+zT0xivN5jQCg pEfCXESDPAww9xWYJcPTbNC4buBeZyKghi7rFDaz5p1eyOYj+RHxiQ5Z33XtyPAWaDHJ UpAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l11si506416jaj.50.2021.05.19.14.14.11; Wed, 19 May 2021 14:14:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242071AbhESNe5 (ORCPT + 99 others); Wed, 19 May 2021 09:34:57 -0400 Received: from verein.lst.de ([213.95.11.211]:38376 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240462AbhESNex (ORCPT ); Wed, 19 May 2021 09:34:53 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id DBED467373; Wed, 19 May 2021 15:33:30 +0200 (CEST) Date: Wed, 19 May 2021 15:33:30 +0200 From: Christoph Hellwig To: Linus Torvalds Cc: kernel test robot , Christoph Hellwig , Thomas =?iso-8859-1?Q?Hellstr=F6m?= , Serge Belyshev , Chris Wilson , Daniel Vetter , Jani Nikula , Joonas Lahtinen , Peter Zijlstra , Rodrigo Vivi , Andrew Morton , LKML , lkp@lists.01.org, kernel test robot Subject: Re: [i915] b12d691ea5: kernel_BUG_at_mm/memory.c Message-ID: <20210519133330.GA14452@lst.de> References: <20210519024322.GA29704@xsang-OptiPlex-9020> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 18, 2021 at 04:58:31PM -1000, Linus Torvalds wrote: > On Tue, May 18, 2021 at 4:26 PM kernel test robot wrote: > > > > commit: b12d691ea5e01db42ccf3b4207e57cb3ce7cfe91 ("i915: fix remap_io_sg to verify the pgprot") > > [...] > > [ 778.550996] kernel BUG at mm/memory.c:2183! > > [ 778.559015] RIP: 0010:remap_pfn_range_notrack (kbuild/src/consumer/mm/memory.c:2183 kbuild/src/consumer/mm/memory.c:2211 kbuild/src/consumer/mm/memory.c:2233 kbuild/src/consumer/mm/memory.c:2255 kbuild/src/consumer/mm/memory.c:2311) > > [ 778.688951] remap_pfn_range (kbuild/src/consumer/mm/memory.c:2342) > > [ 778.692700] remap_io_sg (kbuild/src/consumer/drivers/gpu/drm/i915/i915_mm.c:71) i915 > > Yeah, so that BUG_ON() checks that theer isn't any old mapping there. > > You can't just remap over an old one, but it does seem like that is > exactly what commit b12d691ea5e0 ("i915: fix remap_io_sg to verify the > pgprot") ends up doing. > > So the code used to just do "apply_to_page_range()", which admittedly > was odd too. But it didn't mind having old mappings and re-applying > something over them. > > Converting it to use remap_pfn_range() does look better, but it kind > of depends on it ever being done *once*. But the caller seems to very > much remap the whole vmsa at fault time, so... > > I don't know what the right thing to do here is, because I don't know > the invalidation logic and when faults happen. > > I see that there is another thread about different issues on the > intel-gfx list. Adding a few people to this kernel test robot thread > too. > > I'd be inclined to revert the commits as "not ready yet", but it would > be better if somebody can go "yeah, this should be done properly like > X". I think reverting just this commit for now is the best thing.