Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6939519ybi; Thu, 1 Aug 2019 00:41:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqxx5XiB4xYPHI3p2ZIKqFpA3s2/7KoO5ebBYtUF9vhLJgF3FIurL+qcNW5q9GkcZG+ACiju X-Received: by 2002:a17:902:3363:: with SMTP id a90mr2601074plc.119.1564645265284; Thu, 01 Aug 2019 00:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564645265; cv=none; d=google.com; s=arc-20160816; b=XgpEJY3MKCsUB5UDxUDknn21WuCgf6NjrQVctDZVub8wRH/J2MBMnfQ37q5dqPqieU 28iwt+dwJSMxAvtJvISLf3Hnp60g4iVnOfpk3+hsDnYYP0MTcg7gV09pnl3ToqRT27CE D3auQE18wLibfSUCwhH9KIPHcZXsSsW9FQVgpvXRHHpWKbhrFD+LRvObtqcya4UI0upv JPG6K0Dwu5quLAGCzg1TOrrYKMOvuJ3Cc5JIidwsWH/tt0id9+E7gQBGdbMhg+qGzIk8 QP2VmGNxBw/QmoFELYeejQl3pYK9JkcBwOTgM9qdUjLpH2f6pyQUsTThH09+20NzeBEZ eCGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=4FFz/bBVyysFB3KKw1zsUFOn9cjX6r61XwqqAYRgWEw=; b=C3qL2amyF7NruA2ile/Pl8et0UaUGYJ33NhaG+n1rcjXAaJG1GMc9EkkUm/YqUNO9G qSkgRJ99R/Xk9DNHiWXOsXHmYbyKDKg9EhuujInM5MLBCawhpz6iUF3IneffIahtEw+O Tgroa5tvcYNlu1rp7PmVzzmB9QTBxTKTTi9dS7NWWFSX84U48ZMkrGmnnNmLrM2WZ2Xr aAv+DkAqggxhsSwnsk8rwMSvy6Tl3qMiDlJK1PjemkC4D2qmjNI0tyYEepyqdFEPiQda eLHqv1tHojxVN9j1GxA+Yvj/bedsMqccmhRYKAmRlQbV9i8SH6+VSnoUTuD0XuqoYwAn QG+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iKdgZCvr; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i13si34155315pgf.335.2019.08.01.00.40.48; Thu, 01 Aug 2019 00:41:05 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iKdgZCvr; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730652AbfHAHQy (ORCPT + 99 others); Thu, 1 Aug 2019 03:16:54 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:39708 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730201AbfHAHQx (ORCPT ); Thu, 1 Aug 2019 03:16:53 -0400 Received: by mail-lj1-f193.google.com with SMTP id v18so68244120ljh.6 for ; Thu, 01 Aug 2019 00:16:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4FFz/bBVyysFB3KKw1zsUFOn9cjX6r61XwqqAYRgWEw=; b=iKdgZCvrJQJIeS+/g945+X55Tei/luMZ4Sc+Lm+E2znXcqp88ynGWLPy13tSntyR8e O5LicATEHDYjGw1NW6E/WtaXTQOSYTQwWvm9aM2eBYDJqx+G1oMh53FAc55tmNGrIngK PbbB/AVGuOu2GadLaAhka/pdIzfUBqGF6XNacXQ/vro1Nxpgl6zazyjtSzUm7JYOzDZA sKUzfzXa1bU0BOipWyQFR4ZkJ7+oT5TQCR4rblxTy9Te69PdJAFtkSq5B/m07K0aMLzR yIAloAMM1RKjaq3d68KdctLDYrfHChaNI76Q/vB1szFX8yTKiuF2/1M6DECgyVHp5N1W JdAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4FFz/bBVyysFB3KKw1zsUFOn9cjX6r61XwqqAYRgWEw=; b=rvHBuRzXx5Rv9mNED0PhblnT0gm7foMmkDRlTY23z0p2kVvbTpa+Fke6E/A8zO6E9n Wzk6wSNTC7OFNd8KBPmI1I7tirLVvkHYjD+DcpscvPdtGljG2ZjA3pWSKKXRAxY1IREN PhCqGRyUoFeiixJDs5Fvtdskw/b4ZtqxpF6Vss/yTTJmN7GJJaNULZFivHwYR2JLPcAu /kJbdIeFpf1L8tKywaMGEEl/qifctEM/PK2OHZmWQwLAXzsk2wXQCLN0BZBGhKVHipCg DGyWMImbD8N2IXO/MViwaKnoUi3P9t9RdgL6mKQ2PKGqRoshnl+D2s531Yjzdpkw5hbf m3Rw== X-Gm-Message-State: APjAAAVbIENmL6ht66gWxJWmB09pBdUiSOUZ+POYRs09fIEUtBVZcR2f RhQMpv0RF8bswqJKcwZHZea+QwDqEWos0OKxh3Q= X-Received: by 2002:a2e:298a:: with SMTP id p10mr65571927ljp.74.1564643811920; Thu, 01 Aug 2019 00:16:51 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Aubrey Li Date: Thu, 1 Aug 2019 15:16:40 +0800 Message-ID: Subject: Re: setup_boot_APIC_clock() NULL dereference during early boot on reduced hardware platforms To: Daniel Drake Cc: Thomas Gleixner , x86@kernel.org, "Li, Aubrey" , Ingo Molnar , "H . Peter Anvin" , Linux Kernel , Endless Linux Upstreaming Team Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 1, 2019 at 2:26 PM Daniel Drake wrote: > > Hi, > > 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. > IIRC, acpi_generic_reduced_hw_init() avoids initializing PIT, the status of this legacy device is unknown in ACPI hw-reduced mode. > I tried the obvious: > if (!global_clock_event) > return -1; > No, the platform needs a global clock event, can you turn on some other clock source on your platform, like HPET? Thanks, -Aubrey > 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... > > Thanks > Daniel