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=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham 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 55CBDC4361B for ; Mon, 14 Dec 2020 13:48:17 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 9D231229EF for ; Mon, 14 Dec 2020 13:48:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9D231229EF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com 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 CBA974B674; Mon, 14 Dec 2020 08:48:15 -0500 (EST) 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=@redhat.com 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 8uYf4G9iW0pO; Mon, 14 Dec 2020 08:48:14 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id C8E824B529; Mon, 14 Dec 2020 08:48:14 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 57DF34B529 for ; Mon, 14 Dec 2020 08:48:13 -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 rlej3K5TLd2B for ; Mon, 14 Dec 2020 08:48:12 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 7432F4B4D9 for ; Mon, 14 Dec 2020 08:48:12 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607953692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MZMh9xgwSrcXF2aRTMmuCo54VTLyRe6KjJIxuq1WfcY=; b=HrHm0ynoG/E5kSIY/K5xARWqSjU1SMDWZye33TUsE9zCVta+P7MhhVJavpNxz1WE1wre8P cTtI8OieaE2TkVik4uXSZBzKR1vN71HUGviSpkmfDMEh46dNO5cLB1/KEbSmA9c3Kh4DL+ g2Sx3cMdET6XxdeDMS2C5UhCHWHmS6c= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-167-csCaedztMXuvF9KfS-fMjQ-1; Mon, 14 Dec 2020 08:48:08 -0500 X-MC-Unique: csCaedztMXuvF9KfS-fMjQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D8499801817; Mon, 14 Dec 2020 13:48:06 +0000 (UTC) Received: from [10.36.115.41] (ovpn-115-41.ams2.redhat.com [10.36.115.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 13BDC10016FE; Mon, 14 Dec 2020 13:48:04 +0000 (UTC) Subject: Re: [PATCH 5/5] KVM: arm64: Remove redundant call to kvm_pmu_vcpu_reset() To: Alexandru Elisei , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, maz@kernel.org, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com References: <20201201150157.223625-1-alexandru.elisei@arm.com> <20201201150157.223625-6-alexandru.elisei@arm.com> From: Auger Eric Message-ID: <9f68ed5e-371e-6c0c-7ba3-b14ff059430f@redhat.com> Date: Mon, 14 Dec 2020 14:48:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20201201150157.223625-6-alexandru.elisei@arm.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eric.auger@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US 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 Alexandru, On 12/1/20 4:01 PM, Alexandru Elisei wrote: > KVM_ARM_VCPU_INIT ioctl calls kvm_reset_vcpu(), which in turn resets the > PMU with a call to kvm_pmu_vcpu_reset(). The function zeroes the PMU > chained counters bitmap and stops all the counters with a perf event > attached. Because it is called before the VCPU has had the chance to run, > no perf events are in use and none are released. > > kvm_arm_pmu_v3_enable(), called by kvm_vcpu_first_run_init() only if the > VCPU has not been initialized, also resets the PMU. kvm_pmu_vcpu_reset() in This sounds strange to me. kvm_vcpu_first_run_init() only is called if kvm_vcpu_initialized(vcpu) is true. > this case does the exact same thing as the previous call, so remove it. > > Signed-off-by: Alexandru Elisei > --- > arch/arm64/kvm/pmu-emul.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/arch/arm64/kvm/pmu-emul.c b/arch/arm64/kvm/pmu-emul.c > index 398f6df1bbe4..4ad66a532e38 100644 > --- a/arch/arm64/kvm/pmu-emul.c > +++ b/arch/arm64/kvm/pmu-emul.c > @@ -850,8 +850,6 @@ int kvm_arm_pmu_v3_enable(struct kvm_vcpu *vcpu) > return -EINVAL; > } > > - kvm_pmu_vcpu_reset(vcpu); > - this patch does not apply for me (vcpu->arch.pmu.ready = true; ?) Thanks Eric > return 0; > } > > _______________________________________________ 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=-15.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 C3AFDC4361B for ; Mon, 14 Dec 2020 13:49:29 +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 6BE0C229EF for ; Mon, 14 Dec 2020 13:49:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6BE0C229EF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com 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-Transfer-Encoding: Content-Type:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From:References:To:Subject: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=T8dZQXxKtubnavSXDN+w3kwAQui/BWO+thlxEvzRC+c=; b=qz/kJUXvYJrWw6o3ajt3eyxtwI ZkSoOo+pMNZVirek/+bTL7qWmG5H0cvz266BrSkfYj3bGbgkdTrAYcGpm94FK48qdOHMHZfGAPLuS 6tp3I+NfJI8cHQluD/Xn86dnZDI3ljS73B9nr6qdh9KNqwoa455lhEYgD+uOTL0/VcTmAur6tOFXX eZM+FzxUB5UjSfeOqwgtNTVBOHlai33jTjJo9lxMFi878bhXrV2Hka5Je5ayo8MKxUQxf8Z7HUAUh sRgV/xTWR6aQuMyQGK5A6qEhJAnJtuhnLxH+je0jMrQTnF6ORjaT1BIgGdy0Sg1gEYchgPqBTaW/U 9h9rb7Dg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kooD1-00063j-HQ; Mon, 14 Dec 2020 13:48:15 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kooCz-00062z-0t for linux-arm-kernel@lists.infradead.org; Mon, 14 Dec 2020 13:48:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607953692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MZMh9xgwSrcXF2aRTMmuCo54VTLyRe6KjJIxuq1WfcY=; b=HrHm0ynoG/E5kSIY/K5xARWqSjU1SMDWZye33TUsE9zCVta+P7MhhVJavpNxz1WE1wre8P cTtI8OieaE2TkVik4uXSZBzKR1vN71HUGviSpkmfDMEh46dNO5cLB1/KEbSmA9c3Kh4DL+ g2Sx3cMdET6XxdeDMS2C5UhCHWHmS6c= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-167-csCaedztMXuvF9KfS-fMjQ-1; Mon, 14 Dec 2020 08:48:08 -0500 X-MC-Unique: csCaedztMXuvF9KfS-fMjQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D8499801817; Mon, 14 Dec 2020 13:48:06 +0000 (UTC) Received: from [10.36.115.41] (ovpn-115-41.ams2.redhat.com [10.36.115.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 13BDC10016FE; Mon, 14 Dec 2020 13:48:04 +0000 (UTC) Subject: Re: [PATCH 5/5] KVM: arm64: Remove redundant call to kvm_pmu_vcpu_reset() To: Alexandru Elisei , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, maz@kernel.org, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com References: <20201201150157.223625-1-alexandru.elisei@arm.com> <20201201150157.223625-6-alexandru.elisei@arm.com> From: Auger Eric Message-ID: <9f68ed5e-371e-6c0c-7ba3-b14ff059430f@redhat.com> Date: Mon, 14 Dec 2020 14:48:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20201201150157.223625-6-alexandru.elisei@arm.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eric.auger@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201214_084813_127292_BF5938ED X-CRM114-Status: GOOD ( 21.17 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Alexandru, On 12/1/20 4:01 PM, Alexandru Elisei wrote: > KVM_ARM_VCPU_INIT ioctl calls kvm_reset_vcpu(), which in turn resets the > PMU with a call to kvm_pmu_vcpu_reset(). The function zeroes the PMU > chained counters bitmap and stops all the counters with a perf event > attached. Because it is called before the VCPU has had the chance to run, > no perf events are in use and none are released. > > kvm_arm_pmu_v3_enable(), called by kvm_vcpu_first_run_init() only if the > VCPU has not been initialized, also resets the PMU. kvm_pmu_vcpu_reset() in This sounds strange to me. kvm_vcpu_first_run_init() only is called if kvm_vcpu_initialized(vcpu) is true. > this case does the exact same thing as the previous call, so remove it. > > Signed-off-by: Alexandru Elisei > --- > arch/arm64/kvm/pmu-emul.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/arch/arm64/kvm/pmu-emul.c b/arch/arm64/kvm/pmu-emul.c > index 398f6df1bbe4..4ad66a532e38 100644 > --- a/arch/arm64/kvm/pmu-emul.c > +++ b/arch/arm64/kvm/pmu-emul.c > @@ -850,8 +850,6 @@ int kvm_arm_pmu_v3_enable(struct kvm_vcpu *vcpu) > return -EINVAL; > } > > - kvm_pmu_vcpu_reset(vcpu); > - this patch does not apply for me (vcpu->arch.pmu.ready = true; ?) Thanks Eric > return 0; > } > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel