Received: by 10.213.65.68 with SMTP id h4csp1340102imn; Wed, 14 Mar 2018 17:59:25 -0700 (PDT) X-Google-Smtp-Source: AG47ELvq34FPL/6jh6ldJuCb0xs1AlJ55hFMNK93ao0DpsA78yp/AYo4yzb20De5nL3mgszLfRgU X-Received: by 10.99.160.17 with SMTP id r17mr5269456pge.127.1521075565660; Wed, 14 Mar 2018 17:59:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521075565; cv=none; d=google.com; s=arc-20160816; b=Rr0f4/6ETsadfzq7/zJSIav1prAwKhLx8yE5q98FmOVt7tBdjqmEt6o7Ipkc7OVFxW lsVwwejXyVZvWjvNAHtTH7FqyKn3kVajH6vQYerLVQkwJ5lGUCSxNMrJTziuaxp2CCuH jpjEvEJqlMgt3/Q64o0vljgQ19RXv5YmnigWb1HgZtKQldrEArgAoocVDdUl6wW1lHUN BXANZLGmtK3Xa9gQt87sbgIyNK5p9y8+5bRQACOto9svOnaLbTjtFStQLtvD2Ki3Sz1m j7W+6R788nsCbBM5nm67tSkaqy0LOzfsbXefJSMwXi05/nP72Hi7Aund/1Bho9RzwV8V 188A== 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 :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=f/cRuzxC0CEn1n2FTwuuO18e2S1DfJzDe2TaP6c0BIw=; b=xL0zhdCkhUe2mvCFw9P6EkoS6rbdIf1qiw5OcJ4t+4+zzJRur07IvydeNmFQqC3Cnq V0KlVamWE8bN/ynuEY69JE9LTwH6cqynfuuQMF/I+DOJVYkR62sZuPwOqtsTutDpn853 39t15/DJ8SUJWKATYJg3LZ+9hLQtuOPivQHdwoG5Ld0Di3BjWqpG3x4/BTGEfqI80s98 G9mjidJTzWecGB2Vy2BwZ55CXf9mbRTmMJOL7Jy4R/gAk0WoZtevH5rwK8TPUm1qj2Fg VpeCdUbwN7dhebUETsx6Pesc/gcdnVUXh9ujmHhrt22BHqrkQ176LdZuKF5hGa7Z7PN6 nU2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=fsWazP/b; dkim=fail header.i=@chromium.org header.s=google header.b=Q4YiCG9I; 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=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si2875111plo.475.2018.03.14.17.59.08; Wed, 14 Mar 2018 17:59:25 -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=fail header.i=@google.com header.s=20161025 header.b=fsWazP/b; dkim=fail header.i=@chromium.org header.s=google header.b=Q4YiCG9I; 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=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751860AbeCOAzY (ORCPT + 99 others); Wed, 14 Mar 2018 20:55:24 -0400 Received: from mail-ua0-f194.google.com ([209.85.217.194]:34651 "EHLO mail-ua0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751727AbeCOAzV (ORCPT ); Wed, 14 Mar 2018 20:55:21 -0400 Received: by mail-ua0-f194.google.com with SMTP id m43so3328300uah.1 for ; Wed, 14 Mar 2018 17:55:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=f/cRuzxC0CEn1n2FTwuuO18e2S1DfJzDe2TaP6c0BIw=; b=fsWazP/byEVVfcivhOE7hy5NsNH7pRCQzM7ZDjDkMz6I1Tpvwona2cy08d7oUuzqGG hBKeeu0wGqWsr8Kce3wn8wiMK72zA1+mtT7KAal3migP/v0ngR4IPGFOoUnn5thyGgbo FKrCi4i+KBPDonnfzmqXVFRmqYbzTaQ6xBn3G5GhIpyTpHS1cHoiNGh//xh5ix/crNEg +eI3HJgXlb4oqmtd6iOXv6RE8OBRKlmL1OdM8Oe5wdmS/GHfRwNb/1BZgSMiuaW//rez 4FVKKz/9+jT3vNtDKTnxkcZ+0lrDSe0B8AdxE8v/jJpLDGsFXS0mF59/RnGcb1WHo+32 L3Yg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=f/cRuzxC0CEn1n2FTwuuO18e2S1DfJzDe2TaP6c0BIw=; b=Q4YiCG9IxdT0UwKrY6l5SbSfhHoCDbSqP3w5ju56Yeaaal8aUzrc3uxgtXOpqFiMBQ wXTEZWkm5kwiPHSKZn6/lbSq1IxzT9L1QD6w5w76FajFED01fYPeTCFxRCxzjwBiweya fM4dAfpc3u0SBpfia/kqZDXtcccCOxqWJ2920= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=f/cRuzxC0CEn1n2FTwuuO18e2S1DfJzDe2TaP6c0BIw=; b=Q2X8GXhV4opJeyutWMyRuejzeTwgpsXs6gQ9kg8ioxIHRCHLxJ/eJT2xrA+OXPCzR6 43SMe8uB7OCv3dZzEE50lx7qLbSqD37LufOzjQ2pzj4JFULLKOWVy5oqW7TUs3hDCQqy 8DFd5eNaLb2y8q0uQmRQQsH/0XW5snrFUxa3yL1sIQkGocEKCn4minCqdVjX/oRXRcFR OmTfvhdaxkjeMbMrZuLgw5UyQ5SW2DPAV3zYCWnvMgFVciYYdGJD8UdaxPb5RzMZ8Jc8 +9eruhEPgWt+nPRX4/d2hDocZ/M/XdUFlO3qWZbLUCkh8T6Mt+fnwH0P36ZZ4j8c3ito x9dA== X-Gm-Message-State: AElRT7HlIN09QeGkG/gHLJN6af94wAyxlN5fWcaCkT0dE/KQilJWKf7i uJ9t8REIvR/TZV/nLJ1ghGcvDLiMCr/mOH6WTDayYw== X-Received: by 10.176.22.50 with SMTP id k47mr4892353uae.176.1521075320568; Wed, 14 Mar 2018 17:55:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.172.6 with HTTP; Wed, 14 Mar 2018 17:55:19 -0700 (PDT) In-Reply-To: References: <20180314214439.27806-1-djkurtz@chromium.org> <20180314214439.27806-4-djkurtz@chromium.org> From: Kees Cook Date: Wed, 14 Mar 2018 17:55:19 -0700 X-Google-Sender-Auth: erC5BUhK6_AM_2fAwGhJn5ZTm8U Message-ID: Subject: Re: [PATCH v2 3/3] serial: core: Allow skipping old serial port initialization To: Daniel Kurtz Cc: Greg Kroah-Hartman , Aaron Durbin , LKML , "Rafael J. Wysocki" , Len Brown , Jiri Slaby , Andy Shevchenko , Matthias Brugger , David Howells , Vignesh R , Sean Young , Jeffy , Doug Anderson , Matt Redfearn , Marc Gonzalez , ACPI Devel Maling List , "open list:SERIAL DRIVERS" 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 Wed, Mar 14, 2018 at 5:23 PM, Daniel Kurtz wrote: > On Wed, Mar 14, 2018 at 5:00 PM Kees Cook wrote: > >> On Wed, Mar 14, 2018 at 3:58 PM, Kees Cook wrote: >> > On Wed, Mar 14, 2018 at 2:44 PM, Daniel Kurtz > wrote: >> > Sorry for being dense. What tree is this against? I can't find mention >> > of amdcz in Linus's tree nor linux-next. > >> As I watched this email send, I noticed the "3/3" in the Subject. ;) I >> see the amdcz support now. :P >> https://patchwork.kernel.org/project/LKML/list/?submitter=18441 > >> >> diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h >> >> index a27ef5f56431..02570edaddd8 100644 >> >> --- a/include/linux/serial_8250.h >> >> +++ b/include/linux/serial_8250.h >> >> @@ -136,6 +136,12 @@ struct uart_8250_port { >> >> struct uart_8250_em485 *em485; >> >> }; >> >> >> >> +#ifdef CONFIG_SERIAL_8250 >> >> +extern bool serial8250_skip_old_ports; >> >> +#else >> >> +static const bool serial8250_skip_old_ports; >> >> +#endif >> > >> > Where does serial8250_skip_old_ports get used where CONFIG_SERIAL_8250 >> > isn't defined? (i.e. why is the #ifdef needed here?) > >> This question still stands, though. > > From the same patch: https://patchwork.kernel.org/patch/10283641/ > > if (CONFIG_ACPI_SPCR_TABLE && !CONFIG_SERIAL_8250) > > in other words, if serial ports are disabled, but we still want to parse > the APCI_SPCR_TABLE, which "defaults y if X86". > Perhaps that logic should be changed (no need to parse ACPI SPCR table if > we are going to disable serial anyway)? But won't this break? "static const bool ..." but the code tries to set a value but I'd expect the compiler to still yet about it? I think you could drop the .h #ifdef and use: if (IS_ENABLED(CONFIG_SERIAL_825) && amdcz_present(...)) { -Kees -- Kees Cook Pixel Security