Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1548040rda; Mon, 23 Oct 2023 16:41:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHuHCWTYyZZj92vD2C5/38YRgb9bIxU5hBVVpBYtne8fbMbFFA+8whzIwP4fFvG4KDM/NO+ X-Received: by 2002:a17:90b:1b01:b0:27d:7887:ddc5 with SMTP id nu1-20020a17090b1b0100b0027d7887ddc5mr10304773pjb.32.1698104498959; Mon, 23 Oct 2023 16:41:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698104498; cv=none; d=google.com; s=arc-20160816; b=KNqLAADo327LWeGi3K5fHfAOZNaQUAXpEdWtFYWeSDew1W8LrtP/7eDqc9grwTaAkT XlAeYlzY8463B2XB6nDANuHE1ZITltTSIstJ6RtrRiTNpgAlf+7Yd67IeXrVFexOjEM4 P/CQ/7pY6mGfZku4o1LzaqvAAvifjpk/ABdvkJ15tTr0b7ntjrTk5P7LFNGSx+zeEo8U k0bx1A/BbAjs/rKYP9riKy4kb6wy/S5I+cI1t+fgT2CeKSF9sNqtJdTarom5ByaY95pQ Pwgsj6FMl3/0Yxh0i3zsIv39jZ4EuuGoyQtVy9/QZlGHnxiQ8z+icumWCSaeD6RGYnPO QqXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:reply-to:dkim-signature; bh=kKpVqTewUTpqij+D7Vj0c8pKvN0oprp2NzBGTWeq1ms=; fh=t7gFcWLRyAqmyldGbr6d3KgIXGxOYU/i61iCoIU6S88=; b=g6wVdDvEpv1hqoqTxwI1780oKJAH8yWWZPRhq9slJJ9F6XIXvdJ4kykod9JKczZgk/ 9D/VwPgPwHJ0uadNG6kR/uNIZEnTBkBKdOZQBPdKuT+elNiU8w9CmuOtF1Kq1MuKCCpR 4q6mVEDNUhjqUe8E4o7VZ1wx8k8qb9cjD+GIIB+Gr3pwRjSIVG1FVtTaqA50Y02aiSjV F74yUJhZ6+syYl34d93WYnOwqqEIxBV0Ivl0Q3KANyrdNvitTdfSRb2o50isNL/uGT4V xp1vbJJPykKlZ+ey1k0GGum3n1vljpztU4Q4dpOuw6oSNOndsDR4B7BTs8jioYi9F7+G oUQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=s7VJKKgH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id q15-20020a17090311cf00b001c9ad8ca211si7073312plh.18.2023.10.23.16.41.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 16:41:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=s7VJKKgH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 885758075972; Mon, 23 Oct 2023 16:41:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231808AbjJWXk2 (ORCPT + 99 others); Mon, 23 Oct 2023 19:40:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231681AbjJWXkR (ORCPT ); Mon, 23 Oct 2023 19:40:17 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4A54D7D for ; Mon, 23 Oct 2023 16:40:11 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-da033914f7cso402293276.0 for ; Mon, 23 Oct 2023 16:40:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698104411; x=1698709211; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=kKpVqTewUTpqij+D7Vj0c8pKvN0oprp2NzBGTWeq1ms=; b=s7VJKKgHcoYFE5Dij2QE/tI8xY6NlFHhPB8tUg99k3JQGa1yD4DLHcm5ihnc1CvgAm P9w+Yk5uxYwxu5yCn7I3LYIHj+JnYHDqzChw5FLLtXHxwhs7OAATvWkTeO8zMQKdFTRo HLdGlx716GGnCaMCiqsYrHeZd1bctuyd+NQc3rZPh3p+GfuG2eGYCYcalf21ufCu8R4D UM7ZSV9+DtIikBty260LyZ0JP5damI9soG2bgTfjiqhN9WiW0LDQC2t8IvS7A7f551R3 1Ej7LuCHWsXzRWI3n7vrf3Zdn1xNujVTg4PBmNL0M6sa2dDcsspIKUiqXVC/PkU9oQB5 lUVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698104411; x=1698709211; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kKpVqTewUTpqij+D7Vj0c8pKvN0oprp2NzBGTWeq1ms=; b=QK0Ia4uu046W0LV4H/b/Emsm5uGgQM+8DbqsiaaRnq3VsjyYDQ4oVLmHotXGM8qkEM 5s3dyR6IsjHiZYI7GnkvA5t1yixCzpWZIb6j8W7n38h6jDQ9ktqXGkaI3BmlP0oeJSDS f5nxA0jMysja2joyMKBdUHKwK0x0N9RSfgAKk2kqG1ZqA7WYi9gzzxyaSR1EC64b/57G b2vek/sEC0JnbQ4N2tCqhU+HwHa9dLWEb2zCAyWllx4lcfV39OFRKfMBTKnqip/JdTSd uc9vOVA+SdQwvZ320nXu+8aYucmPYWaXBSHPmzIuQ6lSr2aHodfS/aTLaiWvtg3H5QCt mBxg== X-Gm-Message-State: AOJu0YxM7reyOl8quKkMPiag4dqCMEYAwzBQ5ZtzCiAAneRRft7nZNQz ixSK0W+lmxa/t3nMpKBowTAlaLxfaxI= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a25:b951:0:b0:da0:1ba4:6fa2 with SMTP id s17-20020a25b951000000b00da01ba46fa2mr52717ybm.4.1698104410953; Mon, 23 Oct 2023 16:40:10 -0700 (PDT) Reply-To: Sean Christopherson Date: Mon, 23 Oct 2023 16:39:58 -0700 In-Reply-To: <20231023234000.2499267-1-seanjc@google.com> Mime-Version: 1.0 References: <20231023234000.2499267-1-seanjc@google.com> X-Mailer: git-send-email 2.42.0.758.gaed0368e0e-goog Message-ID: <20231023234000.2499267-5-seanjc@google.com> Subject: [PATCH 4/6] KVM: x86/pmu: Remove manual clearing of fields in kvm_pmu_init() From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Mingwei Zhang , Roman Kagan , Jim Mattson , Dapeng Mi , Like Xu Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 23 Oct 2023 16:41:18 -0700 (PDT) Remove code the unnecessarily clears event_count and need_cleanup in kvm_pmu_init(), the entire kvm_pmu is zeroed just a few lines earlier. Vendor code doesn't set event_count or need_cleanup during .init(), and if either VMX or SVM did set those fields it would be a flagrant bug. Signed-off-by: Sean Christopherson --- arch/x86/kvm/pmu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c index 458e836c6efe..c06090196b00 100644 --- a/arch/x86/kvm/pmu.c +++ b/arch/x86/kvm/pmu.c @@ -710,8 +710,6 @@ void kvm_pmu_init(struct kvm_vcpu *vcpu) memset(pmu, 0, sizeof(*pmu)); static_call(kvm_x86_pmu_init)(vcpu); - pmu->event_count = 0; - pmu->need_cleanup = false; kvm_pmu_refresh(vcpu); } -- 2.42.0.758.gaed0368e0e-goog