Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp198735pxb; Wed, 3 Feb 2021 03:23:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJwehn22zqPtfBenQUAu6ND/HFFSbb+Dc+qqQfhfPlI06/oNLeGJSryc7p5rE1+0Hp2XIjqj X-Received: by 2002:a17:907:968f:: with SMTP id hd15mr2788844ejc.440.1612351429024; Wed, 03 Feb 2021 03:23:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612351429; cv=none; d=google.com; s=arc-20160816; b=nSiRBWzcehMwjLgMbVW9uDqZU0TnoeCzW6fyz/ip0hzscjHIA1LP7yiPPW85syC2Hu GlVEqUsQ/VOnTrcpMwJZ0GATah0V8j/Pp1f/EoJFf7TbQiCqQrtaKO138stHzAq9VEdh jXrMK9wnAMhsd/Vhk4BxPmdoE7x7o8TGlui74lnt8v12FXRB/8u86i3jva58/WMzKhoO nePkWHXSlBQldrDN57u2lSbJs5GZoT4aARKH9wO4kJf0vB4hZgYACQAz7LUPdEPLFhb/ fFOY8oULWDym84Vadlpw+NLaDk9S0Kl7E7D10XjLwxT7LPCRqE/1Y7nBFpw2F1QiE+Tb 21ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:ironport-sdr:ironport-sdr; bh=vGQZIwQt5CXJTX2cKxC1kMwLIaXET+33ebpVoP/SxqI=; b=s7aHd4+gnUP1b4WjGgHRwQJvJGECbsq0kpxRVs//6PV0Xyw2XRiSlKyhnd7CuX2Tzm kfsKq+xJpTfbtZIPLR/6hRkxDI8nWoQN67Klt9AfqsdkfTLsbxXKD7qaTtqJX8YODgD2 1mpRy8Fc1RYAh9SM0QVc/zZn8MaR0wt7oajpCpFkPpx2DUTn+xIB2sOTc/lYiNMtfJGZ WbDk3nYENCgBhnH35ePWvfIOEk2+XOMrjdJFULERzSnCZdMhD/2wFEyEr64zKUfITAOs lrTaJ/zrw2h+EQoeqjchnO7qpCfO2KORD6NAPJEUcONVtdPhFetvVfzd+TTXYKQ73VqH nbAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z3si976338edp.327.2021.02.03.03.23.24; Wed, 03 Feb 2021 03:23:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234160AbhBCLWx (ORCPT + 99 others); Wed, 3 Feb 2021 06:22:53 -0500 Received: from mga01.intel.com ([192.55.52.88]:28338 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234141AbhBCLWs (ORCPT ); Wed, 3 Feb 2021 06:22:48 -0500 IronPort-SDR: T+7htSVXndwn1ohFP5D447d8cIPakNw1tmXDr7bT7uyyhYxHObwbTlKJCcj2vhEtJhAnZd7nAu 6jTWBICp0gGw== X-IronPort-AV: E=McAfee;i="6000,8403,9883"; a="199981242" X-IronPort-AV: E=Sophos;i="5.79,398,1602572400"; d="scan'208";a="199981242" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2021 03:22:08 -0800 IronPort-SDR: Kmuh6o1jdahJ9iaXwcBWw6/DPf6Ajo67xkn8XZu8I+qbUbFfITiIouK4ClYiZhF5mHXMPFSfi3 GauSTKsQDxjw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,398,1602572400"; d="scan'208";a="480311076" Received: from unknown (HELO local-michael-cet-test.sh.intel.com) ([10.239.159.166]) by fmsmga001.fm.intel.com with ESMTP; 03 Feb 2021 03:22:06 -0800 From: Yang Weijiang To: pbonzini@redhat.com, seanjc@google.com, jmattson@google.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: yu.c.zhang@linux.intel.com, Sean Christopherson , Yang Weijiang Subject: [PATCH v15 01/14] KVM: x86: Report XSS as an MSR to be saved if there are supported features Date: Wed, 3 Feb 2021 19:34:08 +0800 Message-Id: <20210203113421.5759-2-weijiang.yang@intel.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20210203113421.5759-1-weijiang.yang@intel.com> References: <20210203113421.5759-1-weijiang.yang@intel.com> 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. Co-developed-by: Sean Christopherson Signed-off-by: Sean Christopherson Signed-off-by: Yang Weijiang --- arch/x86/kvm/x86.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 76bce832cade..a657706358e8 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -1255,6 +1255,8 @@ static const u32 msrs_to_save_all[] = { MSR_ARCH_PERFMON_EVENTSEL0 + 12, MSR_ARCH_PERFMON_EVENTSEL0 + 13, MSR_ARCH_PERFMON_EVENTSEL0 + 14, MSR_ARCH_PERFMON_EVENTSEL0 + 15, MSR_ARCH_PERFMON_EVENTSEL0 + 16, MSR_ARCH_PERFMON_EVENTSEL0 + 17, + + MSR_IA32_XSS, }; static u32 msrs_to_save[ARRAY_SIZE(msrs_to_save_all)]; @@ -5795,6 +5797,10 @@ static void kvm_init_msr_list(void) min(INTEL_PMC_MAX_GENERIC, x86_pmu.num_counters_gp)) continue; break; + case MSR_IA32_XSS: + if (!supported_xss) + continue; + break; default: break; } -- 2.26.2