From: leilei175@gmail.com Subject: one question on __user_pgd Date: Tue, 19 May 2009 22:17:58 +0800 Message-ID: <82fc30000905190717w709caf7bm3a41214dc2bdf831@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org in the mm_pin routine, the function would do mm_walk(mm, PAGE_KERNEL_RO); xen_pgd_pin(__pa(mm->pgd)); /* kernel */ xen_pgd_pin(__pa(__user_pgd(mm->pgd))); /* user */ mm->context.pinned = 1; then I saw the macro __user_pgd is defined as #define __user_pgd(pgd) ((pgd) + PTRS_PER_PGD) my question is: what's the use of __user_pgd? moreover, concerning the action of "pin" the page directory table, what is the use of it? could some one shed some light on these questions? Any explanation is appreciated.