From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753424AbeEKLTR (ORCPT ); Fri, 11 May 2018 07:19:17 -0400 Received: from mga07.intel.com ([134.134.136.100]:9095 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753186AbeEKLTN (ORCPT ); Fri, 11 May 2018 07:19:13 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,388,1520924400"; d="scan'208";a="57786594" Subject: Re: [PATCH RFC 07/19] perf tools: Workaround missing maps for x86_64 KPTI entry trampolines To: Arnaldo Carvalho de Melo Cc: Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Andy Lutomirski , "H. Peter Anvin" , Andi Kleen , Alexander Shishkin , Dave Hansen , Joerg Roedel , Jiri Olsa , "linux-kernel@vger.kernel.org" , "x86@kernel.org" References: <1525866228-30321-1-git-send-email-adrian.hunter@intel.com> <1525866228-30321-8-git-send-email-adrian.hunter@intel.com> <20180509170717.GI13491@kernel.org> <363DA0ED52042842948283D2FC38E4649C13DE9E@IRSMSX106.ger.corp.intel.com> <20180510201542.GD4311@kernel.org> <20180510201922.GE4311@kernel.org> <20180510204700.GF4311@kernel.org> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <291c0615-2b5c-0076-faeb-720df9ab5c84@intel.com> Date: Fri, 11 May 2018 14:18:01 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180510204700.GF4311@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/05/18 23:47, Arnaldo Carvalho de Melo wrote: > Em Thu, May 10, 2018 at 05:19:22PM -0300, Arnaldo Carvalho de Melo escreveu: >> Em Thu, May 10, 2018 at 05:15:42PM -0300, Arnaldo Carvalho de Melo escreveu: >>> Em Thu, May 10, 2018 at 07:08:37PM +0000, Hunter, Adrian escreveu: >>>> Let me know if you want me to post the workaround patches separately, >>>> otherwise I will wait a bit before sending the patches again. > >>> I'll see if I went thru all of the patches already... > >> So I looked at the patches posted and one comment is about the terse >> commit logs for some of the kcore_copy patches, for instance: > >> -------------------- >> In preparation to add more program headers, get rid of kernel_map and >> modules_map. >> -------------------- > >> Can't this be made a bit more verbose? Lemme re-read the patch... > > So you had just one pointers to the kernel map and a module_maps, and > then this is replaced by kcore_copy__map() that instead of populating > those fields that are being removed: > > - struct phdr_data kernel_map; > - struct phdr_data modules_map; > > Will allocate and add "struct phdr_data" instances to the > kcore_copy_info->phdrs list, so I propose, to follow convention used > elsewhere in tools/perf/ that you rename kcore_copy__map() to > > kcore_copy_info__addnew(kci, fields) > > I would do it as: > > struct phdr_data *phdr_data__new(fields) > { > return zalloc() + init fields; > } > > struct phdr_data *kcore_copy_info__addnew(kci, fields) > { > struct phdr_data *pd = phdr_data__new(fields); > > if (pd) > list_add(&pd->list, &kci->phdrs) > } > > Also please rename pd->list to pd->node, to clarify that it is a node in > some list, not a list. > > The commit log list then could reflect that somehow, with something > around: > > ---------------------- > > Move ->kernel_map and ->modules_map to newly allocated entries in the > ->phdrs list. > > ---------------------- > > wdyt? I have done the changes but still have kcore_copy__map() calling kcore_copy_info__addnew(). The changes have been pushed to the same branch.