[v2,02/15] KVM: x86: Report XSS as an MSR to be saved if there are supported features
Message ID | 20221125040604.5051-3-weijiang.yang@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3796556wrr; Thu, 24 Nov 2022 22:10:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf5Rvrl+wKV/zfXvAkLUk7GgisELLluEEFKkfA/1LilamgJm3GX2RAuxga1JN1kJ/X9SnLMf X-Received: by 2002:a17:90b:683:b0:213:cfb4:719 with SMTP id m3-20020a17090b068300b00213cfb40719mr17241100pjz.188.1669356633561; Thu, 24 Nov 2022 22:10:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669356633; cv=none; d=google.com; s=arc-20160816; b=tCim6XC82z7iy9J1812DEKNjgKGTK4VszZzEZxXCXPP+suQJVkVTwg4yV98fD2k3ko PDrVUlKmqvX99Sny1ZP1shhrX9zQVssOlNQRIE5hHmm5UEwOyaymxKzRnDVeVPD6jXkS A5qWhpbU0pZwra09wJBZYTvOeHtPzjMqkdYAkNiiADiPgR8ItXh0m2Ihppze/vgB3eMq YfC4J7nfSM1RdoTu3HBCT8R6Saek248GlDKPfTA27XrzBq+Tzag+0D6jZrlRm7YOgg5l p8gopvwXpYhHPJTnYKjKt+/iX5OHJcxufL0yEH69TMuQCNfDzYd3qmeoeCXFxOxq0opc 7xGw== 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=HB5jDdpQub4bjp14F3Oj6Cy/wgwkbr6huk0Mg052x40=; b=LkSmA1c5oaQmGqUNOeCgyXRkN1meI0gsv4iKpCvl9ckPcWF/ZhuPEuauPNpNNVPb5I Pon172CKq9aX7eo6EEnMx5SNNmAT96xdJFLbusWx2vshz5UyvDxQr1ESUopxUwQbZAzv mYZs97PK+agMp3Y9LJmGRdTiDC1+rAWGqo1dnADSKJ4xxo/gJwasMZy/qA4n7s5JbyRA zoxQO2Jwu6kyyep5wv7KJt+tmCyjG7yjlL9P7AMLEmbU5SkUk9ZqOUEQrMdU7UAZs1ul 85+BjuuqrsTCheB8fQ6lfaTsC7t5th1DW0P2YgExfGWJw2hgP+VZV5di40GOd6ZRdY4P yG0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=K160Jpoa; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s14-20020a170902988e00b0017b3392ca72si2662391plp.323.2022.11.24.22.10.19; Thu, 24 Nov 2022 22:10:33 -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=K160Jpoa; 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 S229548AbiKYGKF (ORCPT <rfc822;zxc52fgh@gmail.com> + 99 others); Fri, 25 Nov 2022 01:10:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbiKYGKE (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 25 Nov 2022 01:10:04 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B11E1F633; Thu, 24 Nov 2022 22:10:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669356603; x=1700892603; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BxKmdti/F0ZDN+6HkQ50O9NI5gzI7uJBgUfpvPRf2BQ=; b=K160JpoaXFeFFMJCzDyATZ2n9HFdS4SNB0tT9DAGCJb20m3mZ5SfyosM 6BKoGG3DEhI3qjdMs5t22VIMU3XQMCPWdUbcC7CFpXF+ZBbsZ5eY7A/v0 VF3KNswHw9YqUSDvS5IuotTgXoDkyX7pB1wDCvJZRiySw2ZtBJ9bWHXdR hV/rvp/JzCvVandQSvhsi3UG3I2XA3iQHdyKtP/gosH9svr41+JMutWBB mPpSdbuwaF71eRdki/vijRArtMsfazjPYwFdTmVtcCT3nwqfcXJoj+8GK Vhzz0ZaX89+R4h6Tj4yWBXQgaKFK6HQPy6zbCIRZaOUqinBDOEiEr2cvR Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10541"; a="313116799" X-IronPort-AV: E=Sophos;i="5.96,192,1665471600"; d="scan'208";a="313116799" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2022 22:10:02 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10541"; a="784838453" X-IronPort-AV: E=Sophos;i="5.96,192,1665471600"; d="scan'208";a="784838453" Received: from embargo.jf.intel.com ([10.165.9.183]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2022 22:10:01 -0800 From: Yang Weijiang <weijiang.yang@intel.com> To: seanjc@google.com, pbonzini@redhat.com, jmattson@google.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: like.xu.linux@gmail.com, kan.liang@linux.intel.com, wei.w.wang@intel.com, weijiang.yang@intel.com, Sean Christopherson <sean.j.christopherson@intel.com> Subject: [PATCH v2 02/15] KVM: x86: Report XSS as an MSR to be saved if there are supported features Date: Thu, 24 Nov 2022 23:05:51 -0500 Message-Id: <20221125040604.5051-3-weijiang.yang@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20221125040604.5051-1-weijiang.yang@intel.com> References: <20221125040604.5051-1-weijiang.yang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750447301131068433?= X-GMAIL-MSGID: =?utf-8?q?1750447301131068433?= |
Series |
Introduce Architectural LBR for vPMU
|
|
Commit Message
Yang, Weijiang
Nov. 25, 2022, 4:05 a.m. UTC
From: Sean Christopherson <sean.j.christopherson@intel.com> 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 <sean.j.christopherson@intel.com> Signed-off-by: Yang Weijiang <weijiang.yang@intel.com> --- 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 f18f579ebde8..16726b44061b 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -1465,6 +1465,7 @@ static const u32 msrs_to_save_all[] = { MSR_F15H_PERF_CTR3, MSR_F15H_PERF_CTR4, MSR_F15H_PERF_CTR5, MSR_IA32_XFD, MSR_IA32_XFD_ERR, + MSR_IA32_XSS, }; static u32 msrs_to_save[ARRAY_SIZE(msrs_to_save_all)]; @@ -7061,6 +7062,10 @@ static void kvm_init_msr_list(void) if (!kvm_cpu_cap_has(X86_FEATURE_XFD)) continue; break; + case MSR_IA32_XSS: + if (!kvm_caps.supported_xss) + continue; + break; default: break; }