Page MenuHomeFreeBSD

Create VM_MEMATTR_DEVICE on all architectures
ClosedPublic

Authored by andrew on Apr 10 2021, 12:47 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 10 2025, 2:32 PM
Unknown Object (File)
Aug 24 2025, 11:32 PM
Unknown Object (File)
Aug 15 2025, 3:11 PM
Unknown Object (File)
Aug 12 2025, 9:46 PM
Unknown Object (File)
Aug 7 2025, 3:34 PM
Unknown Object (File)
Aug 2 2025, 10:50 AM
Unknown Object (File)
Jul 7 2025, 3:53 AM
Unknown Object (File)
Jul 4 2025, 3:25 PM
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.