Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1193879ybh; Thu, 12 Mar 2020 19:20:07 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv+f+AqlkiSWEucU/9+9M+d0YCXsJMURVAd4/4HIKYqxURt3axhF2TF7WdC6JaS7XOBH8dW X-Received: by 2002:a9d:5a9:: with SMTP id 38mr3482127otd.331.1584066006934; Thu, 12 Mar 2020 19:20:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584066006; cv=none; d=google.com; s=arc-20160816; b=bdAm8IJ+W0RBj+RzTQuiQTM3d4M1RS9aHRw1GjCEyafQ/4xJkFEiY7hR1FKoxh4LwB 9A0EqNPXoN6QJKT+d0xMi8QRA9AijyiUvGwvtKIXc7mg4aY/GQVEeF0pu9yOCV3evaO1 j89MaJsILoD3GrKpWkq2IEwrX44sh24IkznTdhO0qtuFKUtAp+ocXb9Flk5oaddm/Lzc CdvK8wrcjpmOD4PVQzAiU3eaQcokIPe/M1Sz5l4qN03EdNjodtKXV9MBhUVK8BKsnabN TS+zKTUTX73ubKR1Xae5pnPplRzokT/BjvZ6iOKiaOkJyPLmdk3kGywAojRNQCeaFsse q1rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=q864KXX9owRuj4jqjqGSvdCfI7OZHI4y9c7ZpLyHlRU=; b=MrCV+sFOaUcBlF1QN5kGeubWWjW11mbRjLoN40Bq1QzAwfrjDmw0j2H2zGBE+zcJ4Q zI/6ttx7rB4xleWYjaUDG69cjh3Nvsil6IyLwCY1hVCGfBlweokgL4+cQvt5Mwl/FOqi AnZ6zRNgzT3Y8sexCrhClfdU5Djgx3TKFkHWWOewqy/+aEYM8O4WkdIPiNE1sUAX9fGK lzbwDCSKaIJj5zIcUGMz0YxzpxV5rzW/XUPvv+NPFnuFmV6PzStqe1FiJwUB/3459Xtf P9v6dbBEZebUBiKl+FlMTKJQTdoDO61YrEAyFLywl1ATwEyKkKv1yFuM2EKKidwRZpls TW+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v1si4076217otj.204.2020.03.12.19.19.55; Thu, 12 Mar 2020 19:20:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726485AbgCMCSv (ORCPT + 99 others); Thu, 12 Mar 2020 22:18:51 -0400 Received: from mga14.intel.com ([192.55.52.115]:25868 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726461AbgCMCSv (ORCPT ); Thu, 12 Mar 2020 22:18:51 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Mar 2020 19:18:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,546,1574150400"; d="scan'208";a="261743756" Received: from sqa-gate.sh.intel.com (HELO clx-ap-likexu.tsp.org) ([10.239.48.212]) by orsmga002.jf.intel.com with ESMTP; 12 Mar 2020 19:18:46 -0700 From: Like Xu To: Paolo Bonzini , Peter Zijlstra , kvm@vger.kernel.org, Andi Kleen , Jim Mattson , Wanpeng Li Cc: Sean Christopherson , Joerg Roedel , Liran Alon , Thomas Gleixner , Ingo Molnar , Arnaldo Carvalho de Melo , Liang Kan , Wei Wang , Like Xu , linux-kernel@vger.kernel.org, Ingo Molnar Subject: [PATCH v9 01/10] perf/x86: Fix msr variable type for the LBR msrs Date: Fri, 13 Mar 2020 10:16:07 +0800 Message-Id: <20200313021616.112322-2-like.xu@linux.intel.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200313021616.112322-1-like.xu@linux.intel.com> References: <20200313021616.112322-1-like.xu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wei Wang The MSR variable type can be 'unsigned int', which uses less memory than the longer 'unsigned long'. Fix struct x86_pmu for that. the lbr_nr won't be a negative number, so make it 'unsigned int' as well. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Suggested-by: Peter Zijlstra Signed-off-by: Wei Wang --- arch/x86/events/perf_event.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/events/perf_event.h b/arch/x86/events/perf_event.h index f1cd1ca1a77b..1025bc6eb04f 100644 --- a/arch/x86/events/perf_event.h +++ b/arch/x86/events/perf_event.h @@ -672,8 +672,8 @@ struct x86_pmu { /* * Intel LBR */ - unsigned long lbr_tos, lbr_from, lbr_to; /* MSR base regs */ - int lbr_nr; /* hardware stack size */ + unsigned int lbr_tos, lbr_from, lbr_to, + lbr_nr; /* LBR base regs and size */ u64 lbr_sel_mask; /* LBR_SELECT valid bits */ const int *lbr_sel_map; /* lbr_select mappings */ bool lbr_double_abort; /* duplicated lbr aborts */ -- 2.21.1