Skip to content
Unverified Commit 0f02cfbc authored by Paul Burton's avatar Paul Burton
Browse files

MIPS: VDSO: Match data page cache colouring when D$ aliases



When a system suffers from dcache aliasing a user program may observe
stale VDSO data from an aliased cache line. Notably this can break the
expectation that clock_gettime(CLOCK_MONOTONIC, ...) is, as its name
suggests, monotonic.

In order to ensure that users observe updates to the VDSO data page as
intended, align the user mappings of the VDSO data page such that their
cache colouring matches that of the virtual address range which the
kernel will use to update the data page - typically its unmapped address
within kseg0.

This ensures that we don't introduce aliasing cache lines for the VDSO
data page, and therefore that userland will observe updates without
requiring cache invalidation.

Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
Reported-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
Reported-by: default avatarRene Nielsen <rene.nielsen@microsemi.com>
Reported-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Fixes: ebb5e78c ("MIPS: Initial implementation of a VDSO")
Patchwork: https://patchwork.linux-mips.org/patch/20344/


Tested-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Tested-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@linux-mips.org
Cc: stable@vger.kernel.org # v4.4+
parent 5b394b2d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment