Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp4100330rdg; Wed, 18 Oct 2023 15:17:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGnjYDu+TIvmAqKpQiWRS1FmEirSxaV691CnN8pL0kVCNy0op4oMuSWFM6pULpNqA6TrCfS X-Received: by 2002:a05:6a00:10c4:b0:6b8:2ef3:331d with SMTP id d4-20020a056a0010c400b006b82ef3331dmr390136pfu.10.1697667439557; Wed, 18 Oct 2023 15:17:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697667439; cv=none; d=google.com; s=arc-20160816; b=mH+piVqYIRG3xl7AnEiVb+6toZTzKBN1ul8tb9722gNy5ksqX5JrLZdPOuDBjo02km jBbfoNSkf1ujby8eHjdV2p5KyYpN3mINdwwyVoKnEMoDhVf7wOf18xQUs+w62jZp+G/Y ai3mr9YAPF6lYJsGRNT0kIIR9bkeYmx0oX85Muwc1sGg1ZF1SpTGucg8PhAzXKDU/S/K hTTVs4fXLPb7OJBZC8G6FJBY2MgkSva81wG50ty8aoo59YtcKfy7sx95sCVzjNGCPggn NPaCQsiAxgbwm5NpPy3AGGdL0wu1TeeLK/MX4f0a5ZegXqFkDmT1jSXJjehfgPhjDL0B qcmw== 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:dkim-signature:date; bh=ztNFzRAh3XJ3IwivXV0tZ5qyOZlUiSKoGVQq6wIcNls=; fh=2aDg5VQfUJVguFLY8OJdWtQWiIffQAeWQntDf9SqrBk=; b=DjN/de0S60GA9qHzUWik0X7370Pk4mxEjTeanpp1uwi4vuauS5jEvTT0WPL1MUERUs VoM3TGDhKB3dMtVDXwKdFOHtH7Clxqkci24LPQjWRb5UUxt8ZW/ppXzwwtYAhfEAReKo 0OCqkr9yyU0osZ9vtWMZaQPBIgcsGTbFsNUuay4csqgGDhp2tkMGpl1UO+XxrKyV83QF AGMsUeM6KvG/0kwLyPoD7ugV1WFTb1yjBtUD0GyVY3i3W87TBhlBKGrFWv4+XLBEisri hp9D9bxpiKI0hP6XgzCG6aER1fQm1awSldSQ7EqTjzedEH0TY9UBF+JYqWXnOWqjYnGm Grfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ekUfSPU3; 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=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id q65-20020a632a44000000b0059b8927ef94si1803343pgq.379.2023.10.18.15.17.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 15:17:19 -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=@linux.dev header.s=key1 header.b=ekUfSPU3; 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=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 9BBBB820DA08; Wed, 18 Oct 2023 15:17:18 -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 S231373AbjJRWRP (ORCPT + 99 others); Wed, 18 Oct 2023 18:17:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229632AbjJRWRO (ORCPT ); Wed, 18 Oct 2023 18:17:14 -0400 Received: from out-202.mta0.migadu.com (out-202.mta0.migadu.com [91.218.175.202]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96602113 for ; Wed, 18 Oct 2023 15:17:11 -0700 (PDT) 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT 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_BLOCKED, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 18 Oct 2023 15:17:18 -0700 (PDT) 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