Page MenuHomeFreeBSD

Make PCB structure binary compatible for old and new PMAP on ARM

Authored by on Oct 27 2015, 10:47 AM.



This structure must be binary compatible regardless of PMAP
version being used. Create reserved section for NEW_PMAP to
make other variables be placed exactly in the same memory
addresses. This fixes kgdb/gdb behavoiur, which uses pcb.h stuctures.
The NEW_PMAP is kernel flag, so it does not propagate to the buildworld,
what makes the tools using pcb.h unable to parse PCB data.

Diff Detail

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

Event Timeline retitled this revision from to Make PCB structure binary compatible for old and new PMAP on ARM. updated this object. edited the test plan for this revision. (Show Details) added reviewers: zbb, imp, kib, jhb, ian.
jhb added inline comments.Oct 27 2015, 4:12 PM
66 ↗(On Diff #9729)

I would rather you just do something more obvious to the reader that doesn't have to worry about padding by having the same exact definitions:

uint32_t *_pcb_rsvd0;
uint32_t  _pcb_rsvd1;
u_int _pcb_rsvd2;
kib added inline comments.Oct 28 2015, 10:47 AM
62 ↗(On Diff #9762)

After the latest revision, you do not need #ifdef ARM_NEW_PMAP. Use ARM_NEW_PMAP definition always. A comment that three fields are only used by new pmap case would be enough.

Is it important that pcb_pagedir is vm_offset_t for v5/old v6 pmaps ?

I removed all ifdefs to avoid obfuscating the code with reserved fields etc.

kib added inline comments.Nov 2 2015, 11:58 AM
62 ↗(On Diff #9881)

I suggest removing the '======' delimiters. Also, please specify in comment what compatibility is wanted there, i.e. that we want binary compatibility between PCB layouts for old and new pmaps.

The code change looks fine.

zbb accepted this revision.Nov 3 2015, 7:47 AM
zbb edited edge metadata.
This revision is now accepted and ready to land.Nov 3 2015, 7:47 AM
mmel added a subscriber: mmel.Nov 5 2015, 11:07 AM

I'm ready to remove old pmap_v6 almost immediately, if you find it helpful.

Thanks, eventually that'd be nice. However I'd like to submit this patch and then remove any old-pmap stuff in a separate commit. It's just that we have prepared new-pmap to be MFCed to 10-stable and I'd like to have every necessary change isolated to keep the track of all required commits.
If you have no objections I'd like to ask zbb to commit this change as is.

mmel accepted this revision.Nov 11 2015, 4:16 PM
mmel added a reviewer: mmel.
This revision was automatically updated to reflect the committed changes.