Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp562479rdb; Thu, 19 Oct 2023 12:06:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHlsRxjofXG6Q5OoojjhbldRGM9Im1EclRJpD4lOZemMeA7Bn9QIg9wat7YI+2/Q2NYidB7 X-Received: by 2002:a17:902:e80e:b0:1ca:2330:196a with SMTP id u14-20020a170902e80e00b001ca2330196amr3730156plg.6.1697742381162; Thu, 19 Oct 2023 12:06:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697742381; cv=none; d=google.com; s=arc-20160816; b=wAa4eRoEnJDIwQiNlZqtWN+uxYz0/Ns6EAUvgATu2vefGvqL8BFgGOlpH7fNbS2Rdt FVXuubc5FwBhCWPmmA+7Y5A9qtEWVMHWcUgP3TAMNQS/ijQ8h/XRTszXWJAArnTwqMfp LpCbcWJ2tzIySUbrbqs3gcfTjWyZ7cwhgkfJ7ylTuRZNYCFiBoJIMEETSBp69HUHvVqH 5CcE3VeXm5DQc9DVLIqUr9VcijBMN9Ex5k8J2D2YB23lyqo2Oyuurrby11aiSpOxVumH bLnIaVuiSeYD21tj5UhveISgffrbwQGfMgELYkrgahRHR2+N45TfFVWVw4l0BmV1F0Cs 5KiA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:dkim-signature:date; bh=RLHQdgbSkkxaLwkcFuueBvH7VycJBav8fBuH03XXBKY=; fh=2aDg5VQfUJVguFLY8OJdWtQWiIffQAeWQntDf9SqrBk=; b=i+kQ+u76RYKt6OrSzvETU3Qxr7azr/LmhribVBwJMSXJKn9Cd5HkCq9EnyU3hoaZqJ RGdLPfj1ykcepIQrXCxnNvLXMAN9P0GSC9i5roJGfi5EFAryOziFTgRWcF3pSkCmseXA oAhkdY/x3Nn6JxLyKhl2RIaCYP11IMbXLNj+yB+Sa1SiRXG3bJO9jZ/WcJQpIC9RD7QS b80ccMG8gVX6vDOBy+ajIx1ZCKDstu+jOc8pwfFXK9hXv/sx3fk4kgn4smC8QbPaTqR1 rfWK8o+yN4+5VM26FGiyafGdd/STtsl1yFgBdjTyal0MXc+vPssmGAJLm6ls9HeV09oJ M+LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=oQgChljY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id y4-20020a170902ed4400b001c6240dec42si92568plb.647.2023.10.19.12.06.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 12:06:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=oQgChljY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 7D84B81B5D38; Thu, 19 Oct 2023 12:06:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346282AbjJSTGH (ORCPT + 99 others); Thu, 19 Oct 2023 15:06:07 -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 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Thu, 19 Oct 2023 12:06:18 -0700 (PDT) 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