aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Kardashevskiy <aik@linux.ibm.com>2020-05-26 12:15:49 +1000
committerDmitry Vyukov <dvyukov@google.com>2020-06-12 05:54:26 +0200
commit819b58b09fc321c20a1d465e63643cff8a3f38f0 (patch)
treede25cdf63f7a32b1b2fd90c176b5aba6071ed6a0
parentc6ec8ed9ced064dbe21ef57ca2b231a0e3a4ce86 (diff)
ppc64: Increase page size
The default configuration on PPC64 uses 64K system page size. Having it 4K was not a problem until recently when 365fba2440cee3aed74c77 "executor: surround the data mapping with PROT_NONE pages" added surrounding mappings not aligned to the actual system page size. This changes the page size for ppc64 to 64K and introduces the upper limit to randPageCount() as we have the hard coded limit of 16MB. If the unlikely event of a PPC64 system with 4K pages, we will end up allocating less pages which is not great but acceptable. This avoids using os.Getpagesize() as the page size on a building host may be different than on the test machine so we always use the bigger size for simplicity. Signed-off-by: Alexey Kardashevskiy <aik@linux.ibm.com>
-rw-r--r--prog/rand.go2
-rw-r--r--sys/targets/targets.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/prog/rand.go b/prog/rand.go
index 7a035c1b2..a6c013fdd 100644
--- a/prog/rand.go
+++ b/prog/rand.go
@@ -175,7 +175,7 @@ func (r *randGen) randPageCount() (n uint64) {
case r.nOutOf(5, 6):
n = r.rand(20) + 1
default:
- n = (r.rand(3) + 1) * 512
+ n = (r.rand(3) + 1) * r.target.NumPages / 4
}
return
}
diff --git a/sys/targets/targets.go b/sys/targets/targets.go
index 82ea52139..44515d480 100644
--- a/sys/targets/targets.go
+++ b/sys/targets/targets.go
@@ -187,7 +187,7 @@ var List = map[string]map[string]*Target{
},
"ppc64le": {
PtrSize: 8,
- PageSize: 4 << 10,
+ PageSize: 64 << 10,
CFlags: []string{"-D__powerpc64__"},
Triple: "powerpc64le-linux-gnu",
KernelArch: "powerpc",