Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7076896ybi; Thu, 1 Aug 2019 02:52:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwj9bUE8ube5hDm2hH7vhn7txQr58IiXPfhdULvcpCwIDLwxgeqeuAinAiQ/zCHZokJxCry X-Received: by 2002:a65:4103:: with SMTP id w3mr99934750pgp.1.1564653134844; Thu, 01 Aug 2019 02:52:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564653134; cv=none; d=google.com; s=arc-20160816; b=mMYbI1hPUXAoayL+EhtEQQ7QRJEFPIadnXruJVyKeZKPQ5PTSzREIDRXVmDHezspQz 4rQ2N0l25zmpYujpgSB7iCy6KYSxvNjif2mH4z3ZGHAMOLT4AL3Af0RJ4WTcRcb7QucB nAQeZjNQ5RBQKlz3k7BFWN1zSSnWoXqAbC5pPXb62vIA66Y/dRUlzTI+lTn4FlPproEJ Vcyq8+QU/+87jQsJeYALO0ccCC8p5ZTBHTiuTnUtrQpmRt5kfIw5aMdUnCmXOE7k/QN9 CC3OoOHfnoPRrDqsyfLroZ8+gRGIA+rKzcOcn6yO2WFkclDV+p0MN3f4MC+2oLRGGc6h olOw== 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=5b7IX24q7TktlSYgCt2gjNJ7EhCRc6l/ODk9oaxl5ZY=; b=L/lMr7S7N7ySDTZ66UKhm//I0L9stPlHlwFH97w7EceVw6OQIXyoi6xZlQXGrYDywP aSRvMwgZ9tx9WKtq7CBBv2ms35rPlSttAeff9Lt0hoUXq9d/hOVeZkdqK/VL9Tqd4A9Y rCRelIWO0qka/KIbNDhOh9mSj3k1WAOg2RNzR+YYYktaYeBKLlSKuCaPfrAvF1AT1cQU QIq+x9If7H23jaywTWJpQczTqNwIvS7xtcBewywH6pw2C6cGiQQ6tWVsVZVBGygI7mAK m7Raj/yA1VE2MSut25Z1xzDuk9sH6hR/irajdvPFRG9DN7VoyKu4+WwC+QdEMLNl5Mvd m1hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@endlessm-com.20150623.gappssmtp.com header.s=20150623 header.b=UQqr+QnD; 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 r14si22636919pli.257.2019.08.01.02.51.58; Thu, 01 Aug 2019 02:52:14 -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=@endlessm-com.20150623.gappssmtp.com header.s=20150623 header.b=UQqr+QnD; 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 S1728884AbfHAJAg (ORCPT + 99 others); Thu, 1 Aug 2019 05:00:36 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:37137 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725283AbfHAJAf (ORCPT ); Thu, 1 Aug 2019 05:00:35 -0400 Received: by mail-qk1-f196.google.com with SMTP id d15so51369940qkl.4 for ; Thu, 01 Aug 2019 02:00:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=endlessm-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5b7IX24q7TktlSYgCt2gjNJ7EhCRc6l/ODk9oaxl5ZY=; b=UQqr+QnDpzpU+LfYLXsCQi6KmKayfm0JGfi7FLDk/g5i/+KMS83US2Pj+wWYwBmyCb U5TlKmnctaAJqUjTRYHu1CpjwiBSZ8gs5lk8gfVtiZeKxEUdqepRwxJNH+o492G6sU/k Eij7atIwrkkpPt4e6T1Y9u4dbRlbTiGxO9bxhONLXZR8s/NMNG/eiUiuhw1Cjto0XwLe N4sCRt+02d5TDQd35PJ6S2kH2BOx3kL+s37ZpRcKm2Whx4ajrenw2wAA223auee5QKS0 AeDD7fbe4q1M7XlXNn1q7/+AuVnHvi45pOieoPgJ91x8kvtZKfhwByDcOxpEV3MVldTv NYQg== 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=5b7IX24q7TktlSYgCt2gjNJ7EhCRc6l/ODk9oaxl5ZY=; b=JcOQxJlcWaNe3lZ6ywAKGT82bvgdL6exRvz9CNJ4mo7b8dEIVRwstLtu3OMS5qoeP+ Ez4xmUX8B6flY7U0r1sUKV0z/zSsRUQVccE3bjpNc39bzjYkjHUD4Snpylup3iggpeJv bgLwWkIrTWZ/BkFhBaIoLd3o7xTQ+6wwaPwlRsO8mjG0XupqOtzJQDFhb1KUfTjXMgD4 O/TZ8yGnVDXY2n2ytY2sZSDwb7prbRNjIP6nWmwxwJ/HTV9DE+VKmjkmXCHJ0+RTUOJY RBApLCXPU5Dggbq41A88MSKV3XINZvGYLiX33THQLS3Q21HLT3Yi6RZEH/NpjTOO5RGB bA3Q== X-Gm-Message-State: APjAAAWcEA33eDv0S2DEhXr7P/CyUOMdlUbX9n2MIx5QFls+/mOjwIRI kBJxrLll8+C+X8ERlitRFMDJ6EvrSpb8YsegyW4aKw== X-Received: by 2002:ae9:e64d:: with SMTP id x13mr79671110qkl.445.1564650034512; Thu, 01 Aug 2019 02:00:34 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Daniel Drake Date: Thu, 1 Aug 2019 17:00:23 +0800 Message-ID: Subject: Re: setup_boot_APIC_clock() NULL dereference during early boot on reduced hardware platforms To: Aubrey Li 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 3:16 PM Aubrey Li wrote: > No, the platform needs a global clock event, can you turn on some other > clock source on your platform, like HPET? Thanks Audrey and Thomas for the quick hints! I double checked under Windows - it seems to be using a HPET there. Also there is the HPET ACPI table. So I think this is the right angle to look at. Under Linux, hpet_legacy_clockevent_register() is the function where global_clock_event can be set to HPET. However, the only way this can be called is from hpet_enable(). hpet_enable() is called from 2 places: 1. From hpet_time_init(). This is the default x86 timer_init that acpi_generic_reduced_hw_init() took out of action here. 2. From hpet_late_init(). However that function is only called late, after calibrate_APIC_clock() has already crashed the kernel. Also, even if moved earlier it would also not call hpet_enable() here because the ACPI HPET table parsing has already populated hpet_address. I tried slotting in a call to hpet_enable() at an earlier point regardless, but I still end up with the kernel hanging later during boot, probably because irq0 fails to be setup and this error is hit: if (setup_irq(0, &irq0)) pr_info("Failed to register legacy timer interrupt\n"); I'll go deeper into that; further hints welcome too. Thanks Daniel