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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0AB0DC46CA1 for ; Thu, 19 Oct 2023 19:06:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346401AbjJSTGI (ORCPT ); Thu, 19 Oct 2023 15:06:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232952AbjJSTGH (ORCPT ); Thu, 19 Oct 2023 15:06:07 -0400 Received: from out-204.mta0.migadu.com (out-204.mta0.migadu.com [IPv6:2001:41d0:1004:224b::cc]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CB9EBE for ; Thu, 19 Oct 2023 12:06:05 -0700 (PDT) Date: Thu, 19 Oct 2023 19:05:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1697742363; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RLHQdgbSkkxaLwkcFuueBvH7VycJBav8fBuH03XXBKY=; b=oQgChljYtL/bUrXu6LUkQIGrJjc8WiMnPJS8uSqF2+0i85LF0qAbU6vRorb3R0acf+NEdw gZcIJiAeOfohEj96llKypUMIb4sxUnfqGRyEqX7ybGc8+qgLJHdDMTQZKuEBMCAeSa9VIN TrPbM/1wjV8d1yKxluF426hrzLWEA+M= 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Raghu, Can you please make sure you include leading and trailing whitespace for your inline replies? The message gets extremely dense and is difficult to read. Also -- delete any unrelated context from your replies. If there's a localized conversation about a particular detail there's no reason to keep the entire thread in the body. On Thu, Oct 19, 2023 at 11:46:22AM -0700, Raghavendra Rao Ananta wrote: > On Wed, Oct 18, 2023 at 2:16 PM 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(). > Re-thinking the first case: Since these registers go through a reset > (reset_pmu_reg()) during initialization, where the valid counter mask > is applied, and since we are sanitizing the registers with the mask > before running the guest (below case), will implementing the > {get,set}_user() add any value, apart from just keeping userspace in > sync with every update of PMCR.N? KVM's sysreg emulation (as seen from userspace) fails to uphold the RES0 bits of these registers. That's a bug. -- Thanks, Oliver