Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp82270yba; Wed, 3 Apr 2019 05:03:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2KF/pbwIg8CAPo2d+aYRCt0tQqokQfSnGjEnC9/9XxyDAe73q2OKMnhSh269+UBikgydR X-Received: by 2002:a65:6489:: with SMTP id e9mr56352965pgv.364.1554293039409; Wed, 03 Apr 2019 05:03:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554293039; cv=none; d=google.com; s=arc-20160816; b=q4k/RvotqNcN1ABfeXfRSlW0SKVLv4OFqhI0OHv8S9r39Q9sFnZY+wp2EaIqm0rRpX /2OvakuVh6oESW31lsVGhYjl1qtDUKzG1rgkh2555ccidF3nV+S7ohwIhELOgtB7tllU mL+QcHU3tVutQQDQvVVes1ol2dM+onMGnYb16LbDMH1ESUsnCgiSFxiuz0Wp0Fc3nDan xx4qbrkcWCnTf9g3z8MWMfUqH+GWq7BVMxiO/d/wGZ/BuKHwMC0nIQyRUijGMINvoGZJ g/1jzER+pZG7l7+eMgTUo7pcCzSrYGYpdKwGoH9Jz3P692VPuVUfy6b4nrBLfDTZCbQg wjxw== 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=hgodO8NvfespgeAv9RTrwYd/exUQhjCDleFVhPq/ecA=; b=gYdZW2Yhrs0NY8LCuNZbFtDDkQM9/VkV/woOIS3/Gzs5F6B8UnKTgK33fH4mTwXC7U 5tfQlNRXivN2Ku4737ayXatNYCn2kAd8q1tYwjLWhbnIkXfv8p2MtC2zATcSB2MSyLAY e/9BsdJxdDTm9AI058+bClHipa4I6xJow7OO1hLYeFVVmZWUWTzY/0UcKMBPeZ3PFsGd rLua0wrDrCQ1KPodq/vM60EpSnawAKmxkMWY4mBw9iC1HqfcbxciKHZownuGFGMp9QsE 1MM/UvHeBW1iB/7oFTHnTtLHmK0cZkargmzn7rNBjEfD+pXFgNM3F5MWld0Dyo6nv7I1 5Ouw== 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 b12si7989971pgq.53.2019.04.03.05.03.42; Wed, 03 Apr 2019 05:03:59 -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 S1726384AbfDCMB3 (ORCPT + 99 others); Wed, 3 Apr 2019 08:01:29 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:40054 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725941AbfDCMB3 (ORCPT ); Wed, 3 Apr 2019 08:01:29 -0400 Received: from [5.158.153.52] (helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hBea6-00051A-Qi; Wed, 03 Apr 2019 14:01:26 +0200 Date: Wed, 3 Apr 2019 14:01:26 +0200 (CEST) From: Thomas Gleixner To: Daniel Drake cc: Linux Kernel , Ingo Molnar , Borislav Petkov , Hans de Goede , david.e.box@linux.intel.com, Endless Linux Upstreaming Team , "Rafael J. Wysocki" , x86@kernel.org Subject: Re: No 8254 PIT & no HPET on new Intel N3350 platforms causes kernel panic during early boot 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 3 Apr 2019, Thomas Gleixner wrote: > For newer CPUs we might assume that: > > 1) The TSC and APIC timer are actually usable > > 2) The frequencies can be retrieved from CPUID or MSRs > > If #1 and #2 are reliable we can avoid the whole calibration and interrupt > delivery mess. > > That means we need the following decision logic: > > 1) If HPET is available in ACPI, boot normal. > > 2) If HPET is not available, verify that the PIT actually counts. If it > does, boot normal. > > If it does not either: > > 2A) Verify that this is a PCH 300/C240 and fiddle with that ISST bit. > > But that means that we need to chase PCH ids forever... > > 2B) Shrug and just avoid the whole PIT/HPET magic all over the place: > > - Avoid the interrupt delivery check in the IOAPIC code as it's > uninteresting in that case. Trivial to do. > > - Prevent the TSC calibration code from touching PIT/HPET. It > should do that already when the TSC frequency can be retrieved > via CPUID or MSR. Should work, emphasis on should ... > > See the mess in: native_calibrate_tsc() and the magic tables in > tsc_msr.c how well that stuff works. > > The cpu_khz_from_cpuid() case at seems to not have these > issues. Knock on wood! > > - Prevent the APIC calibration code from touching PIT/HPET. That's > only happening right now when the TSC frequency comes from > the MSRs. No idea why the CPUID method does not provide that. > > CPUID leaf 0x16 provides the bus frequency, so we can deduce the > APIC timer frequency from there and spare the whole APIC timer > calibration mess: > > ECX Bits 15 - 00: Bus (Reference) Frequency (in MHz). > > It's usually not required on these newer CPUs because they > support TSC deadline timer, but you can disable that on the > kernel command line and some implementations of that were > broken. With that we are back to square one. > > So we need to make sure that these things work under all > circumstances. > > Rafael? And we have to think hard about how we are going to provide that for backporting in a digestable form. People are supposed to run recent stable kernels (I'm not talking about dead kernels ...). Thanks, tglx