Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp3083244ima; Mon, 22 Oct 2018 23:23:52 -0700 (PDT) X-Google-Smtp-Source: ACcGV63fmmbC+Jaf3TZ5unV+bdOJSlYPjRyDAiAt0/b1UM2SQW93D2XZYQt6PhxdDXBHtFxI2w0N X-Received: by 2002:a62:7a81:: with SMTP id v123-v6mr49515874pfc.240.1540275831954; Mon, 22 Oct 2018 23:23:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540275831; cv=none; d=google.com; s=arc-20160816; b=OyVetC4hxEg50HjcbPd0et7Vu96Tb+3TP8dhYMgQEB7Hk7vKOFC5htFNZHqeJkZlgo m4z5Z7GSMi6sQkpqDi1zKE+VUi6RsDzp/hLvjs2kQsFWUzU4aYmgfCqKAveBopWJbcOw JSfznCD2zS/qjqOUZOCyHt5Okye32H7DDYN2WcLUrxS0ugHlcHYPnyigc2qvbmORxbW/ Fm3VUBtgJVzd4Ltuod/I/Lh1Bh6draTmsRUVkaLnVIqGvfANJPteR9OLRUy6qA/Ymu4s gJiZadPfm+CJCaJKl9lr09pe9i++WGPSctUNXsfL4xjKB2ohD3q3Ha4H/wnsC9tc4p8W FOZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Y74D9wcXF+MF7UYTa5cF/Lz2OMdtopJLGklBfwbLKjI=; b=cVwHs7SC4fGpC8WUAA3wa9yHyr7xDfU6x9PFQq8yoYuIFiP5Tn/LD+wfckWYsQ5wMq XpzwYEjdbHmNqBj4DHvna455oNBDzuKrDhxHynqV2slz/w98JjwMtMb2y2AtUrMfO3/X AFGpGmbtxwRYMRmNhPX1Lq9scfNm9GNsGcX6ghIs/hX5Cu9hpi9lhPjhC4n3hK2hUn2I 7fS6VU9Jqqkcr4obmhztLqHbKDtvNK4ehpbc7oTGSbUni97/xNOXuaOpM35Zr/h98Eyj X4ejNOLaxlAUolZnVDq+HWO4lzi95hO4tSvjthdjuKOJjs+WA6rl+TH3QjnuACJuGcTh IWtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=K0S9G8y1; 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.23.36; Mon, 22 Oct 2018 23:23:51 -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=K0S9G8y1; 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 S1727610AbeJWOpO (ORCPT + 99 others); Tue, 23 Oct 2018 10:45:14 -0400 Received: from mail-qk1-f181.google.com ([209.85.222.181]:39753 "EHLO mail-qk1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727118AbeJWOpO (ORCPT ); Tue, 23 Oct 2018 10:45:14 -0400 Received: by mail-qk1-f181.google.com with SMTP id e4so125257qkh.6 for ; Mon, 22 Oct 2018 23:23:16 -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 :cc; bh=Y74D9wcXF+MF7UYTa5cF/Lz2OMdtopJLGklBfwbLKjI=; b=K0S9G8y1eoUvmpU6qCJDDWUAL/3Rozmrxr79c3OEnIfZJk2CEvMdmKj9xI14OJTp9F YtCbSNJzW3/2OUCMrqumYAeQ7Ei2nL6qJ0yr5KMvPfwL80PSXAVoDN5GfILJr+YRB6xq TJA41USfcVYSRgr/ryEIqUqKgDk1qyjvZjTJ30yeu6uJ8EDxKaFpVMZoeCzzDKZyFVjy mjOoEsYG9bvk/BKnz/JNTMoWQFAmsXuKHgy1BkxEKZgeGA20mo0u/6ne5qybUoMSLiD4 FkbLaE+lqbZlt0LVHzf68OAhS380t46DEVAYsdEpHDORqcpBftx1WxjXnYi53h4twwQq yr8w== 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=Y74D9wcXF+MF7UYTa5cF/Lz2OMdtopJLGklBfwbLKjI=; b=BMD6xFkvnfSUEjM3pril6Hl+KY5tIR6QDohDF9rxF7RL+fy/Spa7c0TkDRUa2Ouu3y miSmAZhYgz2g6wIkRcsaRPfzYFnJPhYS3fT3rd37RleqsCIH5Aly9LGw6GBnuYwBls+L vmJHTQ42W+Mae9bNn747P1yInnt7lpgYvUKK4Uz7YxDfpImvaE0VmjbuLSVetirfz71x Lh+qKanKla2jLPLOHYRPHa7NyYstqI6ljGIHn8uzaHRStPgCkSxa57N2PlDKJCLKSK9G fwxWBFHvaKXOhjLIL0n3TWZ7tEaG+JMqOpE1uE4jsDh64Qtc3Xb+TyJiXYhSQA5M9a2e Phrw== X-Gm-Message-State: ABuFfojaOoYeX36B5oK2P2oCEvOiXFpiEvUJVbv0aFYXmVjiVbA2JM3V OlPikAUAlfL743EpiXUVMh7gkThnaJwYJ+l1ZGT7cg== X-Received: by 2002:a37:3094:: with SMTP id w142-v6mr25906665qkw.131.1540275796490; Mon, 22 Oct 2018 23:23:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dave Airlie Date: Tue, 23 Oct 2018 16:23:03 +1000 Message-ID: Subject: Re: To: mtirado418@gmail.com Cc: LKML , dri-devel 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 On Tue, 23 Oct 2018 at 16:13, Michael Tirado wrote: > > 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) ? a) it finds people not using the correct userspace defines. mostly libdrm should handle this, and possibly mesa. b) there used to be legacy maps below that address on older drivers, so we decided to never put stuff in the first 32-bit range that they could clash with. Dave.