Page MenuHomeFreeBSD

ARMv6 pmap - fix the way how a decision is made that a page is under pv management
ClosedPublic

Authored by skra on Nov 11 2016, 8:04 PM.

Details

Summary

PHYS_TO_VM_PAGE() function looks up a page in more segments, but first_page is connected only to the segment associated with vm_page_array. There could be more dynamically created segments for fictitious pages.

Probably, it's not so big problem on architectures where RAM physical address starts from zero. However, it's not a case for many ARM platforms.

On the other hand, AFAIK, fictitious pages under pv management are used only in new drm code.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

skra retitled this revision from to ARMv6 pmap - fix the way how a decision is made that a page is under pv management.Nov 11 2016, 8:04 PM
skra updated this object.
skra edited the test plan for this revision. (Show Details)
skra added a reviewer: kib.
skra set the repository for this revision to rS FreeBSD src repository.
skra added a project: ARM.
skra added a subscriber: ARM.
skra updated this revision to Diff 22153.
kib edited edge metadata.Nov 12 2016, 1:16 PM
kib accepted this revision.

Besides DRM, another consumer of the dynamic managed fictitious page ranges is Xen. I am not sure about state of the Xen/arm port on FreeBSD.

sys/arm/arm/pmap-v6.c
2750 ↗(On Diff #22153)

the `? TRUE : FALSE``` part is not needed, the comparison operator already produces the bool typed result. You might consider changing return type of is_managed() to bool as well.

This revision is now accepted and ready to land.Nov 12 2016, 1:16 PM
skra added inline comments.Nov 12 2016, 1:58 PM
sys/arm/arm/pmap-v6.c
2750 ↗(On Diff #22153)

Right. I saw that in this morning. About bool type, is it prefered now to slowly change all occurrences of boolean_t into bool?

kib added inline comments.Nov 12 2016, 2:14 PM
sys/arm/arm/pmap-v6.c
2750 ↗(On Diff #22153)

I use bool type for all new code and when modifying old code. The only exception is when boolean_t is inscribed in the KPI and the pass over consumers is not desirable.

This revision was automatically updated to reflect the committed changes.