From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web11.71216.1669473254120998417 for ; Sat, 26 Nov 2022 06:34:14 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f/aQinYn; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) 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 606136090C for ; Sat, 26 Nov 2022 14:34:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC3C1C43470 for ; Sat, 26 Nov 2022 14:34:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669473252; bh=JLKvdX0yO8oRH+Trvpy7OQBtq9bfa3iqOEL51byL//k=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=f/aQinYnTuGfuhyGsJ6C4iz96mnHhrbJau6Yg8Aa0pPLgvBSFqN4lVrz2UwH+/Q9s Mzshs3D3qST8ehqFt7M0gIj96zVs3AFlRZv29NeIRA7Sqwcw3AP5Lm+0ykJ9RZGa5D xTjZpgvXY+q2P1jtDLQxXlRtZAU1C8JlRxPscjzO9a+i/aqdbjmh/NKFqiiDAH0oQh kIGdoZVblDweelkKkWt09eXYzHakTSvy8PJmtYDbMQrEpRdYbBfap8f4y2EXiwZytb 5xGJGEeP6rNOBCTdB9n5LS+9R0xx0fTIEn7ye4Ina1HLFPlF4PZXL4WJgdLhBSYwyv jBG9CTlV5kZQQ== Received: by mail-lj1-f179.google.com with SMTP id bn5so8195368ljb.2 for ; Sat, 26 Nov 2022 06:34:12 -0800 (PST) X-Gm-Message-State: ANoB5pmxPurFbGf/PJPLARd5YYr3PvcwTsxENvbAmzTnuZRm7HTMjJul fRqkfl9X7gAMpyM3yc63PgMELZEHct40vIGGtl8= X-Google-Smtp-Source: AA0mqf7ZQuMEjbSCJF4OGBAVEKM0yheZSftAYItWSJoaSlZYIOCsdxVxtZdpsWeerciN9I2/bSshkGCI24SBSvNdLO8= X-Received: by 2002:a05:651c:220a:b0:277:2428:3682 with SMTP id y10-20020a05651c220a00b0027724283682mr15067541ljq.291.1669473250757; Sat, 26 Nov 2022 06:34:10 -0800 (PST) MIME-Version: 1.0 References: <20221124161756.216996-1-Pierre.Gondois@arm.com> In-Reply-To: <20221124161756.216996-1-Pierre.Gondois@arm.com> From: "Ard Biesheuvel" Date: Sat, 26 Nov 2022 15:33:59 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 0/4] ArmPkg/SecurityPkg: Fixes for ArmTrngLib/RngDxe To: Pierre.Gondois@arm.com Cc: devel@edk2.groups.io, Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Jiewen Yao , Jian J Wang Content-Type: text/plain; charset="UTF-8" On Thu, 24 Nov 2022 at 17:18, wrote: > > From: Pierre Gondois > > v1: > - https://edk2.groups.io/g/devel/message/96356 > v2: > - https://edk2.groups.io/g/devel/message/96434 > - Reformulate commit message. > - Do not warn if no algorithm is found as the message > would be printed on non-Arm platforms. > v3: > - Add the following patches: > 1. ArmPkg/ArmTrngLib: Remove ASSERTs in ArmTrngLibConstructor() > Requested by Ard. > Cf https://edk2.groups.io/g/devel/message/96495 > 2. SecurityPkg/RngDxe: Conditionally install EFI_RNG_PROTOCOL > Do not install EFI_RNG_PROTOCOL if no RNG algorithm is available. > Cf. https://edk2.groups.io/g/devel/message/96494 > 3. SecurityPkg/RngDxe: Fix Rng algo selection for Arm > Coming from v2 patch being split. > > Some issues were found by Ard/Sami on the RngDxe/ArmTrngLib after > recent patches were merged. This patch serie intends to fix them. > > Pierre Gondois (4): > ArmPkg/ArmTrngLib: Remove ASSERTs in ArmTrngLibConstructor() Thanks for the fixed Reviewed-by: Ard Biesheuvel I pushed this one as #3663 (pending CI verification atm) > SecurityPkg/RngDxe: Correctly update mAvailableAlgoArrayCount > SecurityPkg/RngDxe: Conditionally install EFI_RNG_PROTOCOL > SecurityPkg/RngDxe: Fix Rng algo selection for Arm > The remaining code still looks a bit clunky to me. Can't we just return an error from the library constructor of the library cannot initialize due to a missing prerequisite? > ArmPkg/Library/ArmTrngLib/ArmTrngLib.c | 5 ----- > .../RandomNumberGenerator/RngDxe/ArmRngDxe.c | 18 +++++------------- > .../RngDxe/Rand/RngDxe.c | 9 ++++++++- > .../RandomNumberGenerator/RngDxe/RngDxe.c | 19 ++++++++++++++----- > 4 files changed, 27 insertions(+), 24 deletions(-) > > -- > 2.25.1 >