Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2497244pxb; Tue, 9 Mar 2021 04:11:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJyVsyqA5XwHM6tFn0PEKkIcwvE/Sj/Lx4jiCRTJvZqVZlb+Fm7dZJ7DNACt2ljzyu1Oh0Vh X-Received: by 2002:aa7:c386:: with SMTP id k6mr3633777edq.224.1615291893942; Tue, 09 Mar 2021 04:11:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615291893; cv=none; d=google.com; s=arc-20160816; b=uAyoUni1K75aVRm2Q1b/iwJtqwCEZTaTh+W1F+3pWbuBjT8+ysMV0LLSQkg0oKBwvV cHjviSyhTHf2NQlivC9TOn3DbRICx1py+hKMWHVPkmo3NV84Of+UjH5f+uFBccs5uqCM QV6cwj63WxVgAlBz977rdXu5yC8MVKBB5NWq4UcvdZTM2pADhVQYasj7+y28P/INJ9h5 MKu4Rv1jmNWqN/PTxNLDwIgYGYdk+PE0DjpdeJ5uw6og5H5Eulm3PwwLCT5J8PAxoo2u 2t5sNYJl3WFD5vSzkQiVCyzaGuPJOrYXo/yveV3coPnTZ8dq8o3scAD0xnUgqH7pbX71 oSlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:cc:to:subject:from:references:in-reply-to :message-id; bh=2adKy8h1na41qMuDut0hKPg+Au32OM4yH/zgVfbIOyU=; b=wGOCTf/AJoakXGJPWOLtbAFCoflnVWhCHoOe/9e3gGtWmxucqFphlNmUbIrqo5GFjp frivgGzjV19HIJ4wwlbMpOBiRtsDlbkgUfV6eBG47gHXQXD3C2XWaQ4r7P8BNQRQR0bZ M2KqkaZ+h1MHFIDTNqY36I6ulEDR+OZmE3vtrld8uzk+auJJt76Q1CY4cPNLMtCSuPAe riwPrGTOypo6R8cg4YE7jKw4mnhiv8KgBeMsNWGBGWrhhU2ZI0OrvjKvVFRhvO8ct2Tn 6dfxcJWOLDrimRjirQ+vVp3gTY5mRXzIFTEz5TgU3+o6I7vDsS5GJRrtJ+PFXj87jivr 8/lQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f21si9055776edy.337.2021.03.09.04.11.10; Tue, 09 Mar 2021 04:11:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231265AbhCIMJw (ORCPT + 99 others); Tue, 9 Mar 2021 07:09:52 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:39142 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230391AbhCIMJh (ORCPT ); Tue, 9 Mar 2021 07:09:37 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4DvvCM31KKz9tyjH; Tue, 9 Mar 2021 13:09:35 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id Dd-6LQI-1UZ2; Tue, 9 Mar 2021 13:09:35 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4DvvCM0hdnz9tyjF; Tue, 9 Mar 2021 13:09:35 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 688D48B7FC; Tue, 9 Mar 2021 13:09:36 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id Q2BNzlo41jGJ; Tue, 9 Mar 2021 13:09:36 +0100 (CET) Received: from po16121vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 1F0738B800; Tue, 9 Mar 2021 13:09:36 +0100 (CET) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 03D0067555; Tue, 9 Mar 2021 12:09:36 +0000 (UTC) Message-Id: <28be46386846e1f454c10d7ac63cf986fc0a8193.1615291472.git.christophe.leroy@csgroup.eu> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v2 10/43] powerpc/32: Entry cpu time accounting in C To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , npiggin@gmail.com Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Tue, 9 Mar 2021 12:09:36 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is no need for this to be in asm, use the new interrupt entry wrapper. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/interrupt.h | 3 +++ arch/powerpc/include/asm/ppc_asm.h | 10 ---------- arch/powerpc/kernel/entry_32.S | 1 - 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/include/asm/interrupt.h b/arch/powerpc/include/asm/interrupt.h index b2f69e5dcb50..c35368adbe71 100644 --- a/arch/powerpc/include/asm/interrupt.h +++ b/arch/powerpc/include/asm/interrupt.h @@ -32,6 +32,9 @@ static inline void interrupt_enter_prepare(struct pt_regs *regs, struct interrup #ifdef CONFIG_PPC32 if (!arch_irq_disabled_regs(regs)) trace_hardirqs_off(); + + if (user_mode(regs)) + account_cpu_user_entry(); #endif /* * Book3E reconciles irq soft mask in asm diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h index 3dceb64fc9af..8998122fc7e2 100644 --- a/arch/powerpc/include/asm/ppc_asm.h +++ b/arch/powerpc/include/asm/ppc_asm.h @@ -23,18 +23,8 @@ */ #ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE -#define ACCOUNT_CPU_USER_ENTRY(ptr, ra, rb) #define ACCOUNT_CPU_USER_EXIT(ptr, ra, rb) #else -#define ACCOUNT_CPU_USER_ENTRY(ptr, ra, rb) \ - MFTB(ra); /* get timebase */ \ - PPC_LL rb, ACCOUNT_STARTTIME_USER(ptr); \ - PPC_STL ra, ACCOUNT_STARTTIME(ptr); \ - subf rb,rb,ra; /* subtract start value */ \ - PPC_LL ra, ACCOUNT_USER_TIME(ptr); \ - add ra,ra,rb; /* add on to user time */ \ - PPC_STL ra, ACCOUNT_USER_TIME(ptr); \ - #define ACCOUNT_CPU_USER_EXIT(ptr, ra, rb) \ MFTB(ra); /* get timebase */ \ PPC_LL rb, ACCOUNT_STARTTIME(ptr); \ diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S index 0f18fe14649c..0f3f1bdd909e 100644 --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S @@ -152,7 +152,6 @@ transfer_to_handler: lwz r12,THREAD_DBCR0(r12) andis. r12,r12,DBCR0_IDM@h #endif - ACCOUNT_CPU_USER_ENTRY(r2, r11, r12) #ifdef CONFIG_PPC_BOOK3S_32 kuep_lock r11, r12 #endif -- 2.25.0