From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757861Ab1JRNgE (ORCPT ); Tue, 18 Oct 2011 09:36:04 -0400 Received: from mail-qw0-f46.google.com ([209.85.216.46]:63072 "EHLO mail-qw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755265Ab1JRNgC convert rfc822-to-8bit (ORCPT ); Tue, 18 Oct 2011 09:36:02 -0400 MIME-Version: 1.0 In-Reply-To: <20111018130843.170b71b2@lxorguk.ukuu.org.uk> References: <20110705141038.23872.55303.stgit@localhost.localdomain> <20110705144140.23872.86541.stgit@localhost.localdomain> <20110708093859.299958df@lxorguk.ukuu.org.uk> <20110711172517.46907e62@lxorguk.ukuu.org.uk> <20111017223928.4d5ed2c6@lxorguk.ukuu.org.uk> <20111018114518.5610a8c2@lxorguk.ukuu.org.uk> <20111018130843.170b71b2@lxorguk.ukuu.org.uk> Date: Tue, 18 Oct 2011 08:36:01 -0500 Message-ID: Subject: Re: [PATCH 34/49] gma500: the GEM and GTT code is device independant From: Rob Clark To: Alan Cox Cc: Hugh Dickins , Patrik Jakobsson , Andrew Morton , Christoph Hellwig , greg@kroah.com, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 18, 2011 at 7:08 AM, Alan Cox wrote: > On Tue, 18 Oct 2011 06:59:28 -0500 > Rob Clark wrote: > >> On Tue, Oct 18, 2011 at 5:45 AM, Alan Cox wrote: >> >> What troubles could you see for swap+uncached (or more likely, >> >> writecombine) pages? >> > >> > That should never occur. I would argue the driver is responsible for >> > putting the cache state of the page back sensibly before it unpins it. >> > That's a simple enough rule and one I think all the drivers follow at >> > this point. >> >> no, what I'm trying to avoid is having two virtual mappings to the >> same physical page with different cache attributes.  This is not >> allowed on some architectures (like ARM) > > Nor x86... that's a matter for the core architecture code to deal with > not the drivers. > hmm, maybe I'm missing something, but how is this ensured on x86? Default drm_gem_mmap() maps pages to userspace as writecombine.. but if page comes from kernel linear map (not highmem), that will be a cached kernel virtual mapping in addition to the wc userspace mapping. BR, -R > Alan >