Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3029237ybi; Tue, 2 Jul 2019 00:43:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8EfhOX9UHvjPLpMhAgq+ju+98fhGuVDf4JLsrOHHKSOuPHZTUD8rBIcOjLvtlLL01Kcp9 X-Received: by 2002:a17:902:9688:: with SMTP id n8mr32883133plp.227.1562053411873; Tue, 02 Jul 2019 00:43:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562053411; cv=none; d=google.com; s=arc-20160816; b=UoiQIXDW8th38MH5ynCG58I8BV00Mmw6Ke+BaEI7fMR+P1yUYgx8xGxTyZSE5YBFv+ itJQwWCvNQfUnERGzqZdQP4oNvmPIGLx7yxoMVVqziPD4lYpdLNTKJ6XLpz5nxZ4xaSj 265Rdq8m9w/5HvG4y8YrJzPmUYnQ44ntTrXiHdyC0TiKKGJlGp4w5KL6QhrPFWeXR4qe CBEy6L6D48/5zvFfrlp9M1rnju+Mg/O4r5m/5bqti2+59Hzyr1c4gt+2owjAU/uryW64 c5DlJxANGGmC3x0MZuX6m4GLg6w9Y+PeEnPxnYOL0fKlmaNlhmh+8ZiBYt7rCmIdMp1a //tQ== 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=Wbmg+8w2lli3nUUDpeIwzY07aP10z8eOaIvsPs6lxw0=; b=KrO5K4v6uBhoPnvT10SWKNtw+MK92oG58X9cfIvvJgjhoNXcJOAhyXomNWmssBotxS rGzGFCblUvi8V3wzSlPfzodYiSMlhY2sAziZBtmQhQz19AZ76F3km3MGX9X+EWKHw/Du LMlLdcPzvOooOA405JPcJiIlKXEMqgTwf6aXEfEzPOh1efnMoJDCREuTqchQsf7l/w4B HDXOtW54An94eyJwwZ8/M11VhqGbaK9g7YTAR8b++lrEQGjzxuil36mMpkx2kzh7OE8I Oyqk1flOXlexTLsMw1AOc7cWWMS5p1gqX2KiMNFZASZmydcqh5F4HoOlcLeye6M6+jy5 1c/A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j187si3351126pge.591.2019.07.02.00.43.16; Tue, 02 Jul 2019 00:43:31 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725972AbfGBHm4 (ORCPT + 99 others); Tue, 2 Jul 2019 03:42:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28180 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725851AbfGBHm4 (ORCPT ); Tue, 2 Jul 2019 03:42:56 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C5270356D3; Tue, 2 Jul 2019 07:42:55 +0000 (UTC) Received: from localhost.localdomain (ovpn-12-129.pek2.redhat.com [10.72.12.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 016915D9D6; Tue, 2 Jul 2019 07:42:50 +0000 (UTC) Date: Tue, 2 Jul 2019 15:42:46 +0800 From: Dave Young To: Baoquan He Cc: David Airlie , kexec@lists.infradead.org, x86@kernel.org, linux-kernel , Lyude Paul Subject: Re: mgag200 fails kdump kernel booting Message-ID: <20190702074246.GB16436@localhost.localdomain> References: <20190626081522.GX24419@MiWiFi-R3L-srv> <20190626082907.GY24419@MiWiFi-R3L-srv> <20190702014158.GC3178@localhost.localdomain> <20190702031715.GB3327@dhcp-128-65.nay.redhat.com> <20190702053443.GE3178@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190702053443.GE3178@localhost.localdomain> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 02 Jul 2019 07:42:55 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/02/19 at 01:34pm, Baoquan He wrote: > On 07/02/19 at 11:17am, Dave Young wrote: > > On 07/02/19 at 09:41am, Baoquan He wrote: > > > On 07/02/19 at 06:51am, David Airlie wrote: > > > > On Wed, Jun 26, 2019 at 6:29 PM Baoquan He wrote: > > > > > > > > > > On 06/26/19 at 04:15pm, Baoquan He wrote: > > > > > > Hi Dave, > > > > > > > > > > > > We met an kdump kernel boot failure on a lenovo system. Kdump kernel > > > > > > failed to boot, but just reset to firmware to reboot system. And nothing > > > > > > is printed out. > > > > > > > > > > > > The machine is a big server, with 6T memory and many cpu, its graphic > > > > > > driver module is mgag200. > > > > > > > > > > > > When added 'earlyprintk=ttyS0' into kernel command line, it printed > > > > > > out only one line to console during kdump kernel booting: > > > > > > KASLR disabled: 'nokaslr' on cmdline. > > > > > > > > > > > > Then reset to firmware to reboot system. > > > > > > > > > > > > By further code debugging, the failure happened in > > > > > > arch/x86/boot/compressed/misc.c, during kernel decompressing stage. It's > > > > > > triggered by the vga printing. As you can see, in __putstr() of > > > > > > arch/x86/boot/compressed/misc.c, the code checks if earlyprintk= is > > > > > > specified, and print out to the target. And no matter if earlyprintk= is > > > > > > added or not, it will print to VGA. And printing to VGA caused it to > > > > > > reset to firmware. That's why we see nothing when didn't specify > > > > > > earlyprintk=, but see only one line of printing about the 'KASLR > > > > > > disabled'. > > > > > > > > > > Here I mean: > > > > > That's why we see nothing when didn't specify earlyprintk=, but see only > > > > > one line of printing about the 'KASLR disabled' message when > > > > > earlyprintk=ttyS0 added. > > > > > > > > Just to clarify, the original kernel is booted with mgag200 turned > > > > off, then kexec works, but if the original kernel loads mgag200, the > > > > kexec kernels resets hard when the VGA is used to write stuff out. > > > > > > Thanks for looking into this, Dave. > > > > > > Yeah, in fact the issue was found in kdump kernel. I haven't checked the > > > kexec jumping. Kexec jumping will call device_shutdown() to attempt to > > > shutdown all devices before jumping to the 2nd kernel. But kdump jumping > > > won't. > > > > > > > > > > > This *might* be fixable in the controlled kexec case, but having an > > > > mgag200 shutdown path that tries to put the gpu back into a state > > > > where VGA doesn't die, but for the uncontrolled kexec it'll still be a > > > > problem, since once the gpu is up and running and VGA is disabled, it > > > > doesn't expect to see anymore VGA transactions. > > > > > > Yes, I see. It should have been shutdown by device_shutdown() in kexec > > > case. The uncontrolled case, I guess you mean the kdump case. In > > > kdump case, we don't call device_shutdown() before jumping because the > > > 1st kernel has been in crashed state, we just want to switch to kdump > > > kernel asap. So wondering how other GPU/VGA device/driver bebahve, > > > currently haven't got report about them. Probably mgag200 is very new, > > > or we may not meet them. This issue was met on a new bought server. > > > > I assumed the vga writing only take effect when earlyprintk is provided. > > eg. earlyprintk=ttyS0, then x86 early decompress code will write to both > > vga and ttyS0. So if one does not use earlyprintk, he/she still get > > nothing. But if one provides earlyprintk, then he/she should provide a > > correct param he want, instead of blindly assume kernel will write to > > vga even if he use ttyS0. > > No, the vga printing takes effect always, otherwise those warn() and > error() won't work. It takes effect no matter if CONFIG_EARLY_PRINTK > is enabled, and if any earlyprintk= specified. > > That's why I prefer to pursuit fix in driver side. It's making the > error/warn print out even though nothing specific needed, that's make > sense to me. Ok, thanks for explanation. A driver fix is better.