public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: airlied@linux.ie, dri-devel@lists.sourceforge.net,
	JBeulich@novell.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm: make sure page protections are updated after changing vm_flags.
Date: Tue, 06 Oct 2009 14:31:17 -0700	[thread overview]
Message-ID: <4ACBB725.4010605@goop.org> (raw)
In-Reply-To: <20091006133937.246a4f33.akpm@linux-foundation.org>

On 10/06/09 13:39, Andrew Morton wrote:
> On Wed, 30 Sep 2009 15:55:39 -0700
> Jeremy Fitzhardinge <jeremy@goop.org> wrote:
>
>   
>> Some architectures compute ->vm_page_prot depending on ->vm_flags, so
>> we need to update the protections after adjusting the flags.
>>
>> Reported-by: Jan Beulich <JBeulich@novell.com>
>> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
>>
>> diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
>> index 8104eca..9d3e39f 100644
>> --- a/drivers/gpu/drm/drm_gem.c
>> +++ b/drivers/gpu/drm/drm_gem.c
>> @@ -537,7 +537,7 @@ int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma)
>>  	vma->vm_ops = obj->dev->driver->gem_vm_ops;
>>  	vma->vm_private_data = map->handle;
>>  	/* FIXME: use pgprot_writecombine when available */
>> -	vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
>> +	vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags));
>>  
>>  	/* Take a ref for this mapping of the object, so that the fault
>>  	 * handler can dereference the mmap offset's pointer to the object.
>>     
> u fail changelogology.
>
> What were the consequences of the bug which you just fixed?
>   

AFAIK this only affects running X under Xen; without this patch you get
lots of coloured blobs on the screen, or maybe a complete lockup.  Or
anything really.

But that still depends on lots of out-of-tree stuff, so I don't think
there are any consequences for anyone else.  But it is wrong in principle.

    J

      reply	other threads:[~2009-10-06 21:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-30 22:55 [PATCH] drm: make sure page protections are updated after changing vm_flags Jeremy Fitzhardinge
2009-10-06 20:39 ` Andrew Morton
2009-10-06 21:31   ` Jeremy Fitzhardinge [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ACBB725.4010605@goop.org \
    --to=jeremy@goop.org \
    --cc=JBeulich@novell.com \
    --cc=airlied@linux.ie \
    --cc=akpm@linux-foundation.org \
    --cc=dri-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox