android_kernel_motorola_sm6375/arch/mips
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Martin Fäcknitz e9602efecf MIPS: vdso: Invalid GIC access through VDSO
[ Upstream commit 47ce8527fbba145a7723685bc9a27d9855e06491 ]

Accessing raw timers (currently only CLOCK_MONOTONIC_RAW) through VDSO
doesn't return the correct time when using the GIC as clock source.
The address of the GIC mapped page is in this case not calculated
correctly. The GIC mapped page is calculated from the VDSO data by
subtracting PAGE_SIZE:

  void *get_gic(const struct vdso_data *data) {
    return (void __iomem *)data - PAGE_SIZE;
  }

However, the data pointer is not page aligned for raw clock sources.
This is because the VDSO data for raw clock sources (CS_RAW = 1) is
stored after the VDSO data for coarse clock sources (CS_HRES_COARSE = 0).
Therefore, only the VDSO data for CS_HRES_COARSE is page aligned:

  +--------------------+
  |                    |
  | vd[CS_RAW]         | ---+
  | vd[CS_HRES_COARSE] |    |
  +--------------------+    | -PAGE_SIZE
  |                    |    |
  |  GIC mapped page   | <--+
  |                    |
  +--------------------+

When __arch_get_hw_counter() is called with &vd[CS_RAW], get_gic returns
the wrong address (somewhere inside the GIC mapped page). The GIC counter
values are not returned which results in an invalid time.

Fixes: a7f4df4e21 ("MIPS: VDSO: Add implementations of gettimeofday() and clock_gettime()")
Signed-off-by: Martin Fäcknitz <faecknitz@hotsplots.de>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-20 16:10:53 +02:00
..
alchemy MIPS: alchemy: xxs1500: add gpio-au1000.h header file 2021-06-03 08:59:16 +02:00
ar7
ath25
ath79
bcm47xx MIPS: BCM47XX: fix kconfig dependency bug for BCM47XX_BCMA 2020-12-30 11:51:07 +01:00
bcm63xx
bmips
boot mips: disable branch profiling in boot/decompress.o 2021-07-20 16:10:53 +02:00
cavium-octeon
cobalt
configs
crypto
dec MIPS: DEC: Restore bootmem reservation for firmware working memory area 2020-11-05 11:43:30 +01:00
emma
fw
generic MIPS: generic: Update node names to avoid unit addresses 2021-06-30 08:47:44 -04:00
include MIPS: vdso: Invalid GIC access through VDSO 2021-07-20 16:10:53 +02:00
jazz
jz4740
kernel MIPS: properly stop .eh_frame generation 2021-03-04 10:26:21 +01:00
kvm
lantiq MIPS: lantiq: Explicitly compare LTQ_EBU_PCC_ISTAT against 0 2021-03-04 10:26:20 +01:00
lasat
lib MIPS: Fix kernel hang under FUNCTION_GRAPH_TRACER and PREEMPT_TRACER 2021-06-16 11:59:37 +02:00
loongson32
loongson64 MIPS: loongsoon64: Reserve memory below starting pfn to prevent Oops 2021-07-19 08:53:13 +02:00
math-emu
mm MIPS: c-r4k: Fix section mismatch for loongson2_sc_init 2021-03-04 10:26:19 +01:00
mti-malta
net
netlogic
oprofile
paravirt
pci MIPS: pci-legacy: stop using of_pci_range_to_resource 2021-05-14 09:44:30 +02:00
pic32
pistachio
pmcs-msp71xx
pnx833x
power
ralink MIPS: ralink: export rt_sysc_membase for rt2880_wdt.c 2021-06-03 08:59:16 +02:00
rb532
sgi-ip22
sgi-ip27
sgi-ip32
sibyte
sni
tools
txx9
vdso MIPS: VDSO: Use CLANG_FLAGS instead of filtering out '--target=' 2021-03-07 12:20:41 +01:00
vr41xx
Kbuild
Kbuild.platforms
Kconfig
Kconfig.debug
Makefile
Makefile.postlink