Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753631AbcD0KwP (ORCPT ); Wed, 27 Apr 2016 06:52:15 -0400 Received: from mail-bn1on0085.outbound.protection.outlook.com ([157.56.110.85]:43808 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752756AbcD0KwN (ORCPT ); Wed, 27 Apr 2016 06:52:13 -0400 Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=caviumnetworks.com; Date: Wed, 27 Apr 2016 12:51:56 +0200 From: Jan Glauber To: Will Deacon CC: Mark Rutland , , , David Daney Subject: Re: [PATCH v2 0/5] Cavium ThunderX uncore PMU support Message-ID: <20160427105156.GB2624@hardcore> References: <20160404121954.GA9300@hardcore> <20160425112207.GL16065@arm.com> <20160425120222.GA2552@hardcore> <20160425131907.GB30830@arm.com> <20160426120809.GA9796@hardcore> <20160426135354.GR27312@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20160426135354.GR27312@arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [46.223.158.165] X-ClientProxiedBy: DB4PR04CA0012.eurprd04.prod.outlook.com (10.160.41.22) To CO2PR07MB2583.namprd07.prod.outlook.com (10.166.201.22) X-MS-Office365-Filtering-Correlation-Id: cfac319d-168a-4cb8-262f-08d36e89fbd6 X-Microsoft-Exchange-Diagnostics: 1;CO2PR07MB2583;2:bFFul1LK6D8kvfC8FpZGXKTwref0+nLB8wjCRkH0ZyQPMEZXasxsr386QCpQHqLlvVZ9aW2/8hLHf5lP3Hk7T6agQr5P2uHAqu8vE/+env+XMJgiXYDW4HwfClGH7Q/qYrSZtUiK+SA+SeykhglzNBExrDd68SEM18xzgA7yoMJhA4tBu+JHgJ/1qRvsi37/;3:I3eV038AHXF1q7n9peKcmEzARbjKYxPuvs9CGcib/UPdgEX/mxdvX37bugz8fqTmpm477LBRvxzXhsG3FvVQrwgTddRoCx7dNxLXsjVoWcKSFvb3rqAYdYnCmXtcYMr1 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO2PR07MB2583; X-Microsoft-Exchange-Diagnostics: 1;CO2PR07MB2583;25:SH0EfmM/E7CPG3lgFVE/auP0ldh5tPkqqknAEZAtt9t4UuqbIMQpJCFpmbN8OtVhAKzL6qGRd28iX4KhPYiSaXFpyiRnQxVMG5vWSyt7uffGAli3CrvtpAKs4kvOtZfiD0OT0nVjDFaWIn2lWwBvLgcRTB4oxkpb/4JcRK3vgSnWqfYuyQy+Z256/u8JF19vlNzIUFqpxKZE380KMq8Swo5ppMbftBXGUVqmeGj+XzViitSZ+vjas7LLcsSg/aB6bT/a3XRechNFSAx2nKmerQ9slQqCjChkwSK5AdfP+n3Z0pj+D8vb+UTQh08Psq4ZKD5tmQMAQtlGqB9XQCizzabopiv8DLJouPQP0apUCNiPLre30o1VVmOwHnS/kCJaJ/4BhoQ9o6UpYaSUyQzjPtr6psz1d/ObdZYISIge6syQI1MAk/bKe0YaTFz+A/fayC3rvOp5w+KwvIHuMBr2ZgoD+1RHuLkXNqnaEcBSshS8tGAh6yB0QEP8LFzugpMs0bJt3GEP8rD1Jb5+ojsbnfjUVFdJ8l8Of0T+fm5DBCS4mGdfYABXHA7QEOUFPsWCcj6jeG097Vra5nAKss0kVkLAHbTQukiB2hUNqdCP4usomYtG5wcMCBqpvmDinBzQkqeLjnACq+qHh+NIYmoxDw== X-Microsoft-Exchange-Diagnostics: 1;CO2PR07MB2583;20:ZknG0bJ6DSfETxPt7gSCHsSwHGgz74BwH4xI2ZFLyuFRLYQLQW562MCiUiT91QInx0Nk8vagfVDEF3V9mQojA851q0oUd1RQiT0xdnOu/8hLC3lY0+7vm5JIEPVsBpgy5AezFkmC6RrPAjj12029cjOAZrXSv28Z8Rk/fkW3pSjQsXbyDlmjenXLRZYEQm9j1iobV0adywxbR8NES+DepH9qGjNI4zKehXi7hgPyP2EvXwHKxoSKe8VRYk7uuxkjF8jgsnHOAuCfhBWNAAd6F3cUx5ygiQ5MjHfHTSrWCsxygXAKW7inAHvd+gM6Wlop78hNqdwOCmTXCiraXkBYHUDB9q8AsbtXwkSZkWv3re6Hzlj7qZrLyTHE8l1B2hKKrJ6pvGjP1LtRDW4pgkE2xfYEqqS/XIu/HV7coWupPdT4xEwY6Eqm0+391+wuSU5co5DSLAreAHrXS7lwzFBq3qdwCwkdjJ6h6UqHD9YqySbXWq57+LCo8MwijByVotVld5CJJiQO7JRa45q4ZuLNbJhnc0WbZHbWGQOXvckQhGoTIdSorsFaqDbYvz0xZQr6u4YUYfSFP47yTP+zAPOI9a4dOlheRPCKjfHkNJIbHPY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(9101521072)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001);SRVR:CO2PR07MB2583;BCL:0;PCL:0;RULEID:;SRVR:CO2PR07MB2583; X-Microsoft-Exchange-Diagnostics: 1;CO2PR07MB2583;4:M6KV5Jxw0sfDYXfgwfmfA0IWvco/Rv1O5CIMOodcxkqLcqFYjnoKEx/qNP3ZFIyx7qwk5m0dBtyv+HEv+47KR1Z1HsePKukgi0AaUsoS8cZz6FFI98BUgvvoxib9/aFLbXT6np/7KpGmbyiHYJ7Liqp+kTuwK9Xe/Ee0pfiAHlotoY21XZxkZxuzdj/eIHzjifR1HDLSSQgnXI9zNP5gmIaN8owRVplJ5xCeFMZtmI7yTXfwOIsOf4Ve/0Py77R9BajOPdzH7fE8uk0hKAV5G3mussTEnEyV0YRhTK17c73xzy2LHCILqHmceRYdLsXxKdde6SUqaO0rK5YBODcOUnpBGSyoUaZZ6s8372UxBIjl9NnPBmkvH8R7ctqUN4F+5pXus79WIrQuXtsFFU2CmA== X-Forefront-PRVS: 0925081676 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(24454002)(4326007)(107886002)(189998001)(4001350100001)(42186005)(92566002)(110136002)(33656002)(97756001)(3846002)(23726003)(6116002)(9686002)(33716001)(1076002)(586003)(1096002)(2906002)(2950100001)(76176999)(54356999)(86362001)(66066001)(81166005)(47776003)(5008740100001)(77096005)(5004730100002)(93886004)(46406003)(4001430100002)(50986999)(50466002);DIR:OUT;SFP:1101;SCL:1;SRVR:CO2PR07MB2583;H:hardcore;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CO2PR07MB2583;23:OeOW3jekRrKM2ED0yDW//gNADJtLZAuM1aO89fHg4?= =?us-ascii?Q?fzkwtXFZniVupUWksPSNeRFiHLNjZkjvdAd3EGWXO+IykngKnJfjDb742Sek?= =?us-ascii?Q?TkWMYRz33Z3JedVG55W4y2mXWd+TWwueIp3jisi7UvYpJkQhQRlGd1DNWV0k?= =?us-ascii?Q?5sRWekXmXynHA9+Xa7fOY0flecLuynGpvd5Ahi30c4iDJVljWxamj425NTjl?= =?us-ascii?Q?jJHxbrYomcPwHpX2PecN9tTMe+ry5QfQNzbvyR5YO3+GfFvqj8ojRvrfTqsw?= =?us-ascii?Q?gCBHrikqktDEjZ8ASfU577KvD6Hj+8JI7I0OS5tZWF8KRgBe/krouHQlzHjc?= =?us-ascii?Q?8t0enlxKAPjHuK5fGBsOH1U+7mwHC+7mUxTVMGgYeb26HOVxkhCFmUXVo6OJ?= =?us-ascii?Q?78M+4uOgVxgZVUy4QHW7V2zxcBwkW2rdJNdZ/7ygPrnq9VuWKTxT7fpxWNpK?= =?us-ascii?Q?tLDLLlL1VnUAOd4gVhWI2giBJpmHck3P8iiD4syxqwMKqWnbnkkNKPFZqbaZ?= =?us-ascii?Q?v8rEGKlQr9mD8A+d8eUpgnMH1x/lolBuhRYeyfiR6GEDTDEIL2+XB5XP1rKq?= =?us-ascii?Q?d7qki/hKKcdkpTlbO4FklQt0Qg8oslwhCMu+Gdz3h6DkyS/CngNflpIx3WwP?= =?us-ascii?Q?wMdJlltQiGFTWJv8xVQm42YXpGGd7n9RdwsP+cK2mokMLQfwhe62K/UI+a4q?= =?us-ascii?Q?Ku1hL8uuIVZjv93T0Lypn+1edKAssNigbZtaxBy4toEzJ4PHyXqyPR3EL9MA?= =?us-ascii?Q?FbwVCMu8HB+M4MbKyJrDGib2SWLZkkr8t0Et+0ljtnc9VmliYeCd+wqSwhFd?= =?us-ascii?Q?0bNa8IE7vmOwE4r0rltLhQuaBJESjYqe8nC0U5ttdQ1eqxG60or00WT8hRsp?= =?us-ascii?Q?e+0aidvWTcNwE/iKAMkcNzayiPIbRIBDq4Gv6NZUs2WxmNSb9HZnmWC3z6Rc?= =?us-ascii?Q?/sWP/xivVVsXsHrgED3un6ROdOeS+OubTqiAsf4Ww=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;CO2PR07MB2583;5:l753QgeLRiVhqwQv/M22jnJzV4MmVSXYy0VRDQb6XE7UE/55qRjjt0p98mJJaFWw6h891VRmMH8ldTdYgKTRQW82HTqp10D47ve3Wbv18qdU96S4pGiZ1uEimH8MtUDKllbbaIzGkemgrGsEx8Wv9g==;24:Tq3c4cGgx7n5Cz6FYuMD1vsRmCoqn2t1EUbQq6FeiLt3e4Gjf9+3shZODhVAfIwprxlLWtWbTuCKd8Ah6MCP5buoB46HD/qcv5AI8RwNbLY=;7:Jd1u8sf2pMfRI3BuZfnqZHTThuhwhPkEszDSUN3mwcOLhbDrhyzYlRyzCC8LTw8gIZ7PzZ3EU/WmzFUjYwCh+YRijm5uix1oSNR7PuQhiQhpVLwRIVpJMlRANoFEFkMeINPHAqMQxAcVEntIrZbfUta6MS/WqylSRKVxWJa+2wIT4cj6h7yzsubCLdTbj+iF SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2016 10:52:09.1249 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB2583 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1145 Lines: 35 On Tue, Apr 26, 2016 at 02:53:54PM +0100, Will Deacon wrote: [...] > > > > That sounds like a good compromise. > > > > So I could do the following: > > > > 1) In the uncore setup check for CONFIG_NUMA, if set use the NUMA > > information to determine the device node > > > > 2) If CONFIG_NUMA is not set we check if we run on a socketed system > > > > a) In that case we return an error and give a message that CONFIG_NUMA needs > > to be enabled > > b) Otherwise we have a single node system and use node_id = 0 > > That sounds sensible to me. How do you "check if we run on a socketed > system"? My assumption would be that you could figure this out from the > firmware tables? There are probably multiple ways to detect a socketed system, with some quite hardware specific. I would like to avoid parsing DT (and ACPI) though, if possible. A generic approach would be to do a query of the multiprocessor affinity register (MPIDR_EL1) on all CPUs. The AFF2 part (bits 23:16) contains the socket number on ThunderX. If this is non-zero on any CPU I would assume a socketed system. Would that be feasible? thanks, Jan