Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1910261img; Sat, 23 Mar 2019 16:16:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3SOSnrAWkAmw9t8DdhZE7J8g6PRMHYPSkRjGt+S7+Qk2hpzgxiLEWXgBxmSJDM3frvgDV X-Received: by 2002:a63:4144:: with SMTP id o65mr16099736pga.241.1553383012914; Sat, 23 Mar 2019 16:16:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553383012; cv=none; d=google.com; s=arc-20160816; b=M9wbx1tPTbgA7YawcYJtgpdiyKiIycewcVhvrw/mgBjuI3lo8ciHfU/KgiUVyLEcyC wX3hdDxP4wgDeP+IkS2s306vsbIoh5nlUk4E2E86v94N08wtb3FlldvEuOnRxqY7/F8K FURRVfS57noYztpM3T5DpPn5/WGjOydww7zHmaQwrHfNmwIzDvTzR+XZb4iVwo+k6Pg9 O+Kl1aZibFj+0KvUOkGroGzpfdtcFW+dS1dHEcqE84NiFFTPiOo6MbPIM+FWeZAZvyPK TQfbUTo7wjZ/8Ie8hcz764gORCtS0LTnop8iY343V601CquJ7456YOHFQ+plhysIHuMK XdYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=4BT/MLny+lfMDJArwPTx/Yvn0q4k0uWcZrDcnvbDUU8=; b=1ARWUMWmBjwkfQ0dkmLTqx7RgF33bYKgOsqeGWZuPPlfaD27XG1PhTDmt2D8AHEmXX SVWUj4pTrgw6jluj5NvCElTg8vaRjE38ZgpOKa4JrYCIuQxTiR+46apxKZZpyTQ9YJLQ V988c3I+RC9WLM3vHg/itp3QFl4iKJHirDf/e4+Y1dUGxEO+h1Bys/KSDXvlCay2UCzX 8M2zr/NbJiUF2YEntmZcMYLH3Uc79pxbLd8hj/rEtoa3HUOzxa6lWRdWrbCIaaQ0wNKC MjuEU7fDY8hXWZS+hh/N6XljoXpqbRMuJuOpPPSQZB0Kdj6F35FR0If9YSJ/9o3ZhkhM JwBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id b3si9741106pgq.132.2019.03.23.16.16.35; Sat, 23 Mar 2019 16:16:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727941AbfCWXPq (ORCPT + 99 others); Sat, 23 Mar 2019 19:15:46 -0400 Received: from mga14.intel.com ([192.55.52.115]:40643 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727552AbfCWXPq (ORCPT ); Sat, 23 Mar 2019 19:15:46 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Mar 2019 16:15:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,256,1549958400"; d="scan'208";a="309864568" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.137]) by orsmga005.jf.intel.com with ESMTP; 23 Mar 2019 16:15:43 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id 672693015F7; Sat, 23 Mar 2019 16:15:43 -0700 (PDT) Date: Sat, 23 Mar 2019 16:15:43 -0700 From: Andi Kleen To: Peter Zijlstra Cc: Like Xu , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, like.xu@intel.com, wei.w.wang@intel.com, Kan Liang , Ingo Molnar , Paolo Bonzini , Thomas Gleixner Subject: Re: [RFC] [PATCH v2 0/5] Intel Virtual PMU Optimization Message-ID: <20190323231543.GE18020@tassilo.jf.intel.com> References: <1553350688-39627-1-git-send-email-like.xu@linux.intel.com> <20190323172800.GD6058@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190323172800.GD6058@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > We optimize the current vPMU to work in this manner: > > > > (1) rely on the existing host perf (perf_event_create_kernel_counter) > > to allocate counters for in-use vPMC and always try to reuse events; > > (2) vPMU captures guest accesses to the eventsel and fixctrl msr directly > > to the hardware msr that the corresponding host event is scheduled on > > and avoid pollution from host is also needed in its partial runtime; > > If you do pass-through; how do you deal with event constraints? The guest has to deal with them. It already needs to know the model number to program the right events, can as well know the constraints too. For architectural events that don't need the model number it's not a problem because they don't have constraints. -Andi