Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp526814ybl; Thu, 15 Aug 2019 23:15:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3CUIgEoRBuQKm3JUTIuPMdfNhYRIci5o/72dalahFb/pNYj6o3HYpveytDNtja+86uOku X-Received: by 2002:a17:90a:f011:: with SMTP id bt17mr5615968pjb.21.1565936120032; Thu, 15 Aug 2019 23:15:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565936120; cv=none; d=google.com; s=arc-20160816; b=NtpUriwyZDmhUMru6tNPyefvquSNfp9UEgJrgUWZn+ML0CORvjyNoZGJxwGMczJ5pq AgMFxFwbscNN4PvRPtwOnXB9BJ5vw55XTF7+YP1ncwZbX8cl7YpCR2sulYbImp87f+uS xAJJeY72WYyH4q6st433mmwgK0GB9r6sgfeBKwth8dTmPByRKbLMrjHbf0kjTxezouCp qjJqrMrF3dKAXjrXcryNhRnU48TwksSwTpDvgfznUSBHhZDqWRLW/Au+teoVbKQzZVOY 0a/UKCqvMMRGYCy0R/D1RFZFk5mQ5C3XNAOaoPqfeigadbb/v9lZTzX2I9408HwlUvl/ yTfQ== 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 :mime-version:dkim-signature; bh=Wobw7RLI2u4sURUplFIazpvMFVTZ4ZldULV2wWwAjLI=; b=Xc1pMxW8i5M5nQO2mrEyJJe/NFhnJ/Z7UYshniFJJdHutgp+gH6Rll3oojHHromcQh OvI3U0irycaj7yDShKnFrCcPmpLwXXo4U9bnjyx/8PGwJNZjbh8d2Jb/+c6H+glY7mGV pWEbxjDeB/Pf+kXbJNhRtwhNBgu+ESBEEk5yqWErOGNEIxkXaSx0HCFX0PBVKeiarKRH nVdBVLg2Fy8ODz6DrlJcxvm/wrEHBH+7pRKmvCGU6aYVA9rQ7Z5MHbrQH081d0VTQW2x W2ByLrY6vAT4mRczr2PtKVRmqp0Aro/V/ceQGWriqEOoicqINaDZTv5ehWbrbU7b2e8K dpWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@endlessm-com.20150623.gappssmtp.com header.s=20150623 header.b=P4PXZlqO; 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 z5si3346299plo.434.2019.08.15.23.15.04; Thu, 15 Aug 2019 23:15:20 -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=P4PXZlqO; 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 S1726672AbfHPGOZ (ORCPT + 99 others); Fri, 16 Aug 2019 02:14:25 -0400 Received: from mail-qk1-f180.google.com ([209.85.222.180]:45148 "EHLO mail-qk1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726487AbfHPGOZ (ORCPT ); Fri, 16 Aug 2019 02:14:25 -0400 Received: by mail-qk1-f180.google.com with SMTP id m2so3838067qki.12 for ; Thu, 15 Aug 2019 23:14:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=endlessm-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to:cc; bh=Wobw7RLI2u4sURUplFIazpvMFVTZ4ZldULV2wWwAjLI=; b=P4PXZlqO4bxMmgCyUAeKyZuva2t09lb4gxM5F8Q0TKniiDkPZTPU32iqrasU5PqA/a sW2xn5dzUQ71EcV5yfF1DyaBAdl6lAW9Bou+RkVhIUmg9TmtJzTHmqiPyB7G5DYs1h7b YUC10afZhajanSIqc9W3qHXPw/dW/RLASzmtPSftnDHtlyqGg5grYTttdS4tJ6hdtl/D dZEIly9IrYBDxb4HgNC9quaeXrPMutp4gWJbKCsCIVxvXHjEoLI5D0z+7K1OVdPneRcS YXFWIFQ4vVO+TNdkTcZ5UTuiFHaGx2rYOtnWfIq9SueukdChWLqNNn9PNHUzRMicxCVO kslQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=Wobw7RLI2u4sURUplFIazpvMFVTZ4ZldULV2wWwAjLI=; b=TOy+A3UmZfh0drgbkDFHnrz/lUFoSyXw5wkTbnTvKp6oMqrbFRL7updhsngpokBbhR k3EZaZ1TMv5q9oAuOMOh19CD1FYn6ahkNk+doN00sP7pgNB1i7ShkjVQmlpW7j6GGzfL vGD6h+h4uJiZsHdlGjgYqbcwhvQ2qY1OrOqMMaErMT8cEQCaJ3+cDIdaL3nlZc25oNVg ws4QdGTh3DMsI1v484hBckOHukGQy2RSybnxPiZbeu8mFn1yVi+PEHPlw54ZBy/htWc7 zdbcYTq96H+mkWu0A9G++XGDZwiSu4FkSafbivQ2e8I2J5HkJMgCoxrJ3OH5YXxsYxeF JhUg== X-Gm-Message-State: APjAAAV9CwOwtyexJToGXd+Bs/0CjLh0ZwckDAjat2u5uz8SyMrFAlFr SGDXhrK+4vD9WVyEQ1P3gL+Y+boxLlTd9hvLZuLO2g== X-Received: by 2002:ae9:eb4e:: with SMTP id b75mr7200498qkg.478.1565936064063; Thu, 15 Aug 2019 23:14:24 -0700 (PDT) MIME-Version: 1.0 From: Daniel Drake Date: Fri, 16 Aug 2019 14:14:12 +0800 Message-ID: Subject: Early EFI-related boot freeze in parse_setup_data() To: linux-efi@vger.kernel.org, Linux Kernel , x86@kernel.org Cc: 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 Hi, We're working with a new consumer MiniPC based on AMD E1-7010. It fails to boot Linux when booting in EFI mode - it hangs with nothing on screen. earlycon=efifb doesn't show any output. Looking closer, I was able to confirm that we reach EFI ExitBootServices() via efi_printk in the efi stub. But you can't use EFI's console functionality after that point, so I then resorted to inserting calls to: idt_invalidate(NULL); __asm__ __volatile__("int3"); throughout the early boot code that follows in order to force a system reset. That way I could deduce if execution was reaching that point (system reset) or not (system hang as before). As a side-question I'd be curious if there is any better way to debug such early boot failures on consumer x86 hardware without a serial port... Anyway, the system freeze occurs in parse_setup_data(), specifically: data = early_memremap(pa_data, sizeof(*data)); data_len = data->len + sizeof(struct setup_data); Dereferencing data->len causes the system to hang. I presume it triggers an exception handler due to some kind of invalid memory access. By returning early in that function, boot continues basically fine. So I could then log the details: pa_data has value 0x892bb018 and early_memremap returns address 0xffffffffff200018. Accessing just a single byte at that address causes the system hang. This original pa_data value (from boot_params.hdr.setup_data) was set by the EFI stub in setup_efi_pci(). I confirmed that the same 0x892bb018 value is set there, it is not being corrupted along the way. Any suggestions for how to diagnose further? dmesg output: https://gist.github.com/dsd/199bed7b590e90efdf73f9f6384ca551 Thanks Daniel