Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2617088rwb; Mon, 7 Nov 2022 15:47:51 -0800 (PST) X-Google-Smtp-Source: AMsMyM4/KOfwJ/QyKAODpTaInlK7tfH07fyfxPZpTNyRzoOEB1fTi8ZYZpIMo/NE7jsj1oWvqrzP X-Received: by 2002:a63:f07:0:b0:440:5c6e:5833 with SMTP id e7-20020a630f07000000b004405c6e5833mr46171873pgl.375.1667864871366; Mon, 07 Nov 2022 15:47:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667864871; cv=none; d=google.com; s=arc-20160816; b=fkMpSRgJAZdXjJvpsiR6Lx9z3AM54eLKTcEYiMwkTsZCIvArV585zGeoYU9ZG84Kq7 Hew56Q4+1kXySm02GUHRHLs/785TRHkUG01sBf3hXX/vKQE0pTjXWENtTap75BktCnZI q4rxDk5WS6B19Xnaa4fPMCUKcV5C3drPFALTbi7KcpG89ItKGatOgivfD+YaOP+jZxq5 ovIL6JoQBYhBMJEudfBikfZ8ExnY8mm0Q9C4ZDk0uMQNVwSRJM/+dTLawCLQa6u2Mgjs wf3H8eBNIOLZNqYrXctpvgQRzPdS7m/HdUJPhowmP41nNezzgdJHnTGvzEuAkOnBfIax JNxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=v6fYIVlT9RhsjG7et9i8YAPm1fJgknh0Hrz7gQ+1700=; b=CZ8CVKTtFXA6HtddUnQEh4sdjblGTxXEAjA6UgjEbx4i3xT46hEielBjbkjYXXlthB AFY6i6gQpDP2xPzHYKLUKdOrQiqlL+gjITJf4ZOvCaBfXt/joyg7HbBlvUkOQwC98FZE /lj0xEJYQ3VbjmU58+xA/aZ/l4IKc7oVXVBILKtoR/CZPwzfmuy46bgzENsjW5oRQ/Ki lMQ/aUqR2pGJEGM4ek/dEfGLsE4FyqvAt1ZUb+7B7HBz91S0eMb7gc2wV4tn/bz/IXE9 3HZOnja+0V2azTaP9Py2tf9ankRFmEwgUSFl+261dRtGzTEA+iXJ86ed/Cnsu67Gel1G CMdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PlIfBVJd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k12-20020a17090aaa0c00b00213d512f07csi10915278pjq.182.2022.11.07.15.47.38; Mon, 07 Nov 2022 15:47:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PlIfBVJd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232564AbiKGXlJ (ORCPT + 91 others); Mon, 7 Nov 2022 18:41:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232518AbiKGXlH (ORCPT ); Mon, 7 Nov 2022 18:41:07 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1453317076; Mon, 7 Nov 2022 15:41:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667864467; x=1699400467; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=HkPqplWnWgKasGuEjl+2C0+gJiDFRh+H10A4rXRH/Z0=; b=PlIfBVJdQYf6s0VPQVtS18XWHJeHthWnS+DAvKp1Gd0x6wuG0KOmAPZo 6d3Hb97XbGSgkobs6GD9js9hWExAHDTagmbHnCpgbdIFYQ525nQrLKSOb Ln7eP6jT1wRsZfQH4oGa0EuqNdfMTFyg6DFoezWNpQAi01G4S56PoSak7 intSfP4llqIpJA1g7FkIErhXlC9oVnmm4Vl1xa6MdJwebCq8jRpe6/ZnR tpd7nYf+CJFEBz+jmLZZ2S+5GjrmWGWn/kJ7PXbzI4DI406HaRFCzHCgA z8qdLsIR8tE2huoi4RIjK+naLfl1hUzd+JZi3ZhJOP+JcQafVjm/ChECu g==; X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="309261744" X-IronPort-AV: E=Sophos;i="5.96,145,1665471600"; d="scan'208";a="309261744" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2022 15:41:06 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="630668969" X-IronPort-AV: E=Sophos;i="5.96,145,1665471600"; d="scan'208";a="630668969" Received: from peggykes-mobl.amr.corp.intel.com (HELO [10.251.7.244]) ([10.251.7.244]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2022 15:41:04 -0800 Message-ID: Date: Mon, 7 Nov 2022 15:41:03 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH 2/3] x86/speculation: Support Automatic IBRS Content-Language: en-US To: Kim Phillips , Peter Zijlstra , Borislav Petkov Cc: 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 , Tony Luck , Babu Moger , Tom Lendacky , kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20221104213651.141057-1-kim.phillips@amd.com> <20221104213651.141057-3-kim.phillips@amd.com> From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/7/22 14:39, Kim Phillips wrote: > I've started a version that has AUTOIBRS reuse SPECTRE_V2_EIBRS > spectre_v2_mitigation enum, but, so far, it's change to bugs.c > looks bigger: 58 lines changed vs. 34 (see below). > > Let me know if you want me to send it as a part of a v2 submission > after I take care of the kvm CPUID review. Thanks for putting that together. I generally like how this looks. I think it probably goes to a _bit_ too much trouble to turn off "eibrs,lfence/retpoline". If someone goes to the trouble of specifying those, a warning or pr_info() is probably enough. You don't need to actively override it. > - } else if (boot_cpu_has(X86_FEATURE_IBRS) && !spectre_v2_in_ibrs_mode(mode) && > - mode != SPECTRE_V2_AUTO_IBRS) { > + } else if ((boot_cpu_has(X86_FEATURE_IBRS) && !spectre_v2_in_ibrs_mode(mode)) || > + (boot_cpu_has(X86_FEATURE_AUTOIBRS) && !spectre_v2_in_ibrs_mode(mode))) { > setup_force_cpu_cap(X86_FEATURE_USE_IBRS_FW); > pr_info("Enabling Restricted Speculation for firmware calls\n"); Did the "mode != SPECTRE_V2_AUTO_IBRS" check get dropped accidentally? Or is it unnecessary now?