Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10508416rwp; Thu, 20 Jul 2023 23:39:47 -0700 (PDT) X-Google-Smtp-Source: APBJJlGl2klQA1r1O4k1P9JRE3qYdj5jeOlKykvpRXM16i12hx4MVczizOSbkKE0+xmpPXnzQGo4 X-Received: by 2002:a05:6402:8c9:b0:521:aa4b:24f3 with SMTP id d9-20020a05640208c900b00521aa4b24f3mr870450edz.24.1689921586927; Thu, 20 Jul 2023 23:39:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689921586; cv=none; d=google.com; s=arc-20160816; b=nCs1pHQd+Yts6uTxwdSjEq8CEUYMwjK9+tIotj9SOvgM80a1mx9CnQXdSE6SzR5g5S 77HE2zXulWa3csukXwr8jY/4XXdNS9V/k6iJxclYFhyVorVZIIEvhxO1Bb9XS5p04VRw PIb4QZKiYCoGWUdkLddsyA5tHSweE5lzlvm0wQNRiJ1PECv2RPiBeSaMfnesyHI9vp09 q3Nw3vd4fjia148v8cZ7BOSUfss3bIZdJMXM/HE6ge0/osDm9h9YnU6YS41xIv3alpE3 PbuctMapxaIHfq4UJwdZ8P4FDac0f+TPFg1vuXBTc+tCjorCoO0+niPyozwBny7995Of W/4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eHNRLSTwL3CfIl/sBzK/DAJMiC6Snyq3IMUoxGZ6ojc=; fh=XnsEqSy+CMYHlJo/r8IG9VDzXKlVDe2fhAHrX/WX8cs=; b=kj3GPQe7TkJ0Yjpt1ozIJeQVLpKFZMub7D53IaGmoF0YQM3VXgIlW9EIRmKRfHEbt4 QEZOR1Ufi6TZzmS/OfnC1n941J8WAM/E8CVcAQ+1Dilnuew47AdPb9DduvOSdD2qOmKI bqnUXJ4LDOap15oiWt17y8XLNrR1dcdtAs+cW94fjBhpjrhSx+zEOMIVfIjmk5KxNSlt 6pHFtRFl98u+EOdmWVkHBjfcpdDEcJwCN/kLHO+jYOZO5JKmvaW5xnNZ2wns3HxUYS5o weSoARM3q7I7dJziJKZpZQmV+dUrB88uU68Jd4mX8bvRcXwuhIv3NAReF7OkRLrU2AsC 3OLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XScH0s3Z; 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 u4-20020aa7d984000000b0051dd300b37bsi1937705eds.76.2023.07.20.23.39.22; Thu, 20 Jul 2023 23:39:46 -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=XScH0s3Z; 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 S230459AbjGUGKD (ORCPT + 99 others); Fri, 21 Jul 2023 02:10:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230071AbjGUGJB (ORCPT ); Fri, 21 Jul 2023 02:09:01 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89B55271F; Thu, 20 Jul 2023 23:08:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689919739; x=1721455739; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MwfzTOMWRaXCBbumrvW/EaiFBOP8yUV8uNuQHa+JVoI=; b=XScH0s3Z2hifcqsZ1zDsHj8pBPmIVooVbRETZiurG1f7cqXdurczyYGi GX/JjPNwfi2HlJs5ODK0gyqyWKIxucyQFbmCb48EbfbYNvt/6IaV4MQ5L 7epS8nM3+xHT8MsiGbCUMkqqf2D1dS6lrVDWeR9hr3eq+agXei5srhnUy Cv2xcNFD6nR4exHAUuJrMaRvpR39aQYAdUk3c7+ioVQSxdd0IUE+YZ2dG L/z2pm3fcpcUOHAo04C4lbpxl+ueE1q+ct9JXZ+60JzfDZJFxcK7Xne3a lsV2hsC1U9t789YMszCacRuWsGEQjenq8HcOnKWx08/dL8G/4OOUE5v0r w==; X-IronPort-AV: E=McAfee;i="6600,9927,10777"; a="370547592" X-IronPort-AV: E=Sophos;i="6.01,220,1684825200"; d="scan'208";a="370547592" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2023 23:08:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10777"; a="848721883" X-IronPort-AV: E=Sophos;i="6.01,220,1684825200"; d="scan'208";a="848721883" Received: from embargo.jf.intel.com ([10.165.9.183]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2023 23:08:40 -0700 From: Yang Weijiang To: seanjc@google.com, pbonzini@redhat.com, peterz@infradead.org, john.allen@amd.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: rick.p.edgecombe@intel.com, chao.gao@intel.com, binbin.wu@linux.intel.com, weijiang.yang@intel.com, Sean Christopherson Subject: [PATCH v4 03/20] KVM:x86: Report XSS as to-be-saved if there are supported features Date: Thu, 20 Jul 2023 23:03:35 -0400 Message-Id: <20230721030352.72414-4-weijiang.yang@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230721030352.72414-1-weijiang.yang@intel.com> References: <20230721030352.72414-1-weijiang.yang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DATE_IN_PAST_03_06, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 From: Sean Christopherson Add MSR_IA32_XSS to the list of MSRs reported to userspace if supported_xss is non-zero, i.e. KVM supports at least one XSS based feature. Signed-off-by: Sean Christopherson Signed-off-by: Yang Weijiang --- arch/x86/kvm/x86.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 439312e04384..4597ab3c811c 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -1451,6 +1451,7 @@ static const u32 msrs_to_save_base[] = { MSR_IA32_UMWAIT_CONTROL, MSR_IA32_XFD, MSR_IA32_XFD_ERR, + MSR_IA32_XSS, }; static const u32 msrs_to_save_pmu[] = { @@ -7173,6 +7174,10 @@ static void kvm_probe_msr_to_save(u32 msr_index) if (!(kvm_get_arch_capabilities() & ARCH_CAP_TSX_CTRL_MSR)) return; break; + case MSR_IA32_XSS: + if (!kvm_caps.supported_xss) + return; + break; default: break; } -- 2.27.0