Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3739079pxb; Tue, 26 Jan 2021 03:34:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJzxq3qOXY1Tf696UjaouXmQ2RMLXLHoQiHsTIjhI+ypi9W+ndKSl2K+ht8fmu1eyCeOPfOV X-Received: by 2002:aa7:d288:: with SMTP id w8mr4187074edq.241.1611660861814; Tue, 26 Jan 2021 03:34:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611660861; cv=none; d=google.com; s=arc-20160816; b=df4WFZD794zZaZuYSyYrTJoPOXKqrZB9LDa3YWGrEWRwEjKNX3x1sUxS3oEugVPoRs w18Uq/gj2TJgKQXZEkhQL6q/2P4PHdQs9HnyiTGy2ruvHu8aZi8ZdfU49J9t3p2TQQw9 TkMQ78pR5SfGi/pDpWcvy7qG225HTb1rmkzPyF/91Uyrt0YzFJUh9mvRneWHgjUZ96Ww yOGAsnw4T5HGnMMqvcMhPej9A0UhA9YBeAwWY9qrt9w18z7nBYd2Sxp7SUHOqrMy6xI/ kNN2gg5X+KWzDJvbn/7ncwCBgpMfBLZXh1c/1ObVY15VtMb3bKTGSTG7Mywie958IPKe 5LJg== 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:from:references :cc:to:subject:dkim-signature; bh=x1Drbrk3bg1upiMuuWq/VTSQhIu0Mj9h/2ZBicG/n7s=; b=x8qtbyL54YMz/ElR0UqLkEjTX+kkUFLAzrZ2K8Qn07Q+8Hn3OhDyS3Cx9V9KGGdsgP JeOUZARocQwAptrNNikbqOErF3TaNrVe3xJ4108ftqrU0FAVCUIJZFKcqx/39W7DFo8g 6rz9HuqPJmCJnD9yTfuNkAaQY1NtEuVHTh7Jn64XC0N27fpnAz2AH4Dra6A6GzDzcHUn a2BGtmJNuhd8ETtd8Rm0c/+3diEBWXkOQ9T7bnTGsfO69VrkDSssNgNiXYE1KjTCmb72 z+drBkZ+4h/FPFEGKzcYWF/VXvaOxhr+weLg4zlQV/fZKhXTMjfQFLcgCH4Rds/3itL+ w3AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SNDNqHjH; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u16si6654680ejb.649.2021.01.26.03.33.56; Tue, 26 Jan 2021 03:34:21 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SNDNqHjH; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392509AbhAZLbZ (ORCPT + 99 others); Tue, 26 Jan 2021 06:31:25 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:33702 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391564AbhAZJxP (ORCPT ); Tue, 26 Jan 2021 04:53:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611654705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=x1Drbrk3bg1upiMuuWq/VTSQhIu0Mj9h/2ZBicG/n7s=; b=SNDNqHjHrYr5ubUbuSMdCo8HUdJuwckk94dOl02qFAI+AQTV+kF6ZZ05fH6UIii1h7fIBx s1uPFXf1rs/7XZj0Un02XKh3Pta2xL2wTmUl4GWozZmCxq/IiTzkmGLyyswEvySSoyVErt 1FXNfJ2HwGiaxWdJIDFYJKWR/HkqTws= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-604-BHveo61dMXG__eiAbKd8sg-1; Tue, 26 Jan 2021 04:51:43 -0500 X-MC-Unique: BHveo61dMXG__eiAbKd8sg-1 Received: by mail-wr1-f70.google.com with SMTP id e15so10321940wrm.13 for ; Tue, 26 Jan 2021 01:51:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=x1Drbrk3bg1upiMuuWq/VTSQhIu0Mj9h/2ZBicG/n7s=; b=USWOR/F+ocGkQVKKuW9v7NLkyXB8V+fXwb8/0iSZNVwjzCvgZh63Docyb3dU8kFd8U LUCdROPf/EZ9W4/XdCQUJg8YkMzWHwRzrqExP1KMcVXXlYBo12OadcAxx0Oy3yXG/cmh P8WwSDEhH883swBwsvWMZEP4FO08mS1kus1TZwM0Woih1eludTxb31uQV31cuzA6RqfR KAoXyZ4TL38uuzzzFP9nEUCPCDPDOJ7cOkTn4llaRARBIEJ8SA1QS97KULxu4JSQf/DW Qi6mu6xOtJxeARGKpNgS2Grk3XD0k8ZKjgrnNRIFE+IdBt9k7YXYnF+6K2E2QlopL1YE RpRg== X-Gm-Message-State: AOAM533UDPWuuASSUZOL4EHoOCdjqhxINpq+nKPT0JBU1lTHgwzPL3jI lm6HPKEsYLA397bejoGjk1WeHaMoRIKWTNsYZZFOdl5AYwFxXnytv5iX2t/eo1gTVpfH8h7Oj0s sQV7V6Z0cckskzwHpkriyKiMT2vd4Wl0or+UMKx6rVPf8FKpX7mwSp6ShxVC/9TUngCETZ74Lq5 uj X-Received: by 2002:adf:c18d:: with SMTP id x13mr5048836wre.128.1611654702368; Tue, 26 Jan 2021 01:51:42 -0800 (PST) X-Received: by 2002:adf:c18d:: with SMTP id x13mr5048804wre.128.1611654702129; Tue, 26 Jan 2021 01:51:42 -0800 (PST) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id q7sm27784410wrx.18.2021.01.26.01.51.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 26 Jan 2021 01:51:41 -0800 (PST) Subject: Re: [PATCH] perf/intel: Remove Perfmon-v4 counter_freezing support To: "Xu, Like" , Stephane Eranian , Peter Zijlstra Cc: Like Xu , kvm@vger.kernel.org, Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Kan Liang , luwei.kang@intel.com, Thomas Gleixner , "Wang, Wei W" , Tony Luck , Mark Gross , Srinivas Pandruvada , LKML References: <20201109021254.79755-1-like.xu@linux.intel.com> <20201110151257.GP2611@hirez.programming.kicks-ass.net> <20201110153721.GQ2651@hirez.programming.kicks-ass.net> <2ce24056-0711-26b3-a62c-3bedc88d7aa7@intel.com> From: Paolo Bonzini Message-ID: <9a85e154-d552-3478-6e99-3f693b3da7ed@redhat.com> Date: Tue, 26 Jan 2021 10:51:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <2ce24056-0711-26b3-a62c-3bedc88d7aa7@intel.com> 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 On 11/11/20 03:42, Xu, Like wrote: > Hi Peter, > > On 2020/11/11 4:52, Stephane Eranian wrote: >> On Tue, Nov 10, 2020 at 7:37 AM Peter Zijlstra >> wrote: >>> On Tue, Nov 10, 2020 at 04:12:57PM +0100, Peter Zijlstra wrote: >>>> On Mon, Nov 09, 2020 at 10:12:37AM +0800, Like Xu wrote: >>>>> The Precise Event Based Sampling(PEBS) supported on Intel Ice Lake >>>>> server >>>>> platforms can provide an architectural state of the instruction >>>>> executed >>>>> after the instruction that caused the event. This patch set enables >>>>> the >>>>> the PEBS via DS feature for KVM (also non) Linux guest on the Ice >>>>> Lake. >>>>> The Linux guest can use PEBS feature like native: >>>>> >>>>>    # perf record -e instructions:ppp ./br_instr a >>>>>    # perf record -c 100000 -e instructions:pp ./br_instr a >>>>> >>>>> If the counter_freezing is not enabled on the host, the guest PEBS >>>>> will >>>>> be disabled on purpose when host is using PEBS facility. By default, >>>>> KVM disables the co-existence of guest PEBS and host PEBS. > Thanks Stephane for clarifying the use cases for Freeze-on-[PMI|Overflow]. > > Please let me express it more clearly. > > The goal of the whole patch set is to enable guest PEBS, regardless of > whether the counter_freezing is frozen or not. By default, it will not > support both the guest and the host to use PEBS at the same time. > > Please continue reviewing the patch set, especially for the slow path > we proposed this time and related host perf changes: > > - add intel_pmu_handle_guest_pebs() to __intel_pmu_pebs_event(); > - add switch MSRs (PEBS_ENABLE, DS_AREA, DATA_CFG) to > intel_guest_get_msrs(); > - the construction of incoming parameters for > perf_event_create_kernel_counter(); > > I believe if you understand the general idea, the comments will be very > valuable. What is the state of this work? I was expecting a new version that doesn't use counter_freezing. However, I see that counter_freezing is still in there, so this patch from Peter has never been applied. Paolo