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 739D6C433F5 for ; Sat, 19 Feb 2022 09:42:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234214AbiBSJmp (ORCPT ); Sat, 19 Feb 2022 04:42:45 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:51618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231863AbiBSJmn (ORCPT ); Sat, 19 Feb 2022 04:42:43 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 958DA6622E for ; Sat, 19 Feb 2022 01:42:24 -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 4F276B80881 for ; Sat, 19 Feb 2022 09:42:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E747CC004E1; Sat, 19 Feb 2022 09:42:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645263742; bh=JHGMB5wyXhuUeu/pJD4Q++IqqHBbSh5JNv1xBjTAPEA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CSFEtGbLDSfNNskaealbTBWwp5XwQV4VUJ6arAPCR4vH1cHFzWXl3FW/exhom/Tc3 AAsAhGeSLlPWBb0j4cX8KN2yKftFgH8nLbv5fprXL0I7sQAPJtdo6XOcuhDEV6lIwE IhICjv5j+WER0/YYudn+WmplDvUF2u414sqrX8dy538qwrrV1Gjw40PzusVIld4dhl dSC03amXgOTf6aBwicxF+zyhxTEQPo+UoXU7A7ALYXHPqF1jd3dlTGThhCAlhFxS/y ptnRQgnG8PpTTI7YX2a+7q7tIYziIMAI5FAuJk6Rf08W1fTQImOrAhAJZ1Siwox6c+ s/YKMlwyu9JNA== Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nLMFv-008xGO-Ul; Sat, 19 Feb 2022 09:42:20 +0000 MIME-Version: 1.0 Date: Sat, 19 Feb 2022 09:42:19 +0000 From: Marc Zyngier To: Reiji Watanabe Cc: Oliver Upton , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Linux ARM , James Morse , Alexandru Elisei , Suzuki K Poulose , Andrew Jones , Paolo Bonzini , Will Deacon , Peter Shier , Ricardo Koller , Jing Zhang , Raghavendra Rao Anata Subject: Re: [PATCH 2/2] KVM: arm64: selftests: Introduce get_set_regs_perf test In-Reply-To: References: <20220217034947.180935-1-reijiw@google.com> <20220217034947.180935-2-reijiw@google.com> <874k4x502u.wl-maz@kernel.org> User-Agent: Roundcube Webmail/1.4.13 Message-ID: <3878ff49741733d6dd76aae57b594cb2@kernel.org> X-Sender: maz@kernel.org Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: reijiw@google.com, oupton@google.com, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, drjones@redhat.com, pbonzini@redhat.com, will@kernel.org, pshier@google.com, ricarkol@google.com, jingzhangos@google.com, rananta@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 Hi Reiji, On 2022-02-19 04:50, Reiji Watanabe wrote: > Hi Marc, > > On Thu, Feb 17, 2022 at 1:12 AM Marc Zyngier wrote: >> >> On Thu, 17 Feb 2022 04:52:10 +0000, >> Oliver Upton wrote: >> >> > Would it make sense to test some opt-in capabilities that expose >> > additional registers (PMU, SVE, etc.)? >> >> I think this is important. System registers are usually saved/restored > > Yes, I will fix the test to include registers for opt-in features > when supported. > >> in groups, and due to the way we walk the sysreg array, timings are >> unlikely to be uniform. Getting a grip on that could help restructure >> the walking if required (either per-group arrays, or maybe a tree >> structure). > > The biggest system register table that I know is sys_reg_descs[], > and KVM_SET_ONE_REG/KVM_GET_ONE_REG/emulation code already uses > binary search to find the target entry. So, the search itself > isn't that bad. The difference between the min and the max > latency of KVM_GET_ONE_REG for the registers is always around > 200nsec on Ampere Altra machine as far as I checked. Even if it is OK so far, it is bound to get worse over time, as the architecture keeps adding all sort of things that we'll eventually have to save/restore. I see this test as a way to monitor this trend and work out when we need to invest in something better. Thanks, M. -- Jazz is not dead. It just smells funny...