Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3681097ybz; Mon, 4 May 2020 07:45:39 -0700 (PDT) X-Google-Smtp-Source: APiQypK9hAbNgJawqg2VPtc5ggtYo8iYxRHU215Ji+Y5JNoxfDVviWszCqBfp82ikt9i0VghKsyM X-Received: by 2002:a17:907:2719:: with SMTP id w25mr15348035ejk.107.1588603539125; Mon, 04 May 2020 07:45:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588603539; cv=none; d=google.com; s=arc-20160816; b=Q10y0DtVWlX7Zxr9IVYExFxrXpUFkc6EsVzNCFGb8sdIjtj94LY+j7LBWHEZu5hSO0 S09FJmzCX7GDRFiO88es4xSJmMHbYMSLQJZl3pB0NTof7eoMwMZhMLmSo9h6JgldW0Hj d1Pa5V9S2zauV2deLmuPUPUPsIvePBIkp7qoE8taU6cFUcI32eMyEZQ7zECDRDGFZOxx DPC0aYpsDoFDZhpCgdzH5GAvLTg1JKNdgTdOroHWI0SxAb6/tVVxfjA4ct7O3suQkpQ1 cm48rJGVGTQf4FFgQQIoGIiHAbdOGLPQixfegeZKWZEHeWieQ8h85+68S3eXTKl4paKF QmoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=IRCeHkqSilUjU3FHunFBHRyW1Y2SXfHm0MWEUqYs4/A=; b=QqEB3DSkGoPe4Z3r6LtI9uYpBZnAZlfWfj4Wp+vh++3vwVJ3IR+eru9rpTorYLBk0y VWa/fPpL1te4BeUWZER5eMcOFTZ2sTv4fKZ67iGZY4W5dy8NlPeUUcSSGx3eQDwJcka0 sz1IzOhUcEr1gp1atwhiWm6ePEGktuHHN55CbxNalkwMFVEOH66NGXQxl0dHz7nTWIus y1opkidi4VcC+pi1a9nVOh1rgbAymkhBMZjsFJgMMD7M0WkAhLXclUy2o6jk1iTvWIjh 9gyyggk82UdSJXGra1Rce1syn4+ii6JSAI30ByR6jHhXY8zJVDT18sJKj6fGwPDrw9h7 WaQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xcitaMAX; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c13si7159233edq.97.2020.05.04.07.45.16; Mon, 04 May 2020 07:45:39 -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=@linaro.org header.s=google header.b=xcitaMAX; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729214AbgEDOnL (ORCPT + 99 others); Mon, 4 May 2020 10:43:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728802AbgEDOnL (ORCPT ); Mon, 4 May 2020 10:43:11 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2E9CC061A0F for ; Mon, 4 May 2020 07:43:10 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id f13so21226259wrm.13 for ; Mon, 04 May 2020 07:43:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=IRCeHkqSilUjU3FHunFBHRyW1Y2SXfHm0MWEUqYs4/A=; b=xcitaMAX9gw+29GendB+8mdnWfteLl6Rm11E72yMhQbVlvTkMInBBYhb4kQT/E0Ee2 RpgEOuBQ9xT8A4YL7gTNTKJ5zh+TWrGPNuLh64057pVrkt7H7DWcmVQrKFXjQeDH3Z1G YCFsMQC8kQ9CMB/oF2OxkJCUhr8/5PDqbAhJ4ks+5YxBltonIWm/PSuzLJD4lbO5C8/X IVOJFT4D78B16tVPI1OguBr0sC8OyIjijzRgZWEz0zkNTW/iglAwowEqku4oyIjAVbwL ownV/fwyJUskK7lI4VXncd03/fUtqP6ly+MFZn69UW2qU+OO761P5e16fgXuwmKiQawd 5f1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=IRCeHkqSilUjU3FHunFBHRyW1Y2SXfHm0MWEUqYs4/A=; b=J/aNrP9B6rn/lWJExIHTwymaAtVkahgFgdRs0ZDaW72xAWPhhx92R5Jp8llXbkkUTa F+zFsQrO52mg45tqAGPmVJ79szGFina4JF81Jgp5Qz4iCjzhwpAmu1niSH3FBJMmHf4E L7MVgV6d/40MNWxE5/F5sUG9ewF9yeUdA//teHknBy4LbjwaW3tpf608NiNPGKfg2l+V yG3i8CHo88HakNUpU3UGEF3EMfw80zgGyJoDtWfOpFT7hrBwQ87zT7G4qoPilhJ2gIy1 i+DeWF5WGrc9+1/p4CB7sxbpgvhQZs9zpnXKuzuHRa/ONkN+2KbR9GKTk7pxNzam4GDq 1+5A== X-Gm-Message-State: AGi0PubUtAk1bfaLrnCpeT+5DV6eq4ZMmvnBXTWXsvslCae7Z0PZSgnL W+o1Q2+p10rcW1x7wxYIxtRS6Q== X-Received: by 2002:a5d:658c:: with SMTP id q12mr21086345wru.128.1588603388730; Mon, 04 May 2020 07:43:08 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id t17sm18896607wro.2.2020.05.04.07.43.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2020 07:43:08 -0700 (PDT) Date: Mon, 4 May 2020 15:43:06 +0100 From: Daniel Thompson To: Doug Anderson Cc: x86@kernel.org, Catalin Marinas , Andrew Morton , Jonathan Corbet , kgdb-bugreport@lists.sourceforge.net, Jason Wessel , "H. Peter Anvin" , LKML , Krzysztof Kozlowski , Bjorn Andersson , Andy Gross , bp@alien8.de, linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Thomas Gleixner , Will Deacon , Ingo Molnar Subject: Re: [Kgdb-bugreport] [PATCH v3 04/11] kgdb: Delay "kgdbwait" to dbg_late_init() by default Message-ID: <20200504144306.zwac2jdlltvhekqm@holly.lan> References: <20200428211351.85055-1-dianders@chromium.org> <20200428141218.v3.4.I3113aea1b08d8ce36dc3720209392ae8b815201b@changeid> <20200430154927.vhkhoffqwirb2fmm@holly.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 30, 2020 at 09:35:30AM -0700, Doug Anderson wrote: > Hi, > > On Thu, Apr 30, 2020 at 8:49 AM Daniel Thompson > wrote: > > > > On Tue, Apr 28, 2020 at 02:13:44PM -0700, Douglas Anderson wrote: > > > Using kgdb requires at least some level of architecture-level > > > initialization. If nothing else, it relies on the architecture to > > > pass breakpoints / crashes onto kgdb. > > > > > > On some architectures this all works super early, specifically it > > > starts working at some point in time before Linux parses > > > early_params's. On other architectures it doesn't. A survey of a few > > > platforms: > > > > > > a) x86: Presumably it all works early since "ekgdboc" is documented to > > > work here. > > > b) arm64: Catching crashes works; with a simple patch breakpoints can > > > also be made to work. > > > c) arm: Nothing in kgdb works until > > > paging_init() -> devicemaps_init() -> early_trap_init() > > > > > > Let's be conservative and, by default, process "kgdbwait" (which tells > > > the kernel to drop into the debugger ASAP at boot) a bit later at > > > dbg_late_init() time. If an architecture has tested it and wants to > > > re-enable super early debugging, they can select the > > > ARCH_HAS_EARLY_DEBUG KConfig option. We'll do this for x86 to start. > > > It should be noted that dbg_late_init() is still called quite early in > > > the system. > > > > > > Note that this patch doesn't affect when kgdb runs its init. If kgdb > > > is set to initialize early it will still initialize when parsing > > > early_param's. This patch _only_ inhibits the initial breakpoint from > > > "kgdbwait". This means: > > > > > > * Without any extra patches arm64 platforms will at least catch > > > crashes after kgdb inits. > > > * arm platforms will catch crashes (and could handle a hardcoded > > > kgdb_breakpoint()) any time after early_trap_init() runs, even > > > before dbg_late_init(). > > > > > > Signed-off-by: Douglas Anderson > > > Cc: Thomas Gleixner > > > Cc: Ingo Molnar > > > Cc: Borislav Petkov > > > Reviewed-by: Greg Kroah-Hartman > > > > It looks like this patch is triggering some warnings from the existing > > defconfigs (both x86 and arm64). It looks like this: > > > > --- > > wychelm$ make defconfig > > GEN Makefile > > *** Default configuration is based on 'x86_64_defconfig' > > > > WARNING: unmet direct dependencies detected for ARCH_HAS_EARLY_DEBUG > > Depends on [n]: KGDB [=n] > > Selected by [y]: > > - X86 [=y] > > > > WARNING: unmet direct dependencies detected for ARCH_HAS_EARLY_DEBUG > > Depends on [n]: KGDB [=n] > > Selected by [y]: > > - X86 [=y] > > Ah, thanks! I hadn't noticed those. I think it'd be easy to just > change the relevant patches to just "select ARCH_HAS_EARLY_DEBUG if > KGDB". If you agree that's a good fix and are willing, I'd be happy > if you just added it to the relevant patches when applying. If not, I > can post a v4. Happy with the approach to fix this. Given the follow on discussion from the end of last week I suspect there probably needs to be a v4 anyway so perhaps the last question is applying a fix up is moot at this point? Daniel.