Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1711165pxj; Wed, 19 May 2021 12:05:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxL4d2fP5U+Q6HlI4A9j90TwG8+5ckYZ4qduAo0Na/XUNNfJ3d331OlRaZI6goLjFaq+u2F X-Received: by 2002:a02:7354:: with SMTP id a20mr615724jae.94.1621451108663; Wed, 19 May 2021 12:05:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621451108; cv=none; d=google.com; s=arc-20160816; b=sareamxM+1B+779UPc956KLh+4oHqWfB9Uc1T5KoKyn3+qs3q6mx7qBF95yn6zvJQY ntuQ5ZbL4W9mR840Lw7u4qT3vuuhAP7FNeMpF1Smb1GLQReHiLEpNK8uEV5SFfHAA5Xd GAXIMt3Dt1SqRzAt03cYBcQLnRv2CoBXp0mdr8DMinOCbkYe1R7b1CDrqb9HKF5T5Zya 0yvVJ7asZLKca8xiW8SdT2czs8KWFRwCAMEjIbwt5Ed0sCjnEfWpZo2bY1NMRkvSEmP0 J80SxaWT+fqYWhhxQ3+qI494M+MPAI7sJbUG8v8jgIaLWOtzqxGP53GhwCnWlL4f47OC h/mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=izMZCHf4ztCeuhhLAt3vYQRnDj7l1KFc/eOQyb+nJRA=; b=WIjydIIuEAx7PBl4BnP+RvOTUhrAnXKr8nWXdN3oE6XajY7UMhtbHTccshQxpfP+UE VG4tUQflZwAn92IOd9l/FofCbNvWOgekET4fMLx5Hy8bFTZ2s+3YucRuvEIz1xj37jDt +19FmCiNPjIOaBc+KRGs7l5txt8wTxHrM0+ydUKltbetzkTbmPzMC5UREzSkRtp239zP koZ3rNCLWBKavm2mhMZFll9kyJJfCnfRb1Mt78RK1zELF5ONihOIkg8cKv6aLfZ13Ndx BmVTamduBGG2TiYEB5V3JzVRHD9rGlu5nai5qz1R6dT1iHgRT3s6Tl2GpXeIKmRU/8wO ct4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=CQ+blHxr; 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 p8si92861ioh.104.2021.05.19.12.04.54; Wed, 19 May 2021 12:05:08 -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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=CQ+blHxr; 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 S1352936AbhESDAJ (ORCPT + 99 others); Tue, 18 May 2021 23:00:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237536AbhESDAJ (ORCPT ); Tue, 18 May 2021 23:00:09 -0400 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45EC7C06175F for ; Tue, 18 May 2021 19:58:50 -0700 (PDT) Received: by mail-lj1-x230.google.com with SMTP id v5so13782095ljg.12 for ; Tue, 18 May 2021 19:58:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=izMZCHf4ztCeuhhLAt3vYQRnDj7l1KFc/eOQyb+nJRA=; b=CQ+blHxrxXFFnRNKFD1XbhqMBx75Ss5aJIAgCcZlFybb61KSDs939EXAWOk/lgLQWI NP4p9qdyuFrzJn07hVf6E1CtK4WpBuamLNMzYuQ59+w7OOh6x5i4gSwuc8koUY3w4SnL dKHwxTD+lSQStJoQwzQp9NLunq0Dp4fQCp5o4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=izMZCHf4ztCeuhhLAt3vYQRnDj7l1KFc/eOQyb+nJRA=; b=T7R79dzXY61bLNiPq+1++Mi/LI57Z1NFp7e3BNfQARma3+tVzKyN3WwkX9/hkOE3BS jI7xI4gzMeWP4kLaPyH1ph3unrtu15sV0bkJ60LCSSBQZdAMtPnP7AiEJbssuRmcFOrw PKP5zWGFQEDD/M2ecf9rgygb8OKyH6mVAvermPWpGqKi+65BaqDF3a2QxytwxxIYFl6h KuhsPKEj3/8c5OnQuOx6rG30/S6Ny/WHQNMXNIHkwvZPqw9czqElYIrTSzwLkb8FLTYp s2LiH9B4Tw+LulT3aPFTluzb7U30h2AczX0VKyVllLWk0G2erDyAZ/FGqWcsDCWCjXYA zEOA== X-Gm-Message-State: AOAM532WyNXVXon8ZOaaRUx831uVBM4wZiLkyaEm2Hvaxzh+qgEnXaC+ CmMlwY8xNqwxiZrH/CH74kBM3WQ4FRwGE87BuwM= X-Received: by 2002:a2e:7207:: with SMTP id n7mr6658767ljc.352.1621393128420; Tue, 18 May 2021 19:58:48 -0700 (PDT) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com. [209.85.208.177]) by smtp.gmail.com with ESMTPSA id h4sm2443450lfv.264.2021.05.18.19.58.47 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 May 2021 19:58:47 -0700 (PDT) Received: by mail-lj1-f177.google.com with SMTP id e11so13766222ljn.13 for ; Tue, 18 May 2021 19:58:47 -0700 (PDT) X-Received: by 2002:a05:651c:1311:: with SMTP id u17mr6477220lja.48.1621393127267; Tue, 18 May 2021 19:58:47 -0700 (PDT) MIME-Version: 1.0 References: <20210519024322.GA29704@xsang-OptiPlex-9020> In-Reply-To: <20210519024322.GA29704@xsang-OptiPlex-9020> From: Linus Torvalds Date: Tue, 18 May 2021 16:58:31 -1000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [i915] b12d691ea5: kernel_BUG_at_mm/memory.c To: kernel test robot , Christoph Hellwig , =?UTF-8?Q?Thomas_Hellstr=C3=B6m?= , Serge Belyshev Cc: Chris Wilson , Daniel Vetter , Jani Nikula , Joonas Lahtinen , Peter Zijlstra , Rodrigo Vivi , Andrew Morton , LKML , lkp@lists.01.org, kernel test robot Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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". Anybody? Linus