Skip to contentSkip to conversation

hamradio: baycom_epp: Do not use x86-specific rdtsc()

PATCH Applied Borislav Petkov 2 participants 2 messages Dec 18, 2022 – Dec 19, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hamradio: baycom_epp: Do not use x86-specific rdtsc()

From: "Borislav Petkov (AMD)" <[email protected]>

Use get_cycles() which is provided by pretty much every arch.

The UML build works too because get_cycles() is a simple "return 0;" because the rdtsc() is optimized away there.

---
 drivers/net/hamradio/baycom_epp.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/net/hamradio/baycom_epp.c +1 -7
index bd3b0c2655a2..83ff882f5d97 100644
@@ -623,16 +623,10 @@ static int receive(struct net_device *dev, int cnt)
 
 /* --------------------------------------------------------------------- */
 
-#if defined(__i386__) && !defined(CONFIG_UML)
-#include <asm/msr.h>
 #define GETTICK(x)						\
 ({								\
-	if (boot_cpu_has(X86_FEATURE_TSC))			\
-		x = (unsigned int)rdtsc();			\
+	x = (unsigned int)get_cycles();				\
 })
-#else /* __i386__  && !CONFIG_UML */
-#define GETTICK(x)
-#endif /* __i386__  && !CONFIG_UML */
 
 static void epp_bh(struct work_struct *work)
 {
Signature · 1 line
2.35.1
#1 lore raw
This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:

Quoted 8 lines · On Sun, 18 Dec 2022 13:04:05 +0100 you wrote:

From: "Borislav Petkov (AMD)" <[email protected]>

Use get_cycles() which is provided by pretty much every arch.

The UML build works too because get_cycles() is a simple "return 0;" because the rdtsc() is optimized away there.

[...]

Here is the summary with links:
- hamradio: baycom_epp: Do not use x86-specific rdtsc()

    https://git.kernel.org/netdev/net-next/c/aba5b397cad7

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html