Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp336596pxb; Mon, 16 Aug 2021 06:36:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeU4EAoet9J66kMcV0ihXSu2fuG8/amtp1fH2oe9ccEdfdJ4lucBhGpkUXnhWRTu3f9pnF X-Received: by 2002:a17:906:c085:: with SMTP id f5mr16439432ejz.250.1629120976455; Mon, 16 Aug 2021 06:36:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629120976; cv=none; d=google.com; s=arc-20160816; b=M2bklphXM71aZ+wX9SUCej+ZJlHA8iPQC/kGvyhP3T7iwKQ+8p2ShUAH4qfAlk1Ir8 TCcFf7FPA4AmwxRumM6Xeik9gLLAIp4rkZ3Z0v/DGTizlpg1Vv9gWU4lEHMPJCQ1uoT9 r0LzSP0YLJCQzGxkEWB30/j2swP2r9h6yVLYgOSdqgrhz4gA2RBRrD73BWQAgZrAthhe kK4t/5p5QoosnqEvGP1Is8Dqu/JmNoXN70txVw3upxCPw9bYmsWuvEnpLHDNI8h805UT 4QsWeC+6Ou9bRl0NqY/IBgQ8hdIudAUreq+Ah/o3DV0QDj8rvvc15OxdGE4srtIEiHAL qqOA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kpmxcgsVeZbOg/18dtpv37Kufbs0zqGzU+EpdWKdmv4=; b=GETidshOKWxipjSqbwhGE/zLxQV1JSQc+8WtwLy3mh71LIjpJMkfV06c62+inhMG1F jKQxkKqNE2LVK9+lBb6D0dBZl10tlDiCL70b/lhiKJricPirEDnLp/iVUgnVo3FABu7E COYK9fNl9qgH45fdobMicZNomYnkcxmCWvMLM3VE28XRHvkcvJf2MQyQ+XHOs2ItJsPL U1RxbOKWqojJWGorIcTYLpVtZDo93hB1ERz07ibALYtdts1zqSDTFnWDujbqWDFx/HsQ 3s+VQ75eSppoCBiJM5aB8s8ZUxqaVLgmkCQIL3kkup5Qq1AVT22vCe9OsZhiwcWlj3zj TLIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FVStAgEB; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l3si12327493ejd.313.2021.08.16.06.35.53; Mon, 16 Aug 2021 06:36:16 -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=@linuxfoundation.org header.s=korg header.b=FVStAgEB; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240400AbhHPNcw (ORCPT + 99 others); Mon, 16 Aug 2021 09:32:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:43352 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239174AbhHPNUk (ORCPT ); Mon, 16 Aug 2021 09:20:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 313CD610E8; Mon, 16 Aug 2021 13:16:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1629119775; bh=lxOA3aSuWyHKSpNa7tRacuT9qo1x35lqn6tdw+aPyC4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FVStAgEBeNsRfub8rGSwFA7oupE+U4P+uALcq3Kn3zNlSAHiWPTRIaTxZsxiMcHLK RI098OzvupSjyeuEzyjCfN+W3Zpht9NCv7tQNiI1qYbNpmTCs55UeIcGhEpDrgGzrV 669hyGxz6x/P8eIYo7qlGQXioXGDqqfgkSs+DmhQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe Leroy , Nicholas Piggin , Michael Ellerman Subject: [PATCH 5.13 136/151] powerpc/interrupt: Do not call single_step_exception() from other exceptions Date: Mon, 16 Aug 2021 15:02:46 +0200 Message-Id: <20210816125448.532135780@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210816125444.082226187@linuxfoundation.org> References: <20210816125444.082226187@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe Leroy commit 01fcac8e4dfc112f420dcaeb70056a74e326cacf upstream. single_step_exception() is called by emulate_single_step() which is called from (at least) alignment exception() handler and program_check_exception() handler. Redefine it as a regular __single_step_exception() which is called by both single_step_exception() handler and emulate_single_step() function. Fixes: 3a96570ffceb ("powerpc: convert interrupt handlers to use wrappers") Cc: stable@vger.kernel.org # v5.12+ Signed-off-by: Christophe Leroy Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/aed174f5cbc06f2cf95233c071d8aac948e46043.1628611921.git.christophe.leroy@csgroup.eu Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/traps.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c @@ -1103,7 +1103,7 @@ DEFINE_INTERRUPT_HANDLER(RunModeExceptio _exception(SIGTRAP, regs, TRAP_UNK, 0); } -DEFINE_INTERRUPT_HANDLER(single_step_exception) +static void __single_step_exception(struct pt_regs *regs) { clear_single_step(regs); clear_br_trace(regs); @@ -1120,6 +1120,11 @@ DEFINE_INTERRUPT_HANDLER(single_step_exc _exception(SIGTRAP, regs, TRAP_TRACE, regs->nip); } +DEFINE_INTERRUPT_HANDLER(single_step_exception) +{ + __single_step_exception(regs); +} + /* * After we have successfully emulated an instruction, we have to * check if the instruction was being single-stepped, and if so, @@ -1129,7 +1134,7 @@ DEFINE_INTERRUPT_HANDLER(single_step_exc static void emulate_single_step(struct pt_regs *regs) { if (single_stepping(regs)) - single_step_exception(regs); + __single_step_exception(regs); } static inline int __parse_fpscr(unsigned long fpscr)