On Wed, Jan 11, 2017 at 11:54:36AM +0800, jiang.biao2@xxxxxxxxxx wrote: > Date: Wed, 11 Jan 2017 11:54:36 +0800 (CST) > From: jiang.biao2@xxxxxxxxxx > To: james.hogan@xxxxxxxxxx > Cc: linux-mips@xxxxxxxxxxxxxx, james.hogan@xxxxxxxxxx, pbonzini@xxxxxxxxxx, > rkrcmar@xxxxxxxxxx, ralf@xxxxxxxxxxxxxx, kvm@xxxxxxxxxxxxxxx > 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