Page MenuHomeFreeBSD

efi: Update efi_phys_to_kva to accept the size of the object being mapped.

Authored by on Tue, May 23, 5:55 PM.
Referenced Files
Unknown Object (File)
Thu, Jun 1, 8:34 PM
Unknown Object (File)
Sun, May 28, 9:47 AM
Unknown Object (File)
Thu, May 25, 9:27 PM
Unknown Object (File)
Wed, May 24, 4:00 AM
Unknown Object (File)
Wed, May 24, 3:32 AM
Unknown Object (File)
Tue, May 23, 9:52 PM



This allows to check that the entire object falls into the direct map.

Diff Detail

rG FreeBSD src repository
Lint Skipped
Tests Skipped
Build Status
Buildable 51861
Build 48752: arc lint + arc unit

Event Timeline

I like it. But let's get Andy and kib to sign off on it too...

This revision is now accepted and ready to land.Tue, May 23, 6:02 PM

I think it would be cleaner to have macro like PHYS_SZ_IN_DMAP(pa, sz) which would check for [pa, pa+sz) belonging to the DMAPed region.

Added the PHYS_SZ_IN_DMAP macro as requested.

Currently this is only added for arm64 and amd64, which are the platforms that use it.
I'm not sure what the policy is in this case, should I add the same macro for other archs to keep the interface consistent?

This revision now requires review to proceed.Thu, Jun 1, 2:48 PM

Only add the macro where needed.


No, this is not what I mean. PHYS_SZ_IN_DMAP(pa, sz) should verify that [pa, ps+sz) is mapped by DMAP.

Should now be fixed. I misinterpreted the desired behaviour for PHYS_SZ_IN_DMAP.


Should the check verify pa+sz-1 instead of pa+sz? Consider the last page in the DMAP, at the address x. If you want to check if the whole page belongs to DMAP-mapped region, you would check the x+PAGE_SIZE address, which lives in the next page not covered by DMAP. added inline comments.

Uh, yes I think it should, the check in PHYS_IN_DMAP uses strict inequality for (pa) < dmaplimit.

Fixed off-by-one check for the DMAP limit.

This revision is now accepted and ready to land.Fri, Jun 2, 7:22 PM