Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6514154rwl; Tue, 4 Apr 2023 14:06:34 -0700 (PDT) X-Google-Smtp-Source: AKy350bSBk1vh/JEGBf+9IeppnSnYgE2dpuKCTft09D4TsKzZGJ3Cgj574uYqb9LpfB+BgtB5Qhc X-Received: by 2002:a17:906:13:b0:931:4285:ea16 with SMTP id 19-20020a170906001300b009314285ea16mr823092eja.7.1680642393725; Tue, 04 Apr 2023 14:06:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680642393; cv=none; d=google.com; s=arc-20160816; b=jB0KsTiMpIF2x5Y7chflC6P2vuKJohTN08hoQ19z3rKXFRKceVEfxhQaa54LI+byti KelYFZbJ5i9V/rFQxVz+2s0GfX9jVG4pwR8g4apV7NVLZrZvTNjIYNYQvYrf3i1OD8Ls GJOUAao77HbS2SVXdPn9sU8D+iv9t1iGepphO5FahgnXK8nT67sC2QtHgc5ELu8at33R 7r49dtf5WUgyOLLMax8g6ZaG6vf22MkHH5NYK3IWfhKfAVXRLhETchoAfFY/2zLyr9ir nl57dUzOi0nSdYVwyM8cEgAgPk58KIfC1b42U1Eu/M4XxKsPCMx8VsN6swXTooZYK6ci C4Bg== 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:dkim-signature; bh=iZsvf6nTaqkI/Y3cb0Vd+Xd2jKBVB7bEeAsnGol6rLA=; b=v1tkcT+1P00/KyHuFrmt7cWvkwTng2pA+u2tLaG2OqEodSr2Iti89dfMNrkreb04Rk tMvLdOr0o53zB87DH0RjTRzC0Ef8cEOf8T+lIbiPgkzA8uwNjIBZLSehm/Cp1L9ydCja AUDpPlxYGwEDkw1WFBJ1XE4nMKAUg7GlmKDU4wxiiqlnEmPvVpATSx21KJA98KbgyFP5 gvYXkeQHflcCU88s2E9uHP6h7PlU8Emlrc1k8Qmoq7RSWNq84EVP5aoCHKHDT/taY8HQ 5GtiTfy5wmI6lLl7xtCW4sugUpP18b343bIy01hg21N4PAm6XX5yqQkLjhr796Y52D74 akbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uvZL46gP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jl2-20020a17090775c200b009329c6f66adsi895861ejc.378.2023.04.04.14.06.08; Tue, 04 Apr 2023 14:06: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=@kernel.org header.s=k20201202 header.b=uvZL46gP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236168AbjDDVFr (ORCPT + 99 others); Tue, 4 Apr 2023 17:05:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236202AbjDDVFj (ORCPT ); Tue, 4 Apr 2023 17:05:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B4344EEF; Tue, 4 Apr 2023 14:05:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 79461637A5; Tue, 4 Apr 2023 21:05:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7703CC433D2; Tue, 4 Apr 2023 21:04:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680642303; bh=K+YWB6gtDBp8CY/sw1YdMADMAZus/ze/KCovhnmTEck=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uvZL46gPl/xyjGjJ3q1IGZT3hEDWU5Z1qRvJ34K5e+P+rh4U8Dulcd+kZdpBk/2fg EoDwLVwBfOvewMhUzO+qQ230d3TvGufRgNY7oJnYMFhMfGw5L0D0mCgXlYMgOHKi0J PuzMDNMxBK9E1lgGuog9v2Hsiyk740+qVIN+PaQsIacLtF79eZe4/mXsw7v2311Cv0 vGVRMg689a/17buOafoebW1qYaNZhjqjV6Sni6lBzj8PimtBFJiosrY2ynzKiLUUWR GydYoC8hx9jgsCvNiEmeZ/E9TqX3I0P43gNjmi/7iwuSR1RKuyy9XwomTJEvPrGQJR TiSqGmVICEIfw== Date: Tue, 4 Apr 2023 22:04:56 +0100 From: Conor Dooley To: Sunil V L Cc: 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, "Rafael J . Wysocki" , "Rafael J . Wysocki" , Tom Rix , Weili Qian , Herbert Xu , Jonathan Corbet , Marc Zyngier , Daniel Lezcano , Andrew Jones , Albert Ou , Mark Gross , Hans de Goede , Paul Walmsley , Thomas Gleixner , Nathan Chancellor , Nick Desaulniers , Zhou Wang , Palmer Dabbelt , Len Brown , Maximilian Luz , "David S . Miller" Subject: Re: [PATCH V4 14/23] RISC-V: cpu: Enable cpuinfo for ACPI systems Message-ID: <20230404-overlaid-flatterer-22731133a75f@spud> References: <20230404182037.863533-1-sunilvl@ventanamicro.com> <20230404182037.863533-15-sunilvl@ventanamicro.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="zg/bxp6Ef08iSfBi" Content-Disposition: inline In-Reply-To: <20230404182037.863533-15-sunilvl@ventanamicro.com> X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS 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 --zg/bxp6Ef08iSfBi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 04, 2023 at 11:50:28PM +0530, Sunil V L wrote: > On ACPI based platforms, few details like ISA need to be read > from the ACPI table. Enable cpuinfo on ACPI based systems. >=20 > ACPI has nothing similar to DT compatible property for each CPU. > SBI calls must be used to get vendor/arch/imp ID for any errata. ecalls are used on DT systems for this too FYI, vendorid/archid/impid are not contained in the DT. Otherwise, Reviewed-by: Conor Dooley Should probably have given that conditionally last time, sorry about that. Thanks, Conor. >=20 > Signed-off-by: Sunil V L > Acked-by: Rafael J. Wysocki > Reviewed-by: Andrew Jones > --- > arch/riscv/kernel/cpu.c | 30 ++++++++++++++++++++++-------- > 1 file changed, 22 insertions(+), 8 deletions(-) >=20 > diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c > index 8400f0cc9704..ace4752516d8 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 > */ > =20 > +#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 =3D (unsigned long)v - 1; > - struct device_node *node =3D of_get_cpu_node(cpu_id, NULL); > struct riscv_cpuinfo *ci =3D per_cpu_ptr(&riscv_cpuinfo, cpu_id); > + struct device_node *node; > const char *compat, *isa; > =20 > 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 =3D 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); > =20 > return 0; > } > --=20 > 2.34.1 >=20 >=20 > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv --zg/bxp6Ef08iSfBi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZCyQ9wAKCRB4tDGHoIJi 0v51AQD/Jdo80g5XJuPuPzzfpYoAjR065ytz0121HJC/oU1PNgD7BeY4NQ7krey7 9Ah5lMqJDV5Ogs1mM3sF3tJs7eMPagQ= =zA1D -----END PGP SIGNATURE----- --zg/bxp6Ef08iSfBi--