Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4121494rwb; Sat, 10 Dec 2022 03:58:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf5fGgBUAzaIe0Xoq/LwW3qTcPpFmIxmQnZgOpRtO6ysFTNLPXrLBPqZ/h5uLV+ViB21D/YM X-Received: by 2002:a17:906:f102:b0:78d:f456:1ef2 with SMTP id gv2-20020a170906f10200b0078df4561ef2mr8070044ejb.67.1670673510177; Sat, 10 Dec 2022 03:58:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670673510; cv=none; d=google.com; s=arc-20160816; b=WabY9mojllP7WNvrvKhiKTCTCQYl5lPtZcecbsC1D/vkyBU9lYa4Ty6UxTnYU+K0+C qJxw20x0DQO5FypmOBU0mtj9637C9+giSED+enaTklOuWGImRz0AY3cM5AymYuLkgSf2 v0RSb49TFiHuffbQXnJHazjzOpSjZpA7FTliLkG7elJI5XQKaMgh1NX+FyO698/sb2PL fSR9z4zVrxg2RGJygwbTzhJx/LIuXkmLuXgZ6NCC0b0orUWm+933xt4//SLSZH8samqX jpVIz+0G5wOkh0pWabVjrtsIXcMLIuVgWgukgZShBTU5BRRck1RgYr+bfZOuvD3GHrOV 9ELQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=cdh/aWUzUl0LP2H5g0OwaDDDA3O58Isijq1yr/1vhhQ=; b=CxRxCNGsehxKbEX1P5jqeF7PZKSoFyd8qe2Il5k037nM7yM0O5d26r7PrgXgAkI3Pf X+svyfvBZ0Rzb2w0jT4Aglq76ovN8qlQIF83QOzzgencP+5NADnmeD1WBi7Jp3rIY9TZ HA+MJShzCLYefgBzBHixT+S14cQHXCWmg74mX4zsLzzCDbh8gvgGifcPSqF+hLDokdfl 8JANibVdqDtjX/V0SoD1Pl+ayZf+XyIxaftc64GwXn77tVAgu8R/Kd/CrLeTdUsKLtcp /XrF2H1BcX3viT670Tps/Udhmam7l+cSUCNVCsdjJpbA8CDV6I7tSNQlFLpvhGLRyN85 hfWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IRXwJzG5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h11-20020a0564020e0b00b0046b0b4ee617si3553931edh.442.2022.12.10.03.58.12; Sat, 10 Dec 2022 03:58:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IRXwJzG5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229723AbiLJLSX (ORCPT + 74 others); Sat, 10 Dec 2022 06:18:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229665AbiLJLSU (ORCPT ); Sat, 10 Dec 2022 06:18:20 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DC6E1AF2F for ; Sat, 10 Dec 2022 03:18:19 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 17BD9B82A53 for ; Sat, 10 Dec 2022 11:18:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A00BDC433D2; Sat, 10 Dec 2022 11:18:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670671096; bh=2ol2CYikgIYVfVb+OZiZSB+xwMyqaLEDiIfsEIqMMHk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IRXwJzG5tMMKaadAVZ+PcfLGh9BTuFHJX08H6Sc6kTynyxsZOMM8gw8o8kpOlLYAj F1TkATzT9Jrv2AKL28Cnm+dvydIYU3RONnQ78BmIF6Mq03PpSpyKBz4qsZasO45Yo7 nSq5R3vNDfBybRW+arijzqeplXYbj/E1RCn9lIOjMnjkdpx7Ybt2ELEAHsBhj3EaBZ GB+zNQ5a4/PovtZIvbHpHhjADiuELKffmgv7VwmrPNYxuj5iErELcWDtwy2HAgfzwo OsYZCGfxebtYlG1yohwGwzDG1YeC6YypJHdPgNYPD3JIIc8Y04F/aahYlBf1Hw289z ncclXffxQxU2g== Received: from sofa.misterjones.org ([185.219.108.64] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1p3xry-00BlMm-B4; Sat, 10 Dec 2022 11:18:14 +0000 Date: Sat, 10 Dec 2022 11:16:37 +0000 Message-ID: <87edt7fqzu.wl-maz@kernel.org> From: Marc Zyngier To: James Clark , Oliver Upton Cc: kvmarm@lists.linux.dev, James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] KVM: arm64: PMU: Fix PMCR_EL0 reset value In-Reply-To: References: <20221209164446.1972014-1-james.clark@arm.com> <20221209164446.1972014-2-james.clark@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: james.clark@arm.com, oliver.upton@linux.dev, kvmarm@lists.linux.dev, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Fri, 09 Dec 2022 17:58:31 +0000, Oliver Upton wrote: > > On Fri, Dec 09, 2022 at 04:44:46PM +0000, James Clark wrote: > > ARMV8_PMU_PMCR_N_MASK is an unshifted value which results in the wrong > > reset value for PMCR_EL0, so shift it to fix it. > > That's just mean. *_MASK tends to be a shifted mask, although it would > appear that asm/perf_event.h does not follow this convention. Fixing > that would be nice (as I'm sure somebody else will get burned by this), > but for the sake of an immediate fix: Well, that'll teach me the usual lesson: last minute changes without full non-regression testing are bound to end in disaster. > > > This fixes the following error when running qemu: > > > > $ qemu-system-aarch64 -cpu host -machine type=virt,accel=kvm -kernel ... > > > > target/arm/helper.c:1813: pmevcntr_rawwrite: Assertion `counter < pmu_num_counters(env)' failed. > > > > Fixes: 292e8f149476 ("KVM: arm64: PMU: Simplify PMCR_EL0 reset handling") > > Signed-off-by: James Clark > > Reviewed-by: Oliver Upton Thanks both. I'll queue that ASAP as a fix. M. -- Without deviation from the norm, progress is not possible.