From patchwork Thu May 27 14:13:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 12284339 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=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 F2CF1C47089 for ; Thu, 27 May 2021 14:14:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BF549613CA for ; Thu, 27 May 2021 14:14:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF549613CA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 824246E970; Thu, 27 May 2021 14:13:51 +0000 (UTC) Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 46DE26E8CE for ; Thu, 27 May 2021 14:13:47 +0000 (UTC) Received: by mail-wm1-x32f.google.com with SMTP id y184-20020a1ce1c10000b02901769b409001so566502wmg.3 for ; Thu, 27 May 2021 07:13:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ta+1QGRj8qkvW03oDuYFdeLGx74AAZepqtGEBPaAeu4=; b=UjgqXOaXPTTQXUGt2iIa74wJo+KnY5lzqMYC5vcVxLQODTyY+9c1PF+T6RqT3zTQ+A E9nLxY7twIo2LQWn3NfSqVZYAoScsGHAmyRtnM1qmPwmKxh0kKGer8bWfM+7xFpl88lG IJeCFyEfeVKtawMgTeqKkdxy/HRVTdMf3lkVU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ta+1QGRj8qkvW03oDuYFdeLGx74AAZepqtGEBPaAeu4=; b=FJ+vx4UWcl7hV1LUBuFgOoATpxLiecB622kk24J/EbxH4uQxTHL2HrE/70QUzjR2/1 vATDdkPFsR4LJVYdYWDY+xNvmcUhEq833MU3TjKLPhcStrGnpV+SKjwfEUyEWfJx68B1 i/KGeuP57I3mh4Y8Gw5v2et1H2q0B2+YAg1b9Kgmd6UKAa/3boQPoS+mk2lVbOoJ5ipY HJ/eli/Z/apiLKEPRCyw7Fz/NsaVY34ygfW2+vJWSmzyC82oGZkVM3pJTu9d8pk9BK7e Ogfnk8fxFaUFIDK6grYd02i95pc3BuWcQc8UwHsLK8qgjlwGhQBjDxE3rtSefLigT1sK alww== X-Gm-Message-State: AOAM531kruxy3f3HrnipuzwVp6FQveziYpYcKOQUKbM6lRMrdpO5Nz1M DRouJ5cZtDPJM8tJSe3Y16IWXw== X-Google-Smtp-Source: ABdhPJz4/ptsWZrOaLs3P+RA+DUiiv3OiIo7JsBVgU/moAVAMl5UiS1z/qa22fJSaFue+dDWwH5ouw== X-Received: by 2002:a1c:e243:: with SMTP id z64mr3681766wmg.25.1622124825935; Thu, 27 May 2021 07:13:45 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id x10sm3381136wrt.65.2021.05.27.07.13.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 May 2021 07:13:45 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Subject: [PATCH 3/4] drm/shmem-helper: Switch to vmf_insert_pfn Date: Thu, 27 May 2021 16:13:36 +0200 Message-Id: <20210527141337.3857901-4-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210527141337.3857901-1-daniel.vetter@ffwll.ch> References: <20210527141337.3857901-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Daniel Vetter , DRI Development , Thomas Zimmermann , Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" We want to stop gup, which isn't the case if we use vmf_insert_page and VM_MIXEDMAP, because that does not set pte_special. Signed-off-by: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Reported-by: kernel test robot --- drivers/gpu/drm/drm_gem_shmem_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index 6d625cee7a6a..11edd54f0580 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -542,7 +542,7 @@ static vm_fault_t drm_gem_shmem_fault(struct vm_fault *vmf) } else { page = shmem->pages[page_offset]; - ret = vmf_insert_page(vma, vmf->address, page); + ret = vmf_insert_pfn(vma, vmf->address, page_to_pfn(page)); } mutex_unlock(&shmem->pages_lock); @@ -612,7 +612,7 @@ int drm_gem_shmem_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma) return ret; } - vma->vm_flags |= VM_MIXEDMAP | VM_DONTEXPAND; + vma->vm_flags |= VM_PFNMAP | VM_DONTEXPAND; vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); if (shmem->map_wc) vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);