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)
Thu, Oct 17, 5:36 AM
Unknown Object (File)
Thu, Oct 17, 5:36 AM
Unknown Object (File)
Thu, Oct 17, 5:36 AM
Unknown Object (File)
Thu, Oct 17, 5:36 AM
Unknown Object (File)
Thu, Oct 17, 5:16 AM
Unknown Object (File)
Oct 6 2024, 11:36 AM
Unknown Object (File)
Oct 3 2024, 9:29 AM
Unknown Object (File)
Oct 3 2024, 8:23 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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 38498
Build 35387: arc lint + arc unit

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.