On 09/16/2012 08:07 PM, Avi Kivity wrote:
> @@ -3672,20 +3672,17 @@ static int vcpu_mmio_gva_to_gpa(struct kvm_vcpu
> *vcpu, unsigned long gva,
> gpa_t *gpa, struct x86_exception *exception,
> bool write)
> {
> - u32 access = (kvm_x86_ops->get_cpl(vcpu) == 3) ? PFERR_USER_MASK : 0;
> + u32 access = ((kvm_x86_ops->get_cpl(vcpu) == 3) ? PFERR_USER_MASK : 0)
> + | (write ? PFERR_WRITE_MASK : 0);
>
> - if (vcpu_match_mmio_gva(vcpu, gva) &&
> - check_write_user_access(vcpu, write, access,
> - vcpu->arch.access)) {
> + if (vcpu_match_mmio_gva(vcpu, gva)
> + && permission_fault(vcpu->arch.walk_mmu, vcpu->arch.access,
> access)) {
I think '!' was missed? Is it !permission_fault()?
Otherwise looks good to me!
Reviewed-by: Xiao Guangrong <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html