From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751810AbcBLP44 (ORCPT ); Fri, 12 Feb 2016 10:56:56 -0500 Received: from mga04.intel.com ([192.55.52.120]:43247 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751277AbcBLP4x (ORCPT ); Fri, 12 Feb 2016 10:56:53 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,436,1449561600"; d="scan'208";a="910807492" From: Alexander Shishkin To: Al Grant , Mathieu Poirier Cc: Chunyan Zhang , "robh\@kernel.org" , Mark Brown , Pratik Patel , Nicolas GUION , Jon Corbet , Mark Rutland , Mike Leach , "Jeremiassen\, Tor" , Lyra Zhang , "linux-kernel\@vger.kernel.org" , "linux-arm-kernel\@lists.infradead.org" , "linux-api\@vger.kernel.org" , "linux-doc\@vger.kernel.org" Subject: RE: [PATCH V2 3/6] stm class: provision for statically assigned masterIDs In-Reply-To: References: <1454487337-30184-1-git-send-email-zhang.chunyan@linaro.org> <1454487337-30184-4-git-send-email-zhang.chunyan@linaro.org> <87mvrf5ngl.fsf@ashishki-desk.ger.corp.intel.com> <87twlj49k7.fsf@ashishki-desk.ger.corp.intel.com> User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Fri, 12 Feb 2016 17:54:41 +0200 Message-ID: <87twld3ovy.fsf@ashishki-desk.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Al Grant writes: >> Mike did write "master IDs are hardwired to individual cores and core security >> states", which make assignment for one platform very static. >> On the flip side those will change from one system to another. > > It depends on your perspective. From the perspective of a userspace > process not pinned to a core, the master id will appear to vary > dynamically and unpredictably as the thread migrates from one > core to another. (That's actually useful if the decoder wants to know > where the thread is running at any given point, as it can find that out > for free, without the need to track migration events.) > > On the other hand if you are pinned (e.g. you're the kernel on a > particular core, or you're a per-core worker thread in some thread > pooling system) then you have a fixed master id, and then you can > have one instance per core all using the same range of channel > numbers, with the master id indicating the core - this saves on > channel space compared to having to give each core its own > range of channel space. What I understood from Mike's explanation is that basically nothing is fixed from the software perspective (talking about Coresight STM). One doesn't know the master id with which one's data will be tagged, regardless of whether one is cpu-affine or not, because: * even per-core master IDs will be highly implementation dependent and therefore not knowable by the kernel and subsequently userspace, * master IDs may change based on other conditions (besides security states), so even if we knew per-core master IDs for sure, it wouldn't give us the complete picture. So even though from the HW perspective master IDs may be "hardwired" to hardware states, the hardware states themselves are dynamic, so from the SW perspective these master IDs are not static or hardwired at all. If the same mmio write done by software would always result in the exact same master ID tagged to it, that would be more like "static" to me. Regards, -- Alex