From: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
To: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>, kvm@vger.kernel.org
Subject: Re: [PATCH v2 5/9] KVM: MMU: Optimize pte permission checks
Date: Tue, 18 Sep 2012 14:45:32 +0800 [thread overview]
Message-ID: <5058188C.70006@linux.vnet.ibm.com> (raw)
In-Reply-To: <1347797235-20732-6-git-send-email-avi@redhat.com>
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 <xiaoguangrong@linux.vnet.ibm.com>
next prev parent reply other threads:[~2012-09-18 6:45 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-16 12:07 [PATCH v2 0/9] Optimize page table walk Avi Kivity
2012-09-16 12:07 ` [PATCH v2 1/9] KVM: MMU: Push clean gpte write protection out of gpte_access() Avi Kivity
2012-09-16 12:07 ` [PATCH v2 2/9] KVM: MMU: Optimize gpte_access() slightly Avi Kivity
2012-09-16 12:07 ` [PATCH v2 3/9] KVM: MMU: Move gpte_access() out of paging_tmpl.h Avi Kivity
2012-09-16 12:07 ` [PATCH v2 4/9] KVM: MMU: Update accessed and dirty bits after guest pagetable walk Avi Kivity
2012-09-18 6:37 ` Xiao Guangrong
2012-09-16 12:07 ` [PATCH v2 5/9] KVM: MMU: Optimize pte permission checks Avi Kivity
2012-09-18 6:45 ` Xiao Guangrong [this message]
2012-09-19 16:06 ` Avi Kivity
2012-09-16 12:07 ` [PATCH v2 6/9] KVM: MMU: Simplify walk_addr_generic() loop Avi Kivity
2012-09-18 6:53 ` Xiao Guangrong
2012-09-19 16:29 ` Avi Kivity
2012-09-16 12:07 ` [PATCH v2 7/9] KVM: MMU: Optimize is_last_gpte() Avi Kivity
2012-09-18 7:36 ` Xiao Guangrong
2012-09-19 17:17 ` Avi Kivity
2012-09-19 17:18 ` Avi Kivity
2012-09-16 12:07 ` [PATCH v2 8/9] KVM: MMU: Eliminate eperm temporary Avi Kivity
2012-09-18 7:00 ` Xiao Guangrong
2012-09-16 12:07 ` [PATCH v2 9/9] KVM: MMU: Avoid access/dirty update loop if all is well Avi Kivity
2012-09-18 7:21 ` Xiao Guangrong
2012-09-19 16:12 ` Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5058188C.70006@linux.vnet.ibm.com \
--to=xiaoguangrong@linux.vnet.ibm.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.