Page MenuHomeFreeBSD

zero vm_page_t inputs to vm_page_initfake() for predictable results
ClosedPublic

Authored by tychon on May 5 2019, 5:28 PM.
Tags
None
Referenced Files
F82540843: D20162.id57069.diff
Tue, Apr 30, 12:58 AM
F82540841: D20162.id57074.diff
Tue, Apr 30, 12:58 AM
Unknown Object (File)
Mar 25 2024, 9:23 AM
Unknown Object (File)
Mar 5 2024, 4:12 PM
Unknown Object (File)
Jan 14 2024, 10:46 AM
Unknown Object (File)
Dec 23 2023, 7:07 AM
Unknown Object (File)
Dec 23 2023, 7:07 AM
Unknown Object (File)
Dec 22 2023, 9:41 PM
Subscribers

Details

Summary

In r345811 I introduced a bug when I copied the malloc() of the fake-page array from one place to another by omitting the M_ZERO. Put it back in dmar_bus_dmamap_load_phys() and dmar_bus_dmamap_load_buffer() as well as nvdimm_spa_uio() and nvdimm_spa_g_all_unmapped().

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Update to a diff with full context.

I think that adding M_ZERO in the places were it is missed is better solution. I am not sure that re-initialization case is not used at all. It is supposed to be used when fake pages come from the vm_page_array[], e.g. typically x86 aperture (or BARs) is located in PCI window and we specially cover memory to 4G in vm_page_array[] even if machine has less than 4G. For such persistent fake pages, it is useful to keep all the fields of struct vm_page intact. I believe I once pasted you the change I have in bhyve+DMAR branch which unconditionally initializes holes in phys map as fictitious pages.

tychon retitled this revision from vm_page_initfake() could do a better job initializing to zero vm_page_t inputs to vm_page_initfake() for predictable results.
tychon edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.May 5 2019, 8:11 PM
This revision was automatically updated to reflect the committed changes.