Page MenuHomeFreeBSD

Remove dead pmap-pvdump from i386, arm, mips. Fixes mips DEBUG builds
ClosedPublic

Authored by kbowling on Jul 26 2015, 12:30 PM.
Tags
Referenced Files
Unknown Object (File)
Fri, May 3, 5:45 PM
Unknown Object (File)
Fri, May 3, 10:03 AM
Unknown Object (File)
Fri, May 3, 10:03 AM
Unknown Object (File)
Fri, May 3, 10:02 AM
Unknown Object (File)
Fri, May 3, 9:35 AM
Unknown Object (File)
Fri, May 3, 9:30 AM
Unknown Object (File)
Fri, May 3, 9:30 AM
Unknown Object (File)
Fri, May 3, 9:30 AM
Subscribers

Details

Reviewers
brooks
alc
sbruno
Summary

Building mips with options DEBUG is broken for me in this function.

Removing this dead code per discussion with alc

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kbowling retitled this revision from to Fix mips DEBUG build.
kbowling updated this object.
kbowling edited the test plan for this revision. (Show Details)
kbowling added a reviewer: sbruno.
kbowling set the repository for this revision to rS FreeBSD src repository - subversion.
kbowling added a project: MIPS.
sbruno added a subscriber: sbruno.

This also matches the pmap_pvdump() function in arm/arm/pmap-v6-new.c

I suspect this is "the right thing to do here"

alc edited edge metadata.

The change is correct. Commit it.

This revision is now accepted and ready to land.Jul 26 2015, 4:52 PM

Hrm, since this is used for MIPS64, I did a test build and it fails.

cc1: warnings being treated as errors
/home/sbruno/bsd/fbsd_head/sys/mips/mips/pmap.c: In function 'pads':
/home/sbruno/bsd/fbsd_head/sys/mips/mips/pmap.c:3315: warning: comparison is always true due to limited range of data type
/home/sbruno/bsd/fbsd_head/sys/mips/mips/pmap.c:3318: warning: comparison is always false due to limited range of data type
/home/sbruno/bsd/fbsd_head/sys/mips/mips/pmap.c: In function 'pmap_pvdump':
/home/sbruno/bsd/fbsd_head/sys/mips/mips/pmap.c:3334: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'vm_offset_t' [-Wformat]
/home/sbruno/bsd/fbsd_head/sys/mips/mips/pmap.c:3338: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'vm_offset_t' [-Wformat]

  • pmap.o ---
  • [pmap.o] Error code 1
sbruno added a reviewer: kbowling.

Let me do a thing to update this change so that it builds for mips/mips64 debug kernels.

sbruno edited edge metadata.

Please give this a once over. I've testbuilt this for the RSPRO(mips32) and MALTA64(mips64) kernels.

The original patch would fail for MIPS64 with:

>>> stage 3.2: building everything
--------------------------------------------------------------
cc1: warnings being treated as errors
/home/sbruno/bsd/fbsd_head/sys/mips/mips/pmap.c: In function 'pads':
/home/sbruno/bsd/fbsd_head/sys/mips/mips/pmap.c:3315: warning: comparison is always true due to limited range of data type
/home/sbruno/bsd/fbsd_head/sys/mips/mips/pmap.c:3318: warning: comparison is always false due to limited range of data type
/home/sbruno/bsd/fbsd_head/sys/mips/mips/pmap.c: In function 'pmap_pvdump':
/home/sbruno/bsd/fbsd_head/sys/mips/mips/pmap.c:3334: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'vm_offset_t' [-Wformat]
/home/sbruno/bsd/fbsd_head/sys/mips/mips/pmap.c:3338: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'vm_offset_t' [-Wformat]
--- pmap.o ---
*** [pmap.o] Error code 1
This revision now requires review to proceed.Jul 26 2015, 6:52 PM

That's a different problem. If you're going to fix the printf()s, then remove the silly casting of the variable "pmap".

sys/mips/mips/pmap.c
3324

The combination of "%lx" and "(int *)" seems dubious.

In D3206#64342, @alc wrote:

That's a different problem. If you're going to fix the printf()s, then remove the silly casting of the variable "pmap".

I tried that:

cc1: warnings being treated as errors
/home/sbruno/bsd/fbsd_head/sys/mips/mips/pmap.c: In function 'pmap_pvdump':
/home/sbruno/bsd/fbsd_head/sys/mips/mips/pmap.c:3348: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'vm_offset_t' [-Wformat]
sys/mips/mips/pmap.c
3324

It seemed SUPER dubious to me, that's why I'm putting it out there.

Note that the warning says "argument 3", which is the pv_va parameter, not "argument 2", which is the pmap parameter. Remove the (void *) from before the pmap parameter.

sys/mips/mips/pmap.c
3324

Use "(pt_entry_t *)".

sbruno edited edge metadata.

Drop casts to (void *)

Use casts to uintmax_t and %j to allow compile on 32/64 bit mips

How about I don't put the rest of my tree in this review.

Previous commit comments:

Drop casts to (void *)

Use casts to uintmax_t and %j to allow compile on 32/64 bit mips

sys/mips/mips/pmap.c
3324

I *think* this is what needs to be done here. The uintmax_t casts ensure proper 32/64 bit type right?

This revision is now accepted and ready to land.Jul 26 2015, 11:21 PM
sys/mips/mips/pmap.c
3307

This should be "vm_offset_t", not "vm_paddr_t".

3312–3314

This can't be correct for 64-bit processors. The page tables have three levels, not two. I would expect to see another nested "for" loop and "if" statement testing the validity of the corresponding entry here. The calculation of "va" below would also need to change.

3316–3318

I find this odd. The very first thing that this function did is return if the pmap is the kernel pmap.

3324

Yes, it's correct. Also, you can remove the ()'s around "*ptep".

3329

This should be "vm_paddr_t".

kbowling edited reviewers, added: sbruno; removed: kbowling.
This revision now requires review to proceed.Jul 27 2015, 9:07 AM
kbowling removed rS FreeBSD src repository - subversion as the repository for this revision.

Trying to incorporate feedback. I don't understand the pads changes, nor am I sure if all the ifdef I added is necessary.

The changes to pads() for 64-bit processors aren't quite right. In particular, the second access to segtab[] isn't correct. The changes should look more like what you see in the DDB function just above pads().

That said, we should just stop here. I finally did something that I should have done in the first place, specifically, look for how this code is actually used. The answer is that it's long dead code that got cut-and-pasted from i386. So, the right fix is simply to delete it from arm-v6, i386, and mips. Like mips, it only exists in arm-v6 because that pmap was also copied from i386.

kbowling retitled this revision from Fix mips DEBUG build to Remove dead pmap-pvdump from i386, arm, mips. Fixes mips DEBUG builds.Jul 27 2015, 7:56 PM
kbowling updated this object.
kbowling set the repository for this revision to rS FreeBSD src repository - subversion.

Ok, I had no interest in the function just ran into the build error while investigating unrelated problems on a device. Removed per review.

Regenerating diff from top of /usr/src. Sorry for the noise.

alc edited edge metadata.
This revision is now accepted and ready to land.Jul 27 2015, 9:23 PM
sbruno edited edge metadata.

Committed at svn r286040