Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1150589ybk; Thu, 14 May 2020 01:33:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoujm9G2T+MWfzamsiW1n9D/Ye9yNAVL7IVHdKuwXsrIuKr3Ld680/Ro3LBtpSBBOy5iJ3 X-Received: by 2002:a50:d65c:: with SMTP id c28mr2775444edj.21.1589445184534; Thu, 14 May 2020 01:33:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589445184; cv=none; d=google.com; s=arc-20160816; b=t+4bkAsvJqvf0hf6lemI6aULNmsnYuhhtGxCjWwWhRWfs7G/NnqDFoPnpPJlBUhh2K C+eRHKB4JW2KLDTKvTQBjo6Z3JU3ZWRm/tJ/UCi1hSj/ON5/8oEHk378aOOVvGwowZ2x fiSWTjEQqZfUtwdrnSDVhwlwtcnLW9tftEkbaPGHn9i2AVC9xo3z9C5KI2ZiM90luLgF U2CDF6UAnBC6iaw6hpV+KIVI/L2pT4GWxdqVrfQSTSdm5hF8ngayEbX3VTCTGh5Ga5xX XD9OodzEV1QjWoF8ebCqjmBHs8H44eRLjnIUVwkGoVhn/WlfSUC3uouFK9AxO2QiF1wb ZSEg== 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=3bo7XI4jIoPyLfA7wRWg/h6hUcQhX9aBFdctP5aYejM=; b=ds6WSCmbU5VRLpbReVLg07RWJ53I18nFluUXplCrZUyyo+KbiWW/aRrnZKBPSs+3pT 7pascpxCt637ytHEqNEr7+Pn/l6p+kIET9ygaZXuNVhDQr0VyuRVmUDROT2tVgJ3roEx jlWTuGC0cWblJaCKAPqnsdP99xyHTHBTAIO4QoID7+t1xYdZ6O5e27jjdz2TbVYqOrbS Y5VvYF9KXvX6F/JklSyM2P3H12FCKY0dNkSpmO0Ks/601WYUjtrsiclLGRD9y9B/tlH9 YCdA/cDnwwkHJQnUOyJEIqxsLJdKxPtYpzQyTeW1zsFzvSyN0ZtT9UJQhV9hOzA4637i rlAQ== 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 c6si1144200edf.468.2020.05.14.01.32.40; Thu, 14 May 2020 01:33:04 -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 S1726142AbgENIbN (ORCPT + 99 others); Thu, 14 May 2020 04:31:13 -0400 Received: from mga18.intel.com ([134.134.136.126]:12082 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726032AbgENIbN (ORCPT ); Thu, 14 May 2020 04:31:13 -0400 IronPort-SDR: FVEiGjUqFpGAyCGTGXEF1GEvM8h0rWuXHPn+J6NW4WIEhuGXGVQRjmCRx4f20E991guxNjqgyI AhZv081oGb6g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 May 2020 01:31:12 -0700 IronPort-SDR: 9XWc+sruIwRfNn7Rh1sIanPM0IFYR2MyJP81M69xvd01H9zD2Zl0evdC3JHt7+O9LQ5XXi4m9W G/sShjQvuirg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,390,1583222400"; d="scan'208";a="341539917" Received: from sqa-gate.sh.intel.com (HELO clx-ap-likexu.tsp.org) ([10.239.48.212]) by orsmga001.jf.intel.com with ESMTP; 14 May 2020 01:31:09 -0700 From: Like Xu To: Peter Zijlstra , Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , ak@linux.intel.com, wei.w.wang@intel.com Subject: [PATCH v11 01/11] perf/x86: Fix variable types for LBR registers Date: Thu, 14 May 2020 16:30:44 +0800 Message-Id: <20200514083054.62538-2-like.xu@linux.intel.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200514083054.62538-1-like.xu@linux.intel.com> References: <20200514083054.62538-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.3