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 8C41BC43334 for ; Tue, 19 Jul 2022 11:34:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236167AbiGSLeR (ORCPT ); Tue, 19 Jul 2022 07:34:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237443AbiGSLeK (ORCPT ); Tue, 19 Jul 2022 07:34:10 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26C4DE03F for ; Tue, 19 Jul 2022 04:34:10 -0700 (PDT) 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 D1526B81A8F for ; Tue, 19 Jul 2022 11:34:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A896C341C6; Tue, 19 Jul 2022 11:34:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658230447; bh=Krnblg1tNNxdY0yWwiDNFGuDPPtegPeqARuHP9+f4g0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GlvOiOoyjy4/huoTXZWupXi4ABhVJBAdeY96eKfGUl2LGC90eIGWJAWm0HAf4bUFx YG6sE2JV7WhkUYOZTb5h0j12kO5jOu23WVDzLN7jr4Te4iy7jjcXW6mZYAuF8Sh5tN CZgUE/1nvzy56ZBazwS1DatDNV71+J0QdBePiolHNFToQgieTrKVqZSCdImvNmFUdU XBYAD7tSFH6lsbUkQ+isO3Z6UUOa6RYE8PmFYDn8w/67uKbnMKnExG00+aThdCG692 PO99EeWsTleCO5vteCTi7NH7FeGEV145Vltl/Nrs/maZGyW6axOnTDvSsWq9bVmA/H g4LPIj/ppQcDA== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.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 1oDlUL-008Syz-Ff; Tue, 19 Jul 2022 12:34:05 +0100 Date: Tue, 19 Jul 2022 12:34:05 +0100 Message-ID: <87edyhz68i.wl-maz@kernel.org> From: Marc Zyngier To: Ricardo Koller Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, drjones@redhat.com, alexandru.elisei@arm.com, eric.auger@redhat.com, oliver.upton@linux.dev, reijiw@google.com Subject: Re: [kvm-unit-tests PATCH 3/3] arm: pmu: Remove checks for !overflow in chained counters tests In-Reply-To: <20220718154910.3923412-4-ricarkol@google.com> References: <20220718154910.3923412-1-ricarkol@google.com> <20220718154910.3923412-4-ricarkol@google.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: ricarkol@google.com, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, drjones@redhat.com, alexandru.elisei@arm.com, eric.auger@redhat.com, oliver.upton@linux.dev, reijiw@google.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Mon, 18 Jul 2022 16:49:10 +0100, Ricardo Koller wrote: > > A chained event overflowing on the low counter can set the overflow flag > in PMOVS. KVM does not set it, but real HW and the fast-model seem to. > Moreover, the AArch64.IncrementEventCounter() pseudocode in the ARM ARM > (DDI 0487H.a, J1.1.1 "aarch64/debug") also sets the PMOVS bit on > overflow. Isn't this indicative of a bug in the KVM emulation? To be honest, the pseudocode looks odd. It says: if old_value<64:ovflw> != new_value<64:ovflw> then PMOVSSET_EL0 = '1'; PMOVSCLR_EL0 = '1'; which I find remarkably ambiguous. Is this setting and clearing the overflow bit? Or setting it in the single register that backs the two accessors in whatever way it can? If it is the second interpretation that is correct, then KVM definitely needs fixing (though this looks pretty involved for anything that isn't a SWINC event). M. -- Without deviation from the norm, progress is not possible. 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 mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id E09B4C43334 for ; Tue, 19 Jul 2022 11:34:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 57E814C947; Tue, 19 Jul 2022 07:34:14 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@kernel.org Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rM-8cE1ZMJFF; Tue, 19 Jul 2022 07:34:13 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 319BD4C957; Tue, 19 Jul 2022 07:34:13 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id F24624C934 for ; Tue, 19 Jul 2022 07:34:11 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id re+eYPdkVXLZ for ; Tue, 19 Jul 2022 07:34:10 -0400 (EDT) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id C9A5B4C93B for ; Tue, 19 Jul 2022 07:34:10 -0400 (EDT) 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 11476B81B07; Tue, 19 Jul 2022 11:34:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A896C341C6; Tue, 19 Jul 2022 11:34:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658230447; bh=Krnblg1tNNxdY0yWwiDNFGuDPPtegPeqARuHP9+f4g0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GlvOiOoyjy4/huoTXZWupXi4ABhVJBAdeY96eKfGUl2LGC90eIGWJAWm0HAf4bUFx YG6sE2JV7WhkUYOZTb5h0j12kO5jOu23WVDzLN7jr4Te4iy7jjcXW6mZYAuF8Sh5tN CZgUE/1nvzy56ZBazwS1DatDNV71+J0QdBePiolHNFToQgieTrKVqZSCdImvNmFUdU XBYAD7tSFH6lsbUkQ+isO3Z6UUOa6RYE8PmFYDn8w/67uKbnMKnExG00+aThdCG692 PO99EeWsTleCO5vteCTi7NH7FeGEV145Vltl/Nrs/maZGyW6axOnTDvSsWq9bVmA/H g4LPIj/ppQcDA== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.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 1oDlUL-008Syz-Ff; Tue, 19 Jul 2022 12:34:05 +0100 Date: Tue, 19 Jul 2022 12:34:05 +0100 Message-ID: <87edyhz68i.wl-maz@kernel.org> From: Marc Zyngier To: Ricardo Koller Subject: Re: [kvm-unit-tests PATCH 3/3] arm: pmu: Remove checks for !overflow in chained counters tests In-Reply-To: <20220718154910.3923412-4-ricarkol@google.com> References: <20220718154910.3923412-1-ricarkol@google.com> <20220718154910.3923412-4-ricarkol@google.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") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: ricarkol@google.com, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, drjones@redhat.com, alexandru.elisei@arm.com, eric.auger@redhat.com, oliver.upton@linux.dev, reijiw@google.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Cc: drjones@redhat.com, kvm@vger.kernel.org, oliver.upton@linux.dev, kvmarm@lists.cs.columbia.edu X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Mon, 18 Jul 2022 16:49:10 +0100, Ricardo Koller wrote: > > A chained event overflowing on the low counter can set the overflow flag > in PMOVS. KVM does not set it, but real HW and the fast-model seem to. > Moreover, the AArch64.IncrementEventCounter() pseudocode in the ARM ARM > (DDI 0487H.a, J1.1.1 "aarch64/debug") also sets the PMOVS bit on > overflow. Isn't this indicative of a bug in the KVM emulation? To be honest, the pseudocode looks odd. It says: if old_value<64:ovflw> != new_value<64:ovflw> then PMOVSSET_EL0 = '1'; PMOVSCLR_EL0 = '1'; which I find remarkably ambiguous. Is this setting and clearing the overflow bit? Or setting it in the single register that backs the two accessors in whatever way it can? If it is the second interpretation that is correct, then KVM definitely needs fixing (though this looks pretty involved for anything that isn't a SWINC event). M. -- Without deviation from the norm, progress is not possible. _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm