Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2382592pxj; Mon, 10 May 2021 01:18:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrjJ+t+5Fzv/bxLEulI7mP/OYXnAcwg6fMf+Th8thLBJmqJ9nhSqO2tTto92wt34WIMU+v X-Received: by 2002:a17:906:80d6:: with SMTP id a22mr23684322ejx.159.1620634736596; Mon, 10 May 2021 01:18:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620634736; cv=none; d=google.com; s=arc-20160816; b=V189s/kOsGcFqXcfBxidHY1117IDf8AjdEm7MbKJWb5m/UJYHs2Q62ux3SnVunJ5Op aS0y44d32Slfl5Q+sTBArxlHQ9dfALaGTAGgYIAutW0rjvywZbd7mhIPWVu0K634KSKb 6R1SwC2jQiSNk3tx1hP8YypewWsxKqSLaZl5sN2DDw1GEdzkUHsBsHo0+RMO3vMXVAkZ 4T57p/c870rVdoQdoVuBgWMZZaRmcpd/mOtMOBrAzUYsVf/pbYEDfGGq1bQtS+W7E/e4 cuFjDR5gMv70WmMbXYr0mGXbvacE5txDKLiUllsFh+NQLAp5+TdVDlispw/APVyqJDCw p/Dw== 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 :ironport-sdr:ironport-sdr; bh=oPmJ3FhQdgIO8oMO9PPZ505z0dZORXHNzBVJKB5AsSY=; b=r/JuhOz//N4KM73hsbZ7yo7P6PxGyfbsvVbHfynnYuxhlAOPYyJ9b41QtrLzHHbpwO 1ZDac1+8Q0xILxlaiSsdzFMW9zuGji3gSKLhuZ+x1UP06HJZJB1UNcfMaUzuz4T39HFW 2liLJg7foh18HOcdCxi9JTrsp4ue2txOhujpvAj7yZwUA+CJoUNqAW91gfof11oK3h7O TNV1V/dug4Wtdb/T9Zo+mOAK6WFOXys2lYnXxTDAARlargyaCpg6gS3f4bqhmpWqjcXb yCWQamazLVztNEuSRCIMy3MM2OojZhymRayv79nNDKLo7LpXN7DC6wvpo7Qebxjcsbou GVfw== 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 s25si14829098edy.17.2021.05.10.01.18.33; Mon, 10 May 2021 01:18:56 -0700 (PDT) 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 S230369AbhEJISB (ORCPT + 99 others); Mon, 10 May 2021 04:18:01 -0400 Received: from mga12.intel.com ([192.55.52.136]:42733 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230140AbhEJIRv (ORCPT ); Mon, 10 May 2021 04:17:51 -0400 IronPort-SDR: JOxIhBufGSXnN6ug9Quy9pGHX6nciVMw4bUTVlVqBcS5W4EvQs6qq7S1ZeCu0N/3wgsRBbZrrZ cdsMPeIBGHmg== X-IronPort-AV: E=McAfee;i="6200,9189,9979"; a="178727840" X-IronPort-AV: E=Sophos;i="5.82,287,1613462400"; d="scan'208";a="178727840" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 01:16:35 -0700 IronPort-SDR: dcUjZzejXNEvuPfmd7iTC+qxBslN5d0lEn1ARd6cZXcuIrdLEWhSf8/cAoFoFFC4rohz4JK6hS ei3bJihoNYew== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,287,1613462400"; d="scan'208";a="408250933" Received: from clx-ap-likexu.sh.intel.com ([10.239.48.108]) by orsmga002.jf.intel.com with ESMTP; 10 May 2021 01:16:33 -0700 From: Like Xu To: Paolo Bonzini Cc: Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , weijiang.yang@intel.com, wei.w.wang@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH v4 08/10] KVM: x86: Report XSS as an MSR to be saved if there are supported features Date: Mon, 10 May 2021 16:15:32 +0800 Message-Id: <20210510081535.94184-9-like.xu@linux.intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510081535.94184-1-like.xu@linux.intel.com> References: <20210510081535.94184-1-like.xu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Message-Id: <20210203113421.5759-2-weijiang.yang@intel.com> Signed-off-by: Paolo Bonzini --- 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 3a67ad29fa9d..b699f7a37b1a 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -1298,6 +1298,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)]; @@ -6035,6 +6037,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.31.1