All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arun Sharma <arun.sharma@intel.com>
To: linux-ia64@vger.kernel.org
Subject: Re: long format VHPT
Date: Thu, 20 Nov 2003 22:48:24 +0000	[thread overview]
Message-ID: <marc-linux-ia64-106936890413775@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-106516182428089@msgid-missing>

[-- Attachment #1: Type: text/plain, Size: 618 bytes --]


Here's an incremental patch that adds Huge TLB support.

	-Arun

On 10/03/2003 05:05 PM, Arun Sharma wrote:
> Darren Williams wrote:
> 
>> Hi
>> This is an updated version of the long format VHPT patch
>> posted earlier.
>> Changes:
>> Added #ifdef to allow compile without long format
>> Updated compute_vhpt_size(void) to remove compiler warnings
> 
> 
> Actually, I moved compute_vhpt_size() to arch/ia64/mm/init.c, where I 
> think it belongs and added lvhpt_adjust to let the user override 
> whatever "intellligent" algorithm we come up with. This required adding 
> parse_early_cmdline().
> 
>     -Arun
> 
> 

[-- Attachment #2: lvhpt-huge2.patch --]
[-- Type: text/plain, Size: 2823 bytes --]

Index: linux-2.6-vhpt/include/asm-ia64/asmmacro.h
===================================================================
--- linux-2.6-vhpt/include/asm-ia64/asmmacro.h	(revision 36)
+++ linux-2.6-vhpt/include/asm-ia64/asmmacro.h	(working copy)
@@ -98,18 +98,38 @@
 /*
  * Find a page table entry with the long format VHPT walker
  */
+#define eva r22			/* effective va after accounting for hugepages */
 #define temp r24
 #define rgn r25
-#define mbz r26
+#define tir r26
+#define mbz r27
+
+#ifdef CONFIG_HUGETLB_PAGE
+#define HUGETLB_GET_ITIR(tir) mov tir=cr.itir
+#define HUGETLB_GET_EVA(tir, temp, va, eva)							\
+        extr.u temp=tir,2,6			/* extract the default page size bits */	\
+        ;;											\
+        cmp.eq p6,p7=HPAGE_SHIFT,temp		/* default page size is huge page size ? */	\
+        ;;											\
+(p6)    shr eva=va,HPAGE_SHIFT-PAGE_SHIFT;							\
+(p7)    mov eva=va										\
+	;;
+#else  /* !CONFIG_HUGETLB_PAGE */
+#define HUGETLB_GET_ITIR(tir)
+#define HUGETLB_GET_EVA(tir, temp, va, eva) mov eva=va;;
+#endif /* !CONFIG_HUGETLB_PAGE */
+
 /* va=r16 ppte=r19 fail=p6 ok=p7 */
 #define FIND_PTE(va, ppte, fail, ok)								\
+	HUGETLB_GET_ITIR(tir);									\
 	rsm psr.dt;				/* switch to using physical data addressing */	\
 	mov ppte=IA64_KR(PT_BASE);		/* get the page table base address */		\
 	shl mbz=va,3;				/* shift bit 60 into sign bit	*/		\
 	shr.u rgn=va,61;			/* get the region number into 'rgn' */		\
 	;;											\
+	HUGETLB_GET_EVA(tir, temp, va, eva)							\
 	cmp.eq p6,p7=5,rgn;			/* is faulting address in region 5? */		\
-	shr.u temp=va,PGDIR_SHIFT;		/* get bits 33-63 of faulting address */	\
+	shr.u temp=eva,PGDIR_SHIFT;		/* get bits 33-63 of faulting address */	\
 	;;											\
 (p7)	dep ppte=rgn,ppte,(PAGE_SHIFT-3),3;	/* put region number bits in place */		\
 	srlz.d;											\
@@ -122,7 +142,7 @@
 (p6)	dep ppte=temp,ppte,3,(PAGE_SHIFT-3);	/* ppte=PTA + IFA(33,42)*8 */			\
 (p7)	dep ppte=temp,ppte,3,(PAGE_SHIFT-6);	/* ppte=PTA + (((IFA(61,63) << 7) | IFA(33,39))*8) */ \
 	cmp.eq ok,fail=0,mbz;			/* unused address bits all zeroes? */		\
-	shr.u temp=va,PMD_SHIFT;			/* shift L2 index into position	*/		\
+	shr.u temp=eva,PMD_SHIFT;			/* shift L2 index into position	*/		\
 	;;											\
 	ld8 ppte=[ppte];			/* fetch the L1 entry (may be 0)*/		\
 	;;											\
@@ -130,7 +150,7 @@
 	dep ppte=temp,ppte,3,(PAGE_SHIFT-3);	/* compute address of L2 page table entry*/	\
 	;;											\
 (ok)	ld8 ppte=[ppte];			/* fetch the L2 entry (may be 0)*/		\
-	shr.u temp=va,PAGE_SHIFT;		/* shift L3 index into position*/		\
+	shr.u temp=eva,PAGE_SHIFT;		/* shift L3 index into position*/		\
 	;;											\
 (ok)	cmp.eq.or.andcm fail,ok=ppte,r0;		/* was L2 entry NULL?*/				\
 	dep ppte=temp,ppte,3,(PAGE_SHIFT-3);	/* compute address of L3 page table entry*/

      parent reply	other threads:[~2003-11-20 22:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-03  6:16 long format VHPT Darren Williams
2003-10-04  0:05 ` Arun Sharma
2003-11-20 22:48 ` Arun Sharma [this message]

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=marc-linux-ia64-106936890413775@msgid-missing \
    --to=arun.sharma@intel.com \
    --cc=linux-ia64@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.