···8080# CONFIG_IA64_PAGE_SIZE_8KB is not set8181CONFIG_IA64_PAGE_SIZE_16KB=y8282# CONFIG_IA64_PAGE_SIZE_64KB is not set8383+# CONFIG_PGTABLE_3 is not set8484+CONFIG_PGTABLE_4=y8385# CONFIG_HZ_100 is not set8486CONFIG_HZ_250=y8587# CONFIG_HZ_1000 is not set
+2
arch/ia64/defconfig
···8282# CONFIG_IA64_PAGE_SIZE_8KB is not set8383CONFIG_IA64_PAGE_SIZE_16KB=y8484# CONFIG_IA64_PAGE_SIZE_64KB is not set8585+CONFIG_PGTABLE_3=y8686+# CONFIG_PGTABLE_4 is not set8587# CONFIG_HZ_100 is not set8688CONFIG_HZ_250=y8789# CONFIG_HZ_1000 is not set
+48-15
arch/ia64/kernel/ivt.S
···114114 shl r21=r16,3 // shift bit 60 into sign bit115115 shr.u r17=r16,61 // get the region number into r17116116 ;;117117- shr r22=r21,3117117+ shr.u r22=r21,3118118#ifdef CONFIG_HUGETLB_PAGE119119 extr.u r26=r25,2,6120120 ;;···140140(p6) dep r17=r18,r19,3,(PAGE_SHIFT-3) // r17=PTA + IFA(33,42)*8141141(p7) dep r17=r18,r17,3,(PAGE_SHIFT-6) // r17=PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)142142 cmp.eq p7,p6=0,r21 // unused address bits all zeroes?143143- shr.u r18=r22,PMD_SHIFT // shift L2 index into position143143+#ifdef CONFIG_PGTABLE_4144144+ shr.u r28=r22,PUD_SHIFT // shift L2 index into position145145+#else146146+ shr.u r18=r22,PMD_SHIFT // shift L3 index into position147147+#endif144148 ;;145149 ld8 r17=[r17] // fetch the L1 entry (may be 0)146150 ;;147151(p7) cmp.eq p6,p7=r17,r0 // was L1 entry NULL?148148- dep r17=r18,r17,3,(PAGE_SHIFT-3) // compute address of L2 page table entry152152+#ifdef CONFIG_PGTABLE_4153153+ dep r28=r28,r17,3,(PAGE_SHIFT-3) // compute address of L2 page table entry149154 ;;150150-(p7) ld8 r20=[r17] // fetch the L2 entry (may be 0)151151- shr.u r19=r22,PAGE_SHIFT // shift L3 index into position155155+ shr.u r18=r22,PMD_SHIFT // shift L3 index into position156156+(p7) ld8 r29=[r28] // fetch the L2 entry (may be 0)152157 ;;153153-(p7) cmp.eq.or.andcm p6,p7=r20,r0 // was L2 entry NULL?154154- dep r21=r19,r20,3,(PAGE_SHIFT-3) // compute address of L3 page table entry158158+(p7) cmp.eq.or.andcm p6,p7=r29,r0 // was L2 entry NULL?159159+ dep r17=r18,r29,3,(PAGE_SHIFT-3) // compute address of L3 page table entry160160+#else161161+ dep r17=r18,r17,3,(PAGE_SHIFT-3) // compute address of L3 page table entry162162+#endif155163 ;;156156-(p7) ld8 r18=[r21] // read the L3 PTE164164+(p7) ld8 r20=[r17] // fetch the L3 entry (may be 0)165165+ shr.u r19=r22,PAGE_SHIFT // shift L4 index into position166166+ ;;167167+(p7) cmp.eq.or.andcm p6,p7=r20,r0 // was L3 entry NULL?168168+ dep r21=r19,r20,3,(PAGE_SHIFT-3) // compute address of L4 page table entry169169+ ;;170170+(p7) ld8 r18=[r21] // read the L4 PTE157171 mov r19=cr.isr // cr.isr bit 0 tells us if this is an insn miss158172 ;;159173(p7) tbit.z p6,p7=r18,_PAGE_P_BIT // page present bit cleared?···206192 * between reading the pagetable and the "itc". If so, flush the entry we207193 * inserted and retry.208194 */209209- ld8 r25=[r21] // read L3 PTE again210210- ld8 r26=[r17] // read L2 entry again195195+ ld8 r25=[r21] // read L4 entry again196196+ ld8 r26=[r17] // read L3 PTE again197197+#ifdef CONFIG_PGTABLE_4198198+ ld8 r18=[r28] // read L2 entry again199199+#endif200200+ cmp.ne p6,p7=r0,r0211201 ;;212212- cmp.ne p6,p7=r26,r20 // did L2 entry change202202+ cmp.ne.or.andcm p6,p7=r26,r20 // did L3 entry change203203+#ifdef CONFIG_PGTABLE_4204204+ cmp.ne.or.andcm p6,p7=r29,r18 // did L4 PTE change205205+#endif213206 mov r27=PAGE_SHIFT<<2214207 ;;215208(p6) ptc.l r22,r27 // purge PTE page translation216216-(p7) cmp.ne.or.andcm p6,p7=r25,r18 // did L3 PTE change209209+(p7) cmp.ne.or.andcm p6,p7=r25,r18 // did L4 PTE change217210 ;;218211(p6) ptc.l r16,r27 // purge translation219212#endif···453432(p6) dep r17=r18,r19,3,(PAGE_SHIFT-3) // r17=PTA + IFA(33,42)*8454433(p7) dep r17=r18,r17,3,(PAGE_SHIFT-6) // r17=PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)455434 cmp.eq p7,p6=0,r21 // unused address bits all zeroes?456456- shr.u r18=r22,PMD_SHIFT // shift L2 index into position435435+#ifdef CONFIG_PGTABLE_4436436+ shr.u r18=r22,PUD_SHIFT // shift L2 index into position437437+#else438438+ shr.u r18=r22,PMD_SHIFT // shift L3 index into position439439+#endif457440 ;;458441 ld8 r17=[r17] // fetch the L1 entry (may be 0)459442 ;;460443(p7) cmp.eq p6,p7=r17,r0 // was L1 entry NULL?461444 dep r17=r18,r17,3,(PAGE_SHIFT-3) // compute address of L2 page table entry462445 ;;446446+#ifdef CONFIG_PGTABLE_4463447(p7) ld8 r17=[r17] // fetch the L2 entry (may be 0)464464- shr.u r19=r22,PAGE_SHIFT // shift L3 index into position448448+ shr.u r18=r22,PMD_SHIFT // shift L3 index into position465449 ;;466450(p7) cmp.eq.or.andcm p6,p7=r17,r0 // was L2 entry NULL?467467- dep r17=r19,r17,3,(PAGE_SHIFT-3) // compute address of L3 page table entry451451+ dep r17=r18,r17,3,(PAGE_SHIFT-3) // compute address of L2 page table entry452452+ ;;453453+#endif454454+(p7) ld8 r17=[r17] // fetch the L3 entry (may be 0)455455+ shr.u r19=r22,PAGE_SHIFT // shift L4 index into position456456+ ;;457457+(p7) cmp.eq.or.andcm p6,p7=r17,r0 // was L3 entry NULL?458458+ dep r17=r19,r17,3,(PAGE_SHIFT-3) // compute address of L4 page table entry468459(p6) br.cond.spnt page_fault469460 mov b0=r30470461 br.sptk.many b0 // return to continuation point
+153-4
arch/ia64/sn/kernel/setup.c
···3030#include <linux/root_dev.h>3131#include <linux/nodemask.h>3232#include <linux/pm.h>3333+#include <linux/efi.h>33343435#include <asm/io.h>3536#include <asm/sal.h>···243242 }244243}245244245245+/*246246+ * Scan the EFI PCDP table (if it exists) for an acceptable VGA console247247+ * output device. If one exists, pick it and set sn_legacy_{io,mem} to248248+ * reflect the bus offsets needed to address it.249249+ *250250+ * Since pcdp support in SN is not supported in the 2.4 kernel (or at least251251+ * the one lbs is based on) just declare the needed structs here.252252+ *253253+ * Reference spec http://www.dig64.org/specifications/DIG64_PCDPv20.pdf254254+ *255255+ * Returns 0 if no acceptable vga is found, !0 otherwise.256256+ *257257+ * Note: This stuff is duped here because Altix requires the PCDP to258258+ * locate a usable VGA device due to lack of proper ACPI support. Structures259259+ * could be used from drivers/firmware/pcdp.h, but it was decided that moving260260+ * this file to a more public location just for Altix use was undesireable.261261+ */262262+263263+struct hcdp_uart_desc {264264+ u8 pad[45];265265+};266266+267267+struct pcdp {268268+ u8 signature[4]; /* should be 'HCDP' */269269+ u32 length;270270+ u8 rev; /* should be >=3 for pcdp, <3 for hcdp */271271+ u8 sum;272272+ u8 oem_id[6];273273+ u64 oem_tableid;274274+ u32 oem_rev;275275+ u32 creator_id;276276+ u32 creator_rev;277277+ u32 num_type0;278278+ struct hcdp_uart_desc uart[0]; /* num_type0 of these */279279+ /* pcdp descriptors follow */280280+} __attribute__((packed));281281+282282+struct pcdp_device_desc {283283+ u8 type;284284+ u8 primary;285285+ u16 length;286286+ u16 index;287287+ /* interconnect specific structure follows */288288+ /* device specific structure follows that */289289+} __attribute__((packed));290290+291291+struct pcdp_interface_pci {292292+ u8 type; /* 1 == pci */293293+ u8 reserved;294294+ u16 length;295295+ u8 segment;296296+ u8 bus;297297+ u8 dev;298298+ u8 fun;299299+ u16 devid;300300+ u16 vendid;301301+ u32 acpi_interrupt;302302+ u64 mmio_tra;303303+ u64 ioport_tra;304304+ u8 flags;305305+ u8 translation;306306+} __attribute__((packed));307307+308308+struct pcdp_vga_device {309309+ u8 num_eas_desc;310310+ /* ACPI Extended Address Space Desc follows */311311+} __attribute__((packed));312312+313313+/* from pcdp_device_desc.primary */314314+#define PCDP_PRIMARY_CONSOLE 0x01315315+316316+/* from pcdp_device_desc.type */317317+#define PCDP_CONSOLE_INOUT 0x0318318+#define PCDP_CONSOLE_DEBUG 0x1319319+#define PCDP_CONSOLE_OUT 0x2320320+#define PCDP_CONSOLE_IN 0x3321321+#define PCDP_CONSOLE_TYPE_VGA 0x8322322+323323+#define PCDP_CONSOLE_VGA (PCDP_CONSOLE_TYPE_VGA | PCDP_CONSOLE_OUT)324324+325325+/* from pcdp_interface_pci.type */326326+#define PCDP_IF_PCI 1327327+328328+/* from pcdp_interface_pci.translation */329329+#define PCDP_PCI_TRANS_IOPORT 0x02330330+#define PCDP_PCI_TRANS_MMIO 0x01331331+332332+static void333333+sn_scan_pcdp(void)334334+{335335+ u8 *bp;336336+ struct pcdp *pcdp;337337+ struct pcdp_device_desc device;338338+ struct pcdp_interface_pci if_pci;339339+ extern struct efi efi;340340+341341+ pcdp = efi.hcdp;342342+ if (! pcdp)343343+ return; /* no hcdp/pcdp table */344344+345345+ if (pcdp->rev < 3)346346+ return; /* only support PCDP (rev >= 3) */347347+348348+ for (bp = (u8 *)&pcdp->uart[pcdp->num_type0];349349+ bp < (u8 *)pcdp + pcdp->length;350350+ bp += device.length) {351351+ memcpy(&device, bp, sizeof(device));352352+ if (! (device.primary & PCDP_PRIMARY_CONSOLE))353353+ continue; /* not primary console */354354+355355+ if (device.type != PCDP_CONSOLE_VGA)356356+ continue; /* not VGA descriptor */357357+358358+ memcpy(&if_pci, bp+sizeof(device), sizeof(if_pci));359359+ if (if_pci.type != PCDP_IF_PCI)360360+ continue; /* not PCI interconnect */361361+362362+ if (if_pci.translation & PCDP_PCI_TRANS_IOPORT)363363+ vga_console_iobase =364364+ if_pci.ioport_tra | __IA64_UNCACHED_OFFSET;365365+366366+ if (if_pci.translation & PCDP_PCI_TRANS_MMIO)367367+ vga_console_membase =368368+ if_pci.mmio_tra | __IA64_UNCACHED_OFFSET;369369+370370+ break; /* once we find the primary, we're done */371371+ }372372+}373373+246374/**247375 * sn_setup - SN platform setup routine248376 * @cmdline_p: kernel command line···393263394264#if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE)395265 /*396396- * If there was a primary vga adapter identified through the397397- * EFI PCDP table, make it the preferred console. Otherwise398398- * zero out conswitchp.266266+ * Handle SN vga console.267267+ *268268+ * SN systems do not have enough ACPI table information269269+ * being passed from prom to identify VGA adapters and the legacy270270+ * addresses to access them. Until that is done, SN systems rely271271+ * on the PCDP table to identify the primary VGA console if one272272+ * exists.273273+ *274274+ * However, kernel PCDP support is optional, and even if it is built275275+ * into the kernel, it will not be used if the boot cmdline contains276276+ * console= directives.277277+ *278278+ * So, to work around this mess, we duplicate some of the PCDP code279279+ * here so that the primary VGA console (as defined by PCDP) will280280+ * work on SN systems even if a different console (e.g. serial) is281281+ * selected on the boot line (or CONFIG_EFI_PCDP is off).399282 */283283+284284+ if (! vga_console_membase)285285+ sn_scan_pcdp();400286401287 if (vga_console_membase) {402288 /* usable vga ... make tty0 the preferred default console */403403- add_preferred_console("tty", 0, NULL);289289+ if (!strstr(*cmdline_p, "console="))290290+ add_preferred_console("tty", 0, NULL);404291 } else {405292 printk(KERN_DEBUG "SGI: Disabling VGA console\n");293293+ if (!strstr(*cmdline_p, "console="))294294+ add_preferred_console("ttySG", 0, NULL);406295#ifdef CONFIG_DUMMY_CONSOLE407296 conswitchp = &dummy_con;408297#else
+6-2
include/asm-ia64/page.h
···4747#define PERCPU_PAGE_SHIFT 16 /* log2() of max. size of per-CPU area */4848#define PERCPU_PAGE_SIZE (__IA64_UL_CONST(1) << PERCPU_PAGE_SHIFT)49495050-#define RGN_MAP_LIMIT ((1UL << (4*PAGE_SHIFT - 12)) - PAGE_SIZE) /* per region addr limit */5151-52505351#ifdef CONFIG_HUGETLB_PAGE5452# define HPAGE_REGION_BASE RGN_BASE(RGN_HPAGE)···173175 */174176 typedef struct { unsigned long pte; } pte_t;175177 typedef struct { unsigned long pmd; } pmd_t;178178+#ifdef CONFIG_PGTABLE_4179179+ typedef struct { unsigned long pud; } pud_t;180180+#endif176181 typedef struct { unsigned long pgd; } pgd_t;177182 typedef struct { unsigned long pgprot; } pgprot_t;178183179184# define pte_val(x) ((x).pte)180185# define pmd_val(x) ((x).pmd)186186+#ifdef CONFIG_PGTABLE_4187187+# define pud_val(x) ((x).pud)188188+#endif181189# define pgd_val(x) ((x).pgd)182190# define pgprot_val(x) ((x).pgprot)183191