Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp3080778ima; Mon, 22 Oct 2018 23:20:32 -0700 (PDT) X-Google-Smtp-Source: ACcGV61cYzqo3PIOt1+Vx2R1579TRuEVCSZ4E3R/m2tX7bWHTDXXHBjNfUb5HgLX9ubEN/P4RsO0 X-Received: by 2002:aa7:8281:: with SMTP id s1-v6mr47690294pfm.63.1540275632894; Mon, 22 Oct 2018 23:20:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540275632; cv=none; d=google.com; s=arc-20160816; b=QA6zBECgI5lLEEmZhKrtaCTGbhfiwwxEL/N0I9vpyT2GAw1PGtawPv/XaS8n7dkNZ1 vvITvJ9/Cqa8uN7IG3SQzOlNG4wD33zLAnQeDXOo0s4TFU4TtKfuQJSJ9KVIXWi6oEN2 TE6B89T2epCCGxlB+J99zfZYTJHvwuZMUjNodXGyWsymPFxXgJbCRWULpiqhxjIOjDPt B30DllHWevIhWm4UY97zzrM4sdeiUIE1tglK1EU8nApmAANvXtnK3lMzByxCA0DkuCOZ uBUBEyV7D5+KrqOrkpnpPDyqQIun1r0iHSs/lga78HGCi3hfy56mODDQGB/N2JvtrUuE f9Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=rWeBSiRUyKS+1XL2yyUkud2i8xgQzAMG93Q8wyC85LY=; b=x0o8jzrbCP6lhIAWZaQqoq4TIhsnRqEOgNo04OkzO3kTLAeeJTG0zKjwkF1Tng0oNq ahtmIQpvb8dO40qb6x/X0Mu3T4zccgqT1Yd+tshvaEsfj/ss+BJ1XALAsafezqJjMu6k KKVevphyNNeHA1caTX7mtiAvGiAN66RZF8S56VHAIrCWqmh0JIVO/rabXngtZtluqAJ2 dpXSxUgZo2XuiI54e9mRMnsEJNfuqsxVwaHste40Vij6A/wOdtFnprs1VCNLQavAKX6X FA3U/ozUbbkTR1DCb6seahxv9CoK8sseWE1LZHUndp/tFEdCh2icGEUzWY1natEGuFpa Y+qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tkvrL1pv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h10-v6si237313pgk.570.2018.10.22.23.20.17; Mon, 22 Oct 2018 23:20:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tkvrL1pv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727668AbeJWOf2 (ORCPT + 99 others); Tue, 23 Oct 2018 10:35:28 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:33473 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726764AbeJWOf2 (ORCPT ); Tue, 23 Oct 2018 10:35:28 -0400 Received: by mail-ot1-f68.google.com with SMTP id q50so230658otd.0 for ; Mon, 22 Oct 2018 23:13:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=rWeBSiRUyKS+1XL2yyUkud2i8xgQzAMG93Q8wyC85LY=; b=tkvrL1pvmYMqzggtMr2672YDmK4ClMJ5AbMUxc48Aq1KMGgBQowpuXMZVAo0+HHW7L P9pbYlWV2n1wmrrTPAtPjVg7iXqB+JXjItBP0bTiXhisVayxKBtdOYLkCx+cg8GE66WB gYDvJoZU5FTotdRNZtCeRNBqCF7l4DW/FKAfZllv9FMNuulsJPdv+/jsfIkmA2SxMeOW QTI4Jou94UiSS5EQklLoRT4D1uOQZnhZ/wmsMjXUkxBTJLf0KYcZ+CXdvMIbA6gi/rwR WITVtXqLkrhVk0L/RsIkWlrDCmUpt/yKhyITYaIvSNQGOZ49EgKD4u/aJ5N3F4glDXEx Xndw== 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; bh=rWeBSiRUyKS+1XL2yyUkud2i8xgQzAMG93Q8wyC85LY=; b=LcRYlsx2WBiSlz/GQBf4EUdrBzgsXYFx704YsBLFuMYTkrXBNsYbp8a14XnsHaJCkc b9hzv1/rrAd+K9gsJOrVQa6BfQX2Vhy9U+yjrSRvMDa7U9Z1+SsBWSoAEYOO1G6SUu5W JnriGS1OHuqIU5R3tftApPhJ4cbfx+2yyhGnNmtpdnv3Qtv8QjGl+1NLP9O4Ff6oKB0n iuXgKkoIWGbr//ak/T3yqRRGQ/87RBXqcKVpyZr6hOxHyV/lSNMU+k/Jx0VTH6XA9dcT p3hg+dzC084N5g01CRn/QfIDgSpcPLwNmLVQZ7DcgXPlFOMNeXatZc/IkiVcj6bq+z2/ 2y+g== X-Gm-Message-State: ABuFfojKRmik9AruRJCcA7ZYgtov1Xogm0PEH57he7sQU4R+Xg896Lh4 ooW4WqBxcBDZK4vvqQsqseUOJbL1n1FuBLMNAy0= X-Received: by 2002:a9d:cb0:: with SMTP id b45mr31561168otb.2.1540275212191; Mon, 22 Oct 2018 23:13:32 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Michael Tirado Date: Tue, 23 Oct 2018 01:47:20 +0000 Message-ID: Subject: Re: To: Dave Airlie , LKML , dri-devel@lists.freedesktop.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org That preprocessor define worked but I'm still confused about this DRM_FILE_PAGE_OFFSET thing. Check out drivers/gpu/drm/drm_gem.c right above drm_gem_init. --- /* * We make up offsets for buffer objects so we can recognize them at * mmap time. */ /* pgoff in mmap is an unsigned long, so we need to make sure that * the faked up offset will fit */ #if BITS_PER_LONG == 64 #define DRM_FILE_PAGE_OFFSET_START ((0xFFFFFFFFUL >> PAGE_SHIFT) + 1) #define DRM_FILE_PAGE_OFFSET_SIZE ((0xFFFFFFFFUL >> PAGE_SHIFT) * 16) #else #define DRM_FILE_PAGE_OFFSET_START ((0xFFFFFFFUL >> PAGE_SHIFT) + 1) #define DRM_FILE_PAGE_OFFSET_SIZE ((0xFFFFFFFUL >> PAGE_SHIFT) * 16) #endif --- Why is having a 64-bit file offsets critical, causing -EINVAL on mmap? What problems might be associated with using (0x10000000UL >> PAGE_SHIFT) ? On Mon, Oct 22, 2018 at 1:50 AM Dave Airlie wrote: > > On Mon, 22 Oct 2018 at 10:49, Michael Tirado wrote: > > > > On Mon, Oct 22, 2018 at 12:26 AM Dave Airlie wrote: > > > > > > This shouldn't be necessary, did someone misbackport the mmap changes without: > > > > > > drm: set FMODE_UNSIGNED_OFFSET for drm files > > > > > > Dave. > > > > The latest kernel I have had to patch was a 4.18-rc6. I'll try with a > > newer 4.19 and let you know if it decides to work. If not I'll > > prepare a test case for demonstration on qemu-system-i386. > > If you have custom userspace software, make sure it's using > AC_SYS_LARGEFILE or whatever the equivalant is in your build system. > > 64-bit file offsets are important. > > Dave.