Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7419122rwb; Wed, 23 Nov 2022 06:21:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf4xkwMli5kuhwDAvdaswdnqqDaxpSogk1wBQW85tfqil+h0ZEdOa9kMtS8z8tsShFs3VRzn X-Received: by 2002:a17:902:848d:b0:17a:b11:3c5 with SMTP id c13-20020a170902848d00b0017a0b1103c5mr8629395plo.22.1669213304660; Wed, 23 Nov 2022 06:21:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669213304; cv=none; d=google.com; s=arc-20160816; b=uJ6kxKIFYdZ+rgu/Bxihwm7P2pwu/J5EeQXbpuB7517AqjPp9CvDHPvqOcUNi4kh5P d7J2TCJbWcjEOnDNY3xL91sZ9nXhVyPWF90oigQnSYfuiVlcqn3aAmC4Qvq5M+9+Prau 2tdvGIdL+PDQoXf9CRCt7djiEuijqa362V8Wu6ie4Uzv21p3nbaundAE9updJlT8nlm7 zH3Da3RznbuFIuUBR1IUN363CObyV6zeCgTUu6wonFR00bzC4JFJ0iC6G9o116A3WZ3i 3OHu89TskUzD10mgf6jNoB4QXD7VPDFdnYigMhvI1o3wA2n4PZQV838MrH1tELuZoMxV COGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qO5DEzg9eRRuBV8jaHiQFeKu/GccCwk1qPJfoU46Cww=; b=CWwlRB0YKhmIpNpDiBjznHUdtBe5U8Ab4xOcvPL2b1aPz7zWeSrnBJ4Ies40nuJgoY dFSmHOFQjiMcXW3PI7LsagJp8geFD4nKIQ0TjGASkN7Mmaj00tRDEUNrYQIRiKfTyt8/ GydgB8N2J/4G0KHnQ3QFet/z8EaCqZeZXTvwNwQz5rwg878S4f9TPMVLJmBGnDymIJvc M3x7RvWRECKGzI3B3nS3MPcTiZv4O+V4vzrZp6U4FIN/+AZbw9gaJR0TG3KYWa1iK64e tdbVkvaOj+g/kIU4hGYwCtJapDTVEC9g9eojTDqszX/JMOVxhrSwFfn5sfw9UTB148m3 +BgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=CnW9K5Ms; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t11-20020a17090ad50b00b00212f7abe85csi1760047pju.41.2022.11.23.06.21.33; Wed, 23 Nov 2022 06:21:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=CnW9K5Ms; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236459AbiKWNbB (ORCPT + 89 others); Wed, 23 Nov 2022 08:31:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236070AbiKWNak (ORCPT ); Wed, 23 Nov 2022 08:30:40 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B09A185161 for ; Wed, 23 Nov 2022 05:11:07 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id c65-20020a1c3544000000b003cfffd00fc0so1418665wma.1 for ; Wed, 23 Nov 2022 05:11:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=qO5DEzg9eRRuBV8jaHiQFeKu/GccCwk1qPJfoU46Cww=; b=CnW9K5MsY6Wf3jSh4utny6DqmahPNJagWfriIUNy/qkhQn32bRwL97MDUUxOZnePgy FNj9HyyK3YrOn4SJlbbd0p0tzEzvPBASXSZxdsEzqRQjbLbAoqwCmzTg3x+JE5kD3uF6 OPIYScYRFaexia9m7Q+XiCf8wJJIOeuMu4BweOJRP5UCLo3sujWNFSCrgRP32HNL7hR/ cytBZ4+TqETXckTFUcKymTjTCM60UNgWiTLFmJN1MweY3sagJKkpu9ODoHe1Yhp/k8+5 NGpAK4e+LCmx96FgecBhWn1uOBVCA42nTf4wb/bMXvH8ndaqKyffyhmywl3KlYDCH3bI njxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=qO5DEzg9eRRuBV8jaHiQFeKu/GccCwk1qPJfoU46Cww=; b=59YwRM3dUvBj0XxwB5H2MzXL6BPNj+s3ZspvStpNogleGpQD28LzE/a1yxqZK1guKC X/QVE+uuphkcv+6YhiEy5k36qV4ll2gaZtQCwfojdMA8YmGjItWguAX7+1AneBuKiBln KBMk6D5H7vCcv4UoFexAo12r+c5WycJQm7QdGIcbVjb5NdZhdGUvD7OrYyD4fxLzHuAW lohSQ/22WNhUk5aa48fWoh8bSHIBKFcxhSX2RXIvQ0M67k+ZCDbl7SqhXnNW5LfZP+yn t+KhVa3PjdOtEbps/7ZdlnHeZAYLRME/VNTFTwvvPb3XlLi00jvf71UF1G0kilJcDt3J vs/g== X-Gm-Message-State: ANoB5pnhrQfLNdhl3/euJggY59/KkopIp6ynyZ11k5CvocBSTRgaiboc BAn1BsyZYW3kB38Q3SDDgSCYVw== X-Received: by 2002:a05:600c:4f12:b0:3cf:e7bd:303a with SMTP id l18-20020a05600c4f1200b003cfe7bd303amr7157554wmq.151.1669209066243; Wed, 23 Nov 2022 05:11:06 -0800 (PST) Received: from localhost (2001-1ae9-1c2-4c00-748-2a9a-a2a6-1362.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:748:2a9a:a2a6:1362]) by smtp.gmail.com with ESMTPSA id dn14-20020a05600c654e00b003cf4d99fd2asm2372934wmb.6.2022.11.23.05.11.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Nov 2022 05:11:05 -0800 (PST) Date: Wed, 23 Nov 2022 14:11:04 +0100 From: Andrew Jones To: Atish Patra Cc: Atish Patra , linux-kernel@vger.kernel.org, Albert Ou , Anup Patel , Guo Ren , kvm-riscv@lists.infradead.org, kvm@vger.kernel.org, linux-riscv@lists.infradead.org, Mark Rutland , Palmer Dabbelt , Paul Walmsley , Will Deacon Subject: Re: [RFC 5/9] RISC-V: KVM: Add skeleton support for perf Message-ID: <20221123131104.zglb3osa5tsgkkkb@kamzik> References: <20220718170205.2972215-1-atishp@rivosinc.com> <20220718170205.2972215-6-atishp@rivosinc.com> <20221101141329.j4qtvjf6kmqixt2r@kamzik> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 On Tue, Nov 22, 2022 at 04:46:14PM -0800, Atish Patra wrote: ... > > > + kvpmu->num_hw_ctrs = num_hw_ctrs; > > > + kvpmu->num_fw_ctrs = num_fw_ctrs; > > > > Maybe it's coming later, but we need to give KVM userspace control over > > the number of counters to allow it to migrate to a larger set of hosts. > > Also, a previous patch said the virtual width must be the same as the > > host width for the hw counters, so we need userspace to know what that > > is in order to determine to which hosts it can migrate a guest. > > > > Yes. The entire user space access control needs to be sketched out. > We probably need another one reg interface to set/get the number of > counters/width. > > However, Is it a common to migrate a guest between different hosts > with different PMU capabilities ? > Ideally we'd be able to define a virtual CPU+PMU which represents the least common denominator of a set of hosts, allowing VMs which use that VCPU model to migrate among all the hosts. x86 pulls this off pretty well, but arm64 doesn't. In the least, I think a goal should be to enable migration of VMs from hosts with less extensions and less PMU counters to hosts with more, as that would support host upgrades without having to recreate VMs. Thanks, drew