Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp447201pxa; Wed, 12 Aug 2020 06:15:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLOzm81t1780j1SjJ9T5yU8FI2NEQgJMCwQga9Qh5vCb6l7FzymdtJf+op7l8i4GnepGm3 X-Received: by 2002:a17:906:e24f:: with SMTP id gq15mr31065870ejb.46.1597238118554; Wed, 12 Aug 2020 06:15:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597238118; cv=none; d=google.com; s=arc-20160816; b=Qwzkvvkb571OnMEoSrKmu7YRlVXxs13vmVwm0Z83hS5k87+wq64GC+JzqSJhz+1E6b AMeg6xV3pKncbc+D4Djirkx8rMn51zt1ZKP7VTL+Vu9K6mE5n1PwKLPOS3MYCZmiE1N1 h4mtwC8v5OCExlLsmB8X18rsU7GEVfnR2m1fPuBh6CLr2KQcjhSVTMwxu/nt91jSeLob WwzM9dsjiaji19s9BFaw299vNtMBlmapIGC2YphwKQTI4NYfbXBghgDjCDR1xM8Iw7p8 /jR0A2LnK6i8gnt3pfpKhw09O0cvz50gVDcrJU3B4O/j2ChaIYt+WxfWR5iYZGAy95Ma qBMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject:reply-to :ironport-sdr:ironport-sdr; bh=ERfc6hlrU9iTEvtd/ZXdqDz9ulANMPuEgscRFy2dPGQ=; b=u8goe8zyqaIGW6PwqlRGH3DREpQPZUnlpFi7tFV4bPIfXqiReYR4U4nkkBOkF29MzL 5ae0iq7XhGPqT2KK6hRH1TW7vE1Dl2BA/WXhgy2KsBFxuPb2EWuo6mDP98B3+TVclmdP +O+1DIGOoaIDulxmsrnRC27bbCnbpJSkZ/ZM654E6MjXK7f6acSwrFqOa6dU4cWYQvlA ru4zcPUSd1AwGL9NUW8zgHFQS4WJLROjuglpl5Uy6lnY/EhDZkeGEcwd0Z8lKyXdSC9e RGOGZ/FBNyxnQ1RlZEPMX1aD4x37s/0puHeKwPKa7BiytSX1ZUcawvkfgHeDpqY83U8L PD1Q== 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 y17si1071997eju.316.2020.08.12.06.14.54; Wed, 12 Aug 2020 06:15:18 -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 S1727872AbgHLNOX (ORCPT + 99 others); Wed, 12 Aug 2020 09:14:23 -0400 Received: from mga02.intel.com ([134.134.136.20]:34726 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726946AbgHLNOX (ORCPT ); Wed, 12 Aug 2020 09:14:23 -0400 IronPort-SDR: /44bTRQwz6tdS3e8XUEqktquuczn/OxXymDd1+JUVvIkpn2PTqZoWvyYOoO4v7wHdD5PbkLLoj vcOc1j7arwOA== X-IronPort-AV: E=McAfee;i="6000,8403,9710"; a="141790260" X-IronPort-AV: E=Sophos;i="5.76,304,1592895600"; d="scan'208";a="141790260" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2020 06:14:22 -0700 IronPort-SDR: t2QBoItcDOpyhDAwHn2dS6eO1YG6/F2yQ38D6pum15YIN0mXB+KkWU/yhou43v7pzetzNPpgdH Coe14iNeqOhA== X-IronPort-AV: E=Sophos;i="5.76,304,1592895600"; d="scan'208";a="469817615" Received: from likexu-mobl1.ccr.corp.intel.com (HELO [10.255.29.234]) ([10.255.29.234]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2020 06:14:18 -0700 Reply-To: like.xu@intel.com Subject: Re: [PATCH] KVM: x86/pmu: Add '.exclude_hv = 1' for guest perf_event To: Paolo Bonzini , peterz@infradead.org Cc: Like Xu , Yao , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Mark Rutland References: <20200812050722.25824-1-like.xu@linux.intel.com> <5c41978e-8341-a179-b724-9aa6e7e8a073@redhat.com> <20200812111115.GO2674@hirez.programming.kicks-ass.net> <65eddd3c-c901-1c5a-681f-f0cb07b5fbb1@redhat.com> <8bdc60d5-c9ef-4e8f-6b73-b7bd012d9d30@redhat.com> From: "Xu, Like" Organization: Intel OTC Message-ID: <69bac394-f10c-c0ad-a23d-36cbbd479212@intel.com> Date: Wed, 12 Aug 2020 21:14:16 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <8bdc60d5-c9ef-4e8f-6b73-b7bd012d9d30@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/8/12 21:04, Paolo Bonzini wrote: > On 12/08/20 14:56, Xu, Like wrote: >> My proposal is to define: >> the "hypervisor privilege levels" events in the KVM/x86 context as >> all the host kernel events plus /dev/kvm user space events. > What are "/dev/kvm user space events"? In any case, this patch should > be included only in the series that adds exclude_hv support in arch/x86. The exclude_kernel events from the QEMU or whoever else has opened /dev/kvm. Do you see any (patches) gap if we map the exclude_host events into exclude_hv events naturally ? Thanks, Like Xu > Paolo > >> If we add ".exclude_hv = 1" in the pmc_reprogram_counter(), >> do you see any side effect to cover the above usages? >> >> The fact that exclude_hv has never been used in x86 does help >> the generic perf code to handle permission checks in a more concise way.