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 X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F272C433E0 for ; Wed, 27 Jan 2021 17:24:01 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 528D464DA5 for ; Wed, 27 Jan 2021 17:23:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 528D464DA5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 7DE644B327; Wed, 27 Jan 2021 12:23:59 -0500 (EST) 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 GTZcrhNEvZXQ; Wed, 27 Jan 2021 12:23:57 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id C79DC4B312; Wed, 27 Jan 2021 12:23:57 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id D751B4B312 for ; Wed, 27 Jan 2021 12:23:55 -0500 (EST) 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 safqXpvITHiQ for ; Wed, 27 Jan 2021 12:23:54 -0500 (EST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id A6F234B29C for ; Wed, 27 Jan 2021 12:23:54 -0500 (EST) Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 62CD064DA0; Wed, 27 Jan 2021 17:23:53 +0000 (UTC) Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1l4oXn-00AQmI-8F; Wed, 27 Jan 2021 17:23:51 +0000 MIME-Version: 1.0 Date: Wed, 27 Jan 2021 17:23:50 +0000 From: Marc Zyngier To: Alexandru Elisei Subject: Re: [PATCH v2 6/7] KVM: arm64: Upgrade PMU support to ARMv8.4 In-Reply-To: References: <20210125122638.2947058-1-maz@kernel.org> <20210125122638.2947058-7-maz@kernel.org> <59700102-5340-b5ec-28e2-d95ee3e59c6b@arm.com> <1b594e7b1f47e372ea84f759507db0b9@kernel.org> User-Agent: Roundcube Webmail/1.4.10 Message-ID: <54926337c1779a492f94f57ee63e5c69@kernel.org> X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: alexandru.elisei@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, eric.auger@redhat.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-team@android.com, 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On 2021-01-27 17:00, Alexandru Elisei wrote: > Hi Marc, > > On 1/27/21 2:35 PM, Marc Zyngier wrote: >> Hi Alex, >> >> On 2021-01-27 14:09, Alexandru Elisei wrote: >>> Hi Marc, >>> >>> On 1/25/21 12:26 PM, Marc Zyngier wrote: >>>> Upgrading the PMU code from ARMv8.1 to ARMv8.4 turns out to be >>>> pretty easy. All that is required is support for PMMIR_EL1, which >>>> is read-only, and for which returning 0 is a valid option as long >>>> as we don't advertise STALL_SLOT as an implemented event. >>> >>> According to ARM DDI 0487F.b, page D7-2743: >>> >>> "If ARMv8.4-PMU is implemented: >>> - If STALL_SLOT is not implemented, it is IMPLEMENTATION DEFINED >>> whether the PMMIR >>> System registers are implemented. >>> - If STALL_SLOT is implemented, then the PMMIR System registers are >>> implemented." >>> >>> I tried to come up with a reason why PMMIR is emulated instead of >>> being left >>> undefined, but I couldn't figure it out. Would you mind adding a >>> comment or >>> changing the commit message to explain that? >> >> The main reason is that PMMIR gets new fields down the line, >> and doing the bare minimum in term of implementation allows >> us to gently ease into it. > I think I understand what you are saying - add a bare minimum emulation > of the > PMMIR register now so it's less work when we do decide to support the > STALL_SLOT > event for a guest. >> >> We could also go for the full PMMIR reporting on homogeneous >> systems too, as a further improvement. >> >> What do you think? > > I don't have an opinion either way. But if you do decide to add full > emulation for > STALL_SLOT, I would like to help with reviewing the patches (I'm > curious to see > how KVM will detect that it's running on a homogeneous system). I'm not sure we can *detect* it. We'd need some more information from the core arch code and firmware. To be honest, PMU emulation is a joke on BL, so maybe we shouldn't really care and expose what we have. M. -- Jazz is not dead. It just smells funny... _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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 X-Spam-Level: X-Spam-Status: No, score=-4.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB0FFC433E0 for ; Wed, 27 Jan 2021 17:25:18 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 500D460187 for ; Wed, 27 Jan 2021 17:25:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 500D460187 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:To:From: Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lESMmPo9OjvwaSDuwmjXhSq10CG/oqd561Oa9xP7lck=; b=I32t7PRcq6wKlsETwojVJ/GFs tYQCNd4ckHW1i/G+hgrWlpkQJM7UOjw4b66pztTAf1JZnvrVkslJGMrQcTbGu1PN+geiqX7WaCu/n tXoIKAnHkLU1JBUZF2CtQmYfrwkPVdk503O3/SnOC8rxTUx5VE8Opni2dxl3NHIo1YsFeUQGSx/AK G2fUwh+RAbToQehua4UW+L/MWzcBCfAHAw3GJ40Qz/rfiCyO3ERFHcCc1Q4Pw13qSDMfZ98pAtWBu 9vj1zibL1pGK+iVkdKPy1DrT4wy+G9uWx47BN7nf6DVaL9Wkmmury+eFgDClo3n6oQ9xiMG8Bv9kp GJEcMaFrw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l4oXs-00052P-Nw; Wed, 27 Jan 2021 17:23:56 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l4oXq-00051i-Cz for linux-arm-kernel@lists.infradead.org; Wed, 27 Jan 2021 17:23:55 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 62CD064DA0; Wed, 27 Jan 2021 17:23:53 +0000 (UTC) Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1l4oXn-00AQmI-8F; Wed, 27 Jan 2021 17:23:51 +0000 MIME-Version: 1.0 Date: Wed, 27 Jan 2021 17:23:50 +0000 From: Marc Zyngier To: Alexandru Elisei Subject: Re: [PATCH v2 6/7] KVM: arm64: Upgrade PMU support to ARMv8.4 In-Reply-To: References: <20210125122638.2947058-1-maz@kernel.org> <20210125122638.2947058-7-maz@kernel.org> <59700102-5340-b5ec-28e2-d95ee3e59c6b@arm.com> <1b594e7b1f47e372ea84f759507db0b9@kernel.org> User-Agent: Roundcube Webmail/1.4.10 Message-ID: <54926337c1779a492f94f57ee63e5c69@kernel.org> X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: alexandru.elisei@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, eric.auger@redhat.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210127_122354_612176_4EBBD259 X-CRM114-Status: GOOD ( 19.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, Suzuki K Poulose , Eric Auger , James Morse , linux-arm-kernel@lists.infradead.org, kernel-team@android.com, kvmarm@lists.cs.columbia.edu, Julien Thierry Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2021-01-27 17:00, Alexandru Elisei wrote: > Hi Marc, > > On 1/27/21 2:35 PM, Marc Zyngier wrote: >> Hi Alex, >> >> On 2021-01-27 14:09, Alexandru Elisei wrote: >>> Hi Marc, >>> >>> On 1/25/21 12:26 PM, Marc Zyngier wrote: >>>> Upgrading the PMU code from ARMv8.1 to ARMv8.4 turns out to be >>>> pretty easy. All that is required is support for PMMIR_EL1, which >>>> is read-only, and for which returning 0 is a valid option as long >>>> as we don't advertise STALL_SLOT as an implemented event. >>> >>> According to ARM DDI 0487F.b, page D7-2743: >>> >>> "If ARMv8.4-PMU is implemented: >>> - If STALL_SLOT is not implemented, it is IMPLEMENTATION DEFINED >>> whether the PMMIR >>> System registers are implemented. >>> - If STALL_SLOT is implemented, then the PMMIR System registers are >>> implemented." >>> >>> I tried to come up with a reason why PMMIR is emulated instead of >>> being left >>> undefined, but I couldn't figure it out. Would you mind adding a >>> comment or >>> changing the commit message to explain that? >> >> The main reason is that PMMIR gets new fields down the line, >> and doing the bare minimum in term of implementation allows >> us to gently ease into it. > I think I understand what you are saying - add a bare minimum emulation > of the > PMMIR register now so it's less work when we do decide to support the > STALL_SLOT > event for a guest. >> >> We could also go for the full PMMIR reporting on homogeneous >> systems too, as a further improvement. >> >> What do you think? > > I don't have an opinion either way. But if you do decide to add full > emulation for > STALL_SLOT, I would like to help with reviewing the patches (I'm > curious to see > how KVM will detect that it's running on a homogeneous system). I'm not sure we can *detect* it. We'd need some more information from the core arch code and firmware. To be honest, PMU emulation is a joke on BL, so maybe we shouldn't really care and expose what we have. M. -- Jazz is not dead. It just smells funny... _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7839BC433DB for ; Wed, 27 Jan 2021 17:24:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2994E64DA5 for ; Wed, 27 Jan 2021 17:24:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233678AbhA0RYo (ORCPT ); Wed, 27 Jan 2021 12:24:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:41400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232218AbhA0RYf (ORCPT ); Wed, 27 Jan 2021 12:24:35 -0500 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 62CD064DA0; Wed, 27 Jan 2021 17:23:53 +0000 (UTC) Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1l4oXn-00AQmI-8F; Wed, 27 Jan 2021 17:23:51 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 27 Jan 2021 17:23:50 +0000 From: Marc Zyngier To: Alexandru Elisei Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, James Morse , Julien Thierry , Suzuki K Poulose , Eric Auger , kernel-team@android.com Subject: Re: [PATCH v2 6/7] KVM: arm64: Upgrade PMU support to ARMv8.4 In-Reply-To: References: <20210125122638.2947058-1-maz@kernel.org> <20210125122638.2947058-7-maz@kernel.org> <59700102-5340-b5ec-28e2-d95ee3e59c6b@arm.com> <1b594e7b1f47e372ea84f759507db0b9@kernel.org> User-Agent: Roundcube Webmail/1.4.10 Message-ID: <54926337c1779a492f94f57ee63e5c69@kernel.org> X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: alexandru.elisei@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, eric.auger@redhat.com, kernel-team@android.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 2021-01-27 17:00, Alexandru Elisei wrote: > Hi Marc, > > On 1/27/21 2:35 PM, Marc Zyngier wrote: >> Hi Alex, >> >> On 2021-01-27 14:09, Alexandru Elisei wrote: >>> Hi Marc, >>> >>> On 1/25/21 12:26 PM, Marc Zyngier wrote: >>>> Upgrading the PMU code from ARMv8.1 to ARMv8.4 turns out to be >>>> pretty easy. All that is required is support for PMMIR_EL1, which >>>> is read-only, and for which returning 0 is a valid option as long >>>> as we don't advertise STALL_SLOT as an implemented event. >>> >>> According to ARM DDI 0487F.b, page D7-2743: >>> >>> "If ARMv8.4-PMU is implemented: >>> - If STALL_SLOT is not implemented, it is IMPLEMENTATION DEFINED >>> whether the PMMIR >>> System registers are implemented. >>> - If STALL_SLOT is implemented, then the PMMIR System registers are >>> implemented." >>> >>> I tried to come up with a reason why PMMIR is emulated instead of >>> being left >>> undefined, but I couldn't figure it out. Would you mind adding a >>> comment or >>> changing the commit message to explain that? >> >> The main reason is that PMMIR gets new fields down the line, >> and doing the bare minimum in term of implementation allows >> us to gently ease into it. > I think I understand what you are saying - add a bare minimum emulation > of the > PMMIR register now so it's less work when we do decide to support the > STALL_SLOT > event for a guest. >> >> We could also go for the full PMMIR reporting on homogeneous >> systems too, as a further improvement. >> >> What do you think? > > I don't have an opinion either way. But if you do decide to add full > emulation for > STALL_SLOT, I would like to help with reviewing the patches (I'm > curious to see > how KVM will detect that it's running on a homogeneous system). I'm not sure we can *detect* it. We'd need some more information from the core arch code and firmware. To be honest, PMU emulation is a joke on BL, so maybe we shouldn't really care and expose what we have. M. -- Jazz is not dead. It just smells funny...