Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp4252786rwr; Mon, 8 May 2023 05:21:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ45vLw9jbKkM5KLyshHbWtX3GRr+8tW8LC8MggPVpjQRQ2r74hzzVMvtOT4i+SI2pHKS9kc X-Received: by 2002:a05:6a00:88f:b0:644:ad29:fd37 with SMTP id q15-20020a056a00088f00b00644ad29fd37mr6739551pfj.28.1683548493619; Mon, 08 May 2023 05:21:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683548493; cv=none; d=google.com; s=arc-20160816; b=uwTHbWzuypvYzC4JpvP3+7GDeGnGRntfGnB5qnVEn5ll8uBiPoEyM14PU1wjvBxJYB Ndhi3Jg6/mQNRWYV05MOwlFpgcR8q7BbNijlAcALxwu+ekJudfc3DnCVohWt36ImzW5F TqOpYjm8pgoUCaHSHC39hDRd7wNtOocrZs32F+j2sStANkxPax/c1J+p6aakSy68Ozm3 MBHcSPsfL6HdzFZWRWB6Cda/CL6ABAsXioAumVbnBoIUdROaLr73TMgIwbn2idGfw1ji Nl1mYI7YrnllhYmbUU/OfuKASaFVALaNuW3GShhfRhlNNxXcSvO+QfX57bcND+kGtrNn vh+Q== 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 :dkim-signature; bh=VyhfCZ5csOlZFGV4bhDymGpgdY5PFJC+Se96opk/VAw=; b=XgYfY9dXXYyVPc+0qYavjgD4RYjrbXVy31TuxAVGEWwI3ne7cjmWmMY5D2lvR20zgl htmcPNg9wgU0fju8ISYMDUkL1bkQBzOUf2yaKulx9emRZ58x0zS7kxkk0gccsAoIdYuf 5WTdqQrL2QVqYUSH6KQncbH5J5KBXl2HjD8HDG8/I60fe0eFZuMURDC7rMFrQTL8bhHE H3ekWtnmV2G4lv9/y/sV3Bhib9bWHO8WdLUEf6VHv7MWzGhmgJ911Mvi6872X0py1Jst o+yY1fS+X9uVru8ENT82riRZe1r0CRuYp0k9DH1zOXKb6nHHic4sxs4fbC9Yb7DXhMUK OtuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=mZVolCAz; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d18-20020a637352000000b0052c7c84229esi8819053pgn.702.2023.05.08.05.21.18; Mon, 08 May 2023 05:21:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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; dkim=pass header.i=@ventanamicro.com header.s=google header.b=mZVolCAz; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233569AbjEHL5D (ORCPT + 99 others); Mon, 8 May 2023 07:57:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236370AbjEHL4O (ORCPT ); Mon, 8 May 2023 07:56:14 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B8511C0F3 for ; Mon, 8 May 2023 04:54:55 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1a50cb65c92so30388555ad.0 for ; Mon, 08 May 2023 04:54:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1683546891; x=1686138891; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VyhfCZ5csOlZFGV4bhDymGpgdY5PFJC+Se96opk/VAw=; b=mZVolCAzG8wvIf6oLT4D4ZY0rlzt0iN1IwMS4s8MGydTIshmGFWZmlzbShfdzJOuBW px2AO5xanvA1J4MGpklcisJXnEEqeF//ddT/JS6zappzr1KbcZ1cDxjBNH/A6h3+gbA8 Z7CohGl6S5DR78mc3xk2ypWYhJvMw01eEs7obS4aSo6CTG/pvT9MZF8oywQI8QZn89rq 7+iiLWswwwgBc2etohzciXWK2a0h9JdMrdKMKYI+uTPQ3lzwut4nG8jzhqgfjVqMee8E uUVdk5gYm0y74iCLkXN6AuWLTotIsWxKoyS9SExB+rM/4pjksv/WO50M3ug19w1NVtYp MkhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683546891; x=1686138891; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VyhfCZ5csOlZFGV4bhDymGpgdY5PFJC+Se96opk/VAw=; b=io30Qmypwulq9+UZU5fUb/ha5KUlTEaNcjVecl6MxSnzJZjH14xobg2uPHf0cXkomU WzNHCrY3AX0ph3Ll7wiqglJxo+8OohVLHOIrBd7POG8gW99mNc9MLCzva243O6ohRHBN RhW19ZDVxEU506jyLQwO/KZ4IDc/hThWq26Hj2zp5QqiK2x6pO7Bw1xRsrni4X8ogLUQ tU6bRAgRJ/2Vy8ooglKvox7i7ThxAeSAjOJ35Y7fYo9aWItW623A4oJIdfDphnNo0POk hxxllTaga4nuiARaZVpYOB6Px4qlENCw+Mqsh1bj5/O8HSpdluOW14Rdc00wjtajYF7M J9bQ== X-Gm-Message-State: AC+VfDzSLNIukGh9sAZQhlPkU/OwgbxXskiqWcv/RTPgeWlj7zR/aVyU eFxV3eagHJ1lI3WE5tVakjHEsg== X-Received: by 2002:a17:902:d701:b0:1ab:624:38cb with SMTP id w1-20020a170902d70100b001ab062438cbmr9348824ply.14.1683546891602; Mon, 08 May 2023 04:54:51 -0700 (PDT) Received: from sunil-laptop.. ([106.51.189.144]) by smtp.gmail.com with ESMTPSA id w9-20020a170902904900b001aaed524541sm7015149plz.227.2023.05.08.04.54.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 May 2023 04:54:51 -0700 (PDT) From: Sunil V L To: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-crypto@vger.kernel.org, platform-driver-x86@vger.kernel.org, llvm@lists.linux.dev Cc: Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Rafael J . Wysocki" , Len Brown , Daniel Lezcano , Thomas Gleixner , Weili Qian , Zhou Wang , Herbert Xu , "David S . Miller" , Marc Zyngier , Maximilian Luz , Hans de Goede , Mark Gross , Nathan Chancellor , Nick Desaulniers , Tom Rix , Sunil V L , "Rafael J . Wysocki" , Andrew Jones , Conor Dooley Subject: [PATCH V5 14/21] RISC-V: cpu: Enable cpuinfo for ACPI systems Date: Mon, 8 May 2023 17:22:30 +0530 Message-Id: <20230508115237.216337-15-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230508115237.216337-1-sunilvl@ventanamicro.com> References: <20230508115237.216337-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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-crypto@vger.kernel.org On ACPI based platforms, few details like ISA need to be read from the ACPI table. Enable cpuinfo on ACPI based systems. ACPI has nothing similar to DT compatible property for each CPU. Hence, cpuinfo will not print "uarch". Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Andrew Jones Reviewed-by: Conor Dooley --- arch/riscv/kernel/cpu.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c index c96aa56cf1c7..5de6fb703cc2 100644 --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c @@ -3,10 +3,12 @@ * Copyright (C) 2012 Regents of the University of California */ +#include #include #include #include #include +#include #include #include #include @@ -283,23 +285,35 @@ static void c_stop(struct seq_file *m, void *v) static int c_show(struct seq_file *m, void *v) { unsigned long cpu_id = (unsigned long)v - 1; - struct device_node *node = of_get_cpu_node(cpu_id, NULL); struct riscv_cpuinfo *ci = per_cpu_ptr(&riscv_cpuinfo, cpu_id); + struct device_node *node; const char *compat, *isa; seq_printf(m, "processor\t: %lu\n", cpu_id); seq_printf(m, "hart\t\t: %lu\n", cpuid_to_hartid_map(cpu_id)); - if (!of_property_read_string(node, "riscv,isa", &isa)) - print_isa(m, isa); - print_mmu(m); - if (!of_property_read_string(node, "compatible", &compat) - && strcmp(compat, "riscv")) - seq_printf(m, "uarch\t\t: %s\n", compat); + + if (acpi_disabled) { + node = of_get_cpu_node(cpu_id, NULL); + if (!of_property_read_string(node, "riscv,isa", &isa)) + print_isa(m, isa); + + print_mmu(m); + if (!of_property_read_string(node, "compatible", &compat) && + strcmp(compat, "riscv")) + seq_printf(m, "uarch\t\t: %s\n", compat); + + of_node_put(node); + } else { + if (!acpi_get_riscv_isa(NULL, cpu_id, &isa)) + print_isa(m, isa); + + print_mmu(m); + } + seq_printf(m, "mvendorid\t: 0x%lx\n", ci->mvendorid); seq_printf(m, "marchid\t\t: 0x%lx\n", ci->marchid); seq_printf(m, "mimpid\t\t: 0x%lx\n", ci->mimpid); seq_puts(m, "\n"); - of_node_put(node); return 0; } -- 2.34.1