Bug 342356

Summary: MIPS: determine page size at runtime
Product: [Developer tools] valgrind Reporter: Maran Pakkirisamy <maran.pakkirisamy>
Component: generalAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: normal CC: mips32r2
Priority: NOR    
Version: 3.10 SVN   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: accept 8k and 32k as valid page size
enable runtime determination of pagesize of MIPS target
remove --with-pagesize config switch

Description Maran Pakkirisamy 2014-12-31 07:23:02 UTC
MIPS kernels support varying pagesizes - 4k, 16k, 64k. In addition to that, Cavium Octeon MIPS (cnMIPS) kernels support 8k and 32k pages.

Valgrind for MIPS target currently requires to pass the page size of the target kernel as a configure time option (--with-pagesize).

The page size is determined at runtime for PPC32/64 and ARM64 which have kernels that support multi-pagesize similar to MIPS.

So, enable valgrind for MIPS target to determine page size at runtime.

Reproducible: Always
Comment 1 Maran Pakkirisamy 2014-12-31 10:32:20 UTC
Created attachment 90176 [details]
accept 8k and 32k as valid page size
Comment 2 Maran Pakkirisamy 2014-12-31 10:38:24 UTC
Created attachment 90177 [details]
enable runtime determination of pagesize of MIPS target

The patch can be applied after applying pagesize-8k-32k-support.patch
To apply the patch,
patch -p1 < multi-pagesize.patch

The patch has been tested on MIPS64 kernels with 4k, 8k, 32k pages. However, it is not tested on MIPS32 target.
Comment 3 Maran Pakkirisamy 2014-12-31 10:42:42 UTC
Created attachment 90178 [details]
remove --with-pagesize config switch

As page size is determined at runtime, --page-size configutation switch become obsolete. So, remove it.
If the patches are accepted, README.mips will need an update regarding the --with-pagesize option.
To apply the patch,
patch -p1 < update-config-option.patch
Comment 4 Julian Seward 2015-01-20 01:12:18 UTC
Sounds like a not-bad plan.  Petar, any comment?
Comment 5 Petar Jovanovic 2016-02-26 15:35:07 UTC
Committed in r15813. Thank you.
Comment 6 Petar Jovanovic 2018-09-10 12:07:19 UTC
Fixed in r15813. Closing it.