If you’re using mainline kernels, or most major distributions’ kernels, the best way to check for full retpoline support ( _i.e._ the kernel was configured with `CONFIG_RETPOLINE`, and was built with a retpoline-capable compiler) is to look for “Full generic retpoline” in `/sys/devices/system/cpu/vulnerabilities/spectre_v2`. On my system:
$ cat /sys/devices/system/cpu/vulnerabilities/spectre_v2
Mitigation: Full generic retpoline, IBPB, IBRS_FW
If you want more comprehensive tests, to detect retpolines on kernels without the `spectre_v2` systree file, check out how `spectre-meltdown-checker` goes about things.