Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4524750imm; Tue, 11 Sep 2018 13:17:40 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZWO3Xyln3TiHEu+molpghDxZmidCmGygIn1CdDVhvt8gS1NerPu9exz87BdQKh10FswZAs X-Received: by 2002:a62:642:: with SMTP id 63-v6mr31647912pfg.42.1536697060572; Tue, 11 Sep 2018 13:17:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536697060; cv=none; d=google.com; s=arc-20160816; b=ZqeIX/Uso49B47st/GUs2YIoF01s329+TTesyd/8yVw8OptD59pYtGlKrC3sD0eHeL gEtWmxROP/cqROEImSdzzUhOL3hCsU9EwUwpx0L1d4lsdk9zLfZKs9VoHP1ul/CcHMin 4RSpbhlFfFRlUowoBp3xoZULQ0fx6TsImgdPRXlMbt/4oZIWfoYPs8BwKKAJNRKLD+Gs gyQhpezyDK3hhSo/ZFVCo+9gekn7dTl715uhzQX0HSWX8n04QMqJWKPXodEx8WUlti0a q/pQ3hyQhrIPTcdkr4rbKZ1er0qftpXlF6JlTQWugwBooKaRfwTc1dTHIVlb8v+VuWHy ZXcA== 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; bh=OQ56u7aMtRaUv9B+fdCAPGMQKBt5LMcUJXtXYwoKArk=; b=HgSSlBxREhAib4mGx6N4XH5eXJ7wZ6ED2fHbkdb5+JJIK6o/+bwwpcDMREhJe+qWmm VtIiQn/t1jpFE+UNBpeiaTiusFWA+9bQkvjpCUnkG6S1v2iDPI71xbpDjAAUJOXR3lUR s66y45P4btKtt82FiXWRFVd4eMqlMHgdste8tDXgETN5b/VUOAVDDZR0eh6XMXOu8eSj +hfFrfBATh8rS3jKLdw0/s+d0d8loTmaZVVKO3oZ+E2er76TDZK9WHpGRZNQqh44VcHF qNwFM3NiiU1VzGhqmPRtCvHbnb1u1pOlTqYkeQbpzFGOxf1OwPag3bnLqc2uGXMGozMb W7Yg== ARC-Authentication-Results: i=1; mx.google.com; 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 l63-v6si7759465plb.166.2018.09.11.13.17.25; Tue, 11 Sep 2018 13:17:40 -0700 (PDT) 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; 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 S1727566AbeILBRl (ORCPT + 99 others); Tue, 11 Sep 2018 21:17:41 -0400 Received: from foss.arm.com ([217.140.101.70]:48822 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726720AbeILBRk (ORCPT ); Tue, 11 Sep 2018 21:17:40 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4A7F27A9; Tue, 11 Sep 2018 13:16:45 -0700 (PDT) Received: from [192.168.100.242] (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C6D213F575; Tue, 11 Sep 2018 13:16:44 -0700 (PDT) Subject: Re: [PATCH] ACPI/PPTT: Handle architecturally unknown cache types To: Jeffrey Hugo , rjw@rjwysocki.net, linux-acpi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, vkilari@codeaurora.org, Sudeep Holla References: <1536694334-5811-1-git-send-email-jhugo@codeaurora.org> From: Jeremy Linton Message-ID: Date: Tue, 11 Sep 2018 15:16:40 -0500 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: <1536694334-5811-1-git-send-email-jhugo@codeaurora.org> 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 Hi Jeffrey, (+Sudeep) On 09/11/2018 02:32 PM, Jeffrey Hugo wrote: > The type of a cache might not be specified by architectural mechanisms (ie > system registers), but its type might be specified in the PPTT. In this > case, following the PPTT specification, we should identify the cache as > the type specified by PPTT. > > This fixes the following lscpu issue where only the cache type sysfs file > is missing which results in no output providing a poor user experience in > the above system configuration- > lscpu: cannot open /sys/devices/system/cpu/cpu0/cache/index3/type: No such > file or directory > > Fixes: 2bd00bcd73e5 (ACPI/PPTT: Add Processor Properties Topology Table parsing) > Reported-by: Vijaya Kumar K > Signed-off-by: Jeffrey Hugo > --- > drivers/acpi/pptt.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c > index d1e26cb..3c6db09 100644 > --- a/drivers/acpi/pptt.c > +++ b/drivers/acpi/pptt.c > @@ -401,6 +401,21 @@ static void update_cache_properties(struct cacheinfo *this_leaf, > break; > } > } > + if ((this_leaf->type == CACHE_TYPE_NOCACHE) && > + (found_cache->flags & ACPI_PPTT_CACHE_TYPE_VALID)) { > + switch (found_cache->attributes & ACPI_PPTT_MASK_CACHE_TYPE) { > + case ACPI_PPTT_CACHE_TYPE_DATA: > + this_leaf->type = CACHE_TYPE_DATA; > + break; > + case ACPI_PPTT_CACHE_TYPE_INSTR: > + this_leaf->type = CACHE_TYPE_INST; > + break; > + case ACPI_PPTT_CACHE_TYPE_UNIFIED: > + case ACPI_PPTT_CACHE_TYPE_UNIFIED_ALT: > + this_leaf->type = CACHE_TYPE_UNIFIED; > + break; > + } > + } > /* > * If the above flags are valid, and the cache type is NOCACHE > * update the cache type as well. > If you look at the next line of code following this comment its going to update the cache type for fully populated PPTT nodes. Although with the suggested change its only going to activate if someone completely fills out the node and fails to set the valid flag on the cache type. What I suspect is happening in the reported case is that the nodes in the PPTT table are missing fields we consider to be important. Since that data isn't being filled out anywhere else, so we leave the cache type alone too. This has the effect of hiding sysfs nodes with incomplete information. Also, the lack of the DATA/INST fields is based on the assumption that the only nodes which need their type field updated are outside of the CPU core itself so they are pretty much guaranteed to be UNIFIED. Are you hitting this case? Thanks,