Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1577564ybz; Thu, 23 Apr 2020 01:19:32 -0700 (PDT) X-Google-Smtp-Source: APiQypKYtxMz9VOtaGEUqocpNyMg6d1GChoKuhaOG9t/4HNQz4/AVPcdHtn7+dK40VvMFZQ1W+Ic X-Received: by 2002:a17:906:7c11:: with SMTP id t17mr1788053ejo.73.1587629972599; Thu, 23 Apr 2020 01:19:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587629972; cv=none; d=google.com; s=arc-20160816; b=CB9JLiFJE9bKk484UZLdtmdCcODTUf6wr/R9DlBKPcz4bZZFYYX9eTpR5aUggbqf81 w4n95U8FC0EZtCGcyekY+ZxvOEjmHEYWDeQmY1jkFxfkkQHH9oaIxaixx9wDfMFjo0Qq uGZYpCw8+wsCFTuQLPsHZXXXvzQDQMqRtJ3L2tAw4bbTBXHDeJ60OCff/toIDJq6oArB 7wxajqXUOpH4HeC+PlzY0K7iv7vPdcarwayTz1t5zdOBNxoRW93Av7tzwRZjvG6rDObl FOLPjUzUcanY2eQwRsaeXSYwR1rzSDZM2mCifvAywtZEwLigtBsf0vWxJB31thtPuZGZ 4RYA== 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 :ironport-sdr:ironport-sdr; bh=YXcuUeASFSDb3A+qxocMQotBZuuX+j0g5MbeHMnrKfM=; b=hWpaL7Fmd9oeBB3sCXlN90xBsexyFKzjp1JPxxL25PI7jA/4LAN1CFepLsDqywTLOg kAH/Cs8+HNizU1q1wc7OX5WGdoPr3qDbwCh2NXQ64Id1sScv3YzvMWSx7FXCkQFamZDR ktXQ3KDZelFCGslQx3qmazA7Vbv76FmLl7qKd3CBTx3Bu1XaBpB0HymvsX7Tp2w+1wbH cd1vLzJbmsgsqS7gMjplTN8HKn4KcCnBZGRB4H6owpoMqu+xxIfGqBGJVl+ywZOw32xR AMIilWi8NP9xHynjg2eycZa2il3tPeHatHsmm/G8+d0i+s/sySCripPllNgbl1qXnZvl sfTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id gq24si797813ejb.222.2020.04.23.01.19.08; Thu, 23 Apr 2020 01:19:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726543AbgDWIRk (ORCPT + 99 others); Thu, 23 Apr 2020 04:17:40 -0400 Received: from mga18.intel.com ([134.134.136.126]:57581 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725863AbgDWIRj (ORCPT ); Thu, 23 Apr 2020 04:17:39 -0400 IronPort-SDR: WjMp5FdaUMxQVfGMIiPqo7F9MzI2Ltpfw5DetEmJmLmHysw/MRXCPVfQwAbINjm6POyFaLECIU wr6XkkM/tjcg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2020 01:17:39 -0700 IronPort-SDR: FXEmfdYw4hyTRvdP0+eXfiwXur70+zIL0Sr8sRUBswK26SVCS21NQKqeMV7QXKq1o6u5UwVc+Q 5owA0xeJ/ReA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,306,1583222400"; d="scan'208";a="255910036" Received: from sqa-gate.sh.intel.com (HELO clx-ap-likexu.tsp.org) ([10.239.48.212]) by orsmga003.jf.intel.com with ESMTP; 23 Apr 2020 01:17:36 -0700 From: Like Xu To: Paolo Bonzini Cc: Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, wei.w.wang@intel.com, ak@linux.intel.com, Peter Zijlstra Subject: [PATCH v10 01/11] perf/x86: Fix variable type for LBR registers Date: Thu, 23 Apr 2020 16:14:02 +0800 Message-Id: <20200423081412.164863-2-like.xu@linux.intel.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200423081412.164863-1-like.xu@linux.intel.com> References: <20200423081412.164863-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: Peter Zijlstra (Intel) Suggested-by: Peter Zijlstra (Intel) 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