Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp433756pxb; Thu, 31 Mar 2022 08:40:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdhgZS2nH2pshNGGBecQwxLJFuX1DaBKqmKQvcoKU4cjUz0kp5WIHjO6qNfbNWKk5a1N+R X-Received: by 2002:a17:907:3e14:b0:6e0:1ef7:6319 with SMTP id hp20-20020a1709073e1400b006e01ef76319mr5466059ejc.321.1648741206194; Thu, 31 Mar 2022 08:40:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648741206; cv=none; d=google.com; s=arc-20160816; b=BYXmjePY2vL80WYq50rCNpvA9k9ei4qXqHe8SNKHhZp8tW27rT07M1H8mp6MoZMQC6 yDAdSzQKpV9QhgcLsYyUhdfC8cMRipTt1Z9hsm0o7dHF5Az1yvwehlBSg5Guanc0u8UU 6SvvJPVh75izwXajRWJJyLoF5cVNl1ljwuSHplchpXVpb0EOgAKoLQnNm2ZaSsNWnmCh KE9bO5rAwaQ8mX0hnKytYgyUZcPwoOx1t6euBnuAzLzO85GNamI49LnLwucKlX/OpQ4F bzjHb7JLNbCO7hNHoJoM1EJ2bYJGr0xkTVW9nYRURQgojw/NK6dsl+jweOWVgxMDYrJ7 zXVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:in-reply-to :references:subject:cc:to:from:dkim-signature; bh=vrDy87kcL6TB44mQjATzL8gmQYaF0l7QVZ9tlO8Lma4=; b=w6ywjOnadc3+KUXI54+H0dL+kKe2gKmTTc8Vc63nOu8PZlg5yUcGCVVjN/LmtI8lZw Zi3eD61CfzwnVD3YncQ+uyKakITRqA24rNBDivBsSnXyCQMBryq0rwJfXWAhJdqtPjBa XNF7NBiIFdvXbjybX68nQe6G7WlMUCWAOfilZi9QUyrdNTNcQe5lziU/bpT9c5fx1Qol nZPTfBEbzaEsk+v42FBWefvBWT0auXf4q/DTNifpeoPDJ6HDjv9j7atOtlPv5hJduEXK ZRldOyqdMK4sVEi5Gv3adoY4lIUtpurYnHUXm23EVdXfWBBw4xCjp3VtycN7oofUC84z 1l7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=H8mj86TA; 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=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s1-20020a170906060100b006df76385ddesi23708114ejb.638.2022.03.31.08.39.39; Thu, 31 Mar 2022 08:40:06 -0700 (PDT) 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=@collabora.com header.s=mail header.b=H8mj86TA; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236721AbiCaNUi (ORCPT + 99 others); Thu, 31 Mar 2022 09:20:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232629AbiCaNUf (ORCPT ); Thu, 31 Mar 2022 09:20:35 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03EDC5005C for ; Thu, 31 Mar 2022 06:18:47 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: rcn) with ESMTPSA id 262651F4680D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1648732726; bh=/j3LkwFKB0+7mnH+l8R0tnH8GNWzHifzKE/6jt5U3UY=; h=From:To:Cc:Subject:References:In-reply-to:Date:From; b=H8mj86TA9sdhniqsX1XxpjpuZkudIKTwl7mQJDIqf+7521RRaNcE5M25LZXsh6CyQ 47unameFmfkGHw8fots1KAhClVG/lfWvKHkQD7nlz/0frggY9s/aYSesfjdBcTDZfW zO0knkpgJ4ut1REKs4f+ym5jW6tzehEeC4lyVH+qQ/Vh4HlGGpwnO3sbdbLS1DVhDt OWsXPG4o5Q1W1yRQxTKeMQsBLuTrxJqppda3Jpx8JvuQjLWYG3h3m1ze2Y9m2xk2Fv Fw/aQXdOjgH/arnwZ6+i14tvdFpXcpIxr0NV2KSH87Yi9yh2MC9LkuaAtPhSYiNIdp 3TMLR/hQZ134Q== From: Ricardo =?utf-8?Q?Ca=C3=B1uelo?= To: Pawan Gupta Cc: Borislav Petkov , linux-kernel@vger.kernel.org, Thadeu Lima de Souza Cascardo , Mark Gross , x86@kernel.org, "H. Peter Anvin" , Ingo Molnar , Thomas Gleixner , John Johansen , Steve Beattie , kernel@collabora.com Subject: Re: [PATCH v2] x86/speculation/srbds: do not try to turn mitigation off when not supported References: <20220330082026.1549073-1-ricardo.canuelo@collabora.com> <87o81mzhoh.fsf@rcn-XPS-13-9305.i-did-not-set--mail-host-address--so-tickle-me> <20220331084536.y4sl7qcfzltsnnew@guptapa-desk> In-reply-to: <20220331084536.y4sl7qcfzltsnnew@guptapa-desk> Date: Thu, 31 Mar 2022 15:18:42 +0200 Message-ID: <87lewqz2dp.fsf@rcn-XPS-13-9305.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY 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 Pawan Gupta writes: Hi Pawan, > void update_srbds_msr(void) > { > u64 mcu_ctrl; > > - if (!boot_cpu_has_bug(X86_BUG_SRBDS)) > - return; > - > - if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) > - return; > - > - if (srbds_mitigation == SRBDS_MITIGATION_UCODE_NEEDED) > + if (!boot_cpu_has_bug(X86_BUG_SRBDS) || > + !boot_cpu_has(X86_FEATURE_SRBDS_CTRL)) > return; Just to clarify, this changes the behavior wrt the hypervisor case: currently it just bails out of update_srbds_msr(), with your patch it'd clear RNGDS_MITG_DIS from MSR_IA32_MCU_OPT_CTRL. Is that what you intended? Ricardo