Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6560976ybv; Wed, 12 Feb 2020 14:56:27 -0800 (PST) X-Google-Smtp-Source: APXvYqys4K9ms7BnzWtQpyyrd/rDFsu5H6e5jbdfBZAa/6dfvtlYqlnlBjyB6/2P2gSHQA2RcEEE X-Received: by 2002:a05:6830:1251:: with SMTP id s17mr11002050otp.108.1581548186856; Wed, 12 Feb 2020 14:56:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581548186; cv=none; d=google.com; s=arc-20160816; b=lSQUW42HE8HavYPyKlT4InLoBLQUbXzUp20H8xQtryqx2T2FbTcyTxYtrk6QiiIp// v9O9pyKNClatGL5R10vHIwUrYZ+7hrjyhkVcpahqNe+u9S1edNFlbTLFTiFPMfFH9qeZ 1XWnTHKV0vLsdHkFvsQI5fX8idydxGyMIK/4W42ddtim7umWUSh9nRnZR/FjWNPVmzZh syxvD9CCcdpX0wc4lS5FTytApjKCzM4vOqXQfoWaBnW9ss8gK7qFdouCha+1wb5jUYYH jSb8CDm9k8+4Az1oIm+U4yIQlKfLxeKPmbZciLW7M2H20kJ9fypbxb3mob57MN8pUTXK vy1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RV5S29QdZ404lYsvfwqHRbja2l8GietYXORjuMt+T6c=; b=lCFJmPJbBvGZMLBxl74MXMilemqwLhshxWlA+CSpoO1PL5I0iMM794WzgLUZA9oRgZ c5WAi6c6gVn+UYjQZnsTtVKDxwFzXGuR838xF8AFyeR9hw0axuhk61d5POd8g4VQf0Ar +w74R115SW/cizwVHsUUa3MxvdW8O8Mg4DA1p3A5xQeWNVH0li8txaBqU+jL8c/7Esvw dhn/+KAPL8qgoRiPBNXT02xBGIZPVZw8UCrksSPKyfuDPslfFutK4+R18YB06HNf/H1c F7sBhkrXt8IhlPd8OPuVVBTEqzy9h0JlBRuTqvXzH2DFCGCfIPOaGZYps+Vx1FwlnLMT /YzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SZnxP8Bu; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d199si260276oib.135.2020.02.12.14.56.14; Wed, 12 Feb 2020 14:56:26 -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; dkim=pass header.i=@kernel.org header.s=default header.b=SZnxP8Bu; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729176AbgBLW4F (ORCPT + 99 others); Wed, 12 Feb 2020 17:56:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:42504 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728185AbgBLW4E (ORCPT ); Wed, 12 Feb 2020 17:56:04 -0500 Received: from localhost (unknown [104.132.1.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D5ABF21569; Wed, 12 Feb 2020 22:56:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581548164; bh=dJpfeI0uuBvhIhsEza0VhIC2G+XvIrf3MaBC2aTSshM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SZnxP8BuZ/Lx5j9m6CT/0ULu3lx3IP+DaF/NdHSdFV8g1l7jTZnnhcBtNL86JP1i2 a7bIxg3o1sJwYOmIXOtcgB+RqMwAc8vk2mvRw8+f5+v+lnkD3vCSY7b63cJbZyOS81 XXWoad5cTUus64OU6aS0+KkxJBinI7ZscyNZYOTc= Date: Wed, 12 Feb 2020 14:56:03 -0800 From: Greg KH To: "Liang, Kan" Cc: "Sudarikov, Roman" , Andi Kleen , peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, linux-kernel@vger.kernel.org, eranian@google.com, bgregg@netflix.com, alexander.antonov@intel.com Subject: Re: [PATCH v5 3/3] perf =?iso-8859-1?Q?x86?= =?iso-8859-1?Q?=3A_Exposing_an_Uncore_unit_to_PMON_for_Intel_Xeon?= =?iso-8859-1?Q?=AE?= server platform Message-ID: <20200212225603.GA2489060@kroah.com> References: <20200211161549.19828-1-roman.sudarikov@linux.intel.com> <20200211161549.19828-4-roman.sudarikov@linux.intel.com> <20200211171544.GA1933705@kroah.com> <20200211184200.GA302770@tassilo.jf.intel.com> <20200211185759.GA1941673@kroah.com> <25dca8dd-c52d-676d-ffe4-90f3a6ddc915@linux.intel.com> <20200211201427.GA1975593@kroah.com> <7a697574-aa76-3eda-d504-1ec72bcb6353@linux.intel.com> <323e0892-d34f-a812-4d9a-e7a4bf71afd2@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <323e0892-d34f-a812-4d9a-e7a4bf71afd2@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 12, 2020 at 03:58:50PM -0500, Liang, Kan wrote: > > > On 2/12/2020 12:31 PM, Sudarikov, Roman wrote: > > On 11.02.2020 23:14, Greg KH wrote: > > > On Tue, Feb 11, 2020 at 02:59:21PM -0500, Liang, Kan wrote: > > > > > > > > On 2/11/2020 1:57 PM, Greg KH wrote: > > > > > On Tue, Feb 11, 2020 at 10:42:00AM -0800, Andi Kleen wrote: > > > > > > On Tue, Feb 11, 2020 at 09:15:44AM -0800, Greg KH wrote: > > > > > > > On Tue, Feb 11, 2020 at 07:15:49PM +0300, > > > > > > > roman.sudarikov@linux.intel.com wrote: > > > > > > > > +static ssize_t skx_iio_mapping_show(struct device *dev, > > > > > > > > +??????????????? struct device_attribute *attr, char *buf) > > > > > > > > +{ > > > > > > > > +??? struct pmu *pmu = dev_get_drvdata(dev); > > > > > > > > +??? struct intel_uncore_pmu *uncore_pmu = > > > > > > > > +??????? container_of(pmu, struct intel_uncore_pmu, pmu); > > > > > > > > + > > > > > > > > +??? struct dev_ext_attribute *ea = > > > > > > > > +??????? container_of(attr, struct dev_ext_attribute, attr); > > > > > > > > +??? long die = (long)ea->var; > > > > > > > > + > > > > > > > > +??? return sprintf(buf, "0000:%02x\n", > > > > > > > > skx_iio_stack(uncore_pmu, die)); > > > > > > > If "0000:" is always the "prefix" of the output of > > > > > > > this file, why have > > > > > > > it at all as you always know it is there? > > > > > > > > I think Roman only test with BIOS configured as single-segment. So he > > > > hard-code the segment# here. > > > > > > > > I'm not sure if Roman can do some test with multiple-segment > > > > BIOS. If not, I > > > > think we should at least print a warning here. > > > > > > > > > > > What is ever going to cause that to change? > > > > > > I think it's just to make it a complete PCI address. > > > > > Is that what this really is?? If so, it's not a "complete" pci address, > > > > > is it?? If it is, use the real pci address please. > > > > I think we don't need a complete PCI address here. The attr is > > > > to disclose > > > > the mapping information between die and PCI BUS. Segment:BUS > > > > should be good > > > > enough. > > > "good enough" for today, but note that you can not change the format of > > > the data in the file in the future, you would have to create a new file. > > > So I suggest at least try to future-proof it as much as possible if you > > > _know_ this could change. > > > > > > Just use the full pci address, there's no reason not to, otherwise it's > > > just confusing. > > > > > > thanks, > > > > > > greg k-h > > Hi Greg, > > > > Yes, the "Segment:Bus" pair is enough to distinguish between different > > Root ports. > > I think Greg suggests us to use full PCI address here. > > Hi Greg, > > There may be several devices are connected to IIO stack. There is no full > PCI address for IIO stack. Please define "full" for me. Please please don't tell me you are just using a truncated version of the PCI address. I thought we got rid of all of that nonsense 10 years ago... > I don't think we can list all of devices in the same IIO stack with full PCI > address here either. It's not necessary, and only increase maintenance > overhead. Then what exactly _IS_ this number, if not the PCI address? Something made up to look almost like a PCI address, but not quite? Somethine else? > I think we may have two options here. > > Option 1: Roman's proposal.The format of the file is "Segment:Bus". For the > future I can see, the format doesn't need to be changed. > E.g. $ls /sys/devices/uncore__/die0 > $0000:7f Again, fake PCI address? > Option 2: Use full PCI address, but use -1 to indicate invalid address. > E.g. $ls /sys/devices/uncore__/die0 > $0000:7f:-1:-1 "Invalid"? Why? Why not just refer to the 0:0 device, as that's the bus "root" address (or whatever it's called, I can't remember PCI stuff all that well...) > Should we use the format in option 2? What could userspace do with a -1 -1 address? thanks, greg k-h