Page MenuHomeFreeBSD

linuxkpi: Fix uses of `pmap_change_attr()`
ClosedPublic

Authored by dumbbell on Oct 2 2023, 10:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 21, 11:24 AM
Unknown Object (File)
Sun, Apr 19, 8:38 PM
Unknown Object (File)
Sat, Apr 18, 10:11 AM
Unknown Object (File)
Wed, Apr 15, 12:00 AM
Unknown Object (File)
Tue, Apr 14, 2:24 AM
Unknown Object (File)
Mon, Apr 13, 8:30 PM
Unknown Object (File)
Sat, Apr 11, 7:32 PM
Unknown Object (File)
Mon, Apr 6, 10:56 PM

Details

Summary

Why

This function takes an offset and a length as argument, not a physical address and a number of pages.

This misuse caused the set_memory_*() and arch_io_reserve_memtype_wc() functions to return EINVAL.

Another problem was the fact that they returned errors as a positive integer, whereas Linux uses negative integers.

How

Physical addresses and number of pages are converted to offset+length in the set_memory_*() functions.

arch_io_reserve_memtype_wc() now calls pmap_change_attr() directly instead of using set_memory_wc().

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable