Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp575874rdb; Sat, 30 Sep 2023 17:32:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFu0kwPrZUfBgQUg3B4NJzN2TfpqSm17VCzekIU7lvolK+Y4Y2mMak0ZfoLc8OlP7KcWl/6 X-Received: by 2002:a05:6870:424f:b0:1be:f0b4:b9bc with SMTP id v15-20020a056870424f00b001bef0b4b9bcmr8940313oac.39.1696120342936; Sat, 30 Sep 2023 17:32:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696120342; cv=none; d=google.com; s=arc-20160816; b=ABZ1WRl75sMKX0Ua5ceXPnAg84IECDpwlDucsT+RevsHdf0Ws3IFfyP2NLFeT9UyoN WhcIgfDBlr9xcGWokb2WKeR/UdadCXEqG6Eqi7rcZ0TxwJlP/S4hDpVgQk1L9EL+/WPg quDLFI1jvlXJc7mg3XgHZJcm/XwkRMsNN/cdV2NdmiDegsGFEOFpy1c0odd0loBM430q 1tG5uhSwhzrikwvtBFB9J1NKWgCIphCdcJydjnnwT3jaOuc1KgqYbyE7Hh8E0zfmbLVg N8uyEogAkQKY+e6I+CktFRr3gagp5V2h/db8Qbcwp4v7s63jS+vpnDrYuE9nCk7/Ax5o IHBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=IwGHiyOvjZr8sgZvxA1ue6iuc+dFgHrrj/1Bk9oyjsc=; fh=OG+6AGSLecCwbAw2Nk0Sv8Wo8gR3F1kaDiHTne0KZ8g=; b=hF1tSDQS/gEAEXVx/67RxyxPQhWa8rX5eVo3Y0XO+9U/7HpulcBp/qJXsAAz2CV1df U6npmb24EgZRgcAvny84v2yprxqe7WubdXu3p4Q7AjX3pK2FjOC1IbZ0fT29ycY1iese YPlcfpfDUCww6F1iQjAAt1IC7v5vjJnuFa2QD542AWH50dB7zzrPOD21Yggj11ox/B6J x5jOfu2jpoFddDCCzU3vZTCWOJJDQtcONbugvJ4Nz4kiGjz2H9OuFhVvf4xHdUKJLFcs DHVpBI45R1HQxfE69Qzw3cULfvyJ6HoV928rGSyHR3GoPtmg/G3lonI2MqEHy9bQglel gqPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id b128-20020a633486000000b0057755c96163si25204783pga.14.2023.09.30.17.32.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 17:32:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 2BCCD812E033; Sat, 30 Sep 2023 17:32:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234139AbjJAAbz convert rfc822-to-8bit (ORCPT + 99 others); Sat, 30 Sep 2023 20:31:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229471AbjJAAby (ORCPT ); Sat, 30 Sep 2023 20:31:54 -0400 Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A52DDCA; Sat, 30 Sep 2023 17:31:51 -0700 (PDT) Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-79f82b26abfso535713739f.1; Sat, 30 Sep 2023 17:31:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696120311; x=1696725111; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6AchQhtz3Is06siYaW/kQahKNyjQihWPGVqucswhxyA=; b=ppAKVSi1Cw9A6DkzkD+q2HLS+JObvee0vZCvRdiB/9V3n9GSGBnixtwRizS4ABjiO/ Xvh/1CogDnKQVVwiVSwFQxgbhPbbhui/QI6YVDhe4BxUzbHD7ZNaoz/KMPADDlc10/v/ QY4m9h/qsDd4Y2o5zrfnqXmkG150NvlaD+Ol4Nd3pNyLYUudbCdFesSESJkqfIlD159H +NFl61KvzSzBISZAFOuqd0nr1RUzI9XkO7N1GdSnjq53PgzX3sX98dx6r9WK7Wu+Obfl Tf7m+Ij5RjHRhDqY0M6nLqgS89NkVQWcR9tZuA7xqDdPXUP5SkoASq1g5J9EHew+K5gK umSg== X-Gm-Message-State: AOJu0YwQD/KIU1v6n+io5eFnyHLuX35i50PqVHTrDKRHcavcaXBOLV0n 0K4FtpHPmwA9xKx3pUKhncRNA5gHZcGkE+E6YFI= X-Received: by 2002:a6b:5b15:0:b0:79f:99f5:fadd with SMTP id v21-20020a6b5b15000000b0079f99f5faddmr8947813ioh.6.1696120310760; Sat, 30 Sep 2023 17:31:50 -0700 (PDT) MIME-Version: 1.0 References: <20230927033124.1226509-1-dapeng1.mi@linux.intel.com> <20230927033124.1226509-8-dapeng1.mi@linux.intel.com> <20230927113312.GD21810@noisy.programming.kicks-ass.net> <20230929115344.GE6282@noisy.programming.kicks-ass.net> In-Reply-To: From: Namhyung Kim Date: Sat, 30 Sep 2023 17:31:39 -0700 Message-ID: Subject: Re: [Patch v4 07/13] perf/x86: Add constraint for guest perf metrics event To: Jim Mattson Cc: Sean Christopherson , Peter Zijlstra , Dapeng Mi , Paolo Bonzini , Arnaldo Carvalho de Melo , Kan Liang , Like Xu , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , kvm@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Zhenyu Wang , Zhang Xiong , Lv Zhiyuan , Yang Weijiang , Dapeng Mi , David Dunn , Mingwei Zhang , Thomas Gleixner , Ingo Molnar Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Sat, 30 Sep 2023 17:32:20 -0700 (PDT) Hello, On Fri, Sep 29, 2023 at 8:29 PM Jim Mattson wrote: > For things to work well in the "vPMU as a client of host perf" world, > we need to have the following at a minimum: > 1) Guaranteed identity mapping of guest PMCs to host PMCs, so that we > don't have to intercept accesses to IA32_PERF_GLOBAL_CTRL. > 2) Exclusive ownership of the PMU MSRs while in the KVM_RUN loop, so > that we don't have to switch any PMU MSRs on VM-entry/VM-exit (with > the exception of IA32_PERF_GLOBAL_CTRL, which has guest and host > fields in the VMCS). IIUC that means multiplexing should be handled in the guest. Not sure it can support mixing host and guest events at the same time. Thanks, Namhyung