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

x86/tsc: Remove obsolete ART to TSC conversion functions

convert_art_to_tsc() and convert_art_ns_to_tsc() interfaces are no
longer required. The conversion is now handled by the core code.

Signed-off-by: Lakshmi Sowjanya D <lakshmi.sowjanya.d@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20240513103813.5666-9-lakshmi.sowjanya.d@intel.com

authored by

Lakshmi Sowjanya D and committed by
Thomas Gleixner
0f532a78 d4bea547

-63
-3
arch/x86/include/asm/tsc.h
··· 28 28 } 29 29 #define get_cycles get_cycles 30 30 31 - extern struct system_counterval_t convert_art_to_tsc(u64 art); 32 - extern struct system_counterval_t convert_art_ns_to_tsc(u64 art_ns); 33 - 34 31 extern void tsc_early_init(void); 35 32 extern void tsc_init(void); 36 33 extern void mark_tsc_unstable(char *reason);
-60
arch/x86/kernel/tsc.c
··· 1297 1297 return 0; 1298 1298 } 1299 1299 1300 - /* 1301 - * Convert ART to TSC given numerator/denominator found in detect_art() 1302 - */ 1303 - struct system_counterval_t convert_art_to_tsc(u64 art) 1304 - { 1305 - u64 tmp, res, rem; 1306 - 1307 - rem = do_div(art, art_base_clk.denominator); 1308 - 1309 - res = art * art_base_clk.numerator; 1310 - tmp = rem * art_base_clk.numerator; 1311 - 1312 - do_div(tmp, art_base_clk.denominator); 1313 - res += tmp + art_base_clk.offset; 1314 - 1315 - return (struct system_counterval_t) { 1316 - .cs_id = have_art ? CSID_X86_TSC : CSID_GENERIC, 1317 - .cycles = res, 1318 - }; 1319 - } 1320 - EXPORT_SYMBOL(convert_art_to_tsc); 1321 - 1322 - /** 1323 - * convert_art_ns_to_tsc() - Convert ART in nanoseconds to TSC. 1324 - * @art_ns: ART (Always Running Timer) in unit of nanoseconds 1325 - * 1326 - * PTM requires all timestamps to be in units of nanoseconds. When user 1327 - * software requests a cross-timestamp, this function converts system timestamp 1328 - * to TSC. 1329 - * 1330 - * This is valid when CPU feature flag X86_FEATURE_TSC_KNOWN_FREQ is set 1331 - * indicating the tsc_khz is derived from CPUID[15H]. Drivers should check 1332 - * that this flag is set before conversion to TSC is attempted. 1333 - * 1334 - * Return: 1335 - * struct system_counterval_t - system counter value with the ID of the 1336 - * corresponding clocksource: 1337 - * cycles: System counter value 1338 - * cs_id: The clocksource ID for validating comparability 1339 - */ 1340 - 1341 - struct system_counterval_t convert_art_ns_to_tsc(u64 art_ns) 1342 - { 1343 - u64 tmp, res, rem; 1344 - 1345 - rem = do_div(art_ns, USEC_PER_SEC); 1346 - 1347 - res = art_ns * tsc_khz; 1348 - tmp = rem * tsc_khz; 1349 - 1350 - do_div(tmp, USEC_PER_SEC); 1351 - res += tmp; 1352 - 1353 - return (struct system_counterval_t) { 1354 - .cs_id = have_art ? CSID_X86_TSC : CSID_GENERIC, 1355 - .cycles = res, 1356 - }; 1357 - } 1358 - EXPORT_SYMBOL(convert_art_ns_to_tsc); 1359 - 1360 1300 static void tsc_refine_calibration_work(struct work_struct *work); 1361 1301 static DECLARE_DELAYED_WORK(tsc_irqwork, tsc_refine_calibration_work); 1362 1302 /**