Re: [PATCH 6/9] KVM, pkeys: add pkeys support for permission_fault logic

2015-11-10 Thread Paolo Bonzini
On 10/11/2015 10:28, Han, Huaitong wrote: > > pkru = is_long_mode(vcpu) ? read_pkru() : 0; > > if (unlikely(pkru) && (pfec & PFERR_PK_MASK)) { > > ... from above ... */ > > > > /* Flip PFERR_PK_MASK if pkru_bits is non-zero */ > > pfec ^= -pkru_bits &

Re: [PATCH 6/9] KVM, pkeys: add pkeys support for permission_fault logic

2015-11-10 Thread Han, Huaitong
On Mon, 2015-11-09 at 14:17 +0100, Paolo Bonzini wrote: > > > static inline bool permission_fault(struct kvm_vcpu *vcpu, > > > struct kvm_mmu *mmu, > > > - unsigned pte_access, > > > unsigned pfec) > > > + unsigned pte_access, unsigned pte_pkeys, > > > unsigned

Re: [PATCH 6/9] KVM, pkeys: add pkeys support for permission_fault logic

2015-11-09 Thread Paolo Bonzini
On 09/11/2015 13:43, Paolo Bonzini wrote: > > > On 09/11/2015 12:54, Huaitong Han wrote: >> Protection keys define a new 4-bit protection key field (PKEY) in bits >> 62:59 of leaf entries of the page tables, the PKEY is an index to PKRU >> register(16 domains), every domain has 2 bits(write dis

Re: [PATCH 6/9] KVM, pkeys: add pkeys support for permission_fault logic

2015-11-09 Thread Paolo Bonzini
On 09/11/2015 12:54, Huaitong Han wrote: > Protection keys define a new 4-bit protection key field (PKEY) in bits > 62:59 of leaf entries of the page tables, the PKEY is an index to PKRU > register(16 domains), every domain has 2 bits(write disable bit, access > disable bit). > > Static logic ha