switch ( attr )
{
- case MT_BUFFERABLE:
+ case MT_NORMAL_NC:
/*
* ARM ARM: Overlaying the shareability attribute (DDI
* 0406C.b B3-1376 to 1377)
*/
e.pt.sh = LPAE_SH_OUTER;
break;
- case MT_UNCACHED:
- case MT_DEV_SHARED:
+ case MT_DEVICE_nGnRnE:
+ case MT_DEVICE_nGnRE:
/*
* Shareability is ignored for non-Normal memory, Outer is as
* good as anything.
count = nr_mfns / LPAE_ENTRIES;
p = second + second_linear_offset(virt_offset);
- pte = mfn_to_xen_entry(_mfn(base_mfn), MT_WRITEALLOC);
+ pte = mfn_to_xen_entry(_mfn(base_mfn), MT_NORMAL);
if ( granularity == 16 * LPAE_ENTRIES )
pte.pt.contig = 1; /* These maps are in 16-entry contiguous chunks. */
for ( i = 0; i < count; i++ )
else if ( map[slot].pt.avail == 0 )
{
/* Commandeer this 2MB slot */
- pte = mfn_to_xen_entry(_mfn(slot_mfn), MT_WRITEALLOC);
+ pte = mfn_to_xen_entry(_mfn(slot_mfn), MT_NORMAL);
pte.pt.avail = 1;
write_pte(map + slot, pte);
break;
{
paddr_t ma = va + phys_offset;
- return mfn_to_xen_entry(maddr_to_mfn(ma), MT_WRITEALLOC);
+ return mfn_to_xen_entry(maddr_to_mfn(ma), MT_NORMAL);
}
/* Map the FDT in the early boot page table */
/* Initialise xen second level entries ... */
/* ... Xen's text etc */
- pte = mfn_to_xen_entry(maddr_to_mfn(xen_paddr), MT_WRITEALLOC);
+ pte = mfn_to_xen_entry(maddr_to_mfn(xen_paddr), MT_NORMAL);
pte.pt.xn = 0;/* Contains our text mapping! */
xen_second[second_table_offset(XEN_VIRT_START)] = pte;
/* ... Boot Misc area for xen relocation */
dest_va = BOOT_RELOC_VIRT_START;
- pte = mfn_to_xen_entry(maddr_to_mfn(xen_paddr), MT_WRITEALLOC);
+ pte = mfn_to_xen_entry(maddr_to_mfn(xen_paddr), MT_NORMAL);
/* Map the destination in xen_second. */
xen_second[second_table_offset(dest_va)] = pte;
/* Map the destination in boot_second. */
unsigned long va = XEN_VIRT_START + (i << PAGE_SHIFT);
if ( !is_kernel(va) )
break;
- pte = mfn_to_xen_entry(mfn, MT_WRITEALLOC);
+ pte = mfn_to_xen_entry(mfn, MT_NORMAL);
pte.pt.table = 1; /* 4k mappings always have this bit set */
if ( is_kernel_text(va) || is_kernel_inittext(va) )
{
for ( i = 0; i < DOMHEAP_SECOND_PAGES; i++ )
{
pte = mfn_to_xen_entry(virt_to_mfn(domheap+i*LPAE_ENTRIES),
- MT_WRITEALLOC);
+ MT_NORMAL);
pte.pt.table = 1;
write_pte(&first[first_table_offset(DOMHEAP_VIRT_START+i*FIRST_SIZE)], pte);
}
mfn_t first_mfn = alloc_boot_pages(1, 1);
clear_page(mfn_to_virt(first_mfn));
- pte = mfn_to_xen_entry(first_mfn, MT_WRITEALLOC);
+ pte = mfn_to_xen_entry(first_mfn, MT_NORMAL);
pte.pt.table = 1;
write_pte(p, pte);
first = mfn_to_virt(first_mfn);
}
- pte = mfn_to_xen_entry(_mfn(mfn), MT_WRITEALLOC);
+ pte = mfn_to_xen_entry(_mfn(mfn), MT_NORMAL);
/* TODO: Set pte.pt.contig when appropriate. */
write_pte(&first[first_table_offset(vaddr)], pte);
for ( i = 0; i < nr_second; i++ )
{
clear_page(mfn_to_virt(mfn_add(second_base, i)));
- pte = mfn_to_xen_entry(mfn_add(second_base, i), MT_WRITEALLOC);
+ pte = mfn_to_xen_entry(mfn_add(second_base, i), MT_NORMAL);
pte.pt.table = 1;
write_pte(&xen_first[first_table_offset(FRAMETABLE_VIRT_START)+i], pte);
}
if ( p == NULL )
return -ENOMEM;
clear_page(p);
- pte = mfn_to_xen_entry(virt_to_mfn(p), MT_WRITEALLOC);
+ pte = mfn_to_xen_entry(virt_to_mfn(p), MT_NORMAL);
pte.pt.table = 1;
write_pte(entry, pte);
return 0;
* LPAE Memory region attributes. Indexed by the AttrIndex bits of a
* LPAE entry; the 8-bit fields are packed little-endian into MAIR0 and MAIR1.
*
+ * See section "Device memory" B2.7.2 in ARM DDI 0487B.a for more
+ * details about the meaning of *G*R*E.
+ *
* ai encoding
- * MT_UNCACHED 000 0000 0000 -- Strongly Ordered
- * MT_BUFFERABLE 001 0100 0100 -- Non-Cacheable
- * MT_WRITETHROUGH 010 1010 1010 -- Write-through
- * MT_WRITEBACK 011 1110 1110 -- Write-back
- * MT_DEV_SHARED 100 0000 0100 -- Device
+ * MT_DEVICE_nGnRnE 000 0000 0000 -- Strongly Ordered/Device nGnRnE
+ * MT_NORMAL_NC 001 0100 0100 -- Non-Cacheable
+ * MT_NORMAL_WT 010 1010 1010 -- Write-through
+ * MT_NORMAL_WB 011 1110 1110 -- Write-back
+ * MT_DEVICE_nGnRE 100 0000 0100 -- Device nGnRE
* ?? 101
* reserved 110
- * MT_WRITEALLOC 111 1111 1111 -- Write-back write-allocate
+ * MT_NORMAL 111 1111 1111 -- Write-back write-allocate
*/
#define MAIR0VAL 0xeeaa4400
#define MAIR1VAL 0xff000004
* registers, as defined above.
*
*/
-#define MT_UNCACHED 0x0
-#define MT_BUFFERABLE 0x1
-#define MT_WRITETHROUGH 0x2
-#define MT_WRITEBACK 0x3
-#define MT_DEV_SHARED 0x4
-#define MT_WRITEALLOC 0x7
-
-#define PAGE_HYPERVISOR (MT_WRITEALLOC)
-#define PAGE_HYPERVISOR_NOCACHE (MT_DEV_SHARED)
-#define PAGE_HYPERVISOR_WC (MT_BUFFERABLE)
+#define MT_DEVICE_nGnRnE 0x0
+#define MT_NORMAL_NC 0x1
+#define MT_NORMAL_WT 0x2
+#define MT_NORMAL_WB 0x3
+#define MT_DEVICE_nGnRE 0x4
+#define MT_NORMAL 0x7
+
+#define PAGE_HYPERVISOR (MT_NORMAL)
+#define PAGE_HYPERVISOR_NOCACHE (MT_DEVICE_nGnRE)
+#define PAGE_HYPERVISOR_WC (MT_NORMAL_NC)
/*
* Defines for changing the hypervisor PTE .ro and .nx bits. This is only to be