Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2124490imu; Tue, 6 Nov 2018 09:23:56 -0800 (PST) X-Google-Smtp-Source: AJdET5eyuYqnCiGlKZkdGo8YjvR30+0nOeSslc/CrpWUb4eyEXaVkiKHqVjka/tb98gU9nZ/84t1 X-Received: by 2002:a17:902:263:: with SMTP id 90-v6mr27094419plc.190.1541525036545; Tue, 06 Nov 2018 09:23:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541525036; cv=none; d=google.com; s=arc-20160816; b=0pQVhNYC8J1BIYeEqtEFg1y2E2nOQKkhDKLQKkKVyD/HdeD0+Oagr1c+3arnsbmsqf 8V09h8GE4mEgKD65sq7d9MJJfl4urjkJHSQHTs1ItJVeOa7N+en3rPzXZ5PExAF1vtJ8 oKOyOqM0B6+Do1HIsimFojf/sv6fk7ZqVwKhC9ekihemMFOILKJzNnOjp9CcjTxKzL6L OuLb2VmUYHQxTywTpxism3BZqv6yLE2AKuny0DJI+WAaa5LbV5RcExJ6DNafX8XWXh0I ssW7FT9Opj6CyhYGrqS1veUxez6kTITi3LQ2dsaCtlC5U7oTYcfWso0V/j8ET6T5Jm4A Zlfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=5uyHgaXaB4SFt7NLJ1P8+p9fRNuSz9USF/hTkruLhb0=; b=WtiZxJFq4KZ6e5w51LqcZcb/HLwrE1k7956Yza+OaorRzhW0M+bpjZGRGOYlZE7WlE zWp+9p29/t4CH4H+lNR01df50pQAE7gOJ88HgacbalJKRfMu6sm51utVztojpv6Fwteq A/FKSM8dCWCnlWIyaxF6RFjJhODPDcyZhi7A5XhQjfAe9/HRhK71iKVznuhwj4ZAEd+/ gnkiWbVBTZoSYcv54DMLlamegF0yknRhSCPvSmxB45J0xHQweYNdSqhGQ+yuOzPS45BF ft8FAjPfK7Ig1jyFttCHDWiw/Jp6Ro9c7HVxde9hhVBlOJX1PT8K9zTNW029+BDHb/d8 m0XA== 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 89-v6si32241835pld.274.2018.11.06.09.23.39; Tue, 06 Nov 2018 09:23:56 -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 S2389600AbeKGCrU (ORCPT + 99 others); Tue, 6 Nov 2018 21:47:20 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:37678 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388987AbeKGCrU (ORCPT ); Tue, 6 Nov 2018 21:47:20 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C61B8A78; Tue, 6 Nov 2018 09:21:07 -0800 (PST) Received: from e107981-ln.cambridge.arm.com (e107981-ln.cambridge.arm.com [10.1.197.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4B7763F5C0; Tue, 6 Nov 2018 09:21:05 -0800 (PST) Date: Tue, 6 Nov 2018 17:21:00 +0000 From: Lorenzo Pieralisi To: Keith Busch Cc: Bjorn Helgaas , Linux PCI , Bjorn Helgaas , Benjamin Herrenschmidt , Sinan Kaya , Thomas Tai , poza@codeaurora.org, Lukas Wunner , Christoph Hellwig , Mika Westerberg , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 00/12] error handling and pciehp maintenance Message-ID: <20181106172100.GA22063@e107981-ln.cambridge.arm.com> References: <20180918235848.26694-1-keith.busch@intel.com> <20181004214015.GK120535@bhelgaas-glaptop.roam.corp.google.com> <20181004221137.GB21834@localhost.localdomain> <20181005173145.GL120535@bhelgaas-glaptop.roam.corp.google.com> <20181008161847.GA30971@localhost.localdomain> <20181106163400.GA21193@e107981-ln.cambridge.arm.com> <20181106164751.GA6217@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181106164751.GA6217@localhost.localdomain> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 06, 2018 at 09:47:52AM -0700, Keith Busch wrote: > On Tue, Nov 06, 2018 at 04:34:08PM +0000, Lorenzo Pieralisi wrote: > > The question is whether we really need to dynamically patch the kernel > > with ftrace to achieve what that patch does. > > > > Furthermore, it would also be good to report what bugs we are actually > > fixing, from what you are writing falling back to the current method if > > !DYNAMIC_FTRACE_WITH_REGS is broken in many ways and I would start with > > fixing the current behaviour with something that does not depend on arch > > features that may not even be implemented. > > There are two problems with the current method: > > 1. It may dereference pci_dev after it was freed > 2. The pci_dev's children inherit its fake pci_bus's ops on > enumeration > > Both result in kernel panic. That's my point, current test module is not robust, I wanted to ask if there is a way to fix it that does not depend on arch features, because if there is a dependency that is not met we are still not fixing the current code, using it as a fallback can still create issues. > The dynamic kernel patch just seemed like a cool way to inject errors > without messing with the driver's structures. But if there's a more > elegant way to do it, I'm all for it. If you have a simple reproducer for the bugs I am happy to help you test it (I can also apply arm64 DYNAMIC_FTRACE_WITH_REGS patches and test that new code path if that's the final direction we are taking). Thanks, Lorenzo