From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 0AE3D7803CC for ; Fri, 14 Jun 2024 17:16:37 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=OGvSxefBYH067aJiMcMpz+EF978iRgzud9T+b0G08sM=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20240206; t=1718385397; v=1; b=3a74WcERxrcbISjE0x35M80mTrKNRkkWw8l2pvf1ge2X5tmFPbMNZGDZGycpyagiRjPLR+3n Zzc2a2p6+jOk+W8UFpb/QibsMlm9dT3UEpFA48XGrDVXQ3HnLAvnrbXUMHX2wf1NJogikMDZNQq HOVIJjXf8IjGbr5c75H35PH9HGyT974kUTl2ca39DQNCAcT/IMp8FvvuFolsKw/EJW189n5iutY y7dDH3qLFRbiboYfxw4hLR1mA00VTLyvd8s5vyV+SFkRNRzQ+Eib5E8/v1CXwXa+HOL65j6z9Bw oHvQfT+usYzTnH5o9w1AvSSc2qypij+vEL/hNV4QicMsw== X-Received: by 127.0.0.2 with SMTP id z6B8YY7687511xEkDteRqJEk; Fri, 14 Jun 2024 10:16:36 -0700 X-Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web10.69.1718385395932381317 for ; Fri, 14 Jun 2024 10:16:36 -0700 X-Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 5E4DB61FFE for ; Fri, 14 Jun 2024 17:16:35 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02D7AC4AF1D for ; Fri, 14 Jun 2024 17:16:35 +0000 (UTC) X-Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-52bc121fb1eso2953503e87.1 for ; Fri, 14 Jun 2024 10:16:34 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCVuAb6bZ+0ru0C/Me65tdOmycHBOCkVxaPCcc4QguvDM7H9U08TLBZa52no0ZA5r52X8MQaYmcRRUFa0AEcnjt+vVe/YA== X-Gm-Message-State: 0Wm4Ug1x6RF8XMcIs5lcjMntx7686176AA= X-Google-Smtp-Source: AGHT+IHKkQ/rNRq4D2zQYXRz1dwU9iCftVF7zan4oJrCAA4VFyOk4KjPKGLRjdGG/Qp0Pou3pI6g8NgQB5ywumV7i34= X-Received: by 2002:ac2:5e6d:0:b0:52b:5451:996a with SMTP id 2adb3069b0e04-52ca6e6d5a3mr1823727e87.31.1718385393206; Fri, 14 Jun 2024 10:16:33 -0700 (PDT) MIME-Version: 1.0 References: <3kj5r4awgurnnlqm67pvpumo4rwwhounzgynydtdohs7cif4qw@edfavg3ztcaq> In-Reply-To: From: "Ard Biesheuvel" Date: Fri, 14 Jun 2024 19:16:21 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] CryptoPkg host test broken due to smoketest for RDRAND To: "Yao, Jiewen" Cc: "Li, Yi1" , Gerd Hoffmann , "devel@edk2.groups.io" , "Hou, Wenxing" , "Kinney, Michael D" , Pedro Falcato Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Fri, 14 Jun 2024 10:16:36 -0700 Resent-From: ardb@kernel.org Reply-To: devel@edk2.groups.io,ardb@kernel.org List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=3a74WcER; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io On Fri, 14 Jun 2024 at 18:45, Yao, Jiewen wrote: > > > > -----Original Message----- > > From: Ard Biesheuvel > > Sent: Saturday, June 15, 2024 12:14 AM > > To: Yao, Jiewen > > Cc: Li, Yi1 ; Gerd Hoffmann ; > > devel@edk2.groups.io; Hou, Wenxing ; Kinney, Mic= hael > > D ; Pedro Falcato > > Subject: Re: [edk2-devel] CryptoPkg host test broken due to smoketest f= or > > RDRAND > > > > On Fri, 14 Jun 2024 at 18:09, Yao, Jiewen wrote: > > > > > > Hey > > > This PR seems just a workaround. > > > > > > I don't feel it is right solution to hardcode BIT30. > > > What if the host platform does not have such capability? You will get= failure > > later. > > > > > > > Agreed. But that was already the case: RngLib assumed that RDRAND was > > implemented without checking CPUID at all, and so the code was already > > broken on systems without RDRAND. > > [Jiewen] Sorry, I don=E2=80=99t understand your comment. " implemented wi= thout checking CPUID at all " > > See below code. It does use CPUID to check the capability. > > EFI_STATUS > EFIAPI > BaseRngLibConstructor ( > VOID > ) > { > UINT32 RegEcx; > > // > // Determine RDRAND support by examining bit 30 of the ECX register ret= urned by > // CPUID. A value of 1 indicates that processor support RDRAND instruct= ion. > // > AsmCpuid (1, 0, 0, &RegEcx, 0); > > mRdRandSupported =3D ((RegEcx & RDRAND_MASK) =3D=3D RDRAND_MASK); > > if (mRdRandSupported) { > mRdRandSupported =3D TestRdRand (); > } > > return EFI_SUCCESS; > } > > See commit 9301e5644cef5a5234f71b178373dd508cabb9ee The old code had +BOOLEAN +EFIAPI +ArchIsRngSupported ( + VOID + ) +{ + /* + Existing software depends on this always returning TRUE, so for + now hard-code it. + + return mRdRandSupported; + */ + return TRUE; +} > > > > > > > > To fix this function, can we call real CPUID instruction to return re= al value? > > > > > > > That would be better. But this change just restores the old behavior. > > And on top of that, Yi Li already merged it. > > [Jiewen] I don=E2=80=99t think it is right to merge it without thorough r= eview. > > I think we need follow 24 hour rule. > Any patch requires at least 24 hours before merge, to give people chance = to review and feedback. > Agreed. -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119579): https://edk2.groups.io/g/devel/message/119579 Mute This Topic: https://groups.io/mt/106666288/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-