Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2973976rwd; Wed, 14 Jun 2023 09:31:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5g99QN6tQStwQYKQhWP8FE7AGl28d/L2Y5PpQ+RtAxZsjaYp9P4efK+14C3auxUg7XQlLy X-Received: by 2002:a17:907:c1e:b0:96f:7d09:7deb with SMTP id ga30-20020a1709070c1e00b0096f7d097debmr19662655ejc.69.1686760298163; Wed, 14 Jun 2023 09:31:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686760298; cv=none; d=google.com; s=arc-20160816; b=zjI7OWl9+LWQM2HN1txxh0T5gMLeCqZN27Wn4ov/gxfAT6mLv6su7dNH0iOHh0cNY2 l6MfhVNOXcVUy9vFM5iHytf4pZR1h7IQP90JqdR5BxSJvjhMo6CR1UrnTiqKUMbVIN1O Ug7lbt41ctIgJ4p9P1p/KAOgVSUiTitvo4MUabr+ciw1DmCqVOyXzWpIG7LN2EshlI0a 5Ks0KhzVCA/k0EZxbVBR65ZGoh8ZhOfHnnOkIfzr8/PGn4jKuqzuISqPoIanG9tuafU0 64Y+vjMOaV+B6hudOCAZwqBpJHLj+o4rOGtLQnuvQjA9kczoXWQV66PjHZ1EvyyAVH0v 5iKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=6Bp1uGLinXJFzwWWRtJqkidJLpfpEL3RXpykN4SvqWk=; b=cbsQA+K16rqagRJ0Y/vYvNpMIAH/Izhk47AGRCkUPxqF6jDVm39HdpClbf5WBHqQS4 M46eFcQzpGtDc8gARyM1+bXpUp53qB1kV5e55CIWPvdD5iXVUfMctoWFpMlIJqfBIvQC tXbP6jKbqV4qlBl/nuXALB8+Lgs9i7YjGRQT1+OElzRa/pWuWY90mS/SPR9/Ltn1nscZ ttbnOW/CHTf9ArHdMAxXTHET59QJ8I0ISHQaGytg8hnkrhhNSMX0iSc6g/AUnh+MHnw3 08QSk3R0AmicvudoY9IhUWS6LdUwSaETIq5N/RloWHdgbnNvIYpmQtSPB9odMaulXrru BMHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@shipmail.org header.s=mail header.b=QNeJaHjq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qk12-20020a170906d9cc00b0096f88e6b33fsi8335168ejb.345.2023.06.14.09.31.13; Wed, 14 Jun 2023 09:31:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@shipmail.org header.s=mail header.b=QNeJaHjq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240899AbjFNPam (ORCPT + 99 others); Wed, 14 Jun 2023 11:30:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237016AbjFNPae (ORCPT ); Wed, 14 Jun 2023 11:30:34 -0400 Received: from ste-pvt-msa1.bahnhof.se (ste-pvt-msa1.bahnhof.se [213.80.101.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55987C3 for ; Wed, 14 Jun 2023 08:30:30 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by ste-pvt-msa1.bahnhof.se (Postfix) with ESMTP id 2B49C3FF00; Wed, 14 Jun 2023 17:30:28 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bahnhof.se X-Spam-Score: -2.199 X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Authentication-Results: ste-pvt-msa1.bahnhof.se (amavisd-new); dkim=pass (1024-bit key) header.d=shipmail.org Received: from ste-pvt-msa1.bahnhof.se ([127.0.0.1]) by localhost (ste-pvt-msa1.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Oe7QbcaBXzJp; Wed, 14 Jun 2023 17:30:27 +0200 (CEST) Received: by ste-pvt-msa1.bahnhof.se (Postfix) with ESMTPA id 6D7533FECC; Wed, 14 Jun 2023 17:30:26 +0200 (CEST) Received: from [192.168.0.209] (h-155-4-205-35.A357.priv.bahnhof.se [155.4.205.35]) by mail1.shipmail.org (Postfix) with ESMTPSA id E894D3631FF; Wed, 14 Jun 2023 17:30:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=shipmail.org; s=mail; t=1686756626; bh=My99GLkGvRcJlCBxLCHL4W/UQjFF1tmEmHpgRBESrnI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=QNeJaHjqVqB4HskMw/NNX9mPCz3LWemDx6Hc9IdNNAgtZlzQ4A7fWTNVmnP/xOySI PLrCXXFLtVOR7+eRI+rMD7YULyQ4zzgSUKUdC3iBYdxBogO/lfZxtVmwIh4YtuX2IL pJl/J1CQhbmzWiugIIF4GGiWwohPosaBmKBT/QG8= Message-ID: <69d7af2f-f4c2-5a7d-ce69-c38be5660c74@shipmail.org> Date: Wed, 14 Jun 2023 17:30:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [Intel-gfx] [PATCH] drm/i915: Call page_address() on page acquired with GFP_KERNEL flag Content-Language: en-US To: Tvrtko Ursulin , Sumitra Sharma , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Deepak R Varma , Fabio , Thomas Hellstrom , Ira Weiny , Matthew Auld References: <20230614123556.GA381200@sumitra.com> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m_=28Intel=29?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/14/23 15:22, Tvrtko Ursulin wrote: > > On 14/06/2023 13:35, Sumitra Sharma wrote: >> Pages allocated with GFP_KERNEL cannot come from Highmem. >> That is why there is no need to call kmap() on them. > > Are you sure it is GFP_KERNEL backed and not tmpfs? I am not sure > myself so let me copy Matt and Thomas if they happen to know off hand. It looks to me these are shmem pages or TTM pages. Both could be highmem. So I think kmap is the correct choice here. /Thomas > > Regards, > > Tvrtko > >> Therefore, don't call kmap() on the page coming from >> vma_res->bi.pages using for_each_sgt_page() in >> i915_vma_coredump_create(). >> >> Use a plain page_address() to get the kernel address instead. >> >> Signed-off-by: Sumitra Sharma >> --- >>   drivers/gpu/drm/i915/i915_gpu_error.c | 3 +-- >>   1 file changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c >> b/drivers/gpu/drm/i915/i915_gpu_error.c >> index f020c0086fbc..6f51cb4fc55c 100644 >> --- a/drivers/gpu/drm/i915/i915_gpu_error.c >> +++ b/drivers/gpu/drm/i915/i915_gpu_error.c >> @@ -1164,9 +1164,8 @@ i915_vma_coredump_create(const struct intel_gt >> *gt, >>                 drm_clflush_pages(&page, 1); >>   -            s = kmap(page); >> +            s = page_address(page); >>               ret = compress_page(compress, s, dst, false); >> -            kunmap(page); >>                 drm_clflush_pages(&page, 1);