Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2999902ybt; Mon, 22 Jun 2020 12:16:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxJNgyu3Eos6eRWZ9wBkgkhH7erTyOEGGYCYK4hD5DvUZMBv4v1EfsYAwzQYytn+nKpmj+ X-Received: by 2002:aa7:c682:: with SMTP id n2mr18009301edq.18.1592853386787; Mon, 22 Jun 2020 12:16:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592853386; cv=none; d=google.com; s=arc-20160816; b=WM0EXYPalzEKd0ZB+tLGBEWXQug9W89onSEUq/7YUsqVzohWCfmHIbZqkSEGj/f3F8 kMFLXDeHiecm9+ORKPR3o+ZRV8KDb2CMpu9erZmfPRjaz+Uuex0D16ELxWJ9KVV/p1p/ 9I64RoIbpuWg/syI6CgVYAcg6RGhO2CcnhxdE4JBAAJKYh3rVamRQAkyZZMH5ViYKEYY GzmF0qPLkLotd5Snt3mcZ6jryGKRfecqG/VqvsPlDtVu4Pei9jgC7e9W9tMuJNwULLUI ChtpkK5S6O4h8pEiFMfKQaKnwldkyo+rd7RWBgMaGPipTyUQEsZpXD38iBaiKr9l0+G+ 9f1Q== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=96laAIFUWtz/6g88ICNK1u/HRUCiMGqOkniEFspmJgI=; b=AykGoRj0DYjj0oy16nFlN2gOGXFNkigLpgW931wLfrjpKeAy3gljQMGqMjrx+9LMux iYjbgyv94tvZD9m3XRXC7Ek6hYaw/vnnPWCFOj31EI2+3+4p0zkmC+BTGktQG9Uwo4bw BBg9inF+BMecd7c8Dinj8krWEJfGAPYcYDhQh1KIBMlKxZJtA6j5EibPe4UwCSlcwzS3 z8hQYLDqVpHO+RoWmH1l/JD1d8QK2TMTldH7JKf11CWlpisXkxDjU/J+QYXFw2We2Q61 IWj0xTX+ycjDsBbw46hzgD7KMvvN2QpRhaoII+nsVFJNHpnd+27xUBKEfdftqLL9Ynvb GWfA== 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 i18si9785036ejx.488.2020.06.22.12.16.03; Mon, 22 Jun 2020 12:16:26 -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 S1728236AbgFVTLM (ORCPT + 99 others); Mon, 22 Jun 2020 15:11:12 -0400 Received: from mga18.intel.com ([134.134.136.126]:9054 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726854AbgFVTLM (ORCPT ); Mon, 22 Jun 2020 15:11:12 -0400 IronPort-SDR: tu1ySlj4Yy8IGOr6ioeztoCedHMDhV77fNhJYPkvY2VxdytcZJr3jKb66bz6IGXQnXx5wzIjgH 5XmkUMwe5PFQ== X-IronPort-AV: E=McAfee;i="6000,8403,9660"; a="131255571" X-IronPort-AV: E=Sophos;i="5.75,268,1589266800"; d="scan'208";a="131255571" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2020 12:11:11 -0700 IronPort-SDR: w4oM3UeUGZyczLf4AXYjD7uSpQVe7388THFRfu+yisn/HnIJkMcPCMBI0c8cIjL6DcA0UyYnjF kuTzs82uH/cA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,268,1589266800"; d="scan'208";a="310201190" Received: from linux.intel.com ([10.54.29.200]) by orsmga008.jf.intel.com with ESMTP; 22 Jun 2020 12:11:11 -0700 Received: from [10.251.30.218] (kliang2-mobl.ccr.corp.intel.com [10.251.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id 1552D5804D6; Mon, 22 Jun 2020 12:11:08 -0700 (PDT) Subject: Re: [PATCH 21/21] perf/x86/intel/lbr: Support XSAVES for arch LBR read To: Cyrill Gorcunov Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, tglx@linutronix.de, bp@alien8.de, x86@kernel.org, linux-kernel@vger.kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, dave.hansen@intel.com, yu-cheng.yu@intel.com, bigeasy@linutronix.de, hpa@zytor.com, alexey.budankov@linux.intel.com, eranian@google.com, ak@linux.intel.com, like.xu@linux.intel.com, yao.jin@linux.intel.com References: <1592575449-64278-1-git-send-email-kan.liang@linux.intel.com> <1592575449-64278-22-git-send-email-kan.liang@linux.intel.com> <20200622184937.GV134822@grain> From: "Liang, Kan" Message-ID: <3492fcad-344d-174e-7e38-46f2e543b065@linux.intel.com> Date: Mon, 22 Jun 2020 15:11:07 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200622184937.GV134822@grain> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/22/2020 2:49 PM, Cyrill Gorcunov wrote: > On Fri, Jun 19, 2020 at 07:04:09AM -0700, kan.liang@linux.intel.com wrote: > ... >> +static void intel_pmu_arch_lbr_read_xsave(struct cpu_hw_events *cpuc) >> +{ >> + struct x86_perf_task_context_arch_lbr_xsave *xsave = cpuc->lbr_xsave; >> + struct arch_lbr_entry *lbr; >> + int i; >> + >> + if (!xsave) >> + goto rollback; > > Why not make it simplier? > > if (!xsave) { > intel_pmu_arch_lbr_read(cpuc); > return; > } > > The goto and "return" statement before the "rollback" label > looks pretty ugly. I'm sorry I didn't follow the series > in details so if you plan to add more handlers at "rollback" > then sure. > There were several handlers when I first implemented the function, but they are removed now. I don't think I will add more handlers in the next version. I will remove the "rollback" label. Thanks for pointing it out. Kan