Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp603908pxb; Thu, 31 Mar 2022 12:43:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDOQ6YN31bmCU8nDiBJAMNusQv3FjJfgbVEHIiX0N9OFkbRkYAU2eZYNPnIufN6b7HaVjm X-Received: by 2002:a17:90b:4c0f:b0:1c7:d2de:5aec with SMTP id na15-20020a17090b4c0f00b001c7d2de5aecmr7859654pjb.110.1648755780645; Thu, 31 Mar 2022 12:43:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648755780; cv=none; d=google.com; s=arc-20160816; b=o/Fkm8gZc7JlnfVc40R7rym2CoR1r6/F0RCyZxBuCvnHRi58f/N8IyGUX3VDF3Fjsu 7JRmYltd4tK8NUJJ6sqrvBS7/ZQAwfjf5VVYeFXp7cHt99tChcAPtgvCX6h0tB60Cg04 Ezkuve4vNgXeJnOivRhODnXOyMVPY5S+8yAuBOTeHkpjJqyXa1abKpPAUB8X06d1MOgL OQuzdTWnv/e+2Y4mYO5/oKvmQ3t34u7Ez3wpn9AAjJzjAdoYcjJFYjof9jeUJc6geJF+ fb17LIN3uDdlwf/CplzQb2lCThHDAq/tZ0odCkx5xtKaAqWTrTIvOWlrTCtm8saWbZAc d5sQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=H3QTCcN2mpYLHSKpmriKCfoZn5krghcdHbqPq6Aw8gE=; b=PfQdWGEg7UXLrMTYHm79SkzmVwu5Ce0InJ/kVL5cngLK0qfAOfCZaFhplUb2U2kfDU zjZc2P4Z2LHdznhtaJwwj79/R50i49rv4tzKAJ2W9CQ1m9C8Fn21esQZiJHhq8RInC82 iBmjNmO9PS/kFRJQmzvg+6OUr0e64+nQ6SRdCIiH5hK7UYFLnSlhCQP/vFnCtpnNDNxZ W/2eZBArrMLSahvRcS8iMrzQX79B6JcWN37zjG/Z2fo8wlf4MGvMzrony708vlpuOPA7 YYJpO/R8NTIlwQKMXOYEYaWXWZYCiZezkh1aAMVraZ3PSOKZ0s2Siqn4RHCVY+krrxrv j37A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KjkTXxkP; 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 b9-20020a655789000000b003816043ee67si473577pgr.92.2022.03.31.12.42.45; Thu, 31 Mar 2022 12:43:00 -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=@intel.com header.s=Intel header.b=KjkTXxkP; 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 S232952AbiCaQ11 (ORCPT + 99 others); Thu, 31 Mar 2022 12:27:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235952AbiCaQ1W (ORCPT ); Thu, 31 Mar 2022 12:27:22 -0400 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 782B45F8D5 for ; Thu, 31 Mar 2022 09:25:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648743934; x=1680279934; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=H3QTCcN2mpYLHSKpmriKCfoZn5krghcdHbqPq6Aw8gE=; b=KjkTXxkPte+D9b3tCRB4nrhH1TcE1gPH9Q8zfhJzQVPpMAlO3UP9eq9T xN6mkVdBJESYVXXw9a99FPS7v0RlyssF0hs6m9Gs11AUeXIAXX9Ty6RFR GaYPRCzGmGBdLhn0i3iRdb/lpwVLBsiC5dR4xf5xvmfWVTb6UyAVhF5NU /X09kvDDZo0ZxS5Qu5kGmOkqVmwWO9rFzRfwTT1yrEc5FpwL3068D2C0Z gMijsYqMmZwU2vhXIv94l+cwV6eLHQisBP5GhsfVnVSc0y7ocNt6aKBrr ZZ+ma9CWvIw/ER+YAvWyFDWOr1DEoYWBUPY/zgptTFITiUfwrTj20Vpzs g==; X-IronPort-AV: E=McAfee;i="6200,9189,10302"; a="320578768" X-IronPort-AV: E=Sophos;i="5.90,225,1643702400"; d="scan'208";a="320578768" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2022 09:25:34 -0700 X-IronPort-AV: E=Sophos;i="5.90,225,1643702400"; d="scan'208";a="650354710" Received: from mshakoox-mobl1.amr.corp.intel.com (HELO guptapa-desk) ([10.251.2.3]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2022 09:25:29 -0700 Date: Thu, 31 Mar 2022 09:25:28 -0700 From: Pawan Gupta To: Borislav Petkov Cc: Ricardo =?utf-8?Q?Ca=C3=B1uelo?= , 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 Message-ID: <20220331162528.t5vkfvmkygkiqpcs@guptapa-desk> 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> <87lewqz2dp.fsf@rcn-XPS-13-9305.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Thu, Mar 31, 2022 at 05:25:27PM +0200, Borislav Petkov wrote: >On Thu, Mar 31, 2022 at 03:18:42PM +0200, Ricardo CaƱuelo wrote: >> 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? Yes, this should be fine as update_srbds_msr() would also check for X86_FEATURE_SRBDS_CTRL. If a hypervisor doesn't want a guest to write to the MSR it should not export X86_FEATURE_SRBDS_CTRL. >Just do the simple thing I pasted earlier - no need to rewrite the whole >function for no good reason. I was trying to address earlier comment on split logic in two functions. I am okay with keeping it as is (and just adding X86_FEATURE_SRBDS_CTRL check in update_srbds_msr()). Thanks, Pawan