Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp396942lqh; Sat, 4 May 2024 05:57:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWzZLYKsq6JGRotpw+PPijSRoYBPsG6W2GZ7vTB7CngyJX1D4KFGQSeQmsFFtBExx1eHl5SV5jI4qzl8Tlko09iOMHOOdW0uPN50o7YHQ== X-Google-Smtp-Source: AGHT+IGFatxdXyaWdtY8I3KQ3eD6LqlnsyuuVmyX2Gh+rrrtBzlXNRQjytj7EkiIC85KOpy2MqzP X-Received: by 2002:a50:a699:0:b0:56e:2c34:cff2 with SMTP id e25-20020a50a699000000b0056e2c34cff2mr4832935edc.19.1714827461868; Sat, 04 May 2024 05:57:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714827461; cv=pass; d=google.com; s=arc-20160816; b=njOwADqZNhPxqiH7NIXDOg/KfmjMMJsIfW4+lxSNI6wZLb4+Peh6fkj1e4t4PY+jqu eYTmh86mb8mSoddFjdpLbZDkNigB6CjxogkCzvPTBi6fZFYIn+3SkPn3LocM5bZK0BJi Pbs2AtyvJ2ckQw8kffW1NAjEI9EfQ4J3R6aymC2puWbLrVrAOeOK84Z01VumgWyWFEDS YgFurnKcu1Oqa96HUo/0aWnxfg3UDOPiJ/PX+tgJv5/C3Dk/AIR+gg+inbA0Vih/9Izq Bk1DORXjZWM6v+BqpQ1PN87umHwoAjIOnnf0L842wUuOfC2BJ92H8xV5l6sX4iLLQo2C aTBQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=XNK1mK0mvPkPIhkijCeRz+GV9/JqvJGZB+kG2twbOVg=; fh=IDKC/cSfrWPhBWolzVEMjxzMuHsAOF+K1pUrRU4bGuk=; b=qrVrzzM+N6B3lfSGBATWubu+5Od/e0OCWsjBLYI5Qs2euiNErJSuCy/25SSAARdG97 /glSsgqVnvmGOjvRCsXqE8QsiRhHMlSaZvCePXeYev9efhSRbp783PnpTV1ndt0ekuK4 3rKlu6LivSypLHJ9XjFOnheGvR22qH+YyiGeuDz6rXZJMXwMPxI30T+oJzpbUfo3igS5 k/bapq11UPoruc+/64fA/hIa4b+OrfJxInhjs8rGQzLcE/kIMsrAjviOJ9mVz4ua5BxZ GHhnnUc8e4GbPSlsmkIosWWxOmHQHCF1gI3Pig4j/lC3Xt8+T0l8WBspBSTqHwKTirC9 pO7Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=HgzmWuRe; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-168659-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168659-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g23-20020a50ee17000000b00572a227a2b5si2701187eds.483.2024.05.04.05.57.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 05:57:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168659-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=HgzmWuRe; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-168659-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168659-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3EA7C1F23D82 for ; Sat, 4 May 2024 12:51:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E5E322616; Sat, 4 May 2024 12:50:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="HgzmWuRe" Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67A7620DF7 for ; Sat, 4 May 2024 12:50:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.109.113.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714827055; cv=none; b=s1LaMPq7Kye3fGdygMAnu1eJN2eNhw5N+msIplKyfT08azUmJJfvbGWOMD45lu39JbvBXfeFh3HFlJcfgDwyLq66InPZgvsbAOtlDZysWcn79iveRG42l9qunPbHViOMTcLqRhNE9/tJfiXG6Yu+gVrnHd7U0slnCyYPtzfG7/Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714827055; c=relaxed/simple; bh=KrH/zPSxhqvTk7sGZgx4edGzXm2L3D1bxrw/uv0GL+4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Zo7xOM0T8s46+GcjvbmLcxrWP7vglWGAvWvHoFzrkQ5rZO1NJ8B9fLEqjDkScaqJqfQcQIobc1LvmjOTXJYCIh+eWXPx2OH+tivYxbRQgvCWcL1xXqADQlRXKFhbmc0Bh/jrMUZ47OitFgI3kOCl7SnTQr+AuQEFHyyNPipJpLc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b=HgzmWuRe; arc=none smtp.client-ip=65.109.113.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id C0E6C40E0192; Sat, 4 May 2024 12:50:52 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key) header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id b1ygzvNIHZiP; Sat, 4 May 2024 12:50:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1714827049; bh=XNK1mK0mvPkPIhkijCeRz+GV9/JqvJGZB+kG2twbOVg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HgzmWuRebHI6UuoqLIM3aWNs5tn4rHtIgT1a/F3O/7P6HkHSmLRbU/TkNcGURad64 Jkh/2WAuvK29QE1huLlnQ2WMDMWCqa8LIVre6DzUd8NaikhH5EltMef8gILD3s65yn E+z2Ui8LftpQw/fn8rb4mInpKNgIGLvSKsi5V0b3BB5e7udaWkgQ1tICRVkGuAhQxY 2dqzJwVpbwr+bpa0ACds623MXBYJ5sE+xiUf5895C2mMCvucq3JIKuv2Mq+dqOiIYx BdknC6p4O2XePmmXu1JttvtvADliWd/5WjG6dYMH67HszpWKO5kJUNrsCusx8NP6bP uv6/IpYKU5/qrrUrNxDnx8iUbzEzuo4wc5QNs84Te5ouMAOTTlW+wLG/bmL04Y6gCc kBSgNtB/8JYvf237R1r2o1w1YDaUz1l1QWwX8N4CxGxhxT3xFbrE/tKc/xjtrxA9nD NF/tUxK68G8pQcvvFWjOdSFfzLTP1oY6IXD/r9WjBSMD76kZI04BaVEhO5KRbRJ+LS DF6Nrfbb0ICi868SngOu3cvy4jJvU/RkKz8BsRAfaMta/8O3dwkOStrC8I4NITMKmB fuqzTVpH1bFXrc+gQCI/Fy6tvwOSVtEUuLIWJsT8B/Holp9R6HvbZpzgAdCjHLAccb N7SLFvXPl6hdTy8Qj9d1DwRM= Received: from zn.tnic (pd953020b.dip0.t-ipconnect.de [217.83.2.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 37E3440E01A1; Sat, 4 May 2024 12:50:41 +0000 (UTC) Date: Sat, 4 May 2024 14:50:40 +0200 From: Borislav Petkov To: Sean Christopherson , kernel test robot Cc: oe-lkp@lists.linux.dev, lkp@intel.com, linux-kernel@vger.kernel.org, x86@kernel.org, Ingo Molnar , Srikanth Aithal Subject: [PATCH 2/2] x86/CPU/Intel: Do the MSR_IA32_FEAT_CTL setup before alternatives Message-ID: <20240504125040.GCZjYvIAK9_DzKuHXh@fat_crate.local> References: <202404302233.f27f91b2-oliver.sang@intel.com> <20240430172313.GCZjEpAfUECkEZ9S5L@fat_crate.local> <20240430193211.GEZjFHO0ayDXtgvbE7@fat_crate.local> <20240430223305.GFZjFxoSha7S5BYbIu@fat_crate.local> <20240504124822.GAZjYulrGPPX_4w4zK@fat_crate.local> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240504124822.GAZjYulrGPPX_4w4zK@fat_crate.local> From: "Borislav Petkov (AMD)" Date: Thu, 2 May 2024 15:15:41 +0200 init_ia32_feat_ctl() goes through the MSR_IA32_FEAT_CTL settings and sanity-checks the configuration on each logical CPU, while setting or clearing X86_FEATURE flags in the process. However, it does that after alternatives have run, leading to settings which have been patched by the alternatives to become invalid and irreversible. Move the settings detection to an earlier path, before the alternatives. Reported-by: kernel test robot Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/oe-lkp/202404302233.f27f91b2-oliver.sang@intel.com --- arch/x86/kernel/cpu/intel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index be30d7fa2e66..d8575511a143 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c @@ -406,6 +406,8 @@ static void early_init_intel(struct cpuinfo_x86 *c) */ if (cpu_has(c, X86_FEATURE_TME)) detect_tme_early(c); + + init_ia32_feat_ctl(c); } static void bsp_init_intel(struct cpuinfo_x86 *c) @@ -682,8 +684,6 @@ static void init_intel(struct cpuinfo_x86 *c) /* Work around errata */ srat_detect_node(c); - init_ia32_feat_ctl(c); - init_intel_misc_features(c); split_lock_init(); -- 2.43.0 -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette