]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: MMU: fix permission_fault()
authorXiao Guangrong <guangrong.xiao@linux.intel.com>
Fri, 25 Mar 2016 13:19:35 +0000 (21:19 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Sun, 10 Apr 2016 19:53:49 +0000 (21:53 +0200)
commitceea0462b941cbab236944a6dff70c227f888704
tree8947affb0accc9dd791d980a3395a1dbb3e8fae5
parenta416e00a2d3540ec10c61ac260a8d7ffeeff4d3a
KVM: MMU: fix permission_fault()

kvm-unit-tests complained about the PFEC is not set properly, e.g,:
test pte.rw pte.d pte.nx pde.p pde.rw pde.pse user fetch: FAIL: error code 15
expected 5
Dump mapping: address: 0x123400000000
------L4: 3e95007
------L3: 3e96007
------L2: 2000083

It's caused by the reason that PFEC returned to guest is copied from the
PFEC triggered by shadow page table

This patch fixes it and makes the logic of updating errcode more clean

Signed-off-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
[Do not assume pfec.p=1. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu.h
arch/x86/kvm/paging_tmpl.h