Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2982600iog; Mon, 27 Jun 2022 06:57:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ss9hOhGmFPmob307u/SLiJcKrUYcfWyxwwiT9GtWCL1fzDGn8jDMhtaitUchZSoV48eq2o X-Received: by 2002:a17:907:7d8a:b0:71d:59ca:e4bf with SMTP id oz10-20020a1709077d8a00b0071d59cae4bfmr12697354ejc.418.1656338259473; Mon, 27 Jun 2022 06:57:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656338259; cv=none; d=google.com; s=arc-20160816; b=tFNmfk+SmnBp4uyAWPsPgFRdeaPZFcTAKNBfvcmFqruzl14+fA2k/bARbyOMs2XqHH PNODuDPFbgCyx8A4ByzoybRamqvG1RjYOV9QPihj7JB2OuEk5/xFJkQe/hR3Xw9qQaJj iaNdiZF2hRKl2u8tTTBvMsNmTio0K0fM/B3s2uSFsTT1UQhEaAE3GxnBZe82ALEn751y 1FkJ5xuQAxML1h5Zy9KOjjxaHmIj6qDP8If0bgpdrxkz/2+P2VrpxG8d/yxHRfnobw/M kc93kE/jOyk9jo7V3WncfwbM6XJ21AUITCwV92FRax32l5HmOJ70vBjTZM2Rg0Jmf9f4 0lAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=odfTrNjoQviq1EuG83l1euunMGUp3WAdOl82k+nZLIg=; b=lpgqmMPDzD8DKQ3OvNCSvRi33n7u04IN6AW+1FxftMcAHqQlJdUTfzOIBl9OfVIefv yyN1O3w9BIl/b67mP0LRkTut108z/Ss4gOf4He6qaxifi/TbbLwfDMhlFEQ81+AdwY2v hUMEAzyXKvbLadymEJH3wNHqLzV+VdxE5BFkIHzNIPWHKjG135XoiVAimirYHZZte2Gj VL3V/GOXiTCzk+5TpxVE/yHZC2DYi1/vQ0WR/Glb8KV6muYAjGj6K6YBz5xm8dCHmhZw Wv9muyMCneCgw20aYvO0Oksudg8KHdi92SjxoTqM9q1JuoqlXEeNlOt+QuNKLRKk3gyt mzNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c12-20020a05640227cc00b004359155f862si14504314ede.590.2022.06.27.06.57.14; Mon, 27 Jun 2022 06:57:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236184AbiF0NmC (ORCPT + 99 others); Mon, 27 Jun 2022 09:42:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234535AbiF0Nl6 (ORCPT ); Mon, 27 Jun 2022 09:41:58 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 62A1B2DCD; Mon, 27 Jun 2022 06:41:57 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 28E471758; Mon, 27 Jun 2022 06:41:57 -0700 (PDT) Received: from localhost (ionvoi01-desktop.cambridge.arm.com [10.1.196.65]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8AB623F5A1; Mon, 27 Jun 2022 06:41:56 -0700 (PDT) Date: Mon, 27 Jun 2022 14:41:54 +0100 From: Ionela Voinescu To: Sudeep Holla Cc: linux-kernel@vger.kernel.org, Greg KH , Atish Patra , Atish Patra , Vincent Guittot , Dietmar Eggemann , Qing Wang , Rob Herring , "Rafael J . Wysocki" , Pierre Gondois , linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org Subject: Re: [PATCH v4 01/20] ACPI: PPTT: Use table offset as fw_token instead of virtual address Message-ID: References: <20220621192034.3332546-1-sudeep.holla@arm.com> <20220621192034.3332546-2-sudeep.holla@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220621192034.3332546-2-sudeep.holla@arm.com> X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sudeep, On Tuesday 21 Jun 2022 at 20:20:15 (+0100), Sudeep Holla wrote: > There is need to use the cache sharing information quite early during > the boot before the secondary cores are up and running. The permanent > memory map for all the ACPI tables(via acpi_permanent_mmap) is turned > on in acpi_early_init() which is quite late for the above requirement. > > As a result there is possibility that the ACPI PPTT gets mapped to > different virtual addresses. In such scenarios, using virtual address as > fw_token before the acpi_permanent_mmap is enabled results in different > fw_token for the same cache entity and hence wrong cache sharing > information will be deduced based on the same. > > Instead of using virtual address, just use the table offset as the > unique firmware token for the caches. The same offset is used as > ACPI identifiers if the firmware has not set a valid one for other > entries in the ACPI PPTT. > > Cc: linux-acpi@vger.kernel.org > Signed-off-by: Sudeep Holla > --- > drivers/acpi/pptt.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > Hi Rafael, > > If you are happy with this change, can you provide Ack, so that it can be > merged together with other changes ? > > Regards, > Sudeep > > diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c > index 701f61c01359..763f021d45e6 100644 > --- a/drivers/acpi/pptt.c > +++ b/drivers/acpi/pptt.c > @@ -437,7 +437,8 @@ static void cache_setup_acpi_cpu(struct acpi_table_header *table, > pr_debug("found = %p %p\n", found_cache, cpu_node); > if (found_cache) > update_cache_properties(this_leaf, found_cache, > - cpu_node, table->revision); > + ACPI_TO_POINTER(ACPI_PTR_DIFF(cpu_node, table)), > + table->revision); > > index++; > } > -- > 2.36.1 > I've run the set on Kunpeng920 where Dietmar noticed an issue [1] before and it looks good to me. Tested-by: Ionela Voinescu [1] https://lore.kernel.org/lkml/0bf199a0-251d-323c-974a-bfd4e26f4cce@arm.com/ Thanks, Ionela.