Received: by 2002:ac8:4892:0:b0:41c:c224:f26f with SMTP id i18csp819343qtq; Thu, 19 Oct 2023 13:18:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE/B5aJld1ZkbbUzLJqARLFHL9kKB/qb9W2lyZlLeK2fRT9JHAVAIupMtaImejyoAdkKNZ1 X-Received: by 2002:a17:90a:fa12:b0:268:808:8e82 with SMTP id cm18-20020a17090afa1200b0026808088e82mr4393534pjb.1.1697746732191; Thu, 19 Oct 2023 13:18:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697746732; cv=none; d=google.com; s=arc-20160816; b=cNEie/YS6JACqVTISdBJyhh/6nB2H/GEzGsMOXfmig9/wwTgzDFGzRvARtUknj1Ouf zc1Bn0OtcqwebbGyxk5j9E2UQsW8auxknwA8hePAoUCGHPDApzl7zmgB9RElvJ+V2s74 Xs/ICixl9M09EtaBWt3itlh0G/goxEKoTHhNBCyzLjOOviVtL6kn2A/5l0Rla0TSZvFD LEUaUxSr+iVWWLAJoXwKXUZJYWzQ39RnN6Z06tzt/3LDgDF5kRM5d5uT9xo36UECb2/u 7HpCQN4xFTAe46fHHwBaiS1EmYgQk1UuRgTbqLJv4x7gGR3xgM/Ai2KK/gZ6Leyigtju faIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=re69crmlRFvuit7vgWY0A8Ey7T/2hSy2QGFgqasYm7Y=; fh=8PxOtfZfGZsNC8isPTb0skP9zMnQm2RYZhP+ZrnBVJo=; b=V4RQTA8nolosW/wrtpR9OI0q+osNoMdTx8RzFEfCQjFm50XBDLumfT5C+qDhTx51pV JbmrQW+2ho4ltQnEzBLTYOnLuMJgN78aAF9Wvovpr9MHcuOkm5JMu4zcEFQQTcmCLyy+ TEWdv/qqCT9nTHc+HXx00rVcHOlihecvO1d/L+h9Ln3nI9MIFYVhpyz0jqt0a8Xx9ahE 8pMv0ehaozBEeqeFNZtsmUb0a7QFQg9+Kj6lnph0tzVcJYf+lK7BDAOaSjCjs/8yI1Gp RM4C7MthJnNT5ZvILNtyK6HA/hYOu8CSbj3w1d0dhbJIkB+lrkeCCVMOzv0Q6oLTKvGQ t3ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=F+OoxEFc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id s10-20020a17090a948a00b002773cc10d3csi2769010pjo.78.2023.10.19.13.18.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 13:18:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=F+OoxEFc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id CC3F381DF266; Thu, 19 Oct 2023 13:18:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346531AbjJSUSN (ORCPT + 99 others); Thu, 19 Oct 2023 16:18:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229892AbjJSUSM (ORCPT ); Thu, 19 Oct 2023 16:18:12 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 861BD124 for ; Thu, 19 Oct 2023 13:18:10 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1c9c496c114so54215ad.0 for ; Thu, 19 Oct 2023 13:18:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1697746690; x=1698351490; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=re69crmlRFvuit7vgWY0A8Ey7T/2hSy2QGFgqasYm7Y=; b=F+OoxEFcOT5QqgbqZx7onn5lCI23oiSsImo13FnXFOPMHNpPVIgzTcXIM6lf/qg1Cc 8BG7xFLIaLaidEJ5OvHqTvl9sVqFZb7NFs9f/QTSyDUnrFx4Bj+2DykKBHZ/R8wMc8VP c+JgeZNjqpR6n/0zIVLSkVFr5j2NDD/HnwZdtY30zcYsXZuVlqrlMIdq0vBSy1Qe7MtY ooI34gVB4mZtmW0d9rh3/GP0IoKLR32oas97O7QLt61QnCMfJ1L4CMcfy2Wt5T9Gu6LW 1BWU2fjViYA8Uc3kz6Farov4tr9uBGkStXtxZ9jqUZQCoM1vn6qB/SUsQrsPnR1UtHfD d3yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697746690; x=1698351490; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=re69crmlRFvuit7vgWY0A8Ey7T/2hSy2QGFgqasYm7Y=; b=tlCrwRX3a0kFdBUCEFZxePwhv2WkB8TmtcHXziO9rzmVLfP0G5U8j5K7y+FjtcjfkN 13ATPmTj1vPsV6pbaGKVpdDNPM3zhVvBbZt1zYfxn8PvioBByx2XPfoMGO8H/73y4nxB mJEthnaYk7UNjsboFcqwVgdRTSy8+B5LXgGka7VAw3m0YfvJnfz3oQwj44UMGy80QnPO 4yHg/phixxtN25TwCc9IcIo/5IY46f86DfaYIG11lhphQSkVZ06ddqFrDA3/35Z44BYu CtUX7Dx/v5SaonhyXAZUol016d0kV99A04lR6gjxQwQPUBVV4EgAQ55LQQAk/F7fUsu9 vHMA== X-Gm-Message-State: AOJu0Yy4LiaVKo+1XBSenkSh0VQgdrDRp8GbrilWRTjcAobpAOHP9Veq cyZg1ETj3mUJMRM+GpGHI3uQqyCurZ80YbUMayN1RdiFt/qKwAQK47E= X-Received: by 2002:a17:903:40cb:b0:1b9:d96c:bca7 with SMTP id t11-20020a17090340cb00b001b9d96cbca7mr42965pld.25.1697746689771; Thu, 19 Oct 2023 13:18:09 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: From: Raghavendra Rao Ananta Date: Thu, 19 Oct 2023 13:17:58 -0700 Message-ID: Subject: Re: [PATCH v7 03/12] KVM: arm64: PMU: Clear PM{C,I}NTEN{SET,CLR} and PMOVS{SET,CLR} on vCPU reset To: Oliver Upton 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Thu, 19 Oct 2023 13:18:29 -0700 (PDT) On Thu, Oct 19, 2023 at 12:06=E2=80=AFPM Oliver Upton wrote: > > 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. > Sorry about that. I'll try to keep it clean. > On Thu, Oct 19, 2023 at 11:46:22AM -0700, Raghavendra Rao Ananta wrote: > > On Wed, Oct 18, 2023 at 2:16=E2=80=AFPM 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. > Got it. Thanks for the confirmation. I'll implement these as originally pla= nned. Thank you. Raghavendra > -- > Thanks, > Oliver