Re: [kvm-unit-tests PATCH v6 09/11] x86: Cleanup PT_*_MASK flags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 04, 2016 at 02:19:50PM +0200, Andrew Jones wrote:
> On Wed, May 04, 2016 at 12:31:34PM +0200, Alexander Gordeev wrote:
> > Cc: Andrew Jones <drjones@xxxxxxxxxx>
> > Cc: Thomas Huth <thuth@xxxxxxxxxx>
> > Cc: Radim Krčmář <rkrcmar@xxxxxxxxxx>
> > Signed-off-by: Alexander Gordeev <agordeev@xxxxxxxxxx>
> > ---
> >  lib/x86/asm/page.h | 13 ++++++++-----
> >  lib/x86/vm.c       | 20 ++++++++++----------
> >  x86/access.c       |  8 --------
> >  x86/asyncpf.c      |  2 +-
> >  x86/eventinj.c     | 10 +++++-----
> >  x86/hypercall.c    |  2 +-
> >  x86/pku.c          |  2 +-
> >  x86/rmap_chain.c   |  2 +-
> >  x86/smap.c         |  6 +++---
> >  9 files changed, 30 insertions(+), 35 deletions(-)
> > 
> > diff --git a/lib/x86/asm/page.h b/lib/x86/asm/page.h
> > index 916462d..8a30212 100644
> > --- a/lib/x86/asm/page.h
> > +++ b/lib/x86/asm/page.h
> > @@ -21,11 +21,14 @@
> >  #define LARGE_PAGE_SIZE	(1024 * PAGE_SIZE)
> >  #endif
> >  
> > -#define PTE_PRESENT	(1ull << 0)
> > -#define PTE_WRITE	(1ull << 1)
> > -#define PTE_USER	(1ull << 2)
> > -#define PTE_PSE		(1ull << 7)
> > -#define PTE_ADDR	(0xffffffffff000ull)
> > +#define PT_PRESENT_MASK		(1ull << 0)
> > +#define PT_WRITABLE_MASK	(1ull << 1)
> > +#define PT_USER_MASK		(1ull << 2)
> > +#define PT_ACCESSED_MASK	(1ull << 5)
> > +#define PT_DIRTY_MASK		(1ull << 6)
> 
> To be 100% consistent with arch/x86/kvm/mmu.h, I'd change
> 
> > +#define PT_PSE_MASK		(1ull << 7)
> 
> to PT_PAT_MASK and

Hmm.. PT_PAT_MASK and PT_PAT_SHIFT seems superseded by
PT_PAGE_SIZE_MASK and PT_PAGE_SIZE_SHIFT and actually
redundant.

> > +#define PT_NX_MASK		(1ull << 63)
> 
> to PT64_NX_MASK
> 
> > +#define PT_ADDR_MASK		(0xffffffffff000ull)
> 
> And, this one (PT_ADDR_MASK) should just be deleted, as it's
> not used. Or, if somebody objects to deleting it, then it
> should be defined as GENMASK_ULL(52, 12) for better clarity.
> 
> These are just nits though, so
> 
> Reviewed-by: Andrew Jones <drjones@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux