Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4465364ybf; Wed, 4 Mar 2020 04:35:00 -0800 (PST) X-Google-Smtp-Source: ADFU+vuaeaPE0YK0IraYMAgv4K8bslJ44Nq32N54ol2HMqGlvlQVsfK96o99Edlk8so8M/vmdu2s X-Received: by 2002:a05:6830:1290:: with SMTP id z16mr2243369otp.231.1583325300490; Wed, 04 Mar 2020 04:35:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583325300; cv=none; d=google.com; s=arc-20160816; b=E+qpnpelRJdn9v9Z7zPbLPW9iZQG1q4OeLDDQu5TipO4L284ib2qw+qvXpG+Q6bnTT EICy5CkiA5K62PrC2EYJNg5UYzwj2jpw9Zm5DjfzdW/9F76cUgypozFEF8rA+cd3M/31 sTGQwZ3jANUqnjsoCz7LNvLvsaqMtAi7F+pvOOKX0A3MV9NbkQ+Q04O69ksh7bCNfnkq 6v1+AQKR7z+F2bwRfXZ0OX8ELtBNZ/2ZlWH8udyyTL5S9vpvYxttNM5ghEipJsHTfTxa wF1YiiUy851KDc2Zr0/WBJ8dRlErPKeYn/uUb5dcgMSvmRPM99x9a9iRJMG8yr1s6bf8 NrpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=MV9P7eAoHWgB4huZ4oxWUiKX6GyE5yEduVvjTIl/Luw=; b=dhUGLw40AiFdU/r2ldw+KCcFzk6kehFzG+YMX5a7geE0NjtGt0JO/q0FVe3PK/qf4S IzyeTTJcNogmRDTsxpZ7sjriOPiJfIyu7PPrtiR27t4ry13id/rYLAO+WuvjBGo+97ic Hkg/vUEatLdzvP/PotWCOH/QJhqaQ+JWzSwEZHLACvJpeyxqwlgKJXMcn7wRpmI6EW3q TvpQbMMwzA4T66mq+Lpx9PT94Mhom3u+vdMtklCrqtURhGDaL/uF6krGTY/GAu5udf6m VLo+9x/OIOFgSVKEvv9QfqK1yhOYBjhYLqVTcJw22XsZyvbG/5uZjs62V/HVIzEVayLe 4kyw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e81si968995ote.13.2020.03.04.04.34.48; Wed, 04 Mar 2020 04:35:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388043AbgCDMdE (ORCPT + 99 others); Wed, 4 Mar 2020 07:33:04 -0500 Received: from mx2.suse.de ([195.135.220.15]:44966 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387776AbgCDMdE (ORCPT ); Wed, 4 Mar 2020 07:33:04 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 7AE1EB2BB; Wed, 4 Mar 2020 12:33:02 +0000 (UTC) From: Miroslav Benes To: jpoimboe@redhat.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de Cc: hpa@zytor.com, linux-kernel@vger.kernel.org, x86@kernel.org, Miroslav Benes Subject: [PATCH] x86/unwind/orc: Do not skip the first frame unless explicitly asked for Date: Wed, 4 Mar 2020 13:32:59 +0100 Message-Id: <20200304123259.32199-1-mbenes@suse.cz> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ORC unwinder can currently skip the first frame even if a user does not ask for it. If both regs and first_frame parameters of unwind_start() are set to NULL, state->sp and first_frame are later initialized to the same value for an inactive task. Given there is "less than or equal to" comparison used at the end of __unwind_start() for skipping stack frames, the first frame is always skipped in this case. Drop the equal part of the comparison and make it equivalent to the frame pointer unwinder. Signed-off-by: Miroslav Benes --- arch/x86/kernel/unwind_orc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c index e9cc182aa97e..8452518cc20a 100644 --- a/arch/x86/kernel/unwind_orc.c +++ b/arch/x86/kernel/unwind_orc.c @@ -651,7 +651,7 @@ void __unwind_start(struct unwind_state *state, struct task_struct *task, /* Otherwise, skip ahead to the user-specified starting frame: */ while (!unwind_done(state) && (!on_stack(&state->stack_info, first_frame, sizeof(long)) || - state->sp <= (unsigned long)first_frame)) + state->sp < (unsigned long)first_frame)) unwind_next_frame(state); return; -- 2.25.1