Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: jiang.biao2@zte.com.cn
Cc: james.hogan@imgtec.com, linux-mips@linux-mips.org,
	pbonzini@redhat.com, rkrcmar@redhat.com, kvm@vger.kernel.org
Subject: Re: [PATCH 20/30] KVM: MIPS/MMU: Invalidate GVA PTs on ASID changes
Date: Wed, 11 Jan 2017 09:34:58 +0100	[thread overview]
Message-ID: <20170111083458.GF31072@linux-mips.org> (raw)
In-Reply-To: <201701111154365057441@zte.com.cn>

On Wed, Jan 11, 2017 at 11:54:36AM +0800, jiang.biao2@zte.com.cn wrote:
> Date:   Wed, 11 Jan 2017 11:54:36 +0800 (CST)
> From: jiang.biao2@zte.com.cn
> To: james.hogan@imgtec.com
> Cc: linux-mips@linux-mips.org, james.hogan@imgtec.com, pbonzini@redhat.com,
>  rkrcmar@redhat.com, ralf@linux-mips.org, kvm@vger.kernel.org
> Subject: Re: [PATCH 20/30] KVM: MIPS/MMU: Invalidate GVA PTs on ASID changes
> Content-Type: multipart/mixed;        boundary="=====_001_next====="
> 
> Hi,
> 
> 
> > +void kvm_mips_flush_gva_pt(pgd_t *pgd, enum kvm_mips_flush flags)
> 
> > +{
> 
> > +    if (flags & KMF_GPA) {
> 
> > +        /* all of guest virtual address space could be affected */
> > +        if (flags & KMF_KERN)
> > +            /* useg, kseg0, seg2/3 */
> > +            kvm_mips_flush_gva_pgd(pgd, 0, 0x7fffffff);
> > +        else
> > +            /* useg */
> > +            kvm_mips_flush_gva_pgd(pgd, 0, 0x3fffffff);
> > +    } else {
> > +        /* useg */
> > +        kvm_mips_flush_gva_pgd(pgd, 0, 0x3fffffff);
> > +
> > +        /* kseg2/3 */
> > +        if (flags & KMF_KERN)
> > +            kvm_mips_flush_gva_pgd(pgd, 0x60000000, 0x7fffffff);
> > +    }
> 
> > +}
> 
> 
> Is it maybe better to replace the hard code *0x7fffffff*, *0x60000000*,
> *0x3fffffff* with marco?

I think to anybody familiar with the architecture the raw numbers are
easier to understand than weird defines.

  Ralf

       reply	other threads:[~2017-01-11  8:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201701111154365057441@zte.com.cn>
2017-01-11  8:34 ` Ralf Baechle [this message]
2017-01-16 16:07 ` [PATCH 20/30] KVM: MIPS/MMU: Invalidate GVA PTs on ASID changes James Hogan
2017-01-16 16:07   ` James Hogan
2017-01-06  1:32 [PATCH 0/30] KVM: MIPS: Implement GVA page tables James Hogan
2017-01-06  1:32 ` [PATCH 20/30] KVM: MIPS/MMU: Invalidate GVA PTs on ASID changes James Hogan
2017-01-06  1:32   ` James Hogan

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=20170111083458.GF31072@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=james.hogan@imgtec.com \
    --cc=jiang.biao2@zte.com.cn \
    --cc=kvm@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox