From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-194.mta0.migadu.com (out-194.mta0.migadu.com [91.218.175.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA8B937155 for ; Wed, 18 Oct 2023 22:17:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="ekUfSPU3" Date: Wed, 18 Oct 2023 22:17:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1697667429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ztNFzRAh3XJ3IwivXV0tZ5qyOZlUiSKoGVQq6wIcNls=; b=ekUfSPU3v18059DZdZrVpew7QpqnJJ1sYScvAhqqc/pvIZCmu+oApZt8bUO6OXug6NmjNy i8pjmvtCEc58wMOafrBz96SXMRUdrgbDW2XXYNfUDDgtbLusEzevbfeI1SUHT+3PKgXfFc kwVxhDtEeZCbrh9xSGm5Msv8LXMXUyA= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Raghavendra Rao Ananta Cc: Eric Auger , Marc Zyngier , Alexandru Elisei , James Morse , Suzuki K Poulose , Paolo Bonzini , Zenghui Yu , Shaoqin Huang , Jing Zhang , Reiji Watanabe , Colton Lewis , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH v7 03/12] KVM: arm64: PMU: Clear PM{C,I}NTEN{SET,CLR} and PMOVS{SET,CLR} on vCPU reset Message-ID: References: <20231009230858.3444834-1-rananta@google.com> <20231009230858.3444834-4-rananta@google.com> <53546f35-f2cc-4c75-171c-26719550f7df@redhat.com> <34959db4-01e9-8c1e-110e-c52701e2fb19@redhat.com> Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT On Wed, Oct 18, 2023 at 02:16:36PM -0700, Raghavendra Rao Ananta wrote: [...] > I had a brief discussion about this with Oliver, and it looks like we > might need a couple of additional changes for these register accesses: > - For the userspace accesses, we have to implement explicit get_user > and set_user callbacks that to filter out the unimplemented counters > using kvm_pmu_valid_counter_mask(). > - For the guest accesses to be correct, we might have to apply the > same mask while serving KVM_REQ_RELOAD_PMU. To be precise, the second issue is that we want to make sure KVM's PMU emulation never uses an invalid value for the configuration, like enabling a PMC at an index inaccessible to the guest. -- Thanks, Oliver From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4D2C6CDB47E for ; Wed, 18 Oct 2023 22:17:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iuOItGXdTHAOLKh9oY4x1pZENe0mBikVpRXPrxU8uW4=; b=CV0bvjugLlyhmB WzcRR9hVpeQu+VZcBBysfzHH1HQKwuC/JwKsDnOYAm8LFlovhVDCtawqUTju4+FMnm7AiXnJmmPVc M1hrCucGElmYEVnWq6V2A82zIzkkjGZ6nnflAEARojF7pdHYhP3wZI9GUkFkrDVNIXR/2sVYsanXy 5PRw6EYrE9LPMB6fwu/51kdRQo/0/uP2PxslHsw2edDsCD03RE69VPJWyRi02RnfqxcHEbMRNJCDA p3iE3aeyel1zWKhey59ukvr36rFDJ6OmHzKPt9vV4JRk7rbRf8e0alva+6j150fqXGQOVgucRi44P UGQQ8GEJC7ilRqarYEUA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qtEqt-00FoGy-06; Wed, 18 Oct 2023 22:17:19 +0000 Received: from out-202.mta0.migadu.com ([91.218.175.202]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qtEqo-00FoFb-0q for linux-arm-kernel@lists.infradead.org; Wed, 18 Oct 2023 22:17:17 +0000 Date: Wed, 18 Oct 2023 22:17:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1697667429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ztNFzRAh3XJ3IwivXV0tZ5qyOZlUiSKoGVQq6wIcNls=; b=ekUfSPU3v18059DZdZrVpew7QpqnJJ1sYScvAhqqc/pvIZCmu+oApZt8bUO6OXug6NmjNy i8pjmvtCEc58wMOafrBz96SXMRUdrgbDW2XXYNfUDDgtbLusEzevbfeI1SUHT+3PKgXfFc kwVxhDtEeZCbrh9xSGm5Msv8LXMXUyA= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Raghavendra Rao Ananta Cc: Eric Auger , Marc Zyngier , Alexandru Elisei , James Morse , Suzuki K Poulose , Paolo Bonzini , Zenghui Yu , Shaoqin Huang , Jing Zhang , Reiji Watanabe , Colton Lewis , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH v7 03/12] KVM: arm64: PMU: Clear PM{C,I}NTEN{SET,CLR} and PMOVS{SET,CLR} on vCPU reset Message-ID: References: <20231009230858.3444834-1-rananta@google.com> <20231009230858.3444834-4-rananta@google.com> <53546f35-f2cc-4c75-171c-26719550f7df@redhat.com> <34959db4-01e9-8c1e-110e-c52701e2fb19@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231018_151714_728127_64A2BB39 X-CRM114-Status: GOOD ( 10.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Oct 18, 2023 at 02:16:36PM -0700, Raghavendra Rao Ananta wrote: [...] > I had a brief discussion about this with Oliver, and it looks like we > might need a couple of additional changes for these register accesses: > - For the userspace accesses, we have to implement explicit get_user > and set_user callbacks that to filter out the unimplemented counters > using kvm_pmu_valid_counter_mask(). > - For the guest accesses to be correct, we might have to apply the > same mask while serving KVM_REQ_RELOAD_PMU. To be precise, the second issue is that we want to make sure KVM's PMU emulation never uses an invalid value for the configuration, like enabling a PMC at an index inaccessible to the guest. -- Thanks, Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel