Commit 2994e1ba authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Michael Ellerman
Browse files

powerpc/64: move account_stolen_time into its own function



This will be used by interrupt entry as well.

Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210130130852.2952424-38-npiggin@gmail.com
parent 75b96950
Loading
Loading
Loading
Loading
+14 −0
Original line number Original line Diff line number Diff line
@@ -87,6 +87,17 @@ static notrace inline void account_cpu_user_exit(void)
	acct->starttime_user = tb;
	acct->starttime_user = tb;
}
}


static notrace inline void account_stolen_time(void)
{
#ifdef CONFIG_PPC_SPLPAR
	if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
		struct lppaca *lp = local_paca->lppaca_ptr;

		if (unlikely(local_paca->dtl_ridx != be64_to_cpu(lp->dtl_idx)))
			accumulate_stolen_time();
	}
#endif
}


#endif /* __KERNEL__ */
#endif /* __KERNEL__ */
#else /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
#else /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
@@ -96,5 +107,8 @@ static inline void account_cpu_user_entry(void)
static inline void account_cpu_user_exit(void)
static inline void account_cpu_user_exit(void)
{
{
}
}
static notrace inline void account_stolen_time(void)
{
}
#endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
#endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
#endif /* __POWERPC_CPUTIME_H */
#endif /* __POWERPC_CPUTIME_H */
+1 −9
Original line number Original line Diff line number Diff line
@@ -69,15 +69,7 @@ notrace long system_call_exception(long r3, long r4, long r5,


	account_cpu_user_entry();
	account_cpu_user_entry();


#ifdef CONFIG_PPC_SPLPAR
	account_stolen_time();
	if (IS_ENABLED(CONFIG_VIRT_CPU_ACCOUNTING_NATIVE) &&
	    firmware_has_feature(FW_FEATURE_SPLPAR)) {
		struct lppaca *lp = local_paca->lppaca_ptr;

		if (unlikely(local_paca->dtl_ridx != be64_to_cpu(lp->dtl_idx)))
			accumulate_stolen_time();
	}
#endif


	/*
	/*
	 * This is not required for the syscall exit path, but makes the
	 * This is not required for the syscall exit path, but makes the