WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] a quick question about _PAGE_GLOBAL flag in para virt mode

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] a quick question about _PAGE_GLOBAL flag in para virt mode
From: weiming <zephyr.zhao@xxxxxxxxx>
Date: Sat, 14 Feb 2009 20:40:55 -0500
Delivery-date: Sat, 14 Feb 2009 17:41:40 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=YKJEcqg8ykPsg4L9GBdgLFRFRPWjPp43uYmjNQrPDSY=; b=Cs3CKyJ6jUfsl9h2DGaCJwHFRutU5s1gHsx99uJ6WpGZcGKXFtI4kPAfg8Iom53UYg 3Mo76cX8jPK7EHdkIhFDeEepgztdM7y/Mb1+RaUp2gn1SZXGk3mlaDJrgMsjIL99YKQa W43/HJziYNkQqhgJExFj5DfApff2sr/q1df4o=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=ANJ0wxUZaVzeYBuIaoSNSNKVmOQ1wgFTo3vxLK3OIbIK+RO6VQUvb9ZLMbeFL5L/EF EjD7p5zSz6lTFkt+udJJc8ZUHLne7w9mhFxQKXUdEJ4gH7m9Kn+88y2MdFodqAPT/Kth +WtBkiC2Utv6OxesP3gi/Q7pmYCMxRY4wFsMg=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi,

I noticed that in adjust_guest_l1e()  in arch/x86/mm.c, _PAGE_GLOBAL flag is set for guest's non-kernel pages. Meanwhile, _PAGE_GUEST_KERNEL page cannot have the Global bit set.

What's the purpose of setting Global bit for guest's user pages? AFAIK, when the Global bit is set, it prevents those entries be flushed from TLB. So it makes more sense to set it for guest's kernel pages.

Below are the codes:
876 #define adjust_guest_l1e(pl1e, d)                                            \
877 do { \
878 if ( likely(l1e_get_flags((pl1e)) & _PAGE_PRESENT) && \
879 likely(!is_pv_32on64_domain(d)) ) \
880 { \
881 /* _PAGE_GUEST_KERNEL page cannot have the Global bit set. */ \
882 if ( (l1e_get_flags((pl1e)) & (_PAGE_GUEST_KERNEL|_PAGE_GLOBAL)) \
883 == (_PAGE_GUEST_KERNEL|_PAGE_GLOBAL) ) \
884 MEM_LOG("Global bit is set to kernel page %lx", \
885 l1e_get_pfn((pl1e))); \
886 if ( !(l1e_get_flags((pl1e)) & _PAGE_USER) ) \
887 l1e_add_flags((pl1e), (_PAGE_GUEST_KERNEL|_PAGE_USER)); \
888 if ( !(l1e_get_flags((pl1e)) & _PAGE_GUEST_KERNEL) ) \
889 l1e_add_flags((pl1e), (_PAGE_GLOBAL|_PAGE_USER)); \
890 } \
891 } while ( 0 )


Thanks
weiming
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel