Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2731817pxb; Sun, 24 Jan 2021 18:46:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJywjLmzseGUnhPpQuTEx9j+66ZCAQvFc09iJ7ciGkk8P4smtto0BypUA7tdzilLJaQGGIqK X-Received: by 2002:a17:907:3fa6:: with SMTP id hr38mr39228ejc.24.1611542795611; Sun, 24 Jan 2021 18:46:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611542795; cv=none; d=google.com; s=arc-20160816; b=E08u5o3pJvEni+FofhR6v+8VsZcd9VAOYy291vpk3ICthqTTPBynUCqeCdwXktBC9s 9T37L7LUsUjpPoGF/TdpuHBPW2PCD0xNv+Hm7gInG3ELiJVGseGMT0exzPmlV8yAJlhk R0BsRdKiqCdJP4Bj7MMv7UWHksjoKy4gO6j0mdj0bTGTPWuMJbKyE1ILn36xKpOUQ+BJ cinmUthvPlwtEK71hi9E/o/R/nTwpOAweoBxzG/sg+SV+sxFr9pWlspGkr2Gm5K8OGmh kZ0izfXUve4CpM/v4xz9+LgmEMedRDoDAU+9NvfJCf/LwndhFa1WfF45B6/s0VB/1kk9 e8+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=vMnHeOOdKAKfJyA4qGIXZ931AAlnyUSNjsVBlQIgXRk=; b=mMSPZVVE0krv8WDuk2lJCgC9Mf2uEV8npiVbN2ifaZWDwsnYKm6wtnQDgLqpALh7P/ hzWWpwCid8gjzYlTIJB38rfgeGsNiEnMqVL49oj/lotjME53eYbIWFckPqpJk23x0GB7 lP5kKoCsvOxzWz4k9PoTl5TgMyRhaLWbXPOp7YnXBi+9wwwlxaLzzApZn4XdS7i38W+p cgl+PVFzWqlVSjBnxJIA/YxHXfDYScPphg0YABhndjLw3hfAyF5Z9yf1Q8j0QkoSz0jJ pp2YytA+ay1S+RE98AqoOMm/+axnXKbz8H/BQq3NBWOPMp6dXQfgs1Ka0rKdJAIOJDMd vL6Q== 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 b24si5525852ejv.374.2021.01.24.18.46.12; Sun, 24 Jan 2021 18:46:35 -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 S1726819AbhAYCnU (ORCPT + 99 others); Sun, 24 Jan 2021 21:43:20 -0500 Received: from mga01.intel.com ([192.55.52.88]:8483 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726821AbhAYCnM (ORCPT ); Sun, 24 Jan 2021 21:43:12 -0500 IronPort-SDR: L9e98l/WCdsGEpP6sPdij86GvGfP/EKvHS//65ne+58ONOvACUpIYn9KHq7qIXn9to0Bt7prwB MQKtVERw/Q3A== X-IronPort-AV: E=McAfee;i="6000,8403,9874"; a="198427923" X-IronPort-AV: E=Sophos;i="5.79,372,1602572400"; d="scan'208";a="198427923" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2021 18:41:10 -0800 IronPort-SDR: TR20KBR/8CvLXHWV/Xpyr7sXuW2iA7heH/n3hUOXi7M/lGpqwTvMMPFuA52qa60fCjrqe9zq5H zlx+ghhtJqIg== X-IronPort-AV: E=Sophos;i="5.79,372,1602572400"; d="scan'208";a="471752637" Received: from likexu-mobl1.ccr.corp.intel.com (HELO [10.238.4.93]) ([10.238.4.93]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2021 18:41:08 -0800 Subject: Re: [PATCH v3 00/17] KVM: x86/pmu: Add support to enable Guest PEBS via DS To: "Liuxiangdong (Aven, Cloud Infrastructure Service Product Dept.)" Cc: "linux-kernel@vger.kernel.org" , Xiexiangyou , "Fangyi (Eric)" , kvm , Wei Wang References: From: Like Xu Organization: Intel OTC Message-ID: <584b4e9a-37e7-1f2a-0a67-42034329a9dc@linux.intel.com> Date: Mon, 25 Jan 2021 10:41:06 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org + kvm@vger.kernel.org Hi Liuxiangdong, On 2021/1/22 18:02, Liuxiangdong (Aven, Cloud Infrastructure Service Product Dept.) wrote: > Hi Like, > > Some questions about > https://lore.kernel.org/kvm/20210104131542.495413-1-like.xu@linux.intel.com/ Thanks for trying the PEBS feature in the guest, and I assume you have correctly applied the QEMU patches for guest PEBS. > > 1)Test in IceLake In the [PATCH v3 10/17] KVM: x86/pmu: Expose CPUIDs feature bits PDCM, DS, DTES64, we only support Ice Lake with the following x86_model(s): #define INTEL_FAM6_ICELAKE_X 0x6A #define INTEL_FAM6_ICELAKE_D 0x6C you can check the eax output of "cpuid -l 1 -1 -r", for example "0x000606a4" meets this requirement. > > HOST: > > CPU family:                      6 > > Model:                           106 > > Model name:                      Intel(R) Xeon(R) Platinum 8378A CPU $@ $@ > > microcode: sig=0x606a6, pf=0x1, revision=0xd000122 As long as you get the latest BIOS from the provider, you may check 'cat /proc/cpuinfo | grep code | uniq' with the latest one. > > Guest:  linux kernel 5.11.0-rc2 I assume it's the "upstream tag v5.11-rc2" which is fine. > > We can find pebs/intel_pt flag in guest cpuinfo, but there still exists > error when we use perf Just a note, intel_pt and pebs are two features and we can write pebs records to intel_pt buffer with extra hardware support. (by default, pebs records are written to the pebs buffer) You may check the output of "dmesg | grep PEBS" in the guest to see if the guest PEBS cpuinfo is exposed and use "perf record –e cycles:pp" to see if PEBS feature actually works in the guest. > > # perf record –e cycles:pp > > Error: > > cycles:pp: PMU Hardware doesn’t support sampling/overflow-interrupts. Try > ‘perf stat’ > > Could you give some advice? If you have more specific comments or any concerns, just let me know. > > 2)Test in Skylake > > HOST: > > CPU family:                      6 > > Model:                           85 > > Model name:                      Intel(R) Xeon(R) Gold 6146 CPU @ > >                                   3.20GHz > > microcode        : 0x2000064 > > Guest: linux 4.18 > > we cannot find intel_pt flag in guest cpuinfo because > cpu_has_vmx_intel_pt() return false. You may check vmx_pebs_supported(). > > SECONDARY_EXEC_PT_USE_GPA/VM_EXIT_CLEAR_IA32_RTIT_CTL/VM_ENTRY_LOAD_IA32_RTIT_CTL > are both disable. > > Is it because microcode is not supported? > > And, isthere a new macrocode which can support these bits? How can we get this? Currently, this patch set doesn't support guest PEBS on the Skylake platforms, and if we choose to support it, we will let you know. --- thx,likexu > > Thanks, > > Liuxiangdong >