Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1635775imj; Thu, 14 Feb 2019 09:30:33 -0800 (PST) X-Google-Smtp-Source: AHgI3IZL64TXT4LtVUVK7L/GdqzD5ByuHx7UkA3Wcb03FnzObDcu+UxOGT/Po5OumwRbDFULSkNM X-Received: by 2002:a63:545:: with SMTP id 66mr928561pgf.102.1550165433673; Thu, 14 Feb 2019 09:30:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550165433; cv=none; d=google.com; s=arc-20160816; b=vXmiL5LsKXmDpl+g+Jmodd6kkgXnRRK4vERZInZqyMIVQKE2Iqn2KqmVkt/zHhcDeQ tBd11wfUJ4bpXm7d2lTsvEAZYJff9yCRmceKc0ZJPuxcT+GDsapX7Va/bNGylSLW020u O9vvLcknTrUVx2/zCiThJ5B4UPzx3atyVK7DDwfLxjnSF7rhDJDjD+OoE5Xy1hxA4Lzg 5LK/yJrPt5nX8oZ9LbalV46g4snTjW3GqCm/HqC8hkkklUKBSqmRjjEVduIwi0CdcVLu dEuhzU5wcYiUqWhCkX3DK1Wug+heYlYT48glk0IBodDXbWkyWWyxSH75T1siWmPq6jQm tsqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=uZGhcO57mOWfQg34QfpVKnIAdFB/bhY1ZrU4qpfwcK0=; b=n/PO0BGHxCrHbWVHP+se+JskpGUmuHUmt4QxSim+axEwnJ+AoAgNNUdGnm/o2tQxP9 Io+bzOTq0Cgr4Tqwa2sCzw7/AxoWQuodb5ShOF+5ntbOcAzvUyWdU+IpIz9mI04uyl5Z FbBOL94TYMKVr7yxG4qRLses+hKk6zjuJMMJb+5duRMc3B/JhdrykAstGuOKRGWCiL/G phgcZKuKW0uhHWMNYaj/0MVAaxJ9nhlmGumrb1f8AdEr5x3RqDpPYHm7lo9e087s3P3u NTNksXjwtn61qMW5iy33LZ7SA9eneLTLhl6lt2zqfRbAVEMpPjRelB5wO0NqUJNdvoY8 pkbQ== 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 o3si2850302pgq.139.2019.02.14.09.30.16; Thu, 14 Feb 2019 09:30:33 -0800 (PST) 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 S2388269AbfBNJmv (ORCPT + 99 others); Thu, 14 Feb 2019 04:42:51 -0500 Received: from mga09.intel.com ([134.134.136.24]:32197 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392934AbfBNJmt (ORCPT ); Thu, 14 Feb 2019 04:42:49 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Feb 2019 01:42:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,368,1544515200"; d="scan'208";a="124411688" Received: from devel-ww.sh.intel.com ([10.239.48.128]) by fmsmga008.fm.intel.com with ESMTP; 14 Feb 2019 01:42:46 -0800 From: Wei Wang To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, pbonzini@redhat.com, ak@linux.intel.com, peterz@infradead.org Cc: kan.liang@intel.com, mingo@redhat.com, rkrcmar@redhat.com, like.xu@intel.com, wei.w.wang@intel.com, jannh@google.com, arei.gonglei@huawei.com, jmattson@google.com Subject: [PATCH v5 01/12] perf/x86: fix the variable type of the LBR MSRs Date: Thu, 14 Feb 2019 17:06:03 +0800 Message-Id: <1550135174-5423-2-git-send-email-wei.w.wang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550135174-5423-1-git-send-email-wei.w.wang@intel.com> References: <1550135174-5423-1-git-send-email-wei.w.wang@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The MSR variable type can be "unsigned int", which uses less memory than the longer unsigned long. The lbr nr won't be a negative number, so make it "unsigned int" as well. Suggested-by: Peter Zijlstra Signed-off-by: Wei Wang Cc: Peter Zijlstra Cc: Andi Kleen --- 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 78d7b70..1f78d85 100644 --- a/arch/x86/events/perf_event.h +++ b/arch/x86/events/perf_event.h @@ -619,8 +619,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 stack 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.7.4