Page MenuHomeFreeBSD

arm64: support identity mapped area >512GiB
ClosedPublic

Authored by mail_patrick-wildt.de on Oct 14 2015, 2:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 16, 3:13 AM
Unknown Object (File)
Sun, Nov 24, 1:17 AM
Unknown Object (File)
Nov 22 2024, 4:11 PM
Unknown Object (File)
Nov 18 2024, 9:48 AM
Unknown Object (File)
Nov 17 2024, 2:12 AM
Unknown Object (File)
Nov 13 2024, 12:25 AM
Unknown Object (File)
Nov 10 2024, 1:49 PM
Unknown Object (File)
Nov 10 2024, 1:20 PM
Subscribers

Details

Summary

A machine in my possesion has memory starting at 0x8000000000
which is just shortly after what 39 bits of virtual address
space can handle. IO ports, like UART, are inside of those
first 39 bits though.

Our bootup code requires an identity mapped TTBR0 until it
jumps into kernel VA space. To be able to cope with those areas
we need to use 48 bit VA space for TTBR0 and add another
pagetable level by starting the translation at L0.

This way we can create 2 512GiB identitiy mappings to handle
the first 39 bits and the space our kernel runs in.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mail_patrick-wildt.de retitled this revision from to arm64: support identity mapped area >512GiB.
mail_patrick-wildt.de updated this object.
mail_patrick-wildt.de edited the test plan for this revision. (Show Details)
mail_patrick-wildt.de added a reviewer: andrew.

Can you rebase this after rS289581? I've committed the locore.S and armreg.h parts.

sys/arm64/arm64/pmap.c
448 ↗(On Diff #9373)

This should be at the top of the file

573 ↗(On Diff #9373)

kernstart isn't the correct value here, it should be based on what physical memory is available. I think this could be moved after the loop, and calculate the minimum PA based on that, with kernstart the fallback value.

sys/arm64/include/vmparam.h
178 ↗(On Diff #9373)

Would it not be better to use the delta between DMAP_MIN_PHYSADDR and dmap_phys_base? i.e. have in pmap.c:

dmap_phys_delta = DMAP_MIN_ADDRESS - dmap_phys_base;

Then make this:

#define PHYS_TO_DMAP(pa)    \
  ({                        \
    ...
    (pa) + dmap_phys_delta; \
  })

(assuming I have the subtraction correct)

This revision was automatically updated to reflect the committed changes.