Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4EACBC64EC7 for ; Sat, 25 Feb 2023 22:57:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229570AbjBYW4r (ORCPT ); Sat, 25 Feb 2023 17:56:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbjBYW4p (ORCPT ); Sat, 25 Feb 2023 17:56:45 -0500 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCF0814E87; Sat, 25 Feb 2023 14:56:44 -0800 (PST) Received: from zn.tnic (p5de8e9fe.dip0.t-ipconnect.de [93.232.233.254]) (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 492E01EC047D; Sat, 25 Feb 2023 23:56:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1677365803; 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=j3ugE7rRx7v8z7AKp5/pV3RvqKMVeAPdtvAIQTrk910=; b=nGfZYDreGx6HtqGQU10qPtOFE6wEB4gbo2koYbUnfRkbrqLfG4yohZ3U1rx9oMq6OJMFSu H8UoJ9xucF1ZPuUwOJEsVv9cvRfzUb66oYBnmwihGIwUSBo6xv9LrsifmgPPAlQlPNWh1L Mpt+1vCC4eufpr2zoExuzVoGTMhf1NY= Date: Sat, 25 Feb 2023 23:56:37 +0100 From: Borislav Petkov To: Josh Poimboeuf Cc: Pawan Gupta , Kim Phillips , x86@kernel.org, Boris Ostrovsky , Dave Hansen , "H. Peter Anvin" , Ingo Molnar , Joao Martins , Jonathan Corbet , Konrad Rzeszutek Wilk , Paolo Bonzini , Sean Christopherson , Thomas Gleixner , David Woodhouse , Greg Kroah-Hartman , Juergen Gross , Peter Zijlstra , Tony Luck , Tom Lendacky , Alexey Kardashevskiy , kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/CPU/AMD: Make sure EFER[AIBRSE] is set Message-ID: References: <20230124163319.2277355-8-kim.phillips@amd.com> <20230224185257.o3mcmloei5zqu7wa@treble> <20230225000931.wrednfun4jifkqau@treble> <20230225005221.425yahqvxb57c43x@desk> <20230225013202.g7tibykvylprsxs5@treble> <20230225172832.sqdd7dejkkmjxpt6@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230225172832.sqdd7dejkkmjxpt6@treble> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 25, 2023 at 09:28:32AM -0800, Josh Poimboeuf wrote: > All the other "bug" code in identify_secondary_cpu() *is* > vendor-specific. I meant "vendor-specific" in the sense that AMD code goes to amd.c, etc. As to the identify_secondary_cpu() code - I didn't like it being slapped there either but it got stuck in there hastily during the mitigations upstreaming as back then we had bigger fish to fry than paying too much attention to clean design... > And for that matter, so is most of the code in bugs.c. > > I'm thinking we should just move all this MSR-writing bug-related code > into a new cpu_init_bugs() function in bugs.c which can be called by > identify_secondary_cpu(). I guess. > Then we have more "bug" code together and all the local > variables/functions like spectre_v2_in_ibrs_mode() can remain local. They're still local, more or less. Note the special cpu.h header which is private to arch/x86/kernel/cpu/ Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette