From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-207.mta0.migadu.com (out-207.mta0.migadu.com [91.218.175.207]) (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 E93F62FE0F for ; Thu, 19 Oct 2023 19:06:06 +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="oQgChljY" 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> Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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 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 B2C37CDB465 for ; Thu, 19 Oct 2023 19:06:40 +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=DIXjyxrXthXPmSRAqA0GDF/6SAR/lqpNmybBo1e4FEI=; b=ffuGg2cnJeMcZP yXpUGi+MPhh8dZvR3nJYqrmW1LUVsv56xUZS4uwte5rLsQvo3CVoC02ZByl3BxR1MU4/LB1KsL52a eWdbO8AoC3AxhpGH2VVIwEffTtiVT+a2/9TJkho4Oo7QKrEQExqRav/Ft6ZJZd2XnnCqt7sd9DZyt zxjL2roKGH7pnHsSYXgfAye7IPoGgpNQQFhh45rgkDJ5P4zyD48yDYdNSPgd0CWHg9gsE0boBBwlY kk+SXn2v46gJImGljXJljbfZFc7QUQ3ALOq0cnZEBqQHXaCrH/cuYt6rh7h4OmIf8fh5TZjQuceqv 7pu8NjG/SGxpy2qcPGzQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qtYLV-000Z9f-34; Thu, 19 Oct 2023 19:06:13 +0000 Received: from out-192.mta0.migadu.com ([2001:41d0:1004:224b::c0]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qtYLS-000Z97-0h for linux-arm-kernel@lists.infradead.org; Thu, 19 Oct 2023 19:06:11 +0000 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-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-20231019_120610_403909_81599273 X-CRM114-Status: GOOD ( 14.96 ) 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="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org SGkgUmFnaHUsCgpDYW4geW91IHBsZWFzZSBtYWtlIHN1cmUgeW91IGluY2x1ZGUgbGVhZGluZyBh bmQgdHJhaWxpbmcgd2hpdGVzcGFjZ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