Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

gcc-9: properly declare the {pv,hv}clock_page storage

The pvlock_page and hvclock_page variables are (as the name implies)
addresses to pages, created by the linker script.

But we declared them as just "extern u8" variables, which _works_, but
now that gcc does some more bounds checking, it causes warnings like

warning: array subscript 1 is outside array bounds of ‘u8[1]’

when we then access more than one byte from those variables.

Fix this by simply making the declaration of the variables match
reality, which makes the compiler happy too.

Signed-off-by: Linus Torvalds <torvalds@-linux-foundation.org>

+2 -2
+2 -2
arch/x86/entry/vdso/vclock_gettime.c
··· 29 29 extern time_t __vdso_time(time_t *t); 30 30 31 31 #ifdef CONFIG_PARAVIRT_CLOCK 32 - extern u8 pvclock_page 32 + extern u8 pvclock_page[PAGE_SIZE] 33 33 __attribute__((visibility("hidden"))); 34 34 #endif 35 35 36 36 #ifdef CONFIG_HYPERV_TSCPAGE 37 - extern u8 hvclock_page 37 + extern u8 hvclock_page[PAGE_SIZE] 38 38 __attribute__((visibility("hidden"))); 39 39 #endif 40 40