Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2380248pxk; Sun, 20 Sep 2020 01:38:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxI7YJA5hcY18xL6jBRxGWen1MDi8LTMPvCz30yRzqVzMOBXVV9EbTOJGH+29LuyGilRugL X-Received: by 2002:a17:906:4088:: with SMTP id u8mr45786530ejj.184.1600591123551; Sun, 20 Sep 2020 01:38:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600591123; cv=none; d=google.com; s=arc-20160816; b=RjgzPtSexr4TFIXZ9MwZOoe/12ARie53v5KEN9EEwNcZmYCVIpc7jlYPbkCO5bPgx4 r4wt0cVES5cB7KVCZmkYYt3SgO1ra/1lxSi4ihuBDJ1Bp4c93lyhYKPPi+aIFGa5Tqeo XxpfqowdgXD8egErdjoJggf7W0OMs2gAoV/byY1DtYJjy7aDn317Q6NBM8e2Q2849OVo Mt32wgUus+pFkSJNFhXwGePSERZXxFmi38AMjUA6sBDn4o97aEoFX0ChdnJa/2jpwwBd tERxrxCTvY1ZN5YmZkgZvpo6CtDlhO+MJn7+gqFmn52a/YJ+QuwKZVKvDtAcmg+IPbnC QMXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=z4ArdGsHu1lItnm9BSdt7a+gByFQ8BVlRUkfS9dAFIE=; b=BD3dhvJscMCc+nnGsw32eQ9v8y8RKLxiv/E/N34d/l7zBRGPMwBPr/EiKP0P9T04RH D0nECSgbdPy1R1Y4lnYcfjd6cVbr5qczemKxh+Ry+NbiLUJb7aI+R0vgaWg2vdY8Uo0B ekVWr9B46p9Uypyxmh1TZzY1OIiSuyDwbzIzh8vyNJv9gX41TuLe/VIZ9HyCOq4nCu9J qtVstrJlqqHr2joLQRv9W1iZ/1kfvrgiuHZDjMdKP0p48R6FAWd8w0xFOT23n+sbNv1i 9nkd9eFmKKayornijzZj/c3yRKGlUFtLsBLJMeasZk2DTQI61ZQzO1J5B2iEY5ARygAM UPhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=XH0cQGO0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v10si5545633eds.459.2020.09.20.01.38.17; Sun, 20 Sep 2020 01:38:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=XH0cQGO0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726298AbgITIgg (ORCPT + 99 others); Sun, 20 Sep 2020 04:36:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726262AbgITIgg (ORCPT ); Sun, 20 Sep 2020 04:36:36 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C9B0C061755 for ; Sun, 20 Sep 2020 01:36:36 -0700 (PDT) Received: from zn.tnic (p200300ec2f295d00612687364c3aa3ce.dip0.t-ipconnect.de [IPv6:2003:ec:2f29:5d00:6126:8736:4c3a:a3ce]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 72B5C1EC03EA; Sun, 20 Sep 2020 10:36:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1600590993; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=z4ArdGsHu1lItnm9BSdt7a+gByFQ8BVlRUkfS9dAFIE=; b=XH0cQGO06+bcmPyHdrCM5/B7LNFk+BnM1qu+MH6F3fTsKyBFnwhLzoJ98sxMJNyaM0TnEl B2MdaL8IBlq4svxxvfz+W4W68BwoUeJ8W0m3+vZ80uieF8BfC8Wax4LGAm6BjI1ViiSqKX nLy4S5fAbU7nCIcV20PFdCpH0z5icA4= Date: Sun, 20 Sep 2020 10:36:26 +0200 From: Borislav Petkov To: Mike Hommey Cc: x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/boot: Delay BSP init until after FPU initialization Message-ID: <20200920083626.GA7473@zn.tnic> References: <20200920010310.10961-1-mh@glandium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200920010310.10961-1-mh@glandium.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 20, 2020 at 10:03:10AM +0900, Mike Hommey wrote: > FPU initialization handles the clearcpuid command line argument. If it > comes after BSP init, clearcpuid cannot be used to disable features that > trigger some parts of the BSP init code. > > Signed-off-by: Mike Hommey > --- > arch/x86/kernel/cpu/common.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > I was trying to use clearcpuid=440 to disable X86_FEATURES_AMD_SSBD to > reproduce the behavior that happens on Zen/Zen+ on a Zen2 machine, but > that didn't work because the command line is handled after the setup for > X86_FEATURE_LS_CFG_SSBD. > > I tought about either moving the command line handling earlier, but it > seems there wasn't a specific reason for BSP init being earlier than FPU > initialization so I went with reordering those instead. Our boot order is fragile and the functionality in fpu__init_parse_early_param() which does the clearcpuid= parsing should be independent from FPU, as your use case shows. So I'd prefer if you moved that function perhaps to right after the call setup_force_cpu_cap(X86_FEATURE_CPUID); in early_identify_cpu() and renamed it to something generic instead. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette