Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4125201iog; Tue, 21 Jun 2022 12:33:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1soKNVQiGCZi2gfXpGBZtMqiAe46LiYcMT8Jv4xI+8ih4wxXdJAHn15shnPF1g6nkESKBsU X-Received: by 2002:a63:8849:0:b0:40d:e25:9fb2 with SMTP id l70-20020a638849000000b0040d0e259fb2mr1842547pgd.592.1655840021194; Tue, 21 Jun 2022 12:33:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655840021; cv=none; d=google.com; s=arc-20160816; b=YcF7rxfcLGY0o0gtoJ2vRm/Jrb7+1+IVkQB9/E0OtW0Jp5P4n4huUUMiQYftkdnT9r WYO8VkxaFWIafXXSnJNHD6KixJEvyLUbKsmxQfBzR7I6OsQprVgP9URDSh1hd1ek/zFi IbuYUnZyUlcAOESDEmD6e4kQx3hUNheJyLSz73wM9lVAGSzVBzBiN3I6JnOmYNtF+l/i MRspszo1Fl6SYyuuUtZ8wSpww9EKxbYqQ+V6zfVC0tHfcmX3w4VNYWHfCb9Zfg15SalG WkqxL7/s+wcU6Z/Lplqq2wiL54KbCD+eVI70eZpOvGxwQ64T6vdVm4Hysv9QikUuzj/9 LcRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=6BXWNwMWMnT7bPsYG7fDcxkiO8qvygyCOCzzpnkDbm0=; b=vvKjXfXgYHkoz9Yr/KyGyJYju7AG+/ys33sOIffYbsttXcvdmOMvv2Jkd1pXKbN69K rEi0iO6uSprrygDGRCoe132WpARQS3m2vOtgJMXJnoRZeGODJfwumalfwcTYinEcf5tC 5AhR/DHkKp0Iwn2KN9dl4byzGhOnFvseNGKopl5vZrD1MmFkREvYZ5Va/5eGASjonIZ6 sBhqN8uHWUNljHqTqMRA9ZbXNQ+PFC2TJELQSncjIuDsiX3ik6WXrxrT/fkc++erRb4c 8Zfb4zeDpAHx0w5RPNtJ23Gs0dYn3HILRYwbhHyMQindUvurj3y5NWNL9vSfT6wE6NYS uQ4Q== 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 jb7-20020a170903258700b00162359521b5si18231056plb.514.2022.06.21.12.33.28; Tue, 21 Jun 2022 12:33:41 -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 S1351072AbiFUTUu (ORCPT + 99 others); Tue, 21 Jun 2022 15:20:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245194AbiFUTUt (ORCPT ); Tue, 21 Jun 2022 15:20:49 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5FC2E254; Tue, 21 Jun 2022 12:20:48 -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 5440A1688; Tue, 21 Jun 2022 12:20:48 -0700 (PDT) Received: from usa.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 48BFB3F792; Tue, 21 Jun 2022 12:20:46 -0700 (PDT) From: Sudeep Holla To: linux-kernel@vger.kernel.org, Greg KH Cc: Sudeep Holla , Atish Patra , Atish Patra , Vincent Guittot , Dietmar Eggemann , Qing Wang , Rob Herring , "Rafael J . Wysocki" , Ionela Voinescu , Pierre Gondois , linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org Subject: [PATCH v4 01/20] ACPI: PPTT: Use table offset as fw_token instead of virtual address Date: Tue, 21 Jun 2022 20:20:15 +0100 Message-Id: <20220621192034.3332546-2-sudeep.holla@arm.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220621192034.3332546-1-sudeep.holla@arm.com> References: <20220621192034.3332546-1-sudeep.holla@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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