Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2380187pxb; Mon, 20 Sep 2021 20:48:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzamWVCEiO4LJ1IosO0e2QbXq7gepLojnFhBNuTcFyC38uSgFEABhA5aM5zzVGda+mQ1Vqw X-Received: by 2002:a50:aa9c:: with SMTP id q28mr32454154edc.199.1632196105220; Mon, 20 Sep 2021 20:48:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632196105; cv=none; d=google.com; s=arc-20160816; b=HNsJqPFxLLwKsosl+NmdntnJVwQJntwoYFf3iBUjOh2erRTfolJAcZHgOdKaRxdC2A s4lvbpw0rAE5/wWqxFhVb1Atn5+KMsl0pEu3hZpYM6MrV49BYj//dKAg72yQ94KOKCSO Dr5eo14WhzyB9g+SO3ZIjbuRZiBHl6rFom5Q2u8iVrxDMnogKP9KwwxeuDwNecsA5if5 ULysCHcbJFbUP6cCwZxaaVls+gUmex2b4aruK30gqgEPy9ECEVHu9szDhiqPdREROZMQ +leoQ3ozQ+I1on00ZKdZDJ2kGHB1jGIkueG94zNRlXMvh7ZJ12WMcxraXbFESRGCoADZ OTmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LVZ8JIzw2S0Mx0HHKSj/pWYG9s/NK0QInUhvA3G5KhM=; b=YDldFbr0gHoINvcdAZNVsKtk/s4MVEJqbz0ZDj5dV83OamfJhaUg598e8zI9yRrx0e UxNW4Rcu5R1QLzAoFrMq9g+8NkF4OiiapMAdJs2N+c6r0D31NxP41zZ7KucCixR5P1xI IwJjFWvrPMDpYIG2cm7/EzFeH9YZA9Epa0Dn7qgIZ410Q0sNaaEd3vUCBchRAItP46qH 6yNKTgai4kbKGSRB9XdmjU7OMSY6DRrxSOG/wDK5yCua+2ebTw8Uevhe7zaT6OOHRlXz LRIjuz3UMy4debPy8yctatYvOMFcZdH9YXE0unUuEBxGC0nojOZTDYCU9aK9GAFFKdan dZ8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GUfBxK5v; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si3782030eds.72.2021.09.20.20.48.01; Mon, 20 Sep 2021 20:48:25 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GUfBxK5v; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245513AbhITXjr (ORCPT + 99 others); Mon, 20 Sep 2021 19:39:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:46998 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239852AbhITXhh (ORCPT ); Mon, 20 Sep 2021 19:37:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E2D356128E; Mon, 20 Sep 2021 23:32:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632180772; bh=i26PstLc95ziXClQ5RoK+ExK60AsHTyUGJvC+QiRy/c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GUfBxK5vCmL92p329EH00TPob+dL918GbcGmWQoa4Iga/S2QaGjEzyZihyR9hkFmT e3ZvxetMbvRBq/5/quYgesvqsB1d3XFM9MUR+4Ly5Naql9QZsHoQvXLjUFXIrbe/eZ 086JtdOF20sl+XvmTuNQru0qzA7VLJchAv4HziAsifjIP3QCyanU+MFr4AFUC/ByPV n3X0UT0d3tAYMGmyzlJ286ZyeaMeoR9tNeFl23DbiPL1hz67W4FOo6VUHX6mqlNZdY dUxkFN36FiKYORjJQe6qVNLzT1NGGQ2DJkO6pOmr2q5EdMINZWmE/ytfblTvKFd0W5 4huRF+Lr7UX2Q== From: Frederic Weisbecker To: Peter Zijlstra , Catalin Marinas , Will Deacon Cc: LKML , Frederic Weisbecker , Ard Biesheuvel , James Morse , Quentin Perret , Mark Rutland Subject: [PATCH 4/4] arm64: Implement HAVE_PREEMPT_DYNAMIC Date: Tue, 21 Sep 2021 01:32:37 +0200 Message-Id: <20210920233237.90463-5-frederic@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210920233237.90463-1-frederic@kernel.org> References: <20210920233237.90463-1-frederic@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Provide the static calls for the common preemption points and report arm64 ability to support dynamic preemption. Signed-off-by: Frederic Weisbecker Cc: Mark Rutland Cc: Quentin Perret Cc: Peter Zijlstra Cc: Catalin Marinas Cc: James Morse Cc: Will Deacon Cc: Ard Biesheuvel --- arch/arm64/Kconfig | 1 + arch/arm64/include/asm/preempt.h | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 5b51b359ccda..e28bcca8954c 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -191,6 +191,7 @@ config ARM64 select HAVE_PERF_EVENTS select HAVE_PERF_REGS select HAVE_PERF_USER_STACK_DUMP + select HAVE_PREEMPT_DYNAMIC select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_STATIC_CALL select HAVE_FUNCTION_ARG_ACCESS_API diff --git a/arch/arm64/include/asm/preempt.h b/arch/arm64/include/asm/preempt.h index 4fbbe644532f..69d1cc491d3b 100644 --- a/arch/arm64/include/asm/preempt.h +++ b/arch/arm64/include/asm/preempt.h @@ -82,15 +82,29 @@ static inline bool should_resched(int preempt_offset) #ifdef CONFIG_PREEMPTION void preempt_schedule(void); -#define __preempt_schedule() preempt_schedule() void preempt_schedule_notrace(void); -#define __preempt_schedule_notrace() preempt_schedule_notrace() -#endif /* CONFIG_PREEMPTION */ #ifdef CONFIG_PREEMPT_DYNAMIC + +#define __preempt_schedule_func preempt_schedule +DECLARE_STATIC_CALL(preempt_schedule, __preempt_schedule_func); +#define __preempt_schedule() static_call(preempt_schedule)() + +#define __preempt_schedule_notrace_func preempt_schedule_notrace +DECLARE_STATIC_CALL(preempt_schedule_notrace, __preempt_schedule_notrace_func); +#define __preempt_schedule_notrace() static_call(preempt_schedule_notrace)() + void arm64_preempt_schedule_irq(void); #define __irqentry_exit_cond_resched_func arm64_preempt_schedule_irq DECLARE_STATIC_CALL(irqentry_exit_cond_resched, __irqentry_exit_cond_resched_func); + +#else /* !CONFIG_PREEMPT_DYNAMIC */ + +#define __preempt_schedule() preempt_schedule() +#define __preempt_schedule_notrace() preempt_schedule_notrace() + #endif /* CONFIG_PREEMPT_DYNAMIC */ +#endif /* CONFIG_PREEMPTION */ + #endif /* __ASM_PREEMPT_H */ -- 2.25.1