linux/arch
Xiao Guangrong dbd877e34a KVM: MMU: fix conflict access permissions in direct sp
commit 5fd5387c89 upstream.

In no-direct mapping, we mark sp is 'direct' when we mapping the
guest's larger page, but its access is encoded form upper page-struct
entire not include the last mapping, it will cause access conflict.

For example, have this mapping:
        [W]
      / PDE1 -> |---|
  P[W]          |   | LPA
      \ PDE2 -> |---|
        [R]

P have two children, PDE1 and PDE2, both PDE1 and PDE2 mapping the
same lage page(LPA). The P's access is WR, PDE1's access is WR,
PDE2's access is RO(just consider read-write permissions here)

When guest access PDE1, we will create a direct sp for LPA, the sp's
access is from P, is W, then we will mark the ptes is W in this sp.

Then, guest access PDE2, we will find LPA's shadow page, is the same as
PDE's, and mark the ptes is RO.

So, if guest access PDE1, the incorrect #PF is occured.

Fixed by encode the last mapping access into direct shadow page

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-22 10:47:33 -08:00
..
alpha alpha: Fix printk format errors 2010-09-26 17:21:43 -07:00
arm AT91: change dma resource index 2010-09-26 17:21:32 -07:00
avr32 untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
blackfin Blackfin: set ARCH_KMALLOC_MINALIGN 2010-07-05 11:10:50 -07:00
cris untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
frv frv: set ARCH_KMALLOC_MINALIGN 2010-07-05 11:10:49 -07:00
h8300 untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
ia64 IA64: Optimize ticket spinlocks in fsys_rt_sigprocmask 2010-09-26 17:21:29 -07:00
m32r untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
m68k m68k: set ARCH_KMALLOC_MINALIGN 2010-07-05 11:10:48 -07:00
m68knommu untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
microblaze untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
mips MIPS: Sibyte: Fix M3 TLB exception handler workaround. 2010-09-26 17:21:40 -07:00
mn10300 mn10300: set ARCH_KMALLOC_MINALIGN 2010-07-05 11:10:47 -07:00
parisc compat: Make compat_alloc_user_space() incorporate the access_ok() 2010-09-20 13:17:57 -07:00
powerpc powerpc/perf: Fix sampling enable for PPC970 2010-11-22 10:47:30 -08:00
s390 compat: Make compat_alloc_user_space() incorporate the access_ok() 2010-09-20 13:17:57 -07:00
score untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
sh sh: Fix FDPIC binary loader 2010-04-26 07:41:17 -07:00
sparc sparc64: Get rid of indirect p1275 PROM call buffer. 2010-09-26 17:21:22 -07:00
um ubd: fix incorrect sector handling during request restart 2010-10-28 21:44:00 -07:00
x86 KVM: MMU: fix conflict access permissions in direct sp 2010-11-22 10:47:33 -08:00
xtensa xtensa: set ARCH_KMALLOC_MINALIGN 2010-07-05 11:10:50 -07:00
.gitignore
Kconfig oprofile: remove tracing build dependency 2010-03-15 08:49:47 -07:00