Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1669747ybh; Fri, 13 Mar 2020 05:25:20 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt0mwsh7EJZUebNd4oWlVBVO7WjIUOfcNzkDeuUSOxwagglswHMuF5dOaqGvEQwaCfqNIVU X-Received: by 2002:a05:6830:231d:: with SMTP id u29mr10257898ote.1.1584102320277; Fri, 13 Mar 2020 05:25:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584102320; cv=none; d=google.com; s=arc-20160816; b=rqccFx+LnUqCt6UHyv7iICn6a4jqdAUCNZofHq8otAlpcAC8tEcfxKUEi/NilY/Ugk qa7mWDBvNSzU3KZfWfGSQCbZT7YnvyKDzdovjLGMZXdiRIvD0V/eCn9noxjL/AOiPJH6 Fm0ZC1VzEYJAYH9epYgXA0mzk+LBAukEwUBd2oN+HU3ca7qj+Oyg1VHoRvvIj7NCDs2n z5L3MmExTeszKH9iURA74UAlWQp+MGhngdwnoNCeNvQGhsBjCP86rp/XOEIOnclAMrrB B5oaTgEcHYZmlbHWv/qK9j8IOs1Ow1WxlSbM29SwwSWrdaf/yuQfquxnbTItBNAZT0Hc RX7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=gega0lljpDQ5MRXNUs7iQJsUmjqFFFGCpCIsnwWKr0I=; b=Jd6bBOYUtnBZJLa4JLHm1VRyc268djCO8DQe9MMIplhWxS/DUI7MhJBqxPkh9WlmK4 lcemKi2S39HcskBMyX4eNVLQz8/N3QEXhK09B5Shlt4WrDRaMGLZc8HdR5fKClUmg6Z+ 0/D//m/k1hKEmqg9zp4ak9Xr9xcAq3iVaCub4e7VWTEFF+sJShb+DhRCl0rI7zH3SJ9s dkr694ecR9prpKiQTzdQXhm1Q/LU2y4FSy70r4iR1czQi46eT+IqLDLgFoM3MSQRckdR c/7sMEiS9eKL2VErgUN+FpGiB3IZrQIoBqttCdT1IW7JT0zyj/UrmtuQjDYwmxs5ga0o eVDw== 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 m18si4380054otf.196.2020.03.13.05.25.05; Fri, 13 Mar 2020 05:25:20 -0700 (PDT) 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 S1726691AbgCMMYN (ORCPT + 99 others); Fri, 13 Mar 2020 08:24:13 -0400 Received: from mx2.suse.de ([195.135.220.15]:50008 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726461AbgCMMYM (ORCPT ); Fri, 13 Mar 2020 08:24:12 -0400 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 C2197AFD4; Fri, 13 Mar 2020 12:24:10 +0000 (UTC) Date: Fri, 13 Mar 2020 13:24:09 +0100 (CET) From: Miroslav Benes To: Josh Poimboeuf cc: x86@kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Vince Weaver , Dave Jones , Jann Horn , Andy Lutomirski , Steven Rostedt , Thomas Gleixner Subject: Re: [PATCH 10/14] x86/unwind/orc: Prevent unwinding before ORC initialization In-Reply-To: <5b3e0cbab4a5e6cf5e3cab87f18f2ae582ec01d7.1584033751.git.jpoimboe@redhat.com> Message-ID: References: <5b3e0cbab4a5e6cf5e3cab87f18f2ae582ec01d7.1584033751.git.jpoimboe@redhat.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 12 Mar 2020, Josh Poimboeuf wrote: > If the unwinder is called before the ORC data has been initialized, > orc_find() returns NULL, and it tries to fall back to using frame > pointers. This can cause some unexpected warnings during boot. > > Move the 'orc_init' check from orc_find() to __unwind_init(), so that it s/__unwind_init()/__unwind_start()/ > void __unwind_start(struct unwind_state *state, struct task_struct *task, > struct pt_regs *regs, unsigned long *first_frame) > { > + if (!orc_init) > + goto done; > + > memset(state, 0, sizeof(*state)); > state->task = task; Miroslav