Page MenuHomeFreeBSD

Create VM_MEMATTR_DEVICE on all architectures
ClosedPublic

Authored by andrew on Apr 10 2021, 12:47 PM.
Tags
None
Referenced Files
F175832019: D29692.diff
Tue, Oct 13, 5:48 PM
Unknown Object (File)
Thu, Oct 8, 4:49 AM
Unknown Object (File)
Sep 12 2026, 2:38 PM
Unknown Object (File)
Sep 10 2026, 5:20 AM
Unknown Object (File)
Sep 10 2026, 5:14 AM
Unknown Object (File)
Sep 8 2026, 12:44 PM
Unknown Object (File)
Sep 6 2026, 1:57 PM
Unknown Object (File)
Sep 6 2026, 11:14 AM
Subscribers

Details

Summary

This is intended to be used with memory mapped IO, e.g. from
bus_space_map with no flags, or pmap_mapdev.

Use this new memory type in the map request configured by
resource_init_map_request, and in pciconf.

Diff Detail

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

Event Timeline

sys/amd64/include/vm.h
46

Why only for kernel?

Also, the recent change to pci_user.c can be simplified after your introduction of VM_MEMATTR_DEVICE, look at line 1129.

sys/amd64/include/vm.h
46

It would break the switch statement in usr.bin/vm/vmstat.c if we don't limit to just the kernel as it will have the same value twice.

sys/amd64/include/vm.h
46

Then perhaps define MD name VM_MEMATTR_DEVMAP, present on all arches. It would be _UNCACHEABLE on x86, DEVICE on arm. pci_user.c would use _DEVMAP

sys/amd64/include/vm.h
46

We could also replace the switch statement with if else, e.g. D29703

  • Remove _KERNEL checks
  • Only use VM_MEMATTR_DEVICE in pciconf
This revision is now accepted and ready to land.Apr 12 2021, 2:01 AM
This revision was automatically updated to reflect the committed changes.