Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp17452285rwd; Tue, 27 Jun 2023 03:16:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6UpdpLLwR9kJ9hYH00OF3WyM7YlSP+7jlj9P7DaBNXHbsA0VmhA6YU+CZsxX6QLOqbibh8 X-Received: by 2002:a17:90a:4607:b0:262:a37a:e940 with SMTP id w7-20020a17090a460700b00262a37ae940mr6776404pjg.4.1687861018981; Tue, 27 Jun 2023 03:16:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687861018; cv=none; d=google.com; s=arc-20160816; b=iv/N/OycC79MnqCG9yF4bMBJlqyr5HDteHBusy9VqTJOBwt5CHiBRnwFZbRwMC50zK lNhIqMCRZXQl+shACSZdUPLIuxR1xAwrCkhQCHZbHs9zcHeYbIaiyd6YVLO1mtUBz4L8 /AmE+U537ZrsljdVpt8kahnVvjw7+DoX1Gt0QPfnRnt07vwERDDJ+vOtpcNor2cmaf4F yEg0pNFdul3zepBlZWS4lx3hdUBrRTZFfV48jyhTx1SnP8cFbFzfFpMk1xf3PpxmgFRI fZHEZt99LNfl4aYM09Nml1SXP+jvc9rqycksx5f2TNAiWb88SKTBc5GYQwAw29bkZDgQ hXow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=6hc55rMRbE5Y2wsQrKnyWJWd2R5Qf+X15Jtm/IOEbTc=; fh=CPZhJmQ9E/vlEQQAZiB1d9Fm4Nmgde1Z/jVqgyDhc/Q=; b=h1lWgFOY6XrZbI+rxbzHWmP7FGlAU58yrqi3qs0CAQCR5OSiN5de9wppnSktflIJ+a 7zwnwibBdixasXaEaLrrZc4mpoh0C2tqlHmdegZe3aFei/vaNAOmvW2oGlKN3geRaZCu gPVtc53+e5XZhrb+Ol/3HvcDrx3a7FPIWlQHhGG+d+3eBzPiqBu25wmR+WFu033Jq8xh Rg3oD1AiJkJziEdik+1Atrc8ViE1RnoZzvNKFtKI/GoIfyM8/pVbJYeSbq4a2md/LCDn IJ0ETMYP6YuHK3+uPal03xMHq/cJcgNgP/OCLRiAwXICnRoJ5FYlucdHdZXjri/JTs/Q sv8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mpvKAggZ; 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=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 h3-20020a17090aa88300b00258ee17486bsi7102264pjq.160.2023.06.27.03.16.47; Tue, 27 Jun 2023 03:16:58 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mpvKAggZ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231439AbjF0Juy (ORCPT + 99 others); Tue, 27 Jun 2023 05:50:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231597AbjF0Juo (ORCPT ); Tue, 27 Jun 2023 05:50:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C88242720; Tue, 27 Jun 2023 02:50:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C701E61090; Tue, 27 Jun 2023 09:50:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38F74C4339A; Tue, 27 Jun 2023 09:50:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687859436; bh=GFjEtbcDTN8Gj6F61Z5J4CnRI2yWhEjnhaExEl2QQt4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=mpvKAggZdcKqUinySEXJb2l8o87xhQH5+AEjcZKuMLX/Ew7ozKVZH8a6z7RIEu9qm OPiVma+XkbALTG59O5dnXT6NxK2ZDyZEavDo3gF0BQllRf29b5SAVUxbq1C84wLjHg hR7ov2m3WfClJNalzdUL38GPeeXiKBTI1ePxJ/+LfJnaUYYUHIJE0PW5w2sQG6raP2 9m61CDYZrE1tKADK5cLGy5gaFPFBjnsaD3XhbLCTzgplVZ6+cAfZTqinLn+q5CCwLq Y+NbAfhFLxKEkQV+1Uf5DisI3HM/Ae4qoemlnt0kx15MOvgRRJehZW9t6D0sV/cGRD xX+t4bUT3DHsg== Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-4f86dbce369so5760003e87.0; Tue, 27 Jun 2023 02:50:36 -0700 (PDT) X-Gm-Message-State: AC+VfDytn76aUI2L2uyFfy8NdAOCKN+l/bJrQzgFFkPokgD+Tj0w6JhF ASp6dx9ICRxeLcU0jty+ivOa6gpjgohD8MPv0Us= X-Received: by 2002:a05:6512:6cc:b0:4fb:7675:1ff9 with SMTP id u12-20020a05651206cc00b004fb76751ff9mr3473299lff.9.1687859434057; Tue, 27 Jun 2023 02:50:34 -0700 (PDT) MIME-Version: 1.0 References: <20230426034001.16-1-cuiyunhui@bytedance.com> In-Reply-To: From: Ard Biesheuvel Date: Tue, 27 Jun 2023 11:50:22 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [External] Re: [PATCH] firmware: added a firmware information passing method FFI To: =?UTF-8?B?6L+Q6L6J5bSU?= , Palmer Dabbelt , Paul Walmsley , Albert Ou , linux-riscv Cc: ron minnich , Mark Rutland , Lorenzo Pieralisi , rafael@kernel.org, lenb@kernel.org, jdelvare@suse.com, yc.hung@mediatek.com, angelogioacchino.delregno@collabora.com, allen-kh.cheng@mediatek.com, pierre-louis.bossart@linux.intel.com, tinghan.shen@mediatek.com, lkml - Kernel Mailing List , linux-acpi@vger.kernel.org, =?UTF-8?B?6JGb5aOr5bu6?= , =?UTF-8?B?6Z+m5Lic?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,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 (cc RISC-V maintainers and mailing list) On Mon, 26 Jun 2023 at 12:20, =E8=BF=90=E8=BE=89=E5=B4=94 wrote: > > Hi Ard, Mark, > > On Mon, Jun 26, 2023 at 4:23=E2=80=AFPM Ard Biesheuvel = wrote: > > > DT support for SMBIOS can live in generic code, but the binding has to > > be sane. As I suggested before, it probably makes sense to supplant > > the entrypoint rather than just carry its address - this means a 'reg' > > property with base and size to describe the physical region, and at > > least major/minor/docrev fields to describe the version. > > Regarding dts node binding, our current definition is as follows: > /dts > { > ... > cfgtables { > acpi_phy_ptr =3D 0000000000000000; //u64 > smbios_phy_ptr =3D 0000000000000000; //u64 > ... > } > ... > } > > x86 only gave a root_pointer entry address > u64 x86_default_get_root_pointer(void) > { > return boot_params.acpi_rsdp_addr; > } > > Regarding the naming of the binding above, Mark, do you have any suggest= ions? > I will defer to Mark or other DT experts to help decide on the naming and general shape of these. However, as I have indicated twice now, it would be better to describe the SMBIOS structured data directly, instead of passing the physical address of one of the existing entry points. This avoids the need for mapping and reserving additional pages that don't carry any relevant information. So the node in question should have at least (base, size) and the major, minor and docrev version fields. > > > For the ACPI side, you should just implement > > acpi_arch_get_root_pointer() under arch/riscv, and wire it up in > > whichever way you want. But please check with the RISC-V maintainers > > if they are up for this, and whether they want to see this mechanism > > contributed to one of the pertinent specifications. > > You suggest putting SMBIOS in general code instead of ACPI, why? SMBIOS is a separate set of firmware tables that have little significance to the kernel itself, and describing it via DT makes sense. ACPI serves a similar purpose as DT, and so having both at the same time results in a maintenance burden, where the arch code is forced to reason about whether they are consistent with each other, and if not, which description has precedence. > From the perspective of firmware information passing, they are a class. > > SMBIOS and ACPI are not related to ARCH, nor is DTS to obtain firmware > information, > > Why do you have to put part of the ACPI code under arch/risc-v/? Yes. And I don't think it should be using this FFI scheme either. If the firmware uses DT as a conduit to deliver the ACPI system description to the OS, it is probably better to pass this via the /chosen node as a special boot argument. > The scope of the previous discussion was limited to RISC-V because of > historical reasons such as the binding with EFI on ARM64. We will only > enable this function on RISC-V in subsequent patches. > > The realization of the FFI scheme itself is irrelevant to the arch. > I don't think we need a FFI scheme or framework for this.