Skip to content

Commit 2994e1b

Browse files
npigginmpe
authored andcommitted
powerpc/64: move account_stolen_time into its own function
This will be used by interrupt entry as well. Signed-off-by: Nicholas Piggin <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 75b9695 commit 2994e1b

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

arch/powerpc/include/asm/cputime.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,17 @@ static notrace inline void account_cpu_user_exit(void)
8787
acct->starttime_user = tb;
8888
}
8989

90+
static notrace inline void account_stolen_time(void)
91+
{
92+
#ifdef CONFIG_PPC_SPLPAR
93+
if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
94+
struct lppaca *lp = local_paca->lppaca_ptr;
95+
96+
if (unlikely(local_paca->dtl_ridx != be64_to_cpu(lp->dtl_idx)))
97+
accumulate_stolen_time();
98+
}
99+
#endif
100+
}
90101

91102
#endif /* __KERNEL__ */
92103
#else /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
@@ -96,5 +107,8 @@ static inline void account_cpu_user_entry(void)
96107
static inline void account_cpu_user_exit(void)
97108
{
98109
}
110+
static notrace inline void account_stolen_time(void)
111+
{
112+
}
99113
#endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
100114
#endif /* __POWERPC_CPUTIME_H */

arch/powerpc/kernel/syscall_64.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,7 @@ notrace long system_call_exception(long r3, long r4, long r5,
6969

7070
account_cpu_user_entry();
7171

72-
#ifdef CONFIG_PPC_SPLPAR
73-
if (IS_ENABLED(CONFIG_VIRT_CPU_ACCOUNTING_NATIVE) &&
74-
firmware_has_feature(FW_FEATURE_SPLPAR)) {
75-
struct lppaca *lp = local_paca->lppaca_ptr;
76-
77-
if (unlikely(local_paca->dtl_ridx != be64_to_cpu(lp->dtl_idx)))
78-
accumulate_stolen_time();
79-
}
80-
#endif
72+
account_stolen_time();
8173

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

0 commit comments

Comments
 (0)