Page MenuHomeFreeBSD

Create VM_MEMATTR_DEVICE on all architectures
ClosedPublic

Authored by andrew on Apr 10 2021, 12:47 PM.
Tags
None
Referenced Files
F170776180: D29692.id87297.diff
Sun, Sep 6, 1:57 PM
F170758957: D29692.diff
Sun, Sep 6, 11:14 AM
F170685019: D29692.id87202.diff
Sun, Sep 6, 12:42 AM
F170670888: D29692.id87297.diff
Sat, Sep 5, 10:51 PM
F170670223: D29692.id.diff
Sat, Sep 5, 10:45 PM
F170664323: D29692.id87202.diff
Sat, Sep 5, 9:51 PM
F170651526: D29692.diff
Sat, Sep 5, 7:58 PM
Unknown Object (File)
Sat, Sep 5, 6:33 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.