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)
Mar 18 2024, 2:02 PM
Unknown Object (File)
Feb 23 2024, 4:57 PM
Unknown Object (File)
Dec 22 2023, 11:02 PM
Unknown Object (File)
Nov 13 2023, 1:31 PM
Unknown Object (File)
Nov 7 2023, 7:32 AM
Unknown Object (File)
Oct 31 2023, 9:10 PM
Unknown Object (File)
Oct 25 2023, 9:00 AM
Unknown Object (File)
Oct 6 2023, 6:28 AM
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.