Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp132573rdb; Fri, 29 Sep 2023 20:52:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHy0hZ/2vHHOlWwYNPnRhtjfvQoRNXP//GVmmsVIlNmKUrfmwNY1Cu3v/N9+jBM/5+Uk6pT X-Received: by 2002:a05:6a20:7349:b0:14d:e615:277c with SMTP id v9-20020a056a20734900b0014de615277cmr8917964pzc.11.1696045930138; Fri, 29 Sep 2023 20:52:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696045930; cv=pass; d=google.com; s=arc-20160816; b=ff1wMQCwRKNtwBkJGzPj+TiUSyQSP6mR5vcCP89bh7CCJV7+eL8xF0lKthk5VK0Jpv nhcCOSMDLGdv0C1dds9gcnjd7iFXpQjWn5QOILUnskYHM0D6xN+QGme3XXBA8oLQ0Uuh CuXY6alX+TAj6Z9XapQOq2dB/J0pqJ45aOCCC/YKivMxwV2yigElsgHD7VXY9VWZxUgA HgDqqNg3JrcsuVEzllxotPNmBr/tmwelEaOM7GPNqJ6N1CrHDT9yOUkO2xv5l7pA47WY ttWKlc7661Qh0VNDbk6MSGsHaHiacLfnqUmHOAqeCoOMdcsUZdOuDDd69H7buH84rbd5 /NoQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:content-language:references:cc:to:subject :user-agent:date:message-id:dkim-signature; bh=jgPGfeBA26AOK1p/cUqj6SE2f1ZpErc9+DbTahbj0d4=; fh=yMBFq5fO4mN+YPAzFf4ye4olTKrMHE4MER8MrMtl+Hw=; b=Y5FPSuZcacw4WQycP8GbUmhIQUa7HCpy4JcLk5y94lL9wxqTnYsnbG2hFZFDn2EDW5 kmJWfdLSIxNaiILAyUpqN0pIT3XTGAjl3cexE7UchpbM8x+gPz124R3oUjt3oIp3263h cfUpm792xLOS3qpmGMlvUvOM9Qz2DShHDaSv+BMVtgnEqWJXIJspa6aRSHSEi21Ftea4 5JjBlcVU5hScmZZD5cabXeWJNsE7c14Q7KR61E1sHlW8VR3CN+zCVuzJr50Q3YOdEjP8 8UNgKiZ2xmeWxqVMlhQuqWOHh6tsTFAsD2KzIlm+TctUzjI3zh97WlBB5XqQKoJTDXhB J9fA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=F1DuA4dT; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id cw16-20020a056a00451000b006906a716917si21942799pfb.398.2023.09.29.20.52.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 20:52:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=F1DuA4dT; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 8D581802B071; Fri, 29 Sep 2023 08:20:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233592AbjI2PU1 (ORCPT + 99 others); Fri, 29 Sep 2023 11:20:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233488AbjI2PUZ (ORCPT ); Fri, 29 Sep 2023 11:20:25 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2080.outbound.protection.outlook.com [40.107.220.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36E30BF; Fri, 29 Sep 2023 08:20:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T9GKxQcD3ru7w7lu+4/CEv1khup779AF2cA6kjZA3KIfGnoH8Wx4Xe6WY+2uij8TUQXSQPEmOgZyvGP43/evm9BhA2jTFZWCJHof2IOqbQUcl86pBXmOj4zTUiYIhIxHF//fZaNsKfinbQ7hdMQcyDt1UuVPeBA/+C6RHftzvw5w2KxWoSyjLVGM5MOjJGgT13lqWQqfqvxlZuedF/xz97TAw3iRq+/EZuz+dHX4UDFEx/q9C4ebz2kPWAUuzULQPSHQsgoNjItGYy0c3a6tNu6U6cCkKOMw03J9DLCvo8cAFh4+mXRVqD4kjFMlN75dD4LEC51uIhB7rPx52ohaUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jgPGfeBA26AOK1p/cUqj6SE2f1ZpErc9+DbTahbj0d4=; b=n9ihLJnpdxN1QKFA4yktVuHkmL7uN6YkJQp9LkBYhW8tekGkIt+ePzAC6ORm8pJRtDgUdYcydUivvv+jQOxPVMrAHFmSbEekkL7qejA0wUyqP0nM0vj9/S51ZbEtGmGg22qpkI3Ui7fiQblPeqj5Qap8KeeaVQE8m53j8hsmINBpdIjZmZfySIdNfK8tnFh9BSbfUnWoSvkFkzrCMnUKIr6es+0MeLNPahCGMi38Mt3SFTL9q6UkcHyFZpq3vvaFUE8BdDrwKoU84eqW2fuGeiLbqiEhHPsbHhufds42At8Ax5ufXIIazsHdbKGQQUBPeGQ/MklhTgiN3i4LhFA9oA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jgPGfeBA26AOK1p/cUqj6SE2f1ZpErc9+DbTahbj0d4=; b=F1DuA4dTt98M3MI3CPUz+UFXNoxI2Jm5gU9WJf/kYrTOUOordNpW8pU3IJLmxSPZ4ZL83jyVnZxK1rx/6u2YRPsVO5tXUJFLQJljiC4Kn1CjTGhd6G3Epj9nYfoyrVxHtPg0XI/mxSxTa5sEl48tRZbw31StUvW8R9L11t0pkx0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from PH7PR12MB6588.namprd12.prod.outlook.com (2603:10b6:510:210::10) by PH7PR12MB9104.namprd12.prod.outlook.com (2603:10b6:510:2f3::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.27; Fri, 29 Sep 2023 15:20:20 +0000 Received: from PH7PR12MB6588.namprd12.prod.outlook.com ([fe80::a4ed:10a6:876a:10d7]) by PH7PR12MB6588.namprd12.prod.outlook.com ([fe80::a4ed:10a6:876a:10d7%3]) with mapi id 15.20.6838.024; Fri, 29 Sep 2023 15:20:19 +0000 Message-ID: <957d37c8-c833-e1d3-2afb-45e5ef695b22@amd.com> Date: Fri, 29 Sep 2023 20:50:07 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [Patch v4 07/13] perf/x86: Add constraint for guest perf metrics event To: Peter Zijlstra , Sean Christopherson Cc: Dapeng Mi , Paolo Bonzini , Arnaldo Carvalho de Melo , Kan Liang , Like Xu , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , 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 , Jim Mattson , David Dunn , Mingwei Zhang , Thomas Gleixner , Ingo Molnar , Ravi Bangoria , Manali Shukla 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> Content-Language: en-US From: Ravi Bangoria In-Reply-To: <20230929115344.GE6282@noisy.programming.kicks-ass.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PN2PR01CA0209.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:e9::20) To PH7PR12MB6588.namprd12.prod.outlook.com (2603:10b6:510:210::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR12MB6588:EE_|PH7PR12MB9104:EE_ X-MS-Office365-Filtering-Correlation-Id: b49d64bb-8b3a-4867-7ef1-08dbc0ff9786 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JDap6XSMPVq4YXDZT6n7kXqOHUQwZoAdgHhSfJVub8h7dZAWqze2YUusqxWQ7D43jK/VeDbFeu29NYiy+zzOoLgSHvU7YagRj3BI179hdkZ0qolLd5whZJoebqp1tZujpWO0f+SB4+dNNhBkHUy96+SKOl8pCh63xb4PEvHnYNHxMqx98HLMhSF3o9OQR+orR54XPQRLRCp47mw0n0rQm3Y2Da2EyrDT/wzb3xsIWbUX2ZcjvnXNmyZh3xRv58Q8/wCfpiaAzfZH1xnaRMgzrHIkApp2qOhvqwel6YwliqvB1NLPI/YeHfUrHQhlE88VOcUrtcNhMFEHgiz5wIq6kJf78Z6JEeppHK/c7eJCivmrYPfNH+HHjEyb8088PJLqtrukeGt4Ay9hzjMQlO8AGgiLbwUQtXazoPcHBRyyUfXA2dKdzY2DNmSzwwzhfASaH7UN8r6v3aVHTIb6b6UI9q4uO6wwClH/bd3wx7qWokdv1j7HWRRekJRe50lN309VQo/HO5rMIg1HZOGNnVYrFC/BHu3ADsIgLkaIqh3EETWv/Bgpb8Jhhv07U8AyYxsegmsO8PJ2B8G2J+kSrjrqIW9I49NxRtHld8TBIhCBdVQzIN1P1iOknp6dt8ZBgwTxTpSgHg/QU2FNFlqfmg7HJQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR12MB6588.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(366004)(346002)(396003)(39860400002)(376002)(230922051799003)(64100799003)(451199024)(186009)(1800799009)(31686004)(66899024)(83380400001)(38100700002)(4326008)(54906003)(7416002)(86362001)(31696002)(36756003)(966005)(478600001)(66556008)(66476007)(110136005)(66946007)(44832011)(5660300002)(41300700001)(8676002)(8936002)(2906002)(53546011)(26005)(2616005)(6486002)(316002)(6506007)(6512007)(6666004)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NWVGcVhXYXZUR01CTk9yVzRuMU03Y2s1RWtVQzg2ek5IVnV2MG1jT3QzSU9Q?= =?utf-8?B?QkFrUDRJWVVrWW1jRWVTRVcySUZWRXk3M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utf-8?B?K2RJNFRkTjROM01KMVRvTkc3Tkd1cGlOcnpUZ1lvL0o1QWdmV3VMcHFNSlVz?= =?utf-8?B?QnpyQU1ZUm42NWhXcnM2M3J2OXBLWUI5aFg5VTAwUnZFMXJjU0lRbmxkSDBG?= =?utf-8?B?aXBZVGFNZmRINnA5L1R6QTBnanpmbHc2T2VCY0Y5d2wzWUtTSGQ0ZjZ3bkhk?= =?utf-8?B?T2FJcHVESW9HNmtRcThPb29tOGR0aFFINWl6aTJRdTNMUnI5dW54OVhNbUxl?= =?utf-8?Q?1Ww9Xy3/B+XUz5biRdNOKYQD5?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: b49d64bb-8b3a-4867-7ef1-08dbc0ff9786 X-MS-Exchange-CrossTenant-AuthSource: PH7PR12MB6588.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2023 15:20:19.8158 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: awIQZK6hHMZx6o4IuGy8LDi4myTffgAEYx/QYXTHw6DOGseWKKeGJKDIAU2JygrmOqoWw4sSM/4QPf9EOvPLzQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB9104 X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, NICE_REPLY_A,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Fri, 29 Sep 2023 08:20:43 -0700 (PDT) On 29-Sep-23 5:23 PM, Peter Zijlstra wrote: > On Wed, Sep 27, 2023 at 10:27:07AM -0700, Sean Christopherson wrote: > >> I don't think it does work, at least not without a very, very carefully crafted >> setup and a host userspace that knows it must not use certain aspects of perf. >> E.g. for PEBS, if the guest virtual counters don't map 1:1 to the "real" counters >> in hardware, KVM+perf simply disables the counter. > > I have distinct memories of there being patches to rewrite the PEBS > buffer, but I really can't remember what we ended up doing. Like I said, > I can't operate KVM in any meaningful way -- it's a monster :-( > >> And for top-down slots, getting anything remotely accurate requires pinning vCPUs >> 1:1 with pCPUs and enumerating an accurate toplogy to the guest: >> >> The count is distributed among unhalted logical processors (hyper-threads) who >> share the same physical core, in processors that support Intel Hyper-Threading >> Technology. > > So IIRC slots is per logical CPU, it counts the actual pipeline stages > going towards that logical CPU, this is required to make it work on SMT > at all -- even for native. > > But it's been a long while since that was explained -- and because it > was a call, I can't very well read it back, god how I hate calls :-( > >> Jumping the gun a bit (we're in the *super* early stages of scraping together a >> rough PoC), but I think we should effectively put KVM's current vPMU support into >> maintenance-only mode, i.e. stop adding new features unless they are *very* simple >> to enable, and instead pursue an implementation that (a) lets userspace (and/or >> the kernel builder) completely disable host perf (or possibly just host perf usage >> of the hardware PMU) and (b) let KVM passthrough the entire hardware PMU when it >> has been turned off in the host. > > I don't think you need to go that far, host can use PMU just fine as > long as it doesn't overlap with a vCPU. Basically, if you force > perf_attr::exclude_guest on everything your vCPU can haz the full thing. > >> Hardware vendors are pushing us in the direction whether we like it or not, e.g. >> SNP and TDX want to disallow profiling the guest from the host, > > Yeah, sekjoerity model etc.. bah. > >> ARM has an upcoming PMU model where (IIUC) it can't be virtualized >> without a passthrough approach, > > :-( > >> Intel's hybrid CPUs are a complete trainwreck unless vCPUs are pinned, > > Anybodies hybrid things are a clusterfuck, hybrid vs virt doesn't work > sanely on ARM either AFAIU. > > I intensely dislike hybrid (and virt ofc), but alas we get to live with > that mess :/ And it's only going to get worse I fear.. > > At least (for now) AMD hybrid is committed to identical ISA, including > PMUs with their Zen4+Zen4c things. We'll have to wait and see how > that'll end up. > >> and virtualizing things like top-down slots, PEBS, and LBRs in the shared model >> requires an absurd amount of complexity throughout the kernel and userspace. > > I'm not sure about top-down, the other two, for sure. > > My main beef with top-down is the ludicrously bad hardware interface we > have on big cores, I like the atom interface a *ton* better. > >> Note, a similar idea was floated and rejected in the past[*], but that failed >> proposal tried to retain host perf+PMU functionality by making the behavior dynamic, >> which I agree would create an awful ABI for the host. If we make the "knob" a >> Kconfig > > Must not be Kconfig, distros would have no sane choice. > >> or kernel param, i.e. require the platform owner to opt-out of using perf >> no later than at boot time, then I think we can provide a sane ABI, keep the >> implementation simple, all without breaking existing users that utilize perf in >> the host to profile guests. > > It's a shit choice to have to make. At the same time I'm not sure I have > a better proposal. How about keying off based on PMU specific KVM module parameter? Something like what Manali has proposed for AMD VIBS? Please see solution 1.1: https://lore.kernel.org/r/3a6c693e-1ef4-6542-bc90-d4468773b97d@amd.com > It does mean a host cannot profile one guest and have pass-through on the > other. Eg. have a development and production guest on the same box. This > is pretty crap. > > Making it a guest-boot-option would allow that, but then the host gets > complicated again. I think I can make it trivially work for per-task > events, simply error the creation of events without exclude_guest for > affected vCPU tasks. But the CPU events are tricky. > > > I will firmly reject anything that takes the PMU away from the host > entirely through. > > Also, NMI watchdog needs a solution.. Ideally hardware grows a second > per-CPU timer we can program to NMI. Thanks, Ravi