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: 12284351 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 6CC78C4708A for ; Thu, 27 May 2021 14:14:02 +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 3AA0E613CA for ; Thu, 27 May 2021 14:14:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3AA0E613CA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A95446ECAF; Thu, 27 May 2021 14:13:53 +0000 (UTC) Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by gabe.freedesktop.org (Postfix) with ESMTPS id 37B6C6E8BC for ; Thu, 27 May 2021 14:13:47 +0000 (UTC) Received: by mail-wm1-x332.google.com with SMTP id z137-20020a1c7e8f0000b02901774f2a7dc4so5210781wmc.0 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=k9fvYzrdVwFocS3fhwdMIxWMPGCHBN9x4j2sqeIhlYowz1n4TQu+d9q75xY8hebbfj QRmwquwBZWMvmlZiOGmp2xz/JNm2ERv/T2Ex/99/6xoOCVYQnZuJA/4lVUXEK2snY40U hVEE3+gnD/50nro9ZdKFjS5tRYxnwozN6a1kNRqHwErP98l6ESTC2amNA8munSOamr7d JAEzvYEMyTvKB0stCKfuJ4Rm96iZxwElfXS5g6m5xchQbxbbvDahhQTRiFzj0lcUqJYp vpiP2l1IiKtIxyNB7OEWvUZBu06RMZhsH2sj3B46Z/bmOsbltuo1u+4SCKOK8C0t/dnf pP9Q== X-Gm-Message-State: AOAM530h61lp7cXCuw0zqHKNtDwk0cEt+mQ0hu3LR86QOSeIs+eIhh6+ ij7Y9XkmSzycddUqJOYs9y9WEnzyoRqLTQ== 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 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 Subject: [Intel-gfx] [PATCH 3/4] drm/shmem-helper: Switch to vmf_insert_pfn X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Daniel Vetter , Maxime Ripard , DRI Development , Thomas Zimmermann , Daniel Vetter Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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);