x86, PAT, PCI: Change vma prot in pci_mmap to reflect inherited prot
x86, PAT, PCI: Change vma prot in pci_mmap to reflect inherited prot

While looking at the issue in the thread:

  http://marc.info/?l=dri-devel&m=123606627824556&w=2

noticed a bug in pci PAT code and memory type setting.

PCI mmap code did not set the proper protection in vma, when it
inherited protection in reserve_memtype. This bug only affects
the case where there exists a WC mapping before X does an mmap
with /proc or /sys pci interface. This will cause X userlevel
mmap from /proc or /sysfs to fail on fork.

Reported-by: Kevin Winchester <55feed738d752f259cc1178e9f949e781be89885@gmail.com>
Signed-off-by: Venkatesh Pallipadi <6b7ddbe82beec4500037cfc9bc14de0a76fca340@intel.com>
Signed-off-by: Suresh Siddha <a42fd12510d3895be740fb89f87586733ee62f57@intel.com>
Cc: Jesse Barnes <bc7add126c2dbb8382bf1c28ac262b9363a32706@virtuousgeek.org>
Cc: Dave Airlie <f2295d84e358395675bc8031be58672073ae065e@redhat.com>
Cc: <4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@kernel.org>
LKML-Reference: <baf2d1856df6faf20bdaeac7dd319e0eaf68e4b1@linux-os.sc.intel.com>
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>

KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs