xen/arm: mm: Use pte_xen_addr when creating xen entries

The helper pte_xen_addr computes the MFN based on the virtual
address and generates the PTE. This can be r

At the same time, make va a vaddr_t to make clear it holds virtual address.

Signed-off-by: Julien Grall <julien.grall@arm.com>
This commit is contained in:
Julien Grall committed 2018-12-17 09:58:40 +00:00
1 parent d2d71a5471
commit e72745671a
1 file changed
+2 -3
+2 -3
View File
@@ -652,12 +652,11 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
/* Break up the Xen mapping into 4k pages and protect them separately. */
for ( i = 0; i < LPAE_ENTRIES; i++ )
{
mfn_t mfn = mfn_add(maddr_to_mfn(xen_paddr), i);
unsigned long va = XEN_VIRT_START + (i << PAGE_SHIFT);
vaddr_t va = XEN_VIRT_START + (i << PAGE_SHIFT);
if ( !is_kernel(va) )
break;
pte = mfn_to_xen_entry(mfn, MT_NORMAL);
pte = pte_of_xenaddr(va);
pte.pt.table = 1; /* 4k mappings always have this bit set */
if ( is_kernel_text(va) || is_kernel_inittext(va) )
{
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.