Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp26209971rwd; Mon, 3 Jul 2023 06:54:09 -0700 (PDT) X-Google-Smtp-Source: APBJJlFD4/0VqSkjW8HNGWv27JLpwymlkUcQDPDWEo4o/Rc3NC4LoiGzfxV0bqeQiaFrhHTgnnfg X-Received: by 2002:a05:6870:80c9:b0:1b0:1d78:f784 with SMTP id r9-20020a05687080c900b001b01d78f784mr9252459oab.54.1688392449152; Mon, 03 Jul 2023 06:54:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392449; cv=none; d=google.com; s=arc-20160816; b=GOlQVlJsfiAzQDh6YK3gMlVIkByHgI+Ufml4shSmrCF2HCgSHcy8BjXvGvc7vQXQ+3 yc/SGZg+ASSAw7v9hJas9WLqspsWEP8kabKPNNRZE4rZcEZFNhtDrCah/HtEPVhChJz6 QDEaHX5xjGs951xRzON3VbbzBZ0UTc418JUOQO4QLs/tI25S1HbpCzyG5sCkCeVkfoi/ ktf1/1f2lNR/5FBFqkn7jyL664QkahMJw9cAvOg/0ouPSOLMubnTSbloUvB6kcd/lKrg vxdBMRY52QmFSGMbvUv6DKFhRsWrLoKAl1GmT0E9y/phaUbeeJhDuqZmAxn1LlzDxTs9 B1zQ== 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=/JlSIzJWdpE0o5RaOTKPM7zb1DqWmOtH1Rn+uIjPt+8=; fh=D6yzgMD3ttbOTughVtU/ZqjQ94GxcgXp5cgiybd0iJ0=; b=YSq+D1kUqlIvtv4kbploWyjukPq979BtVz5jpb8W7k2NxKcCp6d+Rz0Z1jC44H87do rE2Wp3aB3wggQ6TXTSxsg6Wqfj7L9oGVJ55rsF7V4aZ5teL5SkM9juT3aSzfL31Ek8j9 r97EtjOnZ0y/rfFA76l6u1/4hYpiq7++MKJULM4hVSGbxEceO5DmKm2aTMpYMMukir8x M34RkDqkfFh0gyBVOyC54bgKmql0Stvepc9yJPtRmpL15X6eSLf2AnOcb6G4VEmmkOTw o2FbyVj92vUa0Dxd2Q6LnObYf8ToySK1DBQWX8RuAvYodn8BPzDsf3CdYZwdiaIrdpih CMbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="RBVMA+7/"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q4-20020a17090a304400b002634cad1d64si9485136pjl.75.2023.07.03.06.53.56; Mon, 03 Jul 2023 06:54:09 -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=@microchip.com header.s=mchp header.b="RBVMA+7/"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230211AbjGCNDG (ORCPT + 99 others); Mon, 3 Jul 2023 09:03:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbjGCNDF (ORCPT ); Mon, 3 Jul 2023 09:03:05 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78062CA; Mon, 3 Jul 2023 06:03:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1688389384; x=1719925384; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=JKDOENosKmEiL2k4tBZQmuXWBUtv1K4FuCfUPDPb270=; b=RBVMA+7/YD5TQF2fmMiOeeUCNouhjysPpTbtwl6+FH8D7XrcgZgHQQeg XrEXlrTE3YEC9SZ5SYQL0PUfnYgSyzarmZ8ihsX4w9rF5PCfYBtyIoMXP ULLzM/+vY0KZsPnR8d0JUcxHllrlPoO8uKCY9zBILnhCZJ5Wr1JxFicX6 7Q6bnTCrPy5y/5sBci5m2odpFw7go/sUY5HMibPBiCQjiIbnHsyFFL6Oo d2nWiayBQO3sqEqkAsNF9cHrv8mLEuMAhvrwwopKu9mMNZgYbYHFiKM3Z glm4ZVs5w6oICr339Bbu4O4OoFRbX1ytS5QSIrzO0DzspixQ/ScNrIkVD w==; X-IronPort-AV: E=Sophos;i="6.01,178,1684825200"; d="asc'?scan'208";a="221065931" X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 03 Jul 2023 06:02:48 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Mon, 3 Jul 2023 06:02:48 -0700 Received: from wendy (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Mon, 3 Jul 2023 06:02:45 -0700 Date: Mon, 3 Jul 2023 14:02:15 +0100 From: Conor Dooley To: =?utf-8?B?6L+Q6L6J5bSU?= CC: Conor Dooley , , , , , , , , , , , , , , , , , , , , Subject: Re: [External] Re: [PATCH v2 2/3] firmware: introduce FFI for SMBIOS entry. Message-ID: <20230703-patrol-paced-76cd5e24db6b@wendy> References: <20230702095735.860-1-cuiyunhui@bytedance.com> <20230702095735.860-2-cuiyunhui@bytedance.com> <20230702-collide-rumor-f0d915a4f1b2@spud> <20230703-rebuff-smashing-6b2c6f80ba05@wendy> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Uht1cacpbtCJeEos" Content-Disposition: inline In-Reply-To: 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_PASS,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 --Uht1cacpbtCJeEos Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 03, 2023 at 08:41:30PM +0800, =E8=BF=90=E8=BE=89=E5=B4=94 wrote: > On Mon, Jul 3, 2023 at 4:36=E2=80=AFPM Conor Dooley wrote: > > On Mon, Jul 03, 2023 at 04:23:53PM +0800, =E8=BF=90=E8=BE=89=E5=B4=94 w= rote: > > > > > +FDT FIRMWARE INTERFACE (FFI) > > > > > +M: Yunhui Cui cuiyunhui@bytedance.com > > > > > +S: Maintained > > > > > +F: drivers/firmware/ffi.c > > > > > +F: include/linux/ffi.h > > > > > > > > Are you going to apply patches for this, or is someone else? > > > Yes, it will be used by patch 3/3. > > > > That's not what I asked :( >=20 > Sorry, ok, what do you want to ask? Who is going to apply patches for drivers/firmware/ffi*? > > > > > static void __init dmi_scan_machine(void) > > > > > @@ -660,58 +686,22 @@ static void __init dmi_scan_machine(void) > > > > > char __iomem *p, *q; > > > > > char buf[32]; > > > > > > > > > > +#ifdef CONFIG_FDT_FW_INTERFACE > > > > > + if (dmi_sacn_smbios(ffi.smbios3, ffi.smbios)) > > > > > > > > "dmi_sacn_smbios" > > > > > > > > > + goto error; > > > > > +#endif > > > > > > > > Does this not mean that if FDT_FW_INTERFACE is enabled, but the pla= tform > > > > wants to use EFI, it won't be able to? The `goto error;` makes this= look > > > > mutually exclusive to my efi-unaware eyes. > > > > > > If you have enabled FFI, then if something goes wrong, you should got= o error. > > > Just like the origin code: > > > if (efi_enabled(EFI_CONFIG_TABLES)) { > > > if (dmi_sacn_smbios(efi.smbios3, efi.smbios)) > > > goto error; > > > } else if (IS_ENABLED(CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBAC= K)) { > > > p =3D dmi_early_remap(SMBIOS_ENTRY_POINT_SCAN_START, = 0x10000); > > > if (p =3D=3D NULL) > > > goto error; > > > > Does this not make FFI and EFI mutually exclusive Kconfig options? > > Suppose you are on a system that does not implement FFI, but does > > implement EFI - what's going to happen then? > > AFAICT, dmi_sacn_smbios(ffi.smbios3, ffi.smbios) will fail & you'll do a > > `goto error` & skip the EFI code. What am I missing? >=20 > Code is not intended to be mutually exclusive, get the correct value and = return, > The code is going to be changed to this: >=20 > #ifdef CONFIG_FDT_FW_INTERFACE Ideally, these would be IS_ENABLED() instead of #ifdef - but if you copy what EFI does, then you don't need either, as there will always be an ffi_enabled() defined. > if (ffi_enabled(FFI_CONFIG_TABLES)) { I don't know what this function is, but this code seems like a step in the right direction. > if (!dmi_sacn_smbios(ffi.smbios3, ffi.smbios)) > return; > } > #endif Thanks, Conor. --Uht1cacpbtCJeEos Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZKLG1wAKCRB4tDGHoIJi 0p4CAP9UFrVTshkvkiDgNgv0fkaJeO/6lTdr5tKFaGdb9LpN5gD9HCH4Z3GCfUq8 vJfacU093Un2qeuoIdVM+04hLm4hnQ0= =/UOt -----END PGP SIGNATURE----- --Uht1cacpbtCJeEos--