Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp211441pxb; Mon, 25 Oct 2021 06:53:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnPxYcseF/VfuJsBP4Ue6bXsx92ianpx/Zkd/ODMbSWUIPWWTk988xk+mCxo6/IU8A7Seb X-Received: by 2002:a63:618d:: with SMTP id v135mr6364975pgb.79.1635170006973; Mon, 25 Oct 2021 06:53:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635170006; cv=none; d=google.com; s=arc-20160816; b=uC3twCwwHNLAmlvI84IIDfyfoyjgzUkWZ9CmcZUXs3uXdy68pbRjE08UGmFR2KyT28 Sy6/VQ++vBahv4meB46YdmJYf1YNXLjqw/JUe41F+GIERf7AHG3j/s4AF5PeTe2KUFV2 5kACyyGNGfuPN8EIQ1M7gRfpU/DcW7kF4pvMyd8Td7Fjd/S6CE/RlfeoN9DXSl2eRvxg eBwJZ9G2BNR//kVpn+N6WzDI4tXpeqxJPwMj+4WBPCf3PvjCxkYZtVEdkt2T28JRxgLU V2Z3P2FsbGLEuKPmZxeAU0JfplxtJmajRwCW2vwDyzNvj0XTu+0BoK3a6RppwsJKfj67 piTg== 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=uVvKOGsmbN2YJt4XBXUMVdStleaVLNbNk/bXv68hPKk=; b=dVvVyXZUTI7Dfd9Ju1Je5ltIUVkRy21Y5jb8Z2jm8JhTPdtCgYS+0Z1pOXmPPWZe/9 uEH4Qd6+4AjpKa3PN9T2yMwWAkq2Tbykynx6zm3OLWXOJIYOuXTkfZQOZS+f9ByE6R99 yeHcwl5iiizdgpCc/u7HCgktZHf3zZcA6H8nYI71Sa248lLLCBzjRhwOjYmky7X1sION d1dNTRJqDj/B8a/03G5wARwoZanerVj2jYC5cnTO1TGEiFzFEkk4d4F8sES/DnR1CaTH jQz3GMRWMvjJArxLWoGgJtE53OeGgbc1U3p6ze+PelW2FmIq15oZF5uWVWLavoe8Z7Md BX7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NTs54pfL; 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 g18si26413113pfv.146.2021.10.25.06.53.12; Mon, 25 Oct 2021 06:53:26 -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=NTs54pfL; 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 S233219AbhJYMXp (ORCPT + 99 others); Mon, 25 Oct 2021 08:23:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:59168 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233134AbhJYMXk (ORCPT ); Mon, 25 Oct 2021 08:23:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 44AD360C49; Mon, 25 Oct 2021 12:21:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635164478; bh=Tt/i7iD6xlaQxTtA4XyxsrDmMQUJyDa5EIEEzXszjC8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NTs54pfLiCkVwnQBpW2gvPRcrw+reXceRHh+XizOkcA7+ilAmJtWE5PKLw7+/9OPi hpSPvRw4pNJPtFXEB6t/kOKOpMjeLko5aGHtLLFEQpoSLo4SUhRQRbKNO7NjMvVY46 E6Qm40RARzphR+kRY2iPUvx2NvHI62Xx/sB5ePj+g0RWn83IXRbqmEtkv0wBOLNDUl AcUEx8Fo8+m1N33+Vyzil/Omj9daKxd7CaUEtudpVLq2haF+u4Q7zGIvFZTOX2Yi38 lb/97MqQtS3c+5LG3TYmV/y1OZDxOoQIEiPsYs+esUPuJLFP9606YmY+dfXFFbe+N+ sez4h2Di1NFdQ== From: Frederic Weisbecker To: Peter Zijlstra , Ard Biesheuvel Cc: LKML , Frederic Weisbecker , James Morse , David Laight , Quentin Perret , Catalin Marinas , Will Deacon , Mark Rutland Subject: [PATCH 4/4] arm64: Implement HAVE_PREEMPT_DYNAMIC Date: Mon, 25 Oct 2021 14:21:02 +0200 Message-Id: <20211025122102.46089-5-frederic@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211025122102.46089-1-frederic@kernel.org> References: <20211025122102.46089-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 Cc: David Laight --- 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 34b175b1e247..24915ca7d6d5 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