Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6980834ybi; Thu, 1 Aug 2019 01:21:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqy74GiO9A/rSfoQEq54bg0Thjc4fRwTE+5Dk/k2V/fZt9IUMcuZJrVG3fgAedO738l6oL/k X-Received: by 2002:a63:2a08:: with SMTP id q8mr85530110pgq.415.1564647702543; Thu, 01 Aug 2019 01:21:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564647702; cv=none; d=google.com; s=arc-20160816; b=JRUlKC7dLSPzAbOkBDJ8qFeZso8Whfnd94ZNSmN+ZxIKRBvupV2GvA9gfJ2czI7w7B 0tFRt8qvHgE4xCJZsaZJVOnbO8wci8vtKuXpzCxKg9SHUPn54tWL4suiLQBc2i5ZkMib zDA1Q7A8//T1db+w2UpebhL82VkmDYxkBXSb6r+2b0lY8Qwen6tmKZJkaGuDeaNtavXH o/apha5hnnip8oDFmn4OV5UKrpS8AlkZXr9y5CzWIgwK/o3U+c4YXlG09pn1mWF/Kk9t akjuPY7wikolqkK1Rv3vkfnKb/Ph0zwYyFYvzrlgaiPDvQ8mBo1AQAYzRv7CUPAu15aN A+ew== 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=AidWA9k20RFaAOEbNyGey9L1VIMt5p5rsukj5Gf7ixI=; b=c1My3uwumQEJGCQQ1KvxdHTWtqz7IzrxBkivnr33OImMKPcffDNEH5ANlHRaU95+zO TZOX9OJZ3HWO4NYZS5TTDQfQhRockFGVfXx5MDKsuG87qsAw55/yHfTw0qx5wnaR9tw7 HJPqCWzujr6mS3bb3WDUPQOBpiC88mzoyNnpUmD2g5A/vRcePNu7aT+7eKlSiqAA+BjS HzD9hPbaKDH+G8cSPko54jQ26f4VWAT9LGR8Z6+47ZP5Z1cnJYvGhKLecumfNoqouC8D UxqVa+4G753ROqACjyWyt5WRhoaCcAjXQEeBftwym/UbfBQT7Acfw9V7LnIQ1hSPEYyQ C8qQ== 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 k33si30996479pld.359.2019.08.01.01.21.27; Thu, 01 Aug 2019 01:21:42 -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 S1730789AbfHAH2B (ORCPT + 99 others); Thu, 1 Aug 2019 03:28:01 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:34162 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727460AbfHAH2B (ORCPT ); Thu, 1 Aug 2019 03:28:01 -0400 Received: from pd9ef1cb8.dip0.t-ipconnect.de ([217.239.28.184] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1ht5V7-00084G-Tp; Thu, 01 Aug 2019 09:27:50 +0200 Date: Thu, 1 Aug 2019 09:27:49 +0200 (CEST) From: Thomas Gleixner To: Daniel Drake cc: x86@kernel.org, aubrey.li@linux.intel.com, Ingo Molnar , "H . Peter Anvin" , Linux Kernel , Endless Linux Upstreaming Team Subject: Re: setup_boot_APIC_clock() NULL dereference during early boot on reduced hardware platforms In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Daniel, On Thu, 1 Aug 2019, Daniel Drake wrote: > Working with a new consumer laptop based on AMD R7-3700U, we are > seeing a kernel panic during early boot (before the display > initializes). It's a new product and there is no previous known > working kernel version (tested 5.0, 5.2 and current linus master). > > We may have also seen this problem on a MiniPC based on AMD APU 7010 > from another vendor, but we don't have it in hands right now to > confirm that it's the exact same crash. > > earlycon shows the details: a NULL dereference under > setup_boot_APIC_clock(), which actually happens in > calibrate_APIC_clock(): > > /* Replace the global interrupt handler */ > real_handler = global_clock_event->event_handler; > global_clock_event->event_handler = lapic_cal_handler; > > global_clock_event is NULL here. This is a "reduced hardware" ACPI > platform so acpi_generic_reduced_hw_init() has set timer_init to NULL, > avoiding the usual codepaths that would set up global_clock_event. > > I tried the obvious: > if (!global_clock_event) > return -1; > > However I'm probably missing part of the big picture here, as this > only makes boot fail later on. It continues til the next point that > something leads to schedule(), such as a driver calling msleep() or > mark_readonly() calling rcu_barrier(), etc. Then it hangs. > > Is something missing in terms of timer setup here? Suggestions > appreciated... So that trips over the problem that there is no timer to calibrate against and the LAPIC freuency is obviously unknown. How is the kernel supposed to figure that out? The only possible option in that case is to use RTC, but we have no support for this at all. Thanks, tglx