Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3147573iog; Mon, 27 Jun 2022 10:05:59 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v9Gt9mo2tmQVufRWRMXGGkA/sIdyPKlGFEmlPPL3pAnbOrjXsjg2rGP5rkg5Rp82ioeuvQ X-Received: by 2002:a05:6a00:198a:b0:525:8b3a:8965 with SMTP id d10-20020a056a00198a00b005258b3a8965mr13733117pfl.20.1656349559606; Mon, 27 Jun 2022 10:05:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656349559; cv=none; d=google.com; s=arc-20160816; b=Zw5qBBTdQzwbjf8Tci5j5meOpR+V+M6iDv7bYdoukfYMIYitQXllWz8xgILupD+KHC NquzSzmERKTo/YFcdLGfxqA2pzkgPmH03Bm+tJ6k2cWswSOEefNgsmOpDz3MNG6MNs0g jENzfMjlKCZHepjqbSqmd29qyRVXtj7r5f3p56sQeEzOKDT3TFLVCCnZIIF3Szmxkcrd TrfyPLPc9blJYxlrDMzPUH5wY5lUOTDjE+AvQzGZBOQZCpmQ1D77rUn/ubYxhaciV1S7 IfHFpgruAeNxuOgx6RBP4TCwZBUdjOlubBBmmwLp4poSgbsNFsanuDKEw4aYJzX98DqV tk3A== 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=wmuVtk13u4YyTJJk10uZdpod05Y0CdbuI8HVACzMsD0=; b=t3D0sNZzXVKduyGb7NbAKbgbKOslPu2DJrhwz5HuU9tQuLRH+S5eNdoB2oT59OXFmA aQxzY9oOCt0SyunXYJXXrcYSBN+T06YdP2x/R05xp/8jumYcYZWTmWjBi521w/1ckrGr t6ruMjGC1pLjJIKAaLxvV9SJR//D3s8fz5kAxCBN7nJ8us8ufDOomPTcdb/S+qW3ilun 8DvhEKzIz6QXnXrcz5QVTxkEbWzmZjSAfUU2P6KCR58OgdlHsoEeu43jjwC2GhH0TiQH j2AvDtqy7EXDMWfT8kzcg9nmyKLF3NjmvzaXQ/mVNK1OnQhOPDAFt5OJRCXg2o6brbfA K2LA== 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 bf24-20020a656d18000000b003fc573fa56dsi17170534pgb.6.2022.06.27.10.05.47; Mon, 27 Jun 2022 10:05:59 -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 S239421AbiF0QvC (ORCPT + 99 others); Mon, 27 Jun 2022 12:51:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239414AbiF0QvA (ORCPT ); Mon, 27 Jun 2022 12:51:00 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 032EE10FE8; Mon, 27 Jun 2022 09:51:00 -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 05639175A; Mon, 27 Jun 2022 09:51:00 -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 09AFC3F792; Mon, 27 Jun 2022 09:50:57 -0700 (PDT) From: Sudeep Holla To: linux-kernel@vger.kernel.org Cc: Sudeep Holla , Greg Kroah-Hartman , 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 v5 01/19] ACPI: PPTT: Use table offset as fw_token instead of virtual address Date: Mon, 27 Jun 2022 17:50:29 +0100 Message-Id: <20220627165047.336669-2-sudeep.holla@arm.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627165047.336669-1-sudeep.holla@arm.com> References: <20220627165047.336669-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. Link: https://lore.kernel.org/r/20220621192034.3332546-2-sudeep.holla@arm.com Cc: linux-acpi@vger.kernel.org Tested-by: Ionela Voinescu Acked-by: Rafael J. Wysocki Signed-off-by: Sudeep Holla --- drivers/acpi/pptt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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